Message broadcasting method and device

By sending set information to the back-level nodes in a structured P2P network and clarifying their corresponding node sets, the problems of high redundancy and inability to terminate the broadcast process are solved, and resource saving and broadcast convergence are achieved.

CN116016321BActive Publication Date: 2024-12-17ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211735776.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2024-12-17
Estimated Expiration
2042-12-30

AI Technical Summary

Technical Problem

The broadcasting process in the existing structured P2P network has a large resource overhead due to excessive redundancy, and may lead to the inability to terminate broadcasts in high TPS scenarios.

Method used

By sending set information to the back nodes on the previous level node on the broadcast path, the corresponding node set of the next level node is clarified, thereby avoiding broadcast path crossing, reducing resource overhead, and ensuring broadcast convergence in high TPS scenarios.

Benefits of technology

It effectively avoids broadcast path crossing, saves resource overhead, and ensures broadcast convergence in high TPS scenarios, preventing broadcasts from being unable to terminate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016321B_ABST
    Figure CN116016321B_ABST
Patent Text Reader

Abstract

The present specification provides a message broadcasting method and device. The method is applied to a structured P2P network containing N nodes, and includes: any i-level node on the broadcast path determines the i-level node set corresponding to itself, and the optional nodes in the i-level node set that have not received the broadcast message containing target data; when the number of optional nodes is not zero, any i-level node divides the optional nodes into at least one i+1-level node set, and selects the i+1-level nodes corresponding to each i+1-level node set; and, respectively sends an i+1-level broadcast message to each i+1-level node, wherein the i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node; when the number of optional nodes is zero, any i-level node stops broadcasting the target data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present specification belong to the field of Internet technology, and more particularly, to a message broadcasting method and device. Background Art

[0002] P2P (Peer-to-Peer) network, also known as peer-to-peer network, is a distributed application architecture that distributes tasks and workloads among peers. It is a networking or network form formed by the peer-to-peer computing model at the application layer. P2P network is widely used in distributed scenarios such as blockchain networks.

[0003] Structured P2P network is an important form of P2P network. The nodes in this type of network are fixedly distributed in terms of algorithm logic, and the entire network has a relatively stable structure. When a node in a structured P2P network needs to broadcast, it can transmit the data to be broadcast to other nodes in the network by sending a broadcast message. In related technologies, the Gossip algorithm is often used for broadcasting. However, the broadcast process of this algorithm not only leads to high resource overhead due to excessive redundancy; but also because the receiver of the broadcast message needs to cache the received message, it may not converge due to limited cache space in a high TPS (Transactions PerSecond) scenario, resulting in the inability to terminate the broadcast. Summary of the invention

[0004] The purpose of this specification is to provide a message broadcasting method and device.

[0005] According to a first aspect of one or more embodiments of the present specification, a message broadcast method is proposed, which is applied to a structured P2P network comprising N nodes, each node in the structured P2P network is connected to other N-1 nodes respectively, and the N nodes constitute M levels on the broadcast path of the target data, and the nodes of the i-th level are i-level nodes, M>1, M≥i≥0; the method comprises:

[0006] Any i-level node on the broadcast path determines the i-level node set corresponding to itself, and the optional nodes in the i-level node set that have not received the broadcast message containing the target data;

[0007] In the case that the number of the optional nodes is not zero, any i-level node divides the optional nodes into at least one i+1-level node set, and selects i+1-level nodes corresponding to each i+1-level node set from the optional nodes; and, sends an i+1-level broadcast message to each i+1-level node, wherein the i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and the target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node;

[0008] When the number of the selectable nodes is zero, any i-level node stops broadcasting the target data.

[0009] According to a second aspect of one or more embodiments of the present specification, a structured P2P network is proposed, wherein the structured P2P network includes N nodes, each of which is connected to other N-1 nodes, and the N nodes form multiple levels on the broadcast path of the target data, and the nodes of the i-th level are i-level nodes, M>1, M≥i≥0; wherein any i-level node is used to:

[0010] Determine an i-level node set corresponding to itself, and optional nodes in the i-level node set that have not received a broadcast message containing the target data;

[0011] In the case where the number of the optional nodes is not zero, the optional nodes are divided into at least one i+1-level node set, and i+1-level nodes corresponding to each i+1-level node set are selected from the optional nodes; and, i+1-level broadcast messages are respectively sent to each i+1-level node, wherein the i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and the target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node;

[0012] When the number of the selectable nodes is zero, the broadcasting of the target data is stopped.

[0013] According to a third aspect of one or more embodiments of the present specification, a message broadcasting device is provided, which is applied to a structured P2P network comprising N nodes, each node in the structured P2P network is connected to other N-1 nodes respectively, and the N nodes constitute M levels on the broadcast path of the target data, M>1, the nodes of the i-th level are i-level nodes, M>1, M≥i≥0; the device comprises:

[0014] a determination unit, configured to enable any i-level node on the broadcast path to determine an i-level node set corresponding to itself, and optional nodes in the i-level node set that have not yet received a broadcast message containing the target data;

[0015] A sending unit, used for, when the number of the optional nodes is not zero, causing any i-level node to divide the optional nodes into at least one i+1-level node set, and selecting an i+1-level node corresponding to each i+1-level node set from the optional nodes; and sending an i+1-level broadcast message to each i+1-level node, wherein the i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and the target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node;

[0016] A stopping unit is used to make any i-level node stop broadcasting the target data when the number of the optional nodes is zero.

[0017] According to a fourth aspect of one or more embodiments of this specification, an electronic device is provided, including:

[0018] processor;

[0019] a memory for storing processor-executable instructions;

[0020] The processor implements the method as described in any one of the first aspects by running the executable instructions.

[0021] According to a fifth aspect of one or more embodiments of the present specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in any one of the first aspects are implemented.

[0022] In the embodiment of the present specification, when the number of optional nodes is not zero, any i-level node selects an i+1-level node corresponding to each i+1-level node set from the optional nodes, and the i+1-level broadcast message sent to any i+1-level node includes not only the target data but also the i+1-level set information. Since the i+1-level set information can indicate to any i+1-level node the i+1-level node set corresponding to the node, any i+1-level node can accurately determine its corresponding i+1-level node set based on the i+1-level set information, and then further determine the optional nodes from the set and select the i+2-level node for sending the corresponding i+2-level broadcast message, and so on. The target data is broadcasted until the number of optional nodes is zero.

[0023] It can be seen that the previous level node on the broadcast path of the target data can explicitly specify its corresponding next-level node set to the next-level node through the set information, so that the next-level node selects its next-level node from the node set. Because the next-level set information contained in the next-level broadcast message sent by the previous level node to each next-level node is targeted (the next-level set information contained in the next-level broadcast message received by any next-level node is used to specifically indicate the next-level node set corresponding to the node), it can effectively avoid the intersection of the broadcast path, reduce the redundancy of the broadcast process, and save the resource overhead of the broadcast process. Furthermore, because the broadcast path will not be crossed, any recipient of the broadcast message will not receive broadcast messages containing the same target data in other broadcast paths, so there is no need to cache the broadcast messages received by itself for subsequent judgment, and the broadcast convergence can be guaranteed even in high TPS scenarios, thereby effectively avoiding the inability to terminate the broadcast. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0025] Figure 1 This is a schematic diagram of a topological structure of a structured P2P network provided by an exemplary embodiment.

[0026] Figure 2 This is a process of a message broadcasting method provided by an exemplary embodiment.

[0027] Figure 3 It is a schematic diagram of selection results of nodes at different levels corresponding to a broadcast process provided by an exemplary embodiment.

[0028] Figure 4 It is a schematic diagram of selection results of nodes at different levels corresponding to another broadcasting process provided by an exemplary embodiment.

[0029] Figure 5 It is a structural schematic diagram of a device provided by an exemplary embodiment.

[0030] Figure 6 It is a block diagram of a message broadcasting device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0031] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0032] In order to solve the technical problems existing in the aforementioned related technologies, this solution proposes a message broadcasting solution, in which the broadcast message sent by the previous level node on the broadcast path to the next level node includes set information, so as to specify its corresponding node set to the next level node through the information, so that the next level node selects its corresponding next level node from the set. The solution is described in detail below with reference to the accompanying drawings.

[0033] The message broadcasting method described in the embodiment of this specification is applied to a structured P2P network comprising N nodes, and each node in the structured P2P network is connected to other N-1 nodes respectively. In other words, any node in the network has established a network connection with other nodes. It can be seen that the structured P2P network described in the embodiment of this specification is a full mesh network. It should also be noted that each node in the structured P2P network can also maintain a node list respectively, and the node list maintained by any node can record the node information of other N-1 nodes. Exemplarily, the node information of any node may include identity information such as node identification and node public key, as well as address information such as IP address and port number, which will not be repeated.

[0034] In one embodiment, the identity information of the node may be its node identifier. The binary length L1 of the node identifier may be a preset value, such as 160 bits, 8 bits, etc. In this case, the total number of nodes in the structured P2P network does not exceed 2 L1 , that is, the above N satisfies 2 L1 ≥ N. Alternatively, the node identifier of any node can also be a decimal number from 0 to N, that is, each number is used as a node identifier to represent a node in the structured P2P network. Alternatively, the hexadecimal length L2 of the node identifier can be a preset value, such as 8 bits, 64 bits, etc., in which case the total number of nodes in the structured P2P network does not exceed 2 L2 , that is, the above N satisfies 2 L2≥ N. It can be understood that, compared with using a binary value with a preset length as a node identifier, the length of a node identifier using a decimal number of 0 to N is relatively short, and the length of a node identifier using a hexadecimal value with a preset length is relatively shorter, thereby reducing the amount of node identifier data maintained by each node, and at the same time can reduce the size of the broadcast message sent during the broadcast process, which helps to reduce the storage resources and communication resources required for the broadcast process.

[0035] Figure 1 FIG. 1 is a schematic diagram of a topological structure of a structured P2P network provided by an exemplary embodiment. Figure 1 As shown, the structured P2P network includes 12 nodes, namely node0, node1, node2…node11 (abbreviated as node0~node11, the same below), and any node has established network connection with the other 11 nodes. Any node can maintain a node list, which can record the identity information, address information and other node information of the other 11 nodes.

[0036] Any node in a structured P2P network can act as a broadcast initiator, and include the target data that it needs to broadcast in a broadcast message and pass it to other nodes. In the process of transmitting the target data, all the nodes that the broadcast message passes through from the broadcast initiator to any data receiver (i.e., any other node in the structured P2P network) constitute a broadcast path for the data. It is understandable that after the whole network broadcast is completed, N-1 broadcast paths for the target data will be formed from the broadcast initiator to the other N-1 nodes in the structured P2P network (some of the broadcast paths may overlap). Among them, the N nodes will constitute M levels on the broadcast path of the target data, and M>1. It is understandable that N also satisfies N≥M. This specification refers to the nodes of the i-th level in any broadcast path as i-level nodes, and M≥i≥0.

[0037] In one embodiment, the structured P2P network can be used to build a blockchain network. Users can participate in blockchain-related transactions through blockchain nodes. For example, multiple blockchain nodes corresponding to different users in the blockchain system can perform secure multi-party computing (SMPC) on the private data of a node based on privacy technologies such as homomorphic encryption and zero-knowledge proof.

[0038] In addition, the target data described in the embodiments of this specification can be in any form such as text, image, audio, video, etc., and the embodiments of this specification do not limit this. In the case where the structured P2P network is used to build a blockchain network, at least some of the nodes in the structured P2P network can be used as blockchain nodes in the blockchain network. At this time, the target data to be broadcast can be blockchain transactions, consensus data, proposals, etc. in the blockchain network. It should be noted that if the target data described in this solution involves 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.), then the data are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0039] Figure 2 FIG. 1 is a flow chart of a message broadcasting method provided by an exemplary embodiment. Figure 2 As shown, the method includes steps 202-204b.

[0040] Step 202: Any i-level node on the broadcast path determines its corresponding i-level node set and optional nodes in the i-level node set that have not received the broadcast message containing the target data.

[0041] It can be understood that the broadcast initiator is the zero-level node, and i=0 at this time. The larger the value of i, the higher the level of any i-level node in the broadcast path of the target data, and the farther its position in the broadcast path is from the broadcast initiator (that is, the more nodes are located between the two on the broadcast path). Among them, when i=0, there is only one zero-level node, that is, the broadcast initiator corresponding to the target data, and this node is only used to send broadcast messages to the next-level node, that is, to send a first-level broadcast message to each first-level node; when i>0, there may be one or more i-level nodes on any broadcast path. After receiving the i-level broadcast message sent by its upper-level node (that is, the i-1-level node), any i-level node can send a broadcast message to the next-level node, that is, to send an i+1-level broadcast message to each i+1-level node.

[0042] It should be noted that the broadcast process described in this solution can ensure that the broadcast message is sent, but it does not focus on whether the receiver of the broadcast message can reliably receive the broadcast message. Therefore, any node described in the embodiments of this specification receives a broadcast message containing target data, which should be regarded as: any node is regarded as the receiver of the broadcast message containing target data, that is, there is a node that sends any level of broadcast message containing target data to any node.

[0043] The optional node corresponding to any i-level node described in the embodiments of this specification can be selected by the node as an i+1-level node, that is, it can be selected as a message receiver to receive the i+1-level broadcast message sent by any i-level node. For any i-level node, if the node is a broadcast initiator (i.e., i=0), then before it sends the i+1-level broadcast message, other nodes in the structured P2P network have not received the broadcast message containing the target data; and if the node is not a broadcast initiator (i.e., i>0), before it sends the i+1-level broadcast message, some nodes in the structured P2P network have already received the broadcast message containing the target data. Therefore, whether any i-level node is a broadcast initiator will affect the way it determines the i-level node set and selects the optional node.

[0044] In one embodiment, if any of the i-level nodes is a broadcast initiator, the node can determine the entire set of nodes consisting of all N nodes in the structured P2P network as its corresponding i-level node set (i.e., zero-level node set). Since the broadcast initiator itself has already known the target data, it only needs to send a first-level broadcast message to other nodes, so it can determine the N-1 nodes in the i-level node set other than itself as optional nodes. Alternatively, the broadcast initiator can also determine the node set consisting of N-1 nodes other than itself as its corresponding i-level node set; and then determine each node in the i-level node set as an optional node. Through any of the above methods, when any of the i-level nodes is a broadcast initiator, it can determine the remaining N-1 nodes in the structured P2P network as its corresponding optional nodes for further selecting i+1-level nodes.

[0045] It is assumed that the identity information of each node is its node identifier, and the values ​​of the node identifier are 0 to N, and N = 15. At this time, the 15 nodes in the structured P2P network can be seen in Figure 3 and Figure 4 As shown in the figure, the node IDs of the nodes are 0 to 14, and the nodes are arranged in the order of the size of the node IDs. Further, it is assumed that node 0 is the initiator of the broadcast.

[0046] like Figure 3 As shown, node0 can determine node0-14 as the zero-level node set corresponding to itself, and further determine the remaining nodes in the set (i.e., node1-14) except node0 as optional nodes. Alternatively, node1-14 can also be determined as the zero-level node set corresponding to itself, and further determine each node in the set (i.e., node1-14) as an optional node. Figure 4The specific manner in which node0 determines the zero-level node set and the optional nodes is similar to this and will not be described in detail.

[0047] In another embodiment, if any of the i-level nodes is not the broadcast initiator, the node can determine its corresponding i-level node set in response to the i-level broadcast message sent by the i-1-level node that it receives. For example, it can extract the i-level set information from the i-level broadcast message, and determine the i-level node set indicated by the i-level set information as its corresponding i-level node set. In this way, the i-1-level node can specify its corresponding i-level node set to any of the i-level nodes through the i-level set information, so as to limit the range of i+1-level nodes selected by any of the i-level nodes.

[0048] Furthermore, if the i-level broadcast message received by itself does not contain exclusion information, then any i-level node can determine all nodes in its corresponding i-level node set except itself as optional nodes; or, if the i-level broadcast message contains exclusion information, then any i-level node can determine the excluded nodes represented by the exclusion information, and determine the remaining nodes in the aforementioned i-level node set except itself and the excluded nodes as optional nodes. Among them, the exclusion information may include the identity information of each i-level node included in the i-level node set - these nodes have respectively received the i-level broadcast messages sent by the corresponding i-1-level nodes. In this way, when any i-level node is not the broadcast initiator, it can determine the nodes in its corresponding i-level node set that have not received the broadcast message containing the target data as optional nodes, so as to further select i+1-level nodes.

[0049] Among them, the exclusion information may include the identity information of each excluded node; or, in the case where the identity information of each node includes its node identifier, the exclusion information may also include the identifier interval of the identity information of each excluded node. For example, the i-1 level node (i.e., the sender of the i-level broadcast message received by any i-level node) can sort the nodes in the structured P2P network in the order of the size of the node identifier, and after determining the i-level node set corresponding to any i-level node, it can determine the identifier range of the node identifier of each node in the set in the sorting, and include the identifier range as set information in the i-level broadcast message and send it to any i-level node - the set information is used to indicate the corresponding i-level node set to any i-level node. It can be seen that the i+1 level broadcast message sent by any i-level node to different i+1 level nodes also contains different contents. Specifically, the MM contained in different i+1 level broadcast messages is the same but the set information is different.

[0050] In addition, the i-1 level node can also use the node identifiers of each i-level node determined by itself as exclusion information, or use the identifier range of each i-level node in the sorting as exclusion information; and then include the exclusion information in the i-level broadcast message and send it to any i-level node - the exclusion information is used to indicate to any i-level node the i-level nodes included in its corresponding i-level node set (these nodes can be regarded as having received the broadcast message containing the target data).

[0051] Following the above embodiment, Figure 3 As shown, assuming that node0 as the broadcast initiator selects node2, node5 and node14 as its corresponding first-level nodes, node2 can further determine its corresponding first-level node set and the optional nodes therein in response to the first-level broadcast message sent by node0: if the first-level broadcast message contains the set information [1,4] but does not contain the exclusion information, node2 can determine the other nodes except itself among the nodes whose node identifiers belong to [1,4], that is, node1 and node3~4 are its corresponding optional nodes. In a similar manner, node5 can determine its corresponding optional nodes as node6~9, and node14 can determine its corresponding optional nodes as node10~13.

[0052] like Figure 4 As shown, assuming that node0 as the broadcast initiator selects node2, node3 and node10 as its corresponding first-level nodes, node2 can further determine its corresponding first-level node set and the optional nodes therein in response to the first-level broadcast message sent by node0: if the first-level broadcast message contains set information [1,4] and exclusion information (such as "3"), node2 can determine the nodes except itself and node3 among the nodes whose node identifiers belong to [1,4], that is, node1 and node4 are its corresponding optional nodes. In a similar manner, node3 can determine its corresponding optional nodes as node5~9, and node10 can determine its corresponding optional nodes as node11~14.

[0053] The optional nodes may or may not be determined through the aforementioned method. Therefore, any i-level node may be processed separately according to the number of determined optional nodes: when the number of optional nodes is not zero, proceed to step 204a; when the number of optional nodes is zero, proceed to step 204b.

[0054] Step 204a, when the number of optional nodes is not zero, any i-level node divides the optional nodes into at least one i+1-level node set, and selects i+1-level nodes corresponding to each i+1-level node set from the optional nodes; and, sends an i+1-level broadcast message to each i+1-level node respectively, wherein the i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and the target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node.

[0055] Since the optional node belongs to the i-level node set corresponding to any i-level node, and the optional node has not received the broadcast message containing the target data, if the number of optional nodes is not zero, it means that there is a node (i.e., the optional node) in the i-level node set corresponding to any i-level node that has not received the broadcast message containing the target data. At this time, any i-level node can first determine the i+1-level node (i.e., the next-level node corresponding to itself) in the optional node, and then send a broadcast message containing the target data to each i+1-level node. Specifically, the optional nodes can be first divided into at least one i+1-level node set, and the i+1-level nodes corresponding to each i+1-level node set can be selected from the optional nodes.

[0056] As mentioned above, each selected i+1-level node corresponds to each divided i+1-level node set one by one, so the number of i+1-level nodes is the same as the number of i+1-level node sets. In one embodiment, the number can be determined based on the number of optional nodes. For example, when the number of optional nodes is not less than the preset broadcast path, any i-level node can select optional nodes with the preset broadcast path from the optional nodes as i+1-level nodes; and when the number of optional nodes is less than the preset broadcast path, all the optional nodes can be used as i+1-level nodes. It can be understood that for any i-level node, the number of i+1-level nodes it selects is the number of broadcast messages it needs to send, that is, the next-level broadcast path corresponding to itself. It can be seen that the aforementioned preset broadcast path is actually an upper limit set for the actual broadcast path of any i-level node.

[0057] Among them, the preset broadcast path number can be uniformly set for the structured P2P network, and the actual broadcast paths of any two nodes in the network or any two levels of two nodes in the broadcast path do not exceed the preset broadcast paths. Alternatively, the preset broadcast path number can also be set for each node separately, and the preset broadcast paths of any two nodes can be the same or different. Specifically, the preset broadcast path number of any i-level node can be reasonably set according to the actual situation such as the scale of the structured P2P network (i.e., the current value of N), business scenarios, the type and delay requirements of the target data, the message forwarding capability of any i-level node, etc., and the embodiments of this specification do not limit this.

[0058] In addition, if the optional nodes are divided into multiple i+1 level node sets, all the optional nodes can be evenly divided into multiple i+1 level node sets according to the equal division principle, so as to simplify the node set division rules and the complexity of post-processing as much as possible, which is helpful to improve the broadcast efficiency of the target data. Of course, in the case where the first number of optional nodes cannot divide the second number of i+1 level node sets (such as the aforementioned preset broadcast path number), the quotient of the first number and the second number can be rounded to ensure that the number of i+1 level nodes contained in each i+1 level node set is as close as possible, avoiding broadcast failures that may be caused by excessive broadcast burdens on some i+1 level nodes, and improving the efficiency of sending and receiving broadcast messages.

[0059] It should be noted that there is no necessary order between the aforementioned two steps of "dividing the i+1 level node set" and "selecting the i+1 level node". For example, you can first "divide the i+1 level node set" and then "select the i+1 level node", or you can first "select the i+1 level node" and then "divide the i+1 level node set". You can also perform these two steps in parallel at the same time, and the embodiments of this specification do not limit this.

[0060] In one embodiment, any i-level node can select an i+1-level node that corresponds to each i+1-level node set in a one-to-one manner through a variety of methods. For example, each node in the structured P2P network can maintain a fixed broadcast path corresponding to each node in each network. Based on this, when any node initiates a broadcast for target data as a broadcast initiator, other subsequent nodes can quickly determine their corresponding next-level node set and next-level node according to their corresponding fixed broadcast path, and send next-level broadcast messages based on this. Among them, the fixed broadcast path can be pre-specified by an administrator or authorized user of the structured P2P network, or it can be obtained by spontaneous negotiation of each node, and the embodiments of this specification do not limit this. In this way, any i-level node in the broadcast path of the target data can directly determine its corresponding i+1-level node and i+1-level node set according to the above-mentioned fixed broadcast path, and the broadcast process is simple and efficient.

[0061] For another example, when each i+1 level node set is determined, an i+1 level node can be selected from each i+1 level node set, wherein the i+1 level node selected from any i+1 level node set corresponds to the i+1 level node set. In this way, it can be ensured that there is an i+1 level node in each i+1 level node set, and any i+1 level node corresponds to the i+1 level node set to which it belongs.

[0062] like Figure 3 As shown, assuming that node0 as the broadcast initiator divides node1 to 14 into three first-level node sets: G11 = {node1 to 4}, G12 = {node5 to 9} and G13 = {node10 to 14}, node2, node5 and node14 can be selected from these three sets respectively as the first-level nodes corresponding to these three first-level node sets. Further, after node2 as the first-level node determines the optional nodes corresponding to itself (i.e. node1 and node3 to 4), these optional nodes can be divided into three second-level node sets: G21 = {node1}, G22 = {node3} and G23 = {node4}. It can be seen that at this time, each second-level node set contains a node (the node in any second-level node set is the optional node in the set); then a node is selected from each second-level node set as the second-level node corresponding to the set, that is, node1, node3 and node4 are determined as the second-level nodes corresponding to the three second-level node sets G21, G22 and G23. Similarly, node5 can determine three secondary node sets: G24 = {node6}, G25 = {node7} and G26 = {node8-9} and the secondary nodes corresponding to each secondary node set: node6, node7 and node8. Node14 can determine three secondary node sets: G27 = {node10}, G28 = {node11} and G29 = {node12-13} and the secondary nodes corresponding to each secondary node set: node10, node11 and node12. Among them, the secondary node node8 can further determine the third-level node set G31 = {node9}, and further select node9 as the third-level node corresponding to G31; similarly, the secondary node node12 can select node13 as the third-level node corresponding to the third-level node set G32 = {node13}. The remaining secondary nodes do not have corresponding third-level sets.

[0063] For another example, the same number of i+1-level nodes as the i+1-level node set can also be randomly selected from the optional nodes, and a one-to-one correspondence between each i+1-level node and each i+1-level node set can be determined. In this way, each i+1-level node is randomly distributed among the optional nodes, which helps to prevent malicious nodes from reversely inferring the broadcast initiator based on the distribution of nodes of different levels, and then targeted attacks on the broadcast initiator, which may cause broadcast failures or potential security risks.

[0064] like Figure 4 As shown, it is assumed that node0, as the broadcast initiator, divides node1 to 14 into the three first-level node sets G11, G12 and G13 mentioned above, and randomly selects three first-level nodes from node1 to 14: node2, node3 and node10. At this time, node0 can determine the corresponding relationship in sequence according to the arrangement order of each first-level node set and each first-level node: the node identifiers of the nodes respectively contained in G11, G12 and G13 increase in sequence, and the node identifiers of node2, node3 and node10 also increase in sequence, so it can be determined that node2 corresponds to G11, node3 corresponds to G12, and node10 corresponds to G13. Of course, in addition to the order of size, any i-level node can also determine the one-to-one correspondence between each i+1-level node and each i+1-level node set according to other rules such as random correspondence, historical correspondence records, etc., and the embodiments of this specification do not limit this.

[0065] After receiving the first-level broadcast message sent by node0, node2, as a first-level node, can determine its corresponding first-level node set G11 according to the set information contained therein, and determine the excluded node node3 according to the exclusion information contained therein. At this time, the nodes (i.e., node1 and node4) in each node contained in G11 except itself and node3 can be determined as optional nodes. Since there are only two optional nodes at this time, they can be divided into two second-level node sets: G21 = {node1} and G22 = {node4}, and the two second-level nodes node1 and node4 are selected to correspond to the two second-level node sets G21 and G22 respectively. Similarly, node3 can determine three second-level node sets: G23 = {node5~6}, G24 = {node7~8} and G25 = {node9} and the second-level nodes corresponding to each second-level node set: node5, node7 and node9. Node10 can determine three secondary node sets: G26 = {node11}, G27 = {node12} and G28 = {node13-14} and the secondary nodes corresponding to each secondary node set: node11, node12 and node13. Furthermore, the secondary node node5 corresponds to the third-level node set G31 = {node6}. Since node6 is an optional node, node6 can be further used as the third-level node corresponding to G31. Similarly, the secondary node node7 can select node8 as the third-level node corresponding to its third-level node set G32 = {node8}, and the secondary node node13 can select node14 as the third-level node corresponding to its third-level node set G33 = {node14}. The remaining secondary nodes do not have corresponding third-level sets.

[0066] In one embodiment, the identity information of the optional nodes can be arranged in order, such as any i-level node can pre-sort the N-1 nodes connected to it according to the order of the size of the node identifier. Furthermore, the optional nodes determined from the N-1 nodes are naturally also sorted according to the order of the size of the node identifier. Based on this, the i-level node can divide the identity information into multiple broadcast ranges according to the sorting order of the identity information of the optional nodes, wherein the nodes represented by each node identifier belonging to any broadcast range constitute the i+1 level node set corresponding to the broadcast range. For example, after node0 as FF divides [0,14] into three broadcast ranges [0,4], [5,9] and [10,14], the nodes represented by the node identifiers (i.e., 1, 2, 3 and 4) belonging to the broadcast range [0,4] respectively (i.e., node1, node2, node3 and node4) belong to the first-level node set corresponding to the broadcast range [0,4]. The node ranges [5,9] and [10,14] and subsequent levels are similar to this and will not be repeated.

[0067] In one embodiment, the nodes in the structured P2P network may broadcast other data in addition to the target data. For any node, if it selects the same next-level node when broadcasting multiple data, other nodes in the structured P2P network may infer the common broadcast path of the data based on the above node selection results. Therefore, malicious nodes may attack the structured P2P network by attacking the key nodes of the broadcast path, causing subsequent broadcast failures or even network paralysis. This can be solved by enhancing randomness. For example, in addition to randomly selecting i+1-level nodes from the optional nodes, it is also possible to avoid selecting optional nodes that have been used or recently used as i+1-level nodes.

[0068] Exemplarily, when any i-level node selects an i+1-level node from the optional nodes, it can determine whether a broadcast message containing other data has been sent to at least one preceding optional node in the optional nodes before the current moment, that is, determine whether the preceding optional node exists in the optional nodes: if there is at least one preceding optional node, then any i-level node can select an i+1-level node corresponding to each i+1-level node set from other optional nodes except the at least one preceding optional node. Of course, in order to ensure the smooth progress of the broadcast, the valid time can also be set for the preceding optional node, such as determining whether there is a preceding optional node within a preset time before the current moment; or the number of valid broadcasts can be set for the preceding optional node, such as determining whether there is a preceding optional node in the optional nodes that has sent a broadcast message containing other data in the last x broadcasts (that is, selected as an i+1-level node in the last x broadcasts). Among them, any broadcast message can also contain a message sequence number with unique content to uniquely identify the valid content of the message (such as the target data), so any i-level node can determine whether there is a preceding optional node based on the message sequence number of the historical broadcast message cached locally. In this way, we can try to avoid selecting nodes that have sent (or have recently sent) broadcast messages as i+1 level nodes, thereby avoiding the use of the same broadcast path for the broadcast process of different data, reducing the possibility of reverse speculation of the broadcast path, and improving the security performance of the structured P2P network to a certain extent.

[0069] like Figure 3 As shown, when node0, as the broadcast initiator, selects a first-level node, if node1 is a preceding optional node, node1 can be avoided from being selected as a first-level node; when node5, as a first-level node, selects a second-level node, if node9 is a preceding optional node, node9 can be avoided from being selected as a second-level node. Of course, the above-mentioned avoidance of selecting a preceding optional node as an i+1-level node is only a preferred solution. For example, for the first-level node node2, if at least node1 exists as a preceding optional node in its corresponding optional nodes, then since there are only three optional nodes in its first-level node set and three second-level nodes need to be selected from them, node1, node3 and node4 can still be selected as second-level nodes respectively. Figure 4 The process of selecting the middle and lower level nodes is similar to this and will not be repeated here.

[0070] It should be noted that the above embodiments are only exemplary. In the application of the solution, the number of nodes contained in any two levels in the broadcast path may be the same or different. In other words, if i≠j, the number of nodes at level i and the number of nodes at level j may be the same or different. Figure 3As shown, node0, as the broadcast initiator, determines three first-level nodes, and node2, as the first-level node, determines three second-level nodes (node1, node3, and node4). It can be seen that when i=0, j=1, the number of i-level nodes is the same as the number of j-level nodes. Node8, as the second-level node, only determines one third-level node, node9. It can be seen that when i=0, j=3 (or i=1, j=3), the number of i-level nodes is different from the number of j-level nodes.

[0071] And / or, when any i-level node divides the optional nodes into multiple i+1-level node sets, the number of optional nodes included in any two i+1-level node sets may be the same or different, and this embodiment of the specification does not limit this. Figure 4 As shown, node0 as the broadcast initiator divides all optional nodes node1~14 into three first-level node sets G11, G11 and G13. G11 contains three optional nodes node1 and node3~4, G12 contains four optional nodes node6~9, and G13 contains four optional nodes node10~13. It can be seen that the number of optional nodes included in G11 and G12 is different, the number of optional nodes included in G11 and G13 is different, and the number of optional nodes included in G12 and G13 is the same.

[0072] After determining each i+1-level node set and its one-to-one corresponding i+1-level node in the aforementioned manner, any i+1-level node may send an i+1-level broadcast message to each i+1-level node. The i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and the target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node. It can be understood that after receiving any i+1-level broadcast message, any i+1-level node may determine its corresponding i+1-level node set based on the set information contained in the message, and determine whether the set contains optional nodes: if so, an i+2-level node may be further selected from the optional nodes, and an i+2-level broadcast message may be sent to each i+2-level node; if not, broadcasting the target data may be stopped. Among them, the i+1 level broadcast message can also include exclusion information, so that the i+1 level node determines the excluded nodes in the i+1 level node set according to the exclusion information, and ensures that these nodes are not determined as optional nodes, so as to avoid these nodes from repeatedly receiving broadcast messages containing target data.

[0073] like Figure 3As shown, after node0 as the broadcast initiator determines the first-level node set G11, G12 and G13, and the first-level nodes node2, node5 and node14 corresponding to them, it can send a first-level broadcast message to each first-level node respectively. Among them, the first-level broadcast message sent to node2 contains the collection information and target data of G11, the first-level broadcast message sent to node5 contains the collection information and target data of G12, and the first-level broadcast message sent to node14 contains the collection information and target data of G13. Further, after node5 as the first-level node determines the second-level node set G24, G25 and G26, and the second-level nodes node6, node7 and node8 corresponding to them, it can send a second-level broadcast message to each second-level node respectively. Among them, the second-level broadcast message sent to node6 contains the collection information and target data of G24, the second-level broadcast message sent to node7 contains the collection information and target data of G25, and the second-level broadcast message sent to node8 contains the collection information and target data of G26. Other broadcast messages are similar to this and will not be repeated.

[0074] like Figure 3 As shown, node0 as the broadcast initiator can send a first-level broadcast message to each first-level node after determining the first-level node set G11, G12 and G13, and the first-level nodes node2, node3 and node10 corresponding to them respectively. Among them, the first-level broadcast message sent to node2 contains the collection information of G11, the exclusion information (such as "3") and the target data of node3, the first-level broadcast message sent to node3 contains the collection information and target data of G12, and the first-level broadcast message sent to node10 contains the collection information of G13, the exclusion information and the target data of node10. Of course, the above-mentioned first-level broadcast messages can also contain the same exclusion information, that is, the identity information of each first-level node (node2, node3 and node10). Further, node3 as a first-level node can send a second-level broadcast message to each second-level node after determining the second-level node set G23, G24 and G25, and the second-level nodes node5, node7 and node9 corresponding to them respectively. Among them, the secondary broadcast message sent to node5 contains the collection information and target data of G23, the secondary broadcast message sent to node7 contains the collection information and target data of G24, and the secondary broadcast message sent to node9 contains the collection information and target data of G25.

[0075] Step 204b: when the number of the optional nodes is zero, any i-level node stops broadcasting the target data.

[0076] Since the optional node belongs to the i-level node set corresponding to any i-level node, and the optional node has not received the broadcast message containing the target data, if the number of optional nodes is zero, it means that there is no node in the i-level node set corresponding to the i-level node that has not received the broadcast message containing the target data, that is, each node in the i-level node set has received the broadcast message containing the target data. At this time, from the local perspective of any i-level node, the broadcast process for the target data has been completed, and the broadcast of the target data can be stopped.

[0077] Of course, from the global perspective of the structured P2P network, at this time, there may still be some nodes in the network that have not received the broadcast message containing the target data, and these nodes can continue to participate in broadcasting the target data. When the N nodes in the structured P2P network stop broadcasting the target data according to the above steps of this solution, the broadcast process of the data in the structured P2P network ends, and at this time, the N nodes will respectively obtain the target data broadcasted by the broadcast initiator.

[0078] like Figure 3 As shown, after receiving the secondary broadcast message sent by the primary node node2, the secondary node node1 can determine its corresponding secondary node set G12 according to the set information therein. If G21 = {node1}, then at this time, the set only contains the node itself, and the node has received the primary broadcast message, so there is no optional node; or, if G21 is an empty set, there is naturally no optional node. So at this time, node1 can stop broadcasting the target data.

[0079] After acquiring the target data broadcast by the FF, each node in the structured P2P network can perform preset processing on the target data. For example, when the network is used to build a privacy computing network, each node can participate in the privacy computing process for the target data; when the network is used to build a blockchain network, each node can participate in the consensus process for the target data, etc. The embodiments of this specification do not limit the specific processing method for the target data.

[0080] In the embodiment of the present specification, when the number of optional nodes is not zero, any i-level node selects an i+1-level node corresponding to each i+1-level node set from the optional nodes, and the i+1-level broadcast message sent to any i+1-level node includes not only the target data but also the i+1-level set information. Since the i+1-level set information can indicate to any i+1-level node the i+1-level node set corresponding to the node, any i+1-level node can accurately determine its corresponding i+1-level node set based on the i+1-level set information, and then further determine the optional nodes from the set and select the i+2-level node for sending the corresponding i+2-level broadcast message, and so on. The target data is broadcasted until the number of optional nodes is zero.

[0081] It can be seen that the previous level node on the broadcast path of the target data can explicitly specify its corresponding next-level node set to the next-level node through the set information, so that the next-level node selects its next-level node from the node set. Because the next-level set information contained in the next-level broadcast message sent by the previous level node to each next-level node is targeted (the next-level set information contained in the next-level broadcast message received by any next-level node is used to specifically indicate the next-level node set corresponding to the node), it can effectively avoid the intersection of the broadcast path, reduce the redundancy of the broadcast process, and save the resource overhead of the broadcast process. Furthermore, because the broadcast path will not be crossed, any recipient of the broadcast message will not receive broadcast messages containing the same target data in other broadcast paths, so there is no need to cache the broadcast messages received by itself for subsequent judgment, and the broadcast convergence can be guaranteed even in high TPS scenarios, thereby effectively avoiding the inability to terminate the broadcast.

[0082] Corresponding to the embodiment of the aforementioned message broadcasting method, this solution also proposes an embodiment of a structured P2P network. The structured P2P network includes N nodes, each of which is connected to other N-1 nodes, and the N nodes form multiple levels on the broadcast path of the target data, and the nodes of the i-th level are i-level nodes, M>1, M≥i≥0; wherein any i-level node is used to:

[0083] Determine an i-level node set corresponding to itself, and optional nodes in the i-level node set that have not received a broadcast message containing the target data;

[0084] In the case where the number of the optional nodes is not zero, the optional nodes are divided into at least one i+1-level node set, and i+1-level nodes corresponding to each i+1-level node set are selected from the optional nodes; and, i+1-level broadcast messages are respectively sent to each i+1-level node, wherein the i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and the target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node;

[0085] When the number of the selectable nodes is zero, the broadcasting of the target data is stopped.

[0086] The specific process of broadcasting target data by any i-level node in the structured P2P network can be found in the detailed description of the aforementioned method embodiment, which will not be repeated here.

[0087] Figure 5 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 5 At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and may also include hardware required for other services. One or more embodiments of this specification may be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0088] like Figure 6 As shown, Figure 6 is a block diagram of a message broadcasting device provided by this specification according to an exemplary embodiment. The device can be applied to Figure 5 The device shown in the figure is used to implement the technical solution of this specification. The device is applied to a structured P2P network including N nodes, each node in the structured P2P network is connected to other N-1 nodes respectively, and the N nodes form M levels on the broadcast path of the target data, M>1, the nodes of the i-th level are i-level nodes, M>1, M≥i≥0; the device includes:

[0089] a determination unit, configured to enable any i-level node on the broadcast path to determine an i-level node set corresponding to itself, and optional nodes in the i-level node set that have not yet received a broadcast message containing the target data;

[0090] A sending unit, used for, when the number of the optional nodes is not zero, causing any i-level node to divide the optional nodes into at least one i+1-level node set, and selecting an i+1-level node corresponding to each i+1-level node set from the optional nodes; and sending an i+1-level broadcast message to each i+1-level node, wherein the i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and the target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node;

[0091] A stopping unit is used to make any i-level node stop broadcasting the target data when the number of the optional nodes is zero.

[0092] Optionally, the determining unit 601 is specifically configured to:

[0093] In the case where any of the i-level nodes is a broadcast initiator, the entire node set consisting of the N nodes or the node set consisting of N-1 nodes except itself is determined as the i-level node set corresponding to itself;

[0094] When any of the level i nodes is not the broadcast initiator, the level i set information is extracted from the level i broadcast message sent by the level i-1 node received by itself, and the level i node set indicated by the level i set information is determined as the level i node set corresponding to itself.

[0095] Optionally, the determining unit 601 is specifically configured to:

[0096] In the case where any of the i-level nodes is a broadcast initiator, if the i-level node set is a node set consisting of N nodes, then N-1 nodes in the i-level node set except the node itself are determined as optional nodes; or, if the i-level node set is a node set consisting of N-1 nodes except any of the i-level nodes, then each node in the i-level node set is determined as an optional node;

[0097] In the case that any of the i-level nodes is not the broadcast initiator, if the i-level broadcast message sent by the i-1-level node received by the i-level node does not contain exclusion information, then each node in the i-level node set except itself is determined as an optional node; or, if the i-level broadcast message contains exclusion information, then the remaining nodes in the i-level node set except itself and the excluded nodes represented by the exclusion information are determined as optional nodes.

[0098] Optionally, the sending unit 602 is specifically configured to:

[0099] In the case where the number of the optional nodes is not less than the preset number of broadcast paths, selecting optional nodes whose number is the preset number of broadcast paths from the optional nodes as i+1-level nodes; or,

[0100] When the number of the optional nodes is less than the preset number of broadcast paths, all the optional nodes are regarded as i+1 level nodes.

[0101] Optionally, the sending unit 602 is specifically configured to:

[0102] An i+1-level node is selected from each i+1-level node set, wherein the i+1-level node selected from any i+1-level node set corresponds to the i+1-level node set; or,

[0103] Randomly select i+1-level nodes of the same number as the i+1-level node set from the optional nodes, and determine a one-to-one correspondence between each i+1-level node and each i+1-level node set.

[0104] Optionally, the sending unit 602 is specifically configured to:

[0105] If any of the i-level nodes has sent a broadcast message containing other data to at least one preceding optional node among the optional nodes before the current moment, then an i+1-level node corresponding one-to-one to each i+1-level node set is selected from the other optional nodes except the at least one preceding optional node.

[0106] Optional,

[0107] The number of level i nodes is the same as or different from the number of level j nodes, i≠j; and / or,

[0108] When the optional nodes are divided into a plurality of i+1-level node sets, the number of optional nodes included in any two i+1-level node sets is the same or different.

[0109] Optionally, the identity information of the optional nodes is arranged in order, and the sending unit 602 is specifically configured to:

[0110] The identity information of the optional nodes is divided into a plurality of broadcast ranges according to the sorting order of the identity information, and the nodes represented by the node identifiers belonging to any broadcast range constitute an i+1 level node set corresponding to the broadcast range.

[0111] Optionally, when any i+1-level node does not belong to the i+1-level node set corresponding to itself, the i+1-level broadcast message sent to any i+1-level node also includes the identity information of other i+1-level nodes belonging to the i+1-level node set corresponding to any i+1-level node.

[0112] Optionally, the structured P2P network is used to build a blockchain network.

[0113] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the method flow). However, with the development of technology, many improvements to the method flow today can be regarded as direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and produce a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages ​​and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.

[0114] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.

[0115] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a server system. Of course, this specification does not exclude that with the development of computer technology in the future, the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0116] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps, and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not explicitly listed, or also includes elements inherent to such a process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any specific order.

[0117] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0118] This specification is described with reference to the flowcharts and / or block diagrams of the methods, apparatus (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0119] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0120] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0121] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0122] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0123] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0124] It should be understood by those skilled in the art that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0125] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0126] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.

[0127] The above description is only an example of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in the scope of the claims.

Claims

1. A message broadcast method, applied to a structured P2P network comprising N nodes, each node in the structured P2P network is connected to other N-1 nodes respectively, the N nodes form M levels on the broadcast path of the target data, the nodes of the i-th level are i-level nodes, M>1, M≥i≥0; the method include: Any i-level node on the broadcast path determines its corresponding i-level node set and optional nodes in the i-level node set that have not received the broadcast message containing the target data; wherein, The any i-level node determines the i-level node set corresponding to itself, including: when any i-level node is a broadcast initiator, determining the node set consisting of the N nodes or the node set consisting of N-1 nodes other than itself as the i-level node set corresponding to itself; when any i-level node is not a broadcast initiator, extracting i-level set information from the i-level broadcast message sent by the i-1-level node received by itself, and determining the i-level node set indicated by the i-level set information as the i-level node set corresponding to itself; Any i-level node determines the optional nodes in the i-level node set that have not received the broadcast message containing the target data, including: when any i-level node is a broadcast initiator, if the i-level node set is a node set consisting of N nodes, then N-1 nodes in the i-level node set other than itself are determined as optional nodes; or, if the i-level node set is a node set consisting of N-1 nodes other than any i-level node, then each node in the i-level node set is determined as an optional node; when any i-level node is not a broadcast initiator, if the i-level broadcast message sent by the i-1-level node received by any i-level node does not contain exclusion information, then each node in the i-level node set other than itself is determined as an optional node; or, if the i-level broadcast message contains exclusion information, then the remaining nodes in the i-level node set other than itself and the excluded nodes represented by the exclusion information are determined as optional nodes; In the case that the number of the optional nodes is not zero, any i-level node divides the optional nodes into at least one i+1-level node set, and selects i+1-level nodes corresponding to each i+1-level node set from the optional nodes; and, sends an i+1-level broadcast message to each i+1-level node, wherein the i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and the target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node; When the number of the selectable nodes is zero, any i-level node stops broadcasting the target data.

2. The method according to claim 1, wherein any i-level node selects an i+1-level node corresponding to each i+1-level node set from the optional nodes, include: In the case where the number of the optional nodes is not less than the preset number of broadcast paths, selecting optional nodes whose number is the preset number of broadcast paths from the optional nodes as i+1-level nodes; or, When the number of the optional nodes is less than the preset number of broadcast paths, all the optional nodes are regarded as i+1 level nodes.

3. The method according to claim 1, wherein the i+1 level nodes corresponding to each i+1 level node set are selected from the optional nodes. include: An i+1-level node is selected from each i+1-level node set, wherein the i+1-level node selected from any i+1-level node set corresponds to the i+1-level node set; or, Randomly select i+1-level nodes of the same number as the i+1-level node set from the optional nodes, and determine a one-to-one correspondence between each i+1-level node and each i+1-level node set.

4. The method according to claim 1, wherein the i+1 level nodes corresponding to each i+1 level node set are selected from the optional nodes. include: If any of the i-level nodes has sent a broadcast message containing other data to at least one preceding optional node among the optional nodes before the current moment, then an i+1-level node corresponding one-to-one to each i+1-level node set is selected from the other optional nodes except the at least one preceding optional node.

5. The method according to claim 1, The number of level i nodes is the same as or different from the number of level j nodes, i≠j; and / or, When the optional nodes are divided into a plurality of i+1-level node sets, the number of optional nodes included in any two i+1-level node sets is the same or different.

6. The method according to claim 1, wherein the identity information of the optional nodes is arranged in order, and the optional nodes are divided into a plurality of i+1 level node sets, include: The identity information of the optional nodes is divided into a plurality of broadcast ranges according to the sorting order of the identity information, and the nodes represented by the node identifiers belonging to any broadcast range constitute an i+1 level node set corresponding to the broadcast range.

7. According to the method described in claim 1, when any i+1-level node does not belong to the i+1-level node set corresponding to itself, the i+1-level broadcast message sent to any i+1-level node also includes the identity information of other i+1-level nodes belonging to the i+1-level node set corresponding to any i+1-level node.

8. According to the method of claim 1, the structured P2P network is used to build a blockchain network.

9. A structured P2P network, comprising N nodes, each of which is connected to N-1 other nodes, wherein the N nodes form multiple levels on the broadcast path of target data, and the nodes at the i-th level are i-level nodes, M>1, M≥i≥0 ; Any i-level node is used to: Determine the i-level node set corresponding to itself, and the optional nodes in the i-level node set that have not received the broadcast message containing the target data; wherein, The any i-level node determines the i-level node set corresponding to itself, including: when any i-level node is a broadcast initiator, determining the node set consisting of the N nodes or the node set consisting of N-1 nodes other than itself as the i-level node set corresponding to itself; when any i-level node is not a broadcast initiator, extracting i-level set information from the i-level broadcast message sent by the i-1-level node received by itself, and determining the i-level node set indicated by the i-level set information as the i-level node set corresponding to itself; Any i-level node determines the optional nodes in the i-level node set that have not received the broadcast message containing the target data, including: when any i-level node is a broadcast initiator, if the i-level node set is a node set consisting of N nodes, then N-1 nodes in the i-level node set other than itself are determined as optional nodes; or, if the i-level node set is a node set consisting of N-1 nodes other than any i-level node, then each node in the i-level node set is determined as an optional node; when any i-level node is not a broadcast initiator, if the i-level broadcast message sent by the i-1-level node received by any i-level node does not contain exclusion information, then each node in the i-level node set other than itself is determined as an optional node; or, if the i-level broadcast message contains exclusion information, then the remaining nodes in the i-level node set other than itself and the excluded nodes represented by the exclusion information are determined as optional nodes; In the case where the number of the optional nodes is not zero, the optional nodes are divided into at least one i+1-level node set, and i+1-level nodes corresponding to each i+1-level node set are selected from the optional nodes; and, i+1-level broadcast messages are respectively sent to each i+1-level node, wherein the i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and the target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node; When the number of the selectable nodes is zero, the broadcasting of the target data is stopped.

10. A message broadcasting device, applied to a structured P2P network comprising N nodes, each node in the structured P2P network is connected to other N-1 nodes respectively, the N nodes form M levels on the broadcast path of the target data, M>1, the nodes of the i-th level are i-level nodes, M>1, M≥i≥0; the device include: a determination unit, configured to enable any i-level node on the broadcast path to determine an i-level node set corresponding to itself, and optional nodes in the i-level node set that have not yet received a broadcast message containing the target data; The determining unit is specifically used for: In the case where any of the i-level nodes is a broadcast initiator, the entire node set consisting of the N nodes or the node set consisting of N-1 nodes other than itself is determined as the i-level node set corresponding to itself; in the case where any of the i-level nodes is not a broadcast initiator, the i-level set information is extracted from the i-level broadcast message sent by the i-1-level node received by itself, and the i-level node set indicated by the i-level set information is determined as the i-level node set corresponding to itself; In the case where any i-level node is a broadcast initiator, if the i-level node set is a node set consisting of N nodes, then N-1 nodes in the i-level node set except itself are determined as optional nodes; or, if the i-level node set is a node set consisting of N-1 nodes except any i-level node, then each node in the i-level node set is determined as an optional node; in the case where any i-level node is not a broadcast initiator, if the i-level broadcast message sent by the i-1-level node received by any i-level node does not contain exclusion information, then each node in the i-level node set except itself is determined as an optional node; or, if the i-level broadcast message contains exclusion information, then the remaining nodes in the i-level node set except itself and the excluded nodes represented by the exclusion information are determined as optional nodes; A sending unit, used for, when the number of the optional nodes is not zero, causing any i-level node to divide the optional nodes into at least one i+1-level node set, and selecting an i+1-level node corresponding to each i+1-level node set from the optional nodes; and sending an i+1-level broadcast message to each i+1-level node, wherein the i+1-level broadcast message sent to any i+1-level node contains i+1-level set information and the target data, and the i+1-level set information is used to indicate to any i+1-level node the i+1-level node set corresponding to the node; A stopping unit is used to make any i-level node stop broadcasting the target data when the number of the optional nodes is zero.

11. An electronic device, include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 8 by running the executable instructions.

12. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.