Message transmission method based on block chain network and related device
By deploying timed message processing components on blockchain nodes of blockchain networks to record and transmit timing messages, the problems of single point of failure, dependence on external resources and data security in the prior art are solved, and higher reliability and security are achieved.
Patent Information
- Application Number
- CN202311432599.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2025-05-02
AI Technical Summary
The existing timed message transmission technology has the problem of single point of failure risk, reliance on external resources, and inability to ensure data security and insufficient adaptability.
The timing message processing component is deployed on at least one blockchain node of the blockchain network, the timing message is recorded through the blockchain, and the message is automatically transmitted when the sending condition is triggered.
Through the distributed architecture of blockchain, the reliability and security of timed message sending is improved, single point of failure is avoided, and dependence on external resources is reduced.
Smart Images

Figure CN119922204A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of blockchain technology, and specifically to a message transmission method and device based on a blockchain network, an electronic device, and a computer-readable storage medium. Background Art
[0002] At present, the technical implementations for scheduled message sending mainly include the following: the first is to set up a task scheduler on the server side, and set tasks in the task scheduler to run automatically at a scheduled time; the second is to cache messages in a message queue and send them to the recipient at a specific time; the third is to use a third-party timing service; the fourth is to implement a timer in the application code so that the application can schedule message sending according to demand.
[0003] However, each of the above implementation schemes has certain limitations, such as the risk of single point failure, increased dependence on costs and external resources, inability to guarantee data security, and insufficient adaptability. Therefore, it is urgent for technical personnel in this field to develop a new scheduled message transmission scheme to overcome or eliminate one or more limitations of the existing schemes. Summary of the invention
[0004] To solve the above technical problems, the embodiments of the present application provide a message transmission method based on a blockchain network, a message transmission device based on a blockchain network, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] On the one hand, an embodiment of the present application provides a message transmission method based on a blockchain network, wherein a timed message processing component is deployed on at least one blockchain node in the blockchain network, and the method is executed by the blockchain node on which the timed message processing component is deployed, and the method includes: recording a timed message from a message sender on a blockchain, wherein the timed message includes message content, sending conditions, and recipient information; when the timed message processing component detects a recording event on the blockchain, the timed message processing component parses the corresponding blockchain transaction to obtain the timed message; when the sending condition is triggered, the timed message processing component transmits the message content to the message recipient indicated by the recipient information.
[0006] On the other hand, an embodiment of the present application provides a message transmission device based on a blockchain network, wherein a scheduled message processing component is deployed on at least one blockchain node in the blockchain network, and the device is deployed on the blockchain node on which the scheduled message processing component is deployed, and the device includes: a recording module, configured to record a scheduled message from a message sender on a blockchain, wherein the scheduled message includes message content, sending conditions and recipient information; a detection module, configured to parse the corresponding blockchain transaction by the scheduled message processing component to obtain the scheduled message when the scheduled message processing component detects a recording event on the blockchain; and a transmission module, configured to transmit the message content to the message recipient indicated by the recipient information by the scheduled message processing component when the sending condition is triggered.
[0007] On the other hand, an embodiment of the present application provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the steps in the message transmission method based on the blockchain network as described above.
[0008] On the other hand, an embodiment of the present application provides a computer-readable storage medium having computer-readable instructions stored thereon. When the computer-readable instructions are executed by a processor of a computer, the computer executes the steps in the message transmission method based on the blockchain network as described above.
[0009] On the other hand, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps in the message transmission method based on the blockchain network as described above.
[0010] In the technical solution provided in the embodiments of the present application, a scheduled message processing component is deployed on at least one blockchain node of the blockchain network. After the scheduled message is recorded in the blockchain, the scheduled message processing component specifically performs the transmission processing of the scheduled message, which includes detecting whether the sending condition is triggered and sending the message after the sending condition is triggered. Thus, based on the distributed architecture of the blockchain network, the sending of scheduled messages is expanded from a single node to multiple centers based on the blockchain, thereby improving the reliability and security of the sending of scheduled messages.
[0011] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a schematic diagram of an implementation environment involved in this application;
[0013] Figure 2 is a flowchart of a message transmission method based on a blockchain network shown in an exemplary embodiment of the present application;
[0014] Figure 3 It shows that the blockchain nodes are Figure 2 The process further executed based on the example process;
[0015] Figure 4 It shows that the blockchain nodes are Figure 3 The process further executed based on the example process;
[0016] Figure 5 A schematic diagram of the execution flow of the message detection component is shown;
[0017] Figure 6 is a block diagram of a message transmission device based on a blockchain network shown in an exemplary embodiment of the present application;
[0018] Figure 7 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0019] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0020] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0021] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0022] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.
[0023] The terms "first", "second", "third" and "fourth" etc. in the specification and claims of the present application and the drawings are used to distinguish different objects, rather than to describe a specific order. The terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0024] First of all, it should be explained that this application proposes a new timed transmission scheme based on the distributed architecture of the blockchain network, which realizes the expansion of the sending of timed messages from a single node to multiple centers based on blockchain, thereby improving the reliability and security of timed message sending.
[0025] It can be understood that blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0026] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operation detection. Among them, the user management module is responsible for the identity information management of all blockchain participants, including the maintenance of public and private key generation, key management, and the maintenance of the corresponding relationship between the user's real identity and the blockchain address, and, under authorization, supervises and audits the transactions of certain real identities and provides risk control rule configuration; the basic service module is deployed on all blockchain node devices to verify the validity of business requests and record the valid requests to the storage after consensus is reached. For a new business request, the basic service first adapts the interface for parsing and authentication, and then encrypts the business information through the consensus algorithm. After encryption, it is completely and consistently transmitted to the shared ledger and recorded and stored; the smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define the contract logic in a certain programming language and publish it to the blockchain. According to the logic of the contract terms, the key or other event triggers the execution to complete the contract logic. At the same time, it also provides the function of contract upgrade and cancellation; the operation detection module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and real-time status visualization output of the product during the product release process, such as alarm, network status detection, node device health status detection, etc.
[0027] The platform product service layer provides the basic capabilities and implementation framework of typical applications. Developers can superimpose business features based on these basic capabilities to complete the blockchain implementation of business logic. The application service layer provides application services based on blockchain solutions for business participants to use.
[0028] The technical solution provided by this application will be described in detail below:
[0029] See first Figure 1 , Figure 1 This is a schematic diagram of an implementation environment involved in this application. The implementation environment is specifically a message transmission system based on a blockchain network. The system is based on the distributed architecture of the blockchain network and realizes the expansion of the sending of scheduled messages from a single node to multiple centers based on the blockchain, thereby improving the reliability and security of the sending of scheduled messages.
[0030] like Figure 1 As shown in FIG. 1 , the message transmission system is mainly composed of a blockchain network, a message sending program, a message server, and an external state server. The blockchain network is composed of multiple blockchain nodes that communicate with each other. The specific structure of the blockchain network has been introduced in the previous content and will not be repeated here.
[0031] Smart contracts are deployed on blockchain nodes. The message sender sets a timed message through a message sending program. The message sending program writes the timed message set by the message sender into the smart contract, so that the timed message is recorded on the blockchain account book through the smart contract. It can be seen that the message sending program is the entrance for the transmission of timed messages. The message sending program can be implemented in the form of APP (Application), applet, Dapp (Decentralized application), SDK (Software Development Kit), CMC (a blockchain transaction software), API (Application Programming Interface), etc., which are not limited here.
[0032] A timed message processing component is deployed on at least one blockchain node, and a sending condition acquisition component can be further deployed. The timed message processing component is used to parse the corresponding blockchain transaction to obtain the timed message to be sent when a record event on the blockchain is detected, and transmit the message content to the message recipient when the sending condition is triggered. The timed message processing component can be composed of a message reminder component and a message sending component. The message reminder component is mainly used to realize event detection and transaction analysis, and the message sending component is mainly used to realize the external sending of the message content. The message service end is also a third-party service end, such as an SMTP (Simple Mail Transfer Protocol) mailbox server, an SMS gateway, etc., which is used to send the message transmitted by the message sending component to the message recipient. Of course, it is also possible not to use a third-party service to realize the transmission of messages, but to use the blockchain network to transmit messages, such as using Ethereum's whisper protocol to transmit messages.
[0033] Below Figure 1 The detailed design contents of each component in the system shown are described as follows:
[0034] First, the detailed design of the message sending program;
[0035] The message sending program needs to carry out detailed design of the user interface module, and needs to provide an intuitive, easy-to-use and fully functional user interaction interface, which allows users to input message content, set message recipients, select message sending conditions, etc. Exemplarily, the user interface module needs to design the following functions:
[0036] 1. Login / registration function: allows users to register a new account or log in using an existing account; the registration process requires providing information such as username, password, and contact information; the login function can be implemented using username and password, email address, mobile phone number, and third-party account authorization.
[0037] 2. Message recipient list function: Users can create, edit and delete their own message recipient list. The recipient information may include name, nickname, contact information (such as email address, mobile phone number, blockchain address, etc.);
[0038] 3. Create a new scheduled message: Allow users to create a new scheduled message. Users are required to provide the following information:
[0039] 3.1 Message content, which can be text, file, picture, audio, etc.
[0040] 3.2 Recipient information, which supports users to manually input or select one or more recipients from the message recipient list;
[0041] 3.3 Sending conditions: Support users to set conditions based on time, block height, difficulty of solving, external events, etc., and support a combination of multiple conditions;
[0042] 3.4 Message level and category: Allow users to set priority and category for scheduled messages, such as reminder, greeting, confidential, etc.
[0043] 3.5 Browse and manage scheduled messages: Allow users to browse the list of created scheduled messages and filter by conditions, and allow users to edit, cancel or delete existing scheduled messages;
[0044] Encryption option settings: allows users to select encryption methods for scheduled messages, such as default encryption, end-to-end encryption, advanced encryption, etc. Default encryption is, for example, symmetric or asymmetric encryption. End-to-end encryption refers to the encryption and decryption of the transmitted message content in the source node and the destination node. Advanced encryption can be advanced encryption technology using key segmentation technology or advanced encryption technology using multi-signature technology. The appropriate encryption method can be selected according to the message sensitivity and security requirements;
[0045] 3.6 External condition settings: Allow users to set message sending rules associated with external conditions, such as stock prices, exchange rates, weather, etc. Users can customize associated conditions, thresholds and data sources;
[0046] 3.7 Real-time message notification and processing: Integrate message notification channels, such as email, push notification, etc., to notify users of the sending status, recipient's confirmation reply and other information;
[0047] 3.8 Personal Center and Settings: Allow users to modify personal information, such as password, contact information, set notification and message sending preferences, etc.
[0048] The functions that the user interface module needs to have are not introduced one by one here, but it can be understood that by setting the above functions, it can be clearly known that the user interface module enables users to easily create and manage scheduled messages.
[0049] Second, the detailed design of smart contracts;
[0050] The smart contract module is responsible for processing timed messages and is the core logic of blockchain-driven timed message transmission. The following functions need to be designed:
[0051] 1. Message structure definition: Define the message structure including message ID (), sender address, receiver address, message content, message sending conditions, message priority, message category, creation time and sending status, etc.;
[0052] 2. Message recipient definition: The definition includes the recipient ID, name, nickname, contact information (such as email, mobile phone number, blockchain address, etc.);
[0053] 3. Create a scheduled message function: This function allows users to create a new scheduled message and store it in the smart contract, while triggering an event to notify other related components, such as the scheduled message processing component;
[0054] 4. Modify scheduled message function: allows users to modify the content, recipient or sending conditions of existing scheduled messages, and trigger an event to notify other related components;
[0055] 5. Cancel or delete scheduled message function: allows users to cancel or delete existing scheduled messages, and trigger an event to notify other related components;
[0056] 6. Get the scheduled message list function of the specified user: This function returns a list of all scheduled messages of the specified user, which can be filtered by conditions (such as sending status, priority, etc.);
[0057] 7. Create or modify message recipient function: allows users to add and modify recipient information and store it in the smart contract;
[0058] 8. Delete message recipient function: allows the user to delete the specified recipient information and trigger an event to notify other related components;
[0059] 9. Get the recipient list function of the specified user: This function returns a list of all recipients of the specified user;
[0060] 10. Mark message status function: Mark the message as sent or confirmed received by the recipient, and trigger an event to notify other related components.
[0061] The functions that smart contracts must have are not introduced one by one here, but it can be understood that by setting the above functions, it can be clearly known that the operation events on the smart contract can be notified to other related components accordingly, so that other related components can respond and process in a timely manner.
[0062] Third, the detailed design of the timing message processing component;
[0063] The scheduled message processing component includes a message detection component and a message sending component.
[0064] The message detection component is responsible for detecting events in the blockchain and smart contracts, and triggering message sending based on the satisfied sending conditions. For example, the detailed design of the message detection component is as follows:
[0065] 1. Event detection submodule: detects events from smart contracts, such as new message creation, modification or cancellation of existing messages, changes in message recipient information, etc. After detecting an event, the relevant data is passed to the appropriate processing component for processing;
[0066] 2. Timing condition check submodule: Periodically check the timing message data in the smart contract, and determine whether the sending conditions of each message are met. The sending conditions may include time, block height, external events, etc.
[0067] 3. External data acquisition submodule: When the timing conditions involve external data (such as stock prices, exchange rates, weather, etc.), the corresponding data is obtained from the external data source and compared with the message sending conditions;
[0068] 4. Message sending trigger submodule: When the message sending conditions are met, the message sending component is triggered, and the necessary information such as message ID, sender address, encrypted message content, etc. is passed to the message sending component to complete the message sending task;
[0069] 5. Message status update submodule: After the message is actually sent, the status of the message in the smart contract is updated, such as marking the message status as "sent" or "confirmed received", and at the same time, triggering an event to notify other components.
[0070] The message sending component is responsible for the message sending task, including sending the message content or encrypted message to the specified message recipient, and processing the message sending status. The following is the detailed design of an exemplary message sending component:
[0071] 1. Input parameter identification: receiving the sending-related parameters passed by the message detection component, including message ID, sender address, receiver address, encrypted message content, etc.;
[0072] 2. Message channel selection submodule: Determine which message channel to use for message sending, such as email, SMS, push notification, or blockchain message, based on the recipient’s contact information;
[0073] 3. Message sending submodule: Sends the encrypted message content to the designated recipient. It can be integrated with third-party services, such as SMTP mail server, SMS gateway, etc., or use blockchain to send messages (for example, using Ethereum's whisper protocol);
[0074] 4. Sending status processing submodule: processes the message sending results, including success, failure, or need for retry, and returns the sending status to the given timing message processing module for status update;
[0075] 5. Error handling and retry submodule: When a message fails to be sent, determine the failure type and take corresponding measures, such as resending, waiting for a certain period of time and then trying again, or notifying the user to check the sending settings;
[0076] 6. Recipient confirmation submodule: In certain circumstances, such as important notifications, confidential information, etc., the recipient may be asked to confirm receipt at the receiving end. After confirmation, the scheduled message processing module is notified to update the message status.
[0077] The functions that the scheduled message processing component needs to have are not introduced one by one here, but it can be understood that by setting the above functions, it can be clearly known that by deploying the scheduled message processing component on the blockchain node, the blockchain node can have the scheduled message processing function, thereby using the distributed architecture of the blockchain network to expand the sending of scheduled messages from a single node to multiple centers based on the blockchain.
[0078] And based on the above design, Figure 1 The system shown can achieve at least the following beneficial effects:
[0079] First, by deploying the scheduled message processing component on the blockchain node, it is possible to deal with the risk of single point failure and avoid message sending failure. The processing of scheduled messages does not rely on third-party services, which not only reduces costs but also ensures message security.
[0080] Second, the use of blockchain technology and smart contracts can easily expand the setting of the timing method, get rid of the limitation of the single timing method based on centralized services, and can expand to support multiple message sending methods, making the message sending methods more diverse;
[0081] Third, it supports message encryption to ensure the security of scheduled messages during transmission;
[0082] Fourth, by introducing external state conditions into the sending conditions, the scheduled message sending process can flexibly respond to external state changes.
[0083] In summary, Figure 1 The provided system can improve the reliability and security of scheduled message sending. It should also be noted that Figure 1 The system shown can be applied to a variety of application scenarios that require sending messages at regular intervals and require ensuring the reliability and security of message sending.
[0084] For example, in a car scenario, the driver needs to send a private file to others at a specific time. However, since the driver is driving at that time, it is inconvenient for him to send the file in person. If the file is forwarded by others, he is worried that the file may be maliciously tampered with. Figure 1 In the system shown, the driver sets the scheduled message in advance in the message sending program. The scheduled message includes the message content (including private files), message recipient, sending conditions and other information. The corresponding blockchain node can automatically send the message content to the message recipient when the sending condition is triggered. Since the message content is recorded on the blockchain and cannot be tampered with, the security of the file content can be guaranteed.
[0085] For example, a user is very concerned about the price changes of a certain stock and hopes to buy shares when the stock price drops to a certain level, and sell the shares when the stock price rises to a certain level. However, due to the busy work, the user cannot pay attention to the stock price changes personally, so he can also use Figure 1 The system shown sets up scheduled messages in the message sending program in advance, including message content (such as a message reminding to sell / buy), message recipient (the user himself is the message recipient and can receive the reminder message through email, instant messaging application, text message, etc.) and sending conditions (such as sending a message reminding to buy when the stock price is A, and sending a message reminding to sell when the stock price is B). After that, the corresponding blockchain node automatically sends the reminder message to the message recipient when the sending condition is triggered.
[0086] Of course, the above exemplary application scenarios do not represent Figure 1 The application scenario of the system shown is limited and can be used as needed in actual applications.
[0087] And, further, based on Figure 1 The system shown in the present application also proposes a message transmission method based on a blockchain network, such as Figure 2 As shown, Figure 2This is a flowchart of a message transmission method based on a blockchain network shown in an exemplary embodiment of the present application. It should be noted that a timed message processing component is deployed on at least one blockchain node in the blockchain network, and the method is specifically executed by the blockchain node on which the timed message processing component is deployed.
[0088] like Figure 2 As shown, the method includes S210-S230, which are described in detail as follows:
[0089] S210, recording a scheduled message from a message sender on a blockchain, where the scheduled message includes message content, sending conditions, and recipient information.
[0090] First refer to Figure 1 In the system shown, the scheduled message from the message sender is sent by the message sender to the blockchain node through a message sending program, and the scheduled message at least includes message content, sending conditions and recipient information.
[0091] The message content can be text, files, pictures, audio and other types of content, or a combination of multiple types of content, which is not limited here. The sending conditions can be based on time, block height, difficulty of solving, external events and other conditions, or a combination of multiple conditions, which is not limited here. The recipient information can be the recipient address, such as an email address, blockchain address, mobile phone number, etc., which is still not limited here. The recipient information is also the recipient of the corresponding scheduled message, so the recipient information can contain the address information of multiple message recipients.
[0092] The blockchain node records the received timed messages on the blockchain and triggers the corresponding record event notification to the timed message processing component. Based on the immutability of the data on the blockchain, the security of the timed messages can be guaranteed.
[0093] In some embodiments, a smart contract is deployed on a blockchain node, and a message sending program sends a timed message to the smart contract, which records the timed message on the blockchain. The operation on the smart contract will also trigger the corresponding event and notify the timed message processing component. It should be understood that the triggering operation on the smart contract usually corresponds to the call of the operation function of the smart contract by the message sending program.
[0094] S220, when the scheduled message processing component detects a record event on the blockchain, the scheduled message processing component parses the corresponding blockchain transaction to obtain a scheduled message.
[0095] When the scheduled message processing component detects a record event on the blockchain, it parses the corresponding blockchain transaction to obtain a specific scheduled message, such as the aforementioned message content, sending conditions, and recipient information.
[0096] S230, when the sending condition is triggered, the scheduled message processing component transmits the message content to the message recipient indicated by the recipient information.
[0097] After parsing and obtaining the sending condition, the scheduled message processing component starts to detect whether the sending condition is met. If the detection is yes, it means that the sending condition is triggered. When the sending condition is triggered, the scheduled message processing component transmits the message content to the message recipient indicated by the recipient information, thereby realizing the scheduled sending of the message content.
[0098] It should be noted that, when the sending condition includes an external event, the method further includes: the timing message processing component calls the sending condition acquisition component, and obtains external state information from the external state server through the sending condition acquisition component; when the external state information matches the external event, the timing message processing component determines that the sending condition is triggered. The external condition is understood to be an external condition related to the message trigger, and the external state server is the source end that provides the state information of the external condition. For example, the timing condition is to send a reminder message when the stock price is X, the corresponding external condition is the stock price, and the external state server is a stock query server; for another example, the timing condition is to send a reminder message when the exchange rate is Y, the corresponding external condition is the exchange rate, and the external state server is an exchange rate query server; for another example, the timing condition is to remind you to bring an umbrella when the weather forecast is rainy, the corresponding external condition is the weather, and the external state server is a weather query server.
[0099] It should also be noted that the message sender and message receiver mentioned in this embodiment are for the sender and receiver of the scheduled message, and generally refer to the terminal device used by the user who sends or receives the message, such as a smart phone, laptop computer, computer, tablet computer, vehicle-mounted terminal, wearable device, etc. And in actual application scenarios, the message sender and the message receiver can correspond to the same user or different users. For example, if the application scenario is that user A sets a reminder message to be sent to his mailbox at a certain time on the smart phone, in this case, the message sender and the message receiver correspond to the same user, that is, user A. If the application scenario is that user A sets a reminder message to be sent to user B at a certain time, in this case, the message sender and the message receiver correspond to different users.
[0100] When only one blockchain node in the blockchain network is deployed with a scheduled message processing component, after recording the scheduled message to the blockchain, the scheduled message processing component sends the message content to the message recipient. In addition to being unable to avoid the single point failure problem, Figure 1 Other beneficial effects of the system shown are mentioned.
[0101] When there are at least two blockchain nodes in the blockchain network that are deployed with the scheduled message processing component, the single point failure problem can be well solved. Specifically, for any blockchain node that is deployed with the scheduled message processing component, the following is also executed: Figure 3 The method steps shown, namely S310-S330, are described in detail as follows:
[0102] S310, the scheduled message processing component detects the node role of the current blockchain node, and the node role includes a master node or a slave node.
[0103] This embodiment allocates node roles, namely, master nodes and slave nodes, to blockchain nodes deployed with scheduled message processing components. The master node is used to execute specific scheduled message transmissions, and the slave node is used to switch to the role of the master node to execute specific scheduled message transmissions when the master node is in an abnormal state. Based on this, the reliable sending of scheduled messages can be guaranteed, thereby easily coping with single point failure problems.
[0104] In an exemplary embodiment, blockchain nodes deployed with a timed message processing component can communicate with each other through Figure 4 S410-S450 shown determine the master node and the slave node, as follows:
[0105] S410, periodically obtaining network parameters of multiple message channels preset for the current blockchain node;
[0106] S420, determining a network quality score of each message channel based on the acquired network parameters, and determining a comprehensive quality score based on the network quality scores of each message channel;
[0107] S430, broadcasting the comprehensive quality score, and receiving the comprehensive scores broadcasted by other blockchain nodes;
[0108] S440, determining the best comprehensive quality score from the comprehensive quality scores, taking the blockchain node corresponding to the best comprehensive quality score as a candidate node, and broadcasting the information of the candidate node;
[0109] S450: If the number of received information containing candidate nodes is greater than a preset value, the candidate node is determined to be a master node.
[0110] It should be noted that the multiple message channels preset by the blockchain node mentioned in the above process refer to the transmission channels between the scheduled message processing component deployed on the blockchain node and the message server, such as the email channel, the SMS channel, the blockchain channel, etc. The blockchain node can obtain the network parameters of each message channel by sending test messages to multiple message servers respectively. The network parameters include, for example, latency, throughput, etc., which are not limited here. The network parameters are used to describe the quality of the message channel. Therefore, based on the obtained network parameters, the network quality score of each message channel can be determined, and then the comprehensive quality score can be determined by calculating the average value or the weighted average value. That is, the comprehensive quality score can describe the overall performance of the blockchain node sending messages outward. The blockchain node broadcasts its own comprehensive quality score, and similarly, it will also receive the comprehensive quality scores broadcasted by other blockchain nodes, so that the optimal comprehensive quality score can be determined. The blockchain node takes the blockchain node corresponding to the optimal comprehensive quality score as a candidate node and broadcasts the information of the candidate node at the same time. Ultimately, if the amount of information received by the blockchain node containing the candidate node is greater than a preset value, the candidate node can be determined as the master node, and other blockchain nodes deployed with timed message processing components can be determined as slave nodes. The preset value can be set based on the minimum consensus required by the consensus algorithm.
[0111] Furthermore, to ensure the accuracy of the master node, after determining that the amount of information received containing the candidate node is greater than the preset value, the blockchain node also sends a preset instruction message to the candidate node. The preset execution message is equivalent to instructing the candidate node to detect whether it has a timed message processing component deployed, and return the detection result. After determining that the candidate node has a timed message processing component deployed based on the received detection result, the candidate node is determined to be the master node. Otherwise, the comprehensive quality score of the candidate node is cleared to zero and the node role determination process is re-executed to re-determine the master node. In this way, the executability of the master node can be ensured, thereby improving the accuracy of the master node determination process.
[0112] Each blockchain node deployed with a scheduled message processing component can determine its own node role as a master node or a slave node according to the above process, and can also know the relevant information of other slave nodes or master nodes. Therefore, corresponding role identifiers can be added to each master node and slave node to facilitate the blockchain node to obtain its own node role.
[0113] S320: If it is a master node, when a record event on the blockchain is detected, the corresponding blockchain transaction is parsed to obtain a timed message, and when the sending condition is triggered, the message content is transmitted to the message recipient.
[0114] If the blockchain node plays the role of a master node, when a record event on the blockchain is detected, it will parse the corresponding blockchain transaction to obtain a timed message, and when the sending condition is triggered, it will transmit the message content to the message recipient.
[0115] S330: If it is a slave node, when a record event on the blockchain is detected, a processing request is sent to the master node in the blockchain network, so that the master node responds to the processing request, executes the analysis of the corresponding blockchain transaction to obtain a timing message, and transmits the message content to the message recipient when the sending condition is triggered.
[0116] If the blockchain node is in the role of a slave node, when a record event on the blockchain is detected, a processing request is sent to the master node in the blockchain network, so that the master node responds to the processing request, executes the analysis of the corresponding blockchain transaction to obtain a timed message, and transmits the message content to the message recipient when the sending condition is triggered.
[0117] In addition, to further ensure the transmission reliability of the message content, the master node obtains the node status of its own node before transmitting the message content to the message recipient. If it is determined that its own status is abnormal based on the obtained node status, it sends a processing request to the slave node to execute the specific transmission of the message content in the slave node.
[0118] That is to say, the master node performs the specific timed message transmission process, and the slave node is used to switch to the role of the master node to perform specific timed message transmission when the master node is in an abnormal state. Based on this, the reliable transmission of the timed message can be guaranteed, so that the single point failure problem can be easily dealt with. It can be understood that in the case of multiple slave nodes, the master node can select a slave node with a higher comprehensive quality score as the new master node.
[0119] Of course, without distinguishing between master nodes and slave nodes, when there are at least two blockchain nodes in the blockchain network that are deployed with the scheduled message processing component, it is still possible to easily deal with the single point failure problem. Specifically, the scheduled message processing component will detect the node status of the current blockchain node. If it is determined based on the node status that the current blockchain node is abnormal, it will send a processing request to other blockchain nodes that are deployed with the scheduled message processing component, so as to specifically execute the processing of the scheduled message in other blockchain nodes.
[0120] In another exemplary embodiment, the timed message processing component specifically includes a message detection component and a message sending component. The message detection component is specifically used to detect the record events on the blockchain and parse to obtain the timed message. When the sending condition contained in the timed message is triggered, the message sending component is called. The message sending component responds to the call of the message detection component and specifically transmits the message content to the message recipient.
[0121] See also Figure 5 , Figure 5 The execution flow diagram of the message detection component is shown. The message detection component triggers the message sending service at a certain interval, then reads the message list that has been set in the blockchain, and traverses each scheduled message in the message list. The message list also records the relevant information of each scheduled message on the chain. For each scheduled message obtained by traversal, the specific content contained in the scheduled message, such as message content, sending conditions, recipient information, etc., is obtained by parsing the corresponding blockchain transaction, and then detects whether the sending condition is triggered. If the sending condition is triggered, the sender information is read, and the message content is sent through the message sending component, and the sending status is recorded. If the sending condition is not triggered, the next scheduled message is read and processed accordingly. After the traversal is completed and the set interval time is waited for to arrive, the message detection component will perform the next round of scheduled message processing. As a result, the scheduled message sending component can automatically trigger the scheduled message sending when the set conditions are met, while ensuring the security and reliability of message sending.
[0122] It should be noted that the message detection component mentioned above also records the sending status of the message, which means that after the message sending component sends the message content to the message recipient, it also detects the confirmation message returned by the message recipient for the message content. If the confirmation message returned by the message recipient is detected within the preset waiting time, the confirmation message will be returned to the message detection component. When the message detection component detects this confirmation message, it will update the sending status of the scheduled message on the blockchain accordingly. When a smart contract is deployed on the blockchain node, the message detection component can update the sending status of the corresponding scheduled message in the smart contract.
[0123] If the confirmation message returned by the message recipient is not detected within the preset waiting time, it means that the message content has not been successfully sent to the message recipient, or the message recipient has forgotten to manually trigger the confirmation reply. Therefore, the scheduled message will be resent according to the preset time interval until the confirmation message returned by the message recipient is detected. In this way, it can be ensured that the scheduled message is successfully sent to the message recipient, and the message sending status is also recorded on the blockchain accordingly.
[0124] In addition, if the security of message sending is further considered and there is an application requirement for message encryption, the message detection component also obtains the encryption indication information contained in the timed message when detecting that the sending condition is triggered. The encryption indication information includes, for example, encryption type, encryption key and other information. Encryption types include, for example, default encryption, end-to-end encryption, advanced encryption, etc., and the encryption key is set based on the encryption type. For example, if the encryption type is default encryption, the encryption indication information should carry the corresponding key information. If the encryption type is advanced encryption, specifically key segment encryption, the encryption indication information should carry the information of multiple key custodian nodes in the blockchain network. If the encryption type is advanced encryption, specifically multi-signature encryption, the encryption indication information should carry the information of multiple blockchain nodes participating in the decryption signature in the blockchain network.
[0125] Exemplarily, when the encryption type is key segment encryption, the message detection component can implement encryption processing of the message content through the following process:
[0126] Based on the encryption indication information, multiple key custodian nodes in the blockchain network are determined, and requests are made to the multiple key custodian nodes to obtain the key segments kept by each of them; an encryption key is generated based on the key segments returned by the multiple key custodian nodes, and the encryption key is used to encrypt the message content to obtain the encrypted message content.
[0127] When the encryption type is multi-signature encryption, the message detection component can implement encryption processing of the message content through the following process:
[0128] Based on the encrypted indication information, multiple decryption nodes in the blockchain network are determined; the message content is encrypted according to the node information of the multiple decryption nodes to obtain the encrypted message content, and the encrypted message content is decrypted based on the signature information of some or all of the multiple decryption nodes.
[0129] After the encrypted message content is obtained through the above encryption process, the message sending component sends the encrypted message content to the message receiver, so that after the message receiver receives the encrypted message content, it decrypts it according to the agreed decryption method to obtain the plain text of the message content.
[0130] In another embodiment, in order to further improve the security of the message, the encryption processing of the message content can also be performed in the message sending program, that is, the message content sent by the message sending program to the blockchain network is already encrypted content, so that the message content recorded on the blockchain can also exist in ciphertext form, which is more secure.
[0131] Therefore, the method provided in this embodiment can ensure the security of timing messages to a great extent and can meet application scenarios with high security requirements.
[0132] Figure 6 It is a block diagram of a message transmission device based on a blockchain network shown in an exemplary embodiment of the present application. It should be noted that a timed message processing component is deployed on at least one blockchain node in the blockchain network, and the device is deployed on the blockchain node where the timed message processing component is deployed.
[0133] like Figure 6 As shown, the exemplary message transmission device 600 based on the blockchain network includes:
[0134] A recording module 610 is configured to record a timed message from a message sender on a blockchain, wherein the timed message includes message content, sending conditions, and recipient information;
[0135] The detection module 620 is configured to parse the corresponding blockchain transaction to obtain a timing message when the timing message processing component detects a record event on the blockchain;
[0136] The transmission module 630 is configured to transmit the message content to the message recipient indicated by the recipient information by the timed message processing component when the sending condition is triggered.
[0137] In another exemplary embodiment, the sending condition includes an external event, and a sending condition acquisition component is also deployed on at least one blockchain node; the message transmission device 600 based on the blockchain network also includes an external condition detection module, which is configured as follows:
[0138] The timing message processing component calls the sending condition acquisition component, and obtains the external state information from the external state server through the sending condition acquisition component;
[0139] When the external state information matches the external event, the scheduled message processing component determines that the sending condition is triggered.
[0140] In another exemplary embodiment, the scheduled message processing component includes a message detection component and a message sending component; the message detection component detects the record event on the blockchain and parses it to obtain the scheduled message. If it is detected that the sending condition contained in the scheduled message is triggered, the message sending component is called; the message sending component responds to the call of the message detection component and transmits the message content to the message recipient.
[0141] In another exemplary embodiment, the message transmission device 600 based on the blockchain network further includes a message encryption module configured as follows:
[0142] When it is detected that the sending condition is triggered, the message detection component also obtains the encryption indication information contained in the timing message, encrypts the message content based on the encryption indication information, and sends the encrypted message content to the message sending component, so that the message sending component transmits the encrypted message content to the message recipient.
[0143] In another exemplary embodiment, the message encryption module is further configured to:
[0144] Determine multiple key custodian nodes in the blockchain network based on the encrypted indication information, and request the multiple key custodian nodes to obtain the key segments they hold;
[0145] An encryption key is generated based on the key segments returned by multiple key custodian nodes, and the message content is encrypted using the encryption key to obtain the encrypted message content.
[0146] In another exemplary embodiment, the message encryption module is further configured to:
[0147] Determine multiple decryption nodes in the blockchain network based on the encrypted indication information;
[0148] The message content is encrypted according to the node information of multiple decryption nodes to obtain the encrypted message content, and the encrypted message content is decrypted based on the signature information of some or all of the multiple decryption nodes.
[0149] In another exemplary embodiment, a smart contract is deployed on a blockchain node in a blockchain network, and a timed message is recorded on the blockchain through the smart contract; the message transmission device 600 based on the blockchain network also includes a contract processing module configured as follows:
[0150] The message detection component detects event information from smart contracts to obtain recorded events on the blockchain;
[0151] If a confirmation message is detected by the message sending component for the call, the sending status of the scheduled message is updated accordingly in the smart contract.
[0152] In another exemplary embodiment, the message processing component is also used to detect a confirmation message returned by the message recipient regarding the message content; if no confirmation message is detected within a preset waiting period, the timed message is resent according to a preset interval until a confirmation message returned by the message recipient is detected, and then the confirmation message is returned to the message detection component.
[0153] In another exemplary embodiment, a timed message processing component is deployed in at least two blockchain nodes; the timed message processing component is further configured to:
[0154] Detect the node role of the current blockchain node, which includes the master node or the slave node;
[0155] If it is a master node, when a record event on the blockchain is detected, it will parse the corresponding blockchain transaction to obtain a timed message, and when the sending condition is triggered, it will transmit the message content to the message recipient;
[0156] If it is a slave node, when a record event on the blockchain is detected, a processing request is sent to the master node in the blockchain network, so that the master node responds to the processing request, executes the analysis of the corresponding blockchain transaction to obtain a timing message, and transmits the message content to the message recipient when the sending condition is triggered.
[0157] In another exemplary embodiment, the timing message processing component is further configured to:
[0158] Periodically obtain the network parameters of multiple message channels preset for the current blockchain node;
[0159] Determine a network quality score of each message channel based on the acquired network parameters, and determine a comprehensive quality score based on the network quality scores of each message channel;
[0160] Broadcast comprehensive quality scores and receive comprehensive scores broadcasted by other blockchain nodes;
[0161] Determine the best comprehensive quality score from the comprehensive quality scores, take the blockchain node corresponding to the best comprehensive quality score as a candidate node, and broadcast the information of the candidate node;
[0162] If the number of received information containing candidate nodes is greater than a preset value, the candidate node is determined to be the master node.
[0163] In another exemplary embodiment, the timing message processing component is further configured to:
[0164] After determining that the amount of information received containing candidate nodes is greater than a preset value, preset instruction information is also sent to the candidate node, the preset instruction information is used to instruct the candidate node to detect whether a timing message processing component is deployed on itself, and return the detection result;
[0165] If it is determined based on the detection result returned by the candidate node that the candidate node is deployed with a scheduled message processing component, the candidate node is determined as the master node; otherwise, the comprehensive quality score of the candidate node is reset to zero and the master node is re-determined.
[0166] In another exemplary embodiment, a timed message processing component is deployed in at least two blockchain nodes; the timed message processing component is further configured to:
[0167] Detect the node status of the current blockchain node;
[0168] If it is determined based on the node status that the current blockchain node is in an abnormal state, a processing request is sent to other blockchain nodes deployed with a scheduled message processing component to execute the processing of the scheduled message in the other blockchain nodes.
[0169] It should be noted that the message transmission device based on the blockchain network provided in the above embodiment and the message transmission method based on the blockchain network provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the message transmission device based on the blockchain network provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.
[0170] The message transmission device based on the blockchain network provided in the above embodiment deploys a timed message processing component on at least one blockchain node of the blockchain network. After the timed message is recorded in the blockchain, the timed message processing component specifically performs the transmission processing of the timed message, and the processing includes detecting whether the sending condition is triggered and sending the message after the sending condition is triggered. Thus, based on the distributed architecture of the blockchain network, the sending of timed messages is expanded from a single node to multiple centers based on the blockchain, which can improve the reliability and security of the sending of timed messages.
[0171] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the message transmission method based on the blockchain network provided in the above-mentioned embodiments.
[0172] Figure 7 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 7 The computer system 700 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0173] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703, such as executing the method described in the above embodiment. In the RAM 703, various programs and data required for system operation are also stored. The CPU 701, ROM 702 and RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0174] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed so that a computer program read therefrom is installed into the storage section 708 as needed.
[0175] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 709, and / or installed from a removable medium 711. When the computer program is executed by a central processing unit (CPU) 701, various functions defined in the system of the present application are executed.
[0176] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. The computer program contained in the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0177] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0178] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0179] Another aspect of the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the message transmission method based on a blockchain network as described above. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0180] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the message transmission method based on the blockchain network provided in each of the above embodiments.
[0181] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
[0182] It should also be noted that in the specific implementation of this application, user-related data, such as user account / password, mobile phone number, email address, etc., is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
Claims
1. A message transmission method based on a blockchain network, characterized in that: A timed message processing component is deployed on at least one blockchain node in the blockchain network, and the method is executed by the blockchain node on which the timed message processing component is deployed, and the method includes: Recording a scheduled message from a message sender on a blockchain, wherein the scheduled message includes message content, sending conditions, and recipient information; When the timed message processing component detects a record event on the blockchain, the timed message processing component parses the corresponding blockchain transaction to obtain the timed message; When the sending condition is triggered, the scheduled message processing component transmits the message content to the message recipient indicated by the recipient information.
2. The method according to claim 1, characterized in that The sending condition includes an external event, and a sending condition acquisition component is also deployed on the at least one blockchain node; the method also includes: The timing message processing component calls the sending condition acquisition component, and acquires external state information from the external state server through the sending condition acquisition component; When the external state information matches the external event, the scheduled message processing component determines that the sending condition is triggered.
3. The method according to claim 1 or 2, characterized in that: The timing message processing component includes a message detection component and a message sending component; the method also includes: The message detection component detects the record event on the blockchain and parses it to obtain the timed message. If it is detected that the sending condition contained in the timed message is triggered, the message sending component is called; The message sending component transmits the message content to the message recipient in response to the call of the message detection component.
4. The method according to claim 3, characterized in that The method further comprises: When it is detected that the sending condition is triggered, the message detection component also obtains the encryption indication information contained in the timed message, encrypts the message content based on the encryption indication information, and sends the encrypted message content to the message sending component, so that the message sending component transmits the encrypted message content to the message recipient.
5. The method according to claim 4, characterized in that The encrypting the message content based on the encryption indication information includes: Determine multiple key custodian nodes in the blockchain network based on the encryption indication information, and request the multiple key custodian nodes to obtain the key segments kept by each of them; An encryption key is generated based on the key segments returned by the multiple key custody nodes, and the message content is encrypted using the encryption key to obtain the encrypted message content.
6. The method according to claim 4, characterized in that The encrypting the message content based on the encryption indication information includes: Determine a plurality of decryption nodes in the blockchain network based on the encryption indication information; The message content is encrypted according to the node information of the multiple decryption nodes to obtain the encrypted message content, and the encrypted message content is decrypted based on the signature information of some or all of the multiple decryption nodes.
7. The method according to claim 3, characterized in that A smart contract is deployed on a blockchain node in the blockchain network, and the timing message is recorded on the blockchain through the smart contract; the method further includes: The message detection component obtains the recorded events on the blockchain by detecting the event information from the smart contract; If a confirmation message returned by the message sending component in response to the call is detected, the sending status of the scheduled message is updated accordingly in the smart contract.
8. The method according to claim 7, characterized in that The method further comprises: The message processing component detects a confirmation message returned by the message recipient in response to the message content; If the confirmation message is not detected within the preset waiting time, the scheduled message is resent according to the preset interval time until a confirmation message returned by the message recipient is detected; The confirmation message is returned to the message detection component.
9. The method according to claim 1 or 2, characterized in that: The timing message processing component is deployed in at least two blockchain nodes; the method further includes: The timing message processing component detects the node role to which the current blockchain node belongs, and the node role includes a master node or a slave node; If it is a master node, when a record event on the blockchain is detected, it parses the corresponding blockchain transaction to obtain the timed message, and transmits the message content to the message recipient when the sending condition is triggered; If it is a slave node, when a record event on the blockchain is detected, a processing request is sent to the master node in the blockchain network, so that the master node responds to the processing request, executes parsing of the corresponding blockchain transaction to obtain the timing message, and transmits the message content to the message recipient when the sending condition is triggered.
10. The method according to claim 9, characterized in that The method further comprises: Periodically obtain the network parameters of multiple message channels preset for the current blockchain node; Determine a network quality score for each message channel based on the acquired network parameters, and determine a comprehensive quality score based on the network quality scores for each message channel; Broadcasting the comprehensive quality score, and receiving comprehensive scores broadcasted by other blockchain nodes; Determine the best comprehensive quality score from the comprehensive quality scores, use the blockchain node corresponding to the best comprehensive quality score as a candidate node, and broadcast the information of the candidate node; If the amount of information received containing the candidate node is greater than a preset value, the candidate node is determined to be the master node.
11. The method according to claim 10, characterized in that The method further comprises: After determining that the amount of received information containing the candidate node is greater than a preset value, further sending preset instruction information to the candidate node, the preset instruction information is used to instruct the candidate node to detect whether the timing message processing component is deployed on itself, and return the detection result; If it is determined based on the detection result returned by the candidate node that the candidate node is deployed with the scheduled message processing component, the candidate node is determined as the master node; otherwise, the comprehensive quality score of the candidate node is cleared to zero and the master node is re-determined.
12. The method according to claim 1 or 2, characterized in that: The timing message processing component is deployed in at least two blockchain nodes; the method further includes: The timing message processing component detects the node status of the current blockchain node; If it is determined based on the node status that the current blockchain node is in an abnormal state, a processing request is sent to other blockchain nodes deployed with the scheduled message processing component to execute the processing of the scheduled message in the other blockchain nodes.
13. A message transmission device based on a blockchain network, characterized in that: A timed message processing component is deployed on at least one blockchain node in the blockchain network, and the device is deployed on the blockchain node on which the timed message processing component is deployed, and the device includes: A recording module, configured to record a timed message from a message sender on a blockchain, wherein the timed message includes message content, sending conditions, and recipient information; The detection module is configured so that when the scheduled message processing component detects a record event on the blockchain, the scheduled message processing component parses the corresponding blockchain transaction to obtain the scheduled message; the transmission module is configured so that when the sending condition is triggered, the scheduled message processing component transmits the message content to the message recipient indicated by the recipient information.
14. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the message transmission method based on the blockchain network as described in any one of claims 1 to 12.
15. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer executes the message transmission method based on a blockchain network as described in any one of claims 1 to 12.