Message transmission method and device, equipment, storage medium and program product
By detecting the active node list and subscriber of the sending node in the blockchain, and determining the target active node to transmit messages, the problem of poor blockchain message transmission stability is solved, and the transmission efficiency and stability are improved.
Patent Information
- Application Number
- CN202510292651.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-06-10
AI Technical Summary
Blockchain message transmission is poor, especially when the relay node fails, resulting in message transmission failure.
By detecting the active node list and subscriber of the sending node, the target active node is determined, so that the target active node obtains the message to be sent from the message pool of the sending node and transmits it to the receiving node.
The probability of failure of transmission of messages to be sent is reduced, and the stability and transmission efficiency of blockchain message transmission are improved.
Smart Images

Figure CN120128566A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of blockchain technology, and particularly to a message transmission method, apparatus, device, storage medium, and program product. Background Art
[0002] A blockchain is a distributed shared ledger and database, featuring decentralization, immutability, full traceability, traceability, collective maintenance, and public transparency. During the process of blockchain message transmission, after a message is sent by a sending node of the message, a receiving node of the message is used to receive the message.
[0003] In related technologies, a sending node in a blockchain, based on a pre-set routing table, transmits a message layer by layer through relay nodes in the routing table until the message is transmitted to the receiving node of the message. However, in some scenarios, this method has the problem of poor stability in blockchain message transmission. Summary of the Invention
[0004] This application provides a message transmission method, apparatus, device, storage medium, and program product to solve the problem of poor stability in blockchain message transmission in some scenarios in related technologies.
[0005] In a first aspect, this application provides a message transmission method, including: in response to a message to be sent by a first sending node in a blockchain, obtaining a list of active nodes of the first sending node; detecting whether the first sending node involves subscribers; if so, determining a target active node according to the subscribers and the list of active nodes, enabling the target active node to obtain the message to be sent from the message pool corresponding to the first sending node, and transmitting the message to be sent to a receiving node in the blockchain.
[0006] In a second aspect, this application provides a message transmission system, which is deployed on each node in a blockchain system. The node includes a sending node and an active node; the sending node is used to implement the message transmission method provided in the first aspect as described above; the active node is used to obtain the message to be sent from the message pool corresponding to the sending node, and when the active node is not the receiving node in the blockchain, act as a new sending node to implement the message transmission method provided in the first aspect as described above.
[0007] In a third aspect, this application provides a message transmission apparatus, including:
[0008] An obtaining module, configured to obtain a list of active nodes of a first sending node in response to a message to be sent by the first sending node in the blockchain;
[0009] A detecting module, configured to detect whether the first sending node involves subscribers;
[0010] A determination module, configured to determine a target active node according to a subscriber and a list of active nodes when a first sending node in the blockchain involves the subscriber, so that the target active node obtains a message to be sent from a message pool corresponding to the first sending node, and transmits the message to be sent to a receiving node in the blockchain.
[0011] In a fourth aspect, the present application provides an electronic device, including a processor and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the message transmission method provided in the first aspect as described above.
[0012] In a fifth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the message transmission method provided in the first aspect as described above.
[0013] In a sixth aspect, the present application provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the message transmission method provided in the first aspect as described above.
[0014] The message transmission method, device, equipment, storage medium and program product provided by the present application respond to a message to be sent of a first sending node in the blockchain, detect whether the first sending node involves a subscriber by obtaining a list of active nodes of the first sending node, and when it involves, determine a target active node according to the subscriber and the list of active nodes, so that the target active node obtains the message to be sent from a message pool corresponding to the first sending node, and transmits the message to be sent to a receiving node in the blockchain. In the present application, by determining a target active node based on the list of active nodes of the first sending node and the subscriber, and transmitting the message to be sent to the receiving node through the target active node, the probability of message transmission failure of the message to be sent is reduced, and the stability and transmission efficiency of blockchain message transmission are improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0016] Figure 1 It is a schematic structural diagram of a message transmission system provided by an embodiment of the present application;
[0017] Figure 2 It is a schematic flowchart of a message transmission method provided by an embodiment of the present application Figure 1 ;
[0018] Figure 3 It is a schematic flowchart of a message transmission method provided by an embodiment of the present application Figure 2 ;
[0019] Figure 4 A schematic structural diagram of the message transmission device provided by an embodiment of the present application;
[0020] Figure 5 A schematic structural diagram of the electronic device provided by an embodiment of the present application.
[0021] Through the above-mentioned drawings, specific embodiments of the present application have been shown, and more detailed descriptions will be provided later. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed implementation manners
[0022] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the 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 implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0023] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure, application, and other processing of the relevant data all comply with the relevant laws, regulations, and standards of the relevant countries and regions, adopt necessary confidentiality measures, do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0024] Moreover, the present application involves big data analysis of user information (including but not limited to personal biometric features, identity data, consumption data, asset data, electronic terminal operation data, etc.), and uses artificial intelligence technology for automated decision-making. For technical solutions that make decisions having a significant impact on personal rights and interests based on the results of automated decision-making, corresponding operation entrances are provided for users to choose to agree or refuse the results of automated decision-making; if the user chooses to refuse, the expert decision-making process will be entered.
[0025] It should be noted that the transaction portfolio recommendation methods, devices, equipment, storage media, and products provided by the present application can be used in the field of financial technology, and can also be used in any field other than the field of financial technology. The application fields of the transaction portfolio recommendation methods, devices, equipment, storage media, and products in the present application are not limited.
[0026] During the process of blockchain message transmission, after the sending node of the message sends out the message, the receiving node of the message is used to receive the message. However, since the transmission distance between the receiving node and the sending node, such as the physical distance, may be relatively long, it is not possible for the sending node to directly transmit the message to the receiving node. In related technologies, one implementation method is to build a physical transmission line between the sending node and the receiving node, but this method has problems such as resource waste, high transmission complexity, and great implementation difficulty; another implementation method is to transmit the message layer by layer through the relay nodes in the pre-set routing table until the message is transmitted to the receiving node of the message. However, in this method, when a relay node fails, the blockchain cannot perceive it in time, resulting in the failure of message transmission and poor stability of blockchain information transmission.
[0027] Based on the technical problems existing in related technologies, the embodiments of the present application detect the active node list and subscribers of the sending node, determine the target active node based on the subscribers in the active node list, and further transmit the information to be sent to the receiving node through the target active node, reducing the probability of transmission failure of the message to be sent, and thus improving the stability and transmission efficiency of blockchain message transmission.
[0028] First, the application scenarios of the embodiments of the present application will be described in detail below.
[0029] An applicable scenario of the message transmission method, device, equipment, storage medium, and program product provided by the embodiments of the present application can be a message transmission scenario where the transmission distance between the sending node and the receiving node in the blockchain network is relatively long.
[0030] It can be understood that the above is only an applicable application scenario of the embodiments of the present application, and the embodiments of the present application do not limit the specific application scenario, which can be determined according to the actual application requirements.
[0031] Figure 1 It is a schematic structural diagram of the message transmission system provided by the embodiments of the present application. As Figure 1 shown, this message transmission is deployed on each node in the blockchain system, and this node includes: a sending node and an active node;
[0032] Among them, the sending node is used to implement the message transmission method provided by the embodiments of the present application;
[0033] The active node is used to obtain the message to be sent from the message pool corresponding to the sending node, and when the active node is not the receiving node in the blockchain, it acts as a new sending node to implement the message transmission method provided by the embodiments of the present application.
[0034] It can be understood that when the active node is the receiving node, after obtaining the message to be sent, there is no need to transmit the message to be sent to other nodes in the blockchain.
[0035] Exemplarily, each node in the blockchain system is consensusized with a preset routing policy.
[0036] In a possible implementation, the preset routing policy is used as a transaction and consensusized on each node in the blockchain.
[0037] Exemplarily, the preset routing policy may be: at least one active node within the preset range of the sending node can detect the messages in the message pool of the sending node itself. Specifically, on the one hand, when it is detected that the sending node involves a subscriber and the identifier of the subscriber corresponds to the identifier of the active node A among at least one active node, the active node A obtains the current message to be sent from the message pool of the sending node itself. After the active node A obtains the current message to be sent, it determines whether the receiving node of the current message to be sent is the active node A itself. If so, it determines that the transmission of the current message to be sent is completed. If not, the active node A is used as the new sending node and the transmission of the current message to be sent continues; on the other hand, when it is detected that the sending node does not involve a subscriber, after a preset duration, the active node B closest to the sending node is selected from at least one active node within the preset range. The active node B obtains the current message to be sent from the message pool of the sending node itself. After the active node B obtains the current message to be sent, it determines whether the receiving node of the current message to be sent is the active node B itself. If so, it determines that the transmission of the current message to be sent is completed. If not, the active node B is used as the new sending node and the transmission of the current message to be sent continues.
[0038] Exemplarily, the number of active nodes in the blockchain in the embodiments of the present application is not limited and can be determined according to actual application requirements.
[0039] It can be understood that by consensusizing the preset routing policy as a transaction on each node in the blockchain in the embodiments of the present application, the complexity of blockchain message transmission can be reduced.
[0040] The message transmission method provided by the present application aims to solve the above technical problems in the prior art.
[0041] The following takes the sending node shown above Figure 1 as the execution subject, and combines specific embodiments to elaborate in detail on the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following several specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.
[0042] Figure 2 is a flowchart of the message transmission method provided by the embodiments of the present application Figure 1. For example, Figure 2 As shown, the specific implementation of the message transmission method may include the following steps:
[0043] S201. In response to a message to be sent from a first sending node in the blockchain, obtain a list of active nodes of the first sending node.
[0044] Exemplarily, the message to be sent may be a message that the first sending node currently needs to forward.
[0045] Exemplarily, the message to be sent may be stored in the message pool of the first sending node itself.
[0046] Exemplarily, the list of active nodes may include at least one active node.
[0047] Exemplarily, an active node may be a node in the blockchain that is currently in an idle state and not in a fault state within a preset range of the first sending node.
[0048] Exemplarily, the preset range may be determined based on a preset routing policy, which is similar to the above and will not be elaborated here.
[0049] S202. Detect whether the first sending node involves subscribers.
[0050] In a possible implementation, obtain subscriber information of the first sending node in the blockchain, and based on the subscriber information, detect whether the first sending node involves subscribers.
[0051] Exemplarily, the subscriber information may include at least one subscriber and an identifier corresponding to each subscriber.
[0052] In a possible implementation, the subscribers of the first sending node are determined as follows: obtain the transaction tag of the first sending node, and based on the preset routing policy, among the nodes within the preset range, determine the nodes that contain the transaction tag of the first sending node as subscribers. That is, at least one transaction tag in the transaction tags of the subscribers is the same as the transaction tag of the first sending node.
[0053] Exemplarily, the transaction tag of the first sending node may be a transaction tag corresponding to the current message to be sent by the first sending node.
[0054] Exemplarily, each node in the blockchain may correspond to at least one transaction tag. In the message transmission method provided in the embodiments of the present application, the number of transaction tags that each node in the blockchain may correspond to is not limited, and it may be determined specifically according to actual application requirements.
[0055] The preset routing policy is similar to the above and will not be elaborated here.
[0056] S203. If it is involved, based on the subscriber and the active node list, determine the target active node, so that the target active node obtains the message to be sent from the message pool corresponding to the first sending node, and transmits the message to be sent to the receiving node in the blockchain.
[0057] Exemplarily, the number of subscribers detected for the first sending node can be one or multiple.
[0058] In this step, in one possible implementation, determine the target active node according to the identifier of the subscriber and the identifier corresponding to each active node in the active node list.
[0059] Exemplarily, the target active node can be the receiving node of the message to be sent, or can be a relay node for transmitting the message to be sent.
[0060] In the embodiment of the present application, in response to the message to be sent of the first sending node in the blockchain, by obtaining the active node list of the first sending node, detect whether the first sending node is involved in subscribers, and when it is involved, based on the subscribers and the active node list, determine the target active node, so that the target active node obtains the message to be sent from the message pool corresponding to the first sending node, and transmits the message to be sent to the receiving node in the blockchain. In the embodiment of the present application, by determining the target active node based on the active node list and subscribers of the first sending node, and transmitting the message to be sent to the receiving node through the target active node, the probability of transmission failure of the message to be sent is reduced, and the stability and transmission efficiency of blockchain message transmission are improved.
[0061] It can be understood that in the message transmission method provided by the embodiment of the present application, there is no need to build a physical transmission line between the receiving node and the sending node, which realizes resource overhead savings and can also realize long-distance message transmission.
[0062] When the active node list includes at least one active node, optionally, the message transmission method provided by the embodiment of the present application further includes: if it is not involved, after a preset duration, calculate the distance between each active node in the at least one active node and the first sending node; determine the active node with the smallest distance from the first sending node as the target active node.
[0063] Exemplarily, when it is detected that the first sending node is not involved in subscribers, after a preset duration, calculate the distance between each active node in the active node list and the first sending node, and determine the active node with the smallest distance from the first sending node as the target active node.
[0064] Exemplarily, the distance between each active node and the first sending node can be measured by the number of network hops or broadband consumption, or by network latency, or by the physical distance between nodes. In the message transmission method provided in the embodiments of the present application, the measurement method of the distance between nodes is not limited, and can be specifically determined according to actual application requirements.
[0065] Exemplarily, the embodiments of the present application do not limit the size of the preset duration, and can be specifically determined according to actual application requirements.
[0066] Optionally, in the message transmission method provided in the embodiments of the present application, if it is detected that the first sending node is involved with a subscriber within the preset duration, the target active node can be determined according to the latest detected subscriber and the active node list.
[0067] It can be understood that by determining the active node with the smallest distance from the first sending node as the target active node, the message transmission efficiency and reliability can be improved. At the same time, the network bandwidth occupied during the message transmission process can be reduced, thereby reducing the network load.
[0068] The following combines Figure 3 to detail the specific implementation manner of determining the target active node according to the subscriber and the active node list in step S203.
[0069] Figure 3 is the flow diagram of the message transmission method provided in the embodiments of the present application Figure 2 As Figure 3 shown, the specific implementation manner of determining the target active node according to the subscriber and the active node list may include the following steps:
[0070] S301, for each active node among at least one active node, determine whether the identifier of the active node is the same as the identifier of the subscriber.
[0071] Exemplarily, each node in the blockchain system is configured with a corresponding node identifier.
[0072] Exemplarily, when the identifier of the active node is the same as the identifier of the subscriber, it indicates that the active node is a subscriber of the first sending node.
[0073] In this step, determine whether the identifier of the active node is the same as the identifier of the subscriber. If they are the same, execute step S302; if they are not the same, execute step S303.
[0074] S302, determine that the active node is the target active node.
[0075] S303, after the preset duration, determine the active node with the smallest distance from the first sending node as the target active node.
[0076] The specific implementation method is similar to the above, and will not be elaborated here.
[0077] In the embodiment of the present application, for each active node among at least one active node, by determining whether the identifier of the active node is the same as the identifier of the subscriber, and when they are the same, determining the active node as the target active node, and when they are different, after a preset time period, determining the active node with the smallest distance from the first sending node as the target active node, and transmitting the message to be sent through the target active node, which improves the message transmission efficiency, stability and reliability. At the same time, the network bandwidth occupied during the message transmission process can be reduced, thereby reducing the network load.
[0078] Optionally, in the message transmission method provided by the embodiment of the present application, when it is detected that the subscribers involved by the first sending node are at least two subscribers, a possible implementation manner for determining the target active node according to the subscriber and the active node list may be: for each active node in the active node list, determining whether the identifier of the active node is the same as the identifier of each of the at least two subscribers, if there is a subscriber whose identifier is the same as the identifier of the active node, determining the active node as the target active node; if not, after a preset time period, determining the active node with the smallest distance from the first sending node as the target active node.
[0079] Optionally, when there are at least two active nodes whose identifiers are the same as the identifiers of the corresponding subscribers respectively, the distances between the at least two active nodes and the first sending node are further determined, and the active node with the smallest distance from the first sending node is determined as the target active node.
[0080] Optionally, in the message transmission method provided by the embodiment of the present application, a possible implementation manner for the target active node to transmit the message to be sent to the receiving node in the blockchain may be: determining whether the target active node is the receiving node; if so, determining that the message to be sent is completely transmitted; if not, determining the target active node as the second sending node, and transmitting the message to be sent through the second sending node.
[0081] Exemplarily, the identifier of the receiving node may be carried in the message to be sent.
[0082] In a possible implementation manner of determining whether the target active node is the receiving node, it may be determined whether the identifier of the target active node is the same as the identifier of the receiving node carried in the message to be sent. If they are the same, it is determined that the target active node is the receiving node. If they are different, it is determined that the target active node is not the receiving node.
[0083] Exemplarily, the specific implementation manner of transmitting the message to be sent by the second sending node may be: obtaining the list of active nodes of the second sending node, detecting whether the second sending node involves subscribers, and when it does, determining the target active node according to the subscribers and the list of active nodes, enabling the target active node to obtain the message to be sent from the message pool corresponding to the second sending node, and transmitting the message to be sent to the receiving node in the blockchain, and so on, until the message to be sent is transmitted to the receiving node.
[0084] In the embodiment of the present application, by determining whether the target active node is the receiving node, and when the target active node is the receiving node, determining that the message to be sent is successfully transmitted, and when the target active node is not the receiving node, determining that the target active node is the second sending node, and transmitting the message to be sent through the second sending node. In the embodiment of the present application, by transmitting the message to be sent to the receiving node based on one or more target active nodes, the probability of transmission failure of the message to be sent can be reduced, thereby improving the stability and transmission efficiency of blockchain message transmission.
[0085] Optionally, in the message transmission method provided by the embodiment of the present application, the list of active nodes is obtained in the following manner: detecting the active nodes of the first sending node based on a preset routing policy to obtain the list of active nodes.
[0086] Exemplarily, the preset routing policy is similar to the above, and will not be elaborated here.
[0087] Exemplarily, a possible implementation manner of detecting the active nodes of the first sending node may be: detecting the active nodes of the first sending node based on a heartbeat mechanism and / or a node discovery protocol, etc.
[0088] The embodiment of the present application does not limit the specific implementation manner of detecting the active nodes of the first sending node, and it can be determined specifically according to actual application requirements.
[0089] Exemplarily, the set composed of the detected active nodes of the first sending node is determined as the list of active nodes.
[0090] In the embodiment of the present application, by detecting the active nodes of the first sending node based on a preset routing policy to obtain the list of active nodes, it is ensured that the intermediate nodes used for transmitting the message to be sent are currently available nodes.
[0091] Optionally, the message transmission method provided by the embodiment of the present application further includes: responding to the target active node obtaining the message to be sent, and destroying the message to be sent in the message pool corresponding to the first sending node.
[0092] It can be understood that after the first sending node detects that the target active node obtains the message to be sent from the message pool of the first sending node, the message to be sent is destroyed from its own message pool, which can release the storage space of the first sending node, reduce the storage cost. At the same time, by promptly clearing the processed messages and reducing the redundant messages in the message pool, the message processing efficiency of the blockchain system can be improved.
[0093] In some embodiments, the specific implementation of the message transmission method provided by the embodiments of the present application may include the following steps:
[0094] S1, in response to the first sending node placing the message to be sent in its own message pool, based on a preset routing policy, detect the active nodes of the first sending node within a preset range to obtain a list of active nodes;
[0095] S2, detect whether the first sending node involves subscribers.
[0096] In this step, if it is detected that the first sending node involves subscribers, then execute step S3; if it is detected that the first sending node does not involve subscribers, then execute step S4.
[0097] S3, for each active node in the list of active nodes, determine whether the identifier of the active node is the same as the identifier of the subscriber, and when they are the same, determine the corresponding active node as the target active node; when they are different, after a preset duration, determine the active node with the smallest distance from the first sending node as the target active node.
[0098] S4, after a preset duration, calculate the distance between each active node in the list of active nodes and the first sending node, and determine the active node with the smallest distance from the first sending node as the target active node.
[0099] S5, the target active node obtains the message to be sent from the message pool of the first sending node. Further, the target active node determines whether it is the receiving node through the receiving node identifier carried in the message to be sent. If so, the transmission of the message to be sent is completed. If not, the target active node is used as the second sending node, and continue to execute the message transmission method provided by the embodiments of the present application until the message to be sent is transmitted to the receiving node.
[0100] In summary, the message transmission method provided by the embodiments of the present application has the following beneficial effects:
[0101] 1) By determining the target active node based on the list of active nodes of the first sending node and the subscribers, and transmitting the message to be sent to the receiving node through the target active node, the probability of the transmission failure of the message to be sent is reduced, and the stability and transmission efficiency of the blockchain message transmission are improved;
[0102] 2) There is no need to build a physical transmission line between the receiving node and the sending node, which can save resource overhead and can also achieve long-distance message transmission;
[0103] 3) By making a preset routing policy consensus as a transaction on each node in the blockchain, the complexity of blockchain message transmission can be reduced.
[0104] The following is the device embodiment of the present application, which can be used to execute the method embodiment of the present application. For the details not disclosed in the device embodiment of the present application, please refer to the method embodiment of the present application.
[0105] Figure 4 It is a schematic structural diagram of the message transmission device provided by the embodiment of the present application. As Figure 4 shown, the message transmission device 40 includes an acquisition module 410, a detection module 420, and a determination module 430.
[0106] Among them, the acquisition module 410 is used to respond to the message to be sent of the first sending node in the blockchain and acquire the list of active nodes of the first sending node;
[0107] The detection module 420 is used to detect whether the first sending node involves subscribers;
[0108] The determination module 430 is used to, when the first sending node involves subscribers, determine the target active node according to the subscribers and the list of active nodes, so that the target active node acquires the message to be sent from the message pool corresponding to the first sending node and transmits the message to be sent to the receiving node in the blockchain.
[0109] In a possible implementation manner, the determination module 430 is further used to: when the first sending node does not involve subscribers, after a preset duration, calculate the distance between each active node in at least one active node and the first sending node; determine the active node with the smallest distance from the first sending node as the target active node.
[0110] In a possible implementation manner, the determination module 430 is specifically used to: for each active node in at least one active node, determine whether the identifier of the active node is the same as the identifier of the subscriber; if the same, determine the active node as the target active node; if not the same, after a preset duration, determine the active node with the smallest distance from the first sending node as the target active node.
[0111] In a possible implementation manner, the determination module 430 is further used to: determine whether the target active node is the receiving node; if so, determine that the message to be sent is completely transmitted; if not, determine the target active node as the second sending node and transmit the message to be sent through the second sending node.
[0112] In a possible implementation, the obtaining module 410 is specifically configured to: detect the active nodes of the first sending node based on a preset routing policy, and obtain a list of active nodes.
[0113] In a possible implementation, the message transmission device further includes a destruction module (not shown), and the destruction module is configured to: in response to a target active node obtaining a message to be sent, destroy the message to be sent in the message pool corresponding to the first sending node.
[0114] The message transmission device provided in this embodiment can be used to execute the method steps of the above method embodiment, and the specific implementation manners and technical effects are similar, which will not be elaborated here.
[0115] Figure 5 It is a schematic structural diagram of an electronic device provided in an embodiment of the present application. As Figure 5 shown, the electronic device 50 includes: at least one processor 510, a memory 520, a communication interface 530, and a system bus 540. Among them, the memory 520 and the communication interface 530 are connected to the processor 510 through the system bus 540 and complete communication with each other. The memory 520 is used to store instructions, the communication interface 530 is used to communicate with other devices, and the processor 510 is used to call the instructions in the memory to execute the method steps provided in the above method embodiment. The specific implementation manners and technical effects are similar, which will not be elaborated here.
[0116] The Figure 5 system bus 540 mentioned above may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus 540 can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.
[0117] The communication interface 530 is used to implement communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries).
[0118] The memory 520 may include a Random Access Memory (RAM), and may also include a non-volatile memory, such as at least one disk memory.
[0119] The processor 510 may be a general-purpose processor, including a central processing unit, a network processor (NP for short), etc.; a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0120] The embodiments of the present application further provide a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the method steps in the above method embodiments. The specific implementation manners and technical effects are similar and will not be elaborated here.
[0121] The embodiments of the present application further provide a computer program product. The computer program product includes a computer program. When the computer program is executed by a processor, it is used to implement the method steps in the above method embodiments. The specific implementation manners and technical effects are similar and will not be elaborated here.
[0122] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to the present application.
[0123] Furthermore, it should be noted that although the steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limitation, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0124] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0125] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0126] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a hybrid memory cube (HMC), etc.
[0127] When an integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. And the aforementioned memory includes: various media that can store program codes, such as USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs.
[0128] In the above embodiments, the descriptions of the various embodiments have their own focuses. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as within the scope described in this specification.
[0129] Those skilled in the art will readily think of other implementation manners of this application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptive changes of this application, which follow the general principles of this application and include the common general knowledge or conventional technical means in the technical field not disclosed in this application. The specification and the embodiments are only regarded as exemplary, and the true scope and spirit of this application are pointed out by the following claims.
[0130] It should be understood that this application is not limited to the exact structure already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is only limited by the appended claims.
Claims
1. A message transmission method, characterized in that: include: In response to a message to be sent by a first sending node in the blockchain, obtaining an active node list of the first sending node; Detecting whether the first sending node involves a subscriber; If involved, a target active node is determined according to the subscriber and the active node list, so that the target active node obtains the message to be sent from the message pool corresponding to the first sending node, and transmits the message to be sent to the receiving node in the blockchain.
2. The message transmission method according to claim 1, characterized in that: The active node list includes at least one active node, and the message transmission method further includes: If not, after a preset time period, calculating the distance between each active node in the at least one active node and the first sending node; An active node with the shortest distance from the first sending node is determined as the target active node.
3. The message transmission method according to claim 2, characterized in that: The determining the target active node according to the subscriber and the active node list includes: For each active node of the at least one active node, determining whether an identifier of the active node is the same as an identifier of the subscriber; If they are the same, determining the active node as the target active node; If they are not the same, after a preset time period, the active node with the shortest distance from the first sending node is determined as the target active node.
4. The message transmission method according to any one of claims 1 to 3, characterized in that: The transmitting the message to be sent to the receiving node in the blockchain includes: Determining whether the target active node is the receiving node; If yes, determining that the message to be sent has completed transmission; If not, it is determined that the target active node is a second sending node, and the message to be sent is transmitted through the second sending node.
5. The message transmission method according to any one of claims 1 to 3, characterized in that: The active node list is obtained by: Based on a preset routing strategy, active nodes of the first sending node are detected to obtain the active node list.
6. The message transmission method according to any one of claims 1 to 3, characterized in that: Also includes: In response to the target active node acquiring the message to be sent, the message to be sent in the message pool corresponding to the first sending node is destroyed.
7. A message transmission system, characterized in that: The message transmission system is deployed on each node in the blockchain system, and the nodes include sending nodes and active nodes; The sending node is used to implement the message transmission method according to any one of claims 1 to 6; The active node is used to obtain the message to be sent from the message pool corresponding to the sending node, and when the active node is not a receiving node in the blockchain, it acts as a new sending node to implement the message transmission method according to any one of claims 1 to 6.
8. A message transmission device, characterized in that: include: An acquisition module, configured to respond to a message to be sent by a first sending node in the blockchain and acquire an active node list of the first sending node; A detection module, used to detect whether the first sending node involves a subscriber; A determination module is used to determine a target active node according to the subscriber and the active node list when the first sending node involves a subscriber, so that the target active node obtains the message to be sent from the message pool corresponding to the first sending node, and transmits the message to be sent to the receiving node in the blockchain.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
11. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.