Message broadcasting method and device
The message broadcasting method in unstructured P2P networks uses Bloom filters to optimize broadcast efficiency by reducing redundancy and ensuring complete coverage, addressing resource overhead and convergence issues in high TPS scenarios.
Patent Information
- Application Number
- CN202211737775.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In unstructured P2P networks, the Gossip algorithm leads to high resource overhead and incomplete broadcast coverage due to redundancy and limited cache space, resulting in broadcast blind spots and failure to converge in high TPS scenarios.
A message broadcasting method where each node determines optional nodes that have not received the target data and sends a Bloom filter-containing message to the next level nodes, indicating which nodes have already received the data, ensuring efficient broadcast convergence and reducing redundancy.
This method reduces resource overhead and ensures complete broadcast coverage by avoiding redundant transmissions and blind spots, even in high TPS scenarios, by using Bloom filters to indicate data receipt and stop broadcasting when necessary.
Smart Images

Figure CN116248594B_ABST
Abstract
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] Unstructured P2P network is an important form of P2P network. The nodes in this type of network are not fixedly distributed in the algorithm logic. Nodes can frequently enter and exit the network. The entire network is relatively loose and does not have a relatively stable structure. When a node in an unstructured 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 the related art, the Gossip algorithm is often used for broadcasting. However, the use of this algorithm not only leads to high resource overhead due to excessive redundancy in the broadcast process, 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 the high TPS (Transactions Per Second) scenario, resulting in the inability to terminate the broadcast. Moreover, any node selection in this scheme usually randomly selects the next node as the receiver of the broadcast message, which may cause more nodes in the network to never receive the broadcast message, that is, there is a broadcast blind spot. 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 an unstructured P2P network, wherein each node in the unstructured P2P network is respectively connected to at least one neighbor node, and each node in the unstructured P2P network forms M levels on the broadcast path of target data, and the nodes of the i-th level are i-level nodes, M and i are both integers, M>1, M≥i≥0; the method comprises:
[0006] Any i-level node on any broadcast path determines, from its neighboring nodes, an optional node that has not received a broadcast message containing the target data;
[0007] In the case that the number of optional nodes is not zero, any i-level node selects at least one i+1-level node from the optional nodes arranged in order, and the position of the i+1-level node in the arrangement order of the optional nodes is positively correlated with i; and, an i+1-level broadcast message is sent to each i+1-level node respectively, wherein the i+1-level broadcast message contains an i+1-level Bloom filter, i+1-level level information and the target data, and the i+1-level Bloom filter records the identity information of each node and its brother nodes whose level is not higher than the i+1 level on any broadcast path, which is used to indicate to the i+1-level node that the broadcast message containing the target data has been received, and the i+1-level level information is used to indicate to the i+1-level node that it is at the i+1th level on any broadcast path;
[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, an unstructured P2P network is proposed, wherein each node in the unstructured P2P network is respectively connected to at least one neighbor node, and each node in the unstructured P2P network forms M levels on a broadcast path of target data, and the nodes of the i-th level are i-level nodes, M and i are both integers, M>1, M≥i≥0; wherein any i-level node on any broadcast path is used to:
[0010] Determine, from its own neighbor nodes, an optional node that has not received the broadcast message containing the target data;
[0011] In the case where the number of the optional nodes is not zero, at least one i+1-level node is selected from the optional nodes arranged in order, and the position of the i+1-level node in the arrangement order of the optional nodes is positively correlated with i; and, an i+1-level broadcast message is sent to each i+1-level node respectively, wherein the i+1-level broadcast message contains an i+1-level Bloom filter, i+1-level level information and the target data, and the i+1-level Bloom filter records the identity information of each node and its brother nodes whose level is not higher than the i+1 level on any broadcast path, which is used to indicate to the i+1-level node that the broadcast message containing the target data has been received, and the i+1-level level information is used to indicate to the i+1-level node that it is at the i+1th level on any broadcast path;
[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 proposed, which is applied to an unstructured P2P network, wherein each node in the unstructured P2P network is respectively connected to at least one neighboring node, and each node in the unstructured P2P network forms M levels on the broadcast path of the target data, and the nodes of the i-th level are i-level nodes, M and i are both integers, M>1, M≥i≥0; the device comprises:
[0014] A determination unit, configured to enable any i-level node on any broadcast path to determine, from its neighboring nodes, an optional node that has not received the broadcast message containing the target data;
[0015] A sending unit, used for, when the number of optional nodes is not zero, enabling any i-level node to select at least one i+1-level node from the optional nodes arranged in order, wherein the position of the i+1-level node in the arrangement order of the optional nodes is positively correlated with i; and, sending an i+1-level broadcast message to each i+1-level node respectively, wherein the i+1-level broadcast message includes an i+1-level Bloom filter, i+1-level level information and the target data, the i+1-level Bloom filter records the identity information of each node and its brother nodes whose level is not higher than the i+1 level on any broadcast path, and is used to indicate to the i+1-level node the node that has received the broadcast message containing the target data, and the i+1-level level information is used to indicate to the i+1-level node that it is at the i+1th level on any broadcast path;
[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 on any broadcast path selects at least one i+1-level node from the optional nodes, and sends an i+1-level broadcast message containing an i+1-level Bloom filter and the target data to each i+1-level node. The position of the selected i+1-level node in the arrangement sequence of the optional nodes is positively correlated with i; and the i+1-level Bloom filter records the identity information of each node and its sibling nodes on any broadcast path whose level is not higher than i+1, which is used to indicate to the i+1-level node the node that has received the broadcast message containing the target data.
[0023] It can be seen that the previous level node on any broadcast path can clearly indicate to the next level node the nodes that have received the broadcast message containing the target data through the i+1 level Bloom filter, thereby avoiding the next level node from selecting these nodes as the next level nodes corresponding to itself, effectively avoiding the probability of the same node repeatedly receiving the broadcast message containing the target data, thereby reducing the redundancy of the broadcast process and saving the resource overhead of the broadcast process. Moreover, since the previous level node does not need to confirm with the next level node when sending a broadcast message to the next level node, and any node does not need to cache the broadcast message it receives for subsequent judgment, and can clearly know when it should stop broadcasting the target data according to the number of optional nodes corresponding to itself (that is, the number of optional nodes is zero), broadcast convergence can be guaranteed even in high TPS scenarios, thereby effectively avoiding the inability to terminate the broadcast. In addition, because the position of the next-level node in the arrangement order of the optional nodes of the previous-level node is positively correlated with i (i.e., the level of the previous-level node, used to characterize the number of hops of the node in the broadcast path), it can ensure that the nodes selected at each level (for receiving broadcast messages) are offset in the same direction in the arrangement order, thereby solving the problem that some nodes cannot be selected as recipients of broadcast messages to a certain extent, helping to narrow the broadcast blind spot and ultimately achieving a more complete broadcast coverage effect. 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 an unstructured P2P network provided by an exemplary embodiment.
[0026] Figure 2It is a schematic diagram of a node selection process provided by an exemplary embodiment.
[0027] Figure 3 It is a schematic diagram of a broadcasting process provided by an exemplary embodiment.
[0028] Figure 4 It is a schematic diagram of a broadcast path provided by an exemplary embodiment.
[0029] Figure 5 This is a process of a message broadcasting method provided by an exemplary embodiment.
[0030] Figure 6 It is a structural schematic diagram of a device provided by an exemplary embodiment.
[0031] Figure 7 It is a block diagram of a message broadcasting device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0032] 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.
[0033] In order to solve the technical problems existing in the aforementioned related technologies, this solution proposes a message broadcasting solution, in which a Bloom filter is included in the broadcast message sent by the previous level node on the broadcast path to the next level node, so as to indicate to the next level node through the Bloom filter the node that has received the broadcast message containing the target data, thereby avoiding the next node from repeatedly sending the broadcast message to this part of the nodes. The solution is described in detail below with reference to the accompanying drawings.
[0034] The message broadcasting method described in the embodiment of this specification is applied to an unstructured P2P network, in which each node in the network is connected to at least one neighbor node, in other words, any node in the network has established a network connection with at least one other node. Specifically, the unstructured P2P network described in the embodiment of this specification can be a full-mesh network (in which case each node is connected to all other nodes in the network) or a non-full-mesh network (in which case each node is connected to some other nodes in the network). Among them, for any two nodes in the unstructured P2P network, if a network connection is established between the two, the two are neighbor nodes to each other. It should also be noted that each node in the unstructured P2P network can also maintain a neighbor node list, and the node information of each neighbor node can be recorded in the neighbor node list maintained by any node. Exemplarily, the node information of any neighbor node can 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.
[0035] 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.
[0036] Figure 1 FIG. 1 is a schematic diagram of a topological structure of an unstructured P2P network provided by an exemplary embodiment. Figure 1 As shown, the unstructured P2P network includes multiple nodes, wherein any node has a network connection with at least one other node, that is, any node has at least one neighbor node.
[0037] Any node in an unstructured P2P network can act as a broadcast initiator, and include the target data that it needs to broadcast in a broadcast message and transmit 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 unstructured P2P network) constitute a broadcast path for the data. Assuming that there are N nodes in the unstructured P2P network, after the whole network broadcast is completed, N-1 broadcast paths of the target data will be formed from the broadcast initiator to the other N-1 nodes in the unstructured 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 can be understood 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.
[0038] In one embodiment, the unstructured 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.
[0039] 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 unstructured P2P network is used to build a blockchain network, at least some of the nodes in the unstructured 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.
[0040] 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.
[0041] Step 202: Any i-level node on any broadcast path determines, from its neighboring nodes, an optional node that has not received a broadcast message containing the target data.
[0042] 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.
[0043] 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.
[0044] For any i-level node, if the node is a broadcast initiator (i.e., i=0), before it sends the i+1-level broadcast message, other nodes in the unstructured 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 unstructured 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 optional nodes.
[0045] 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 used as a message receiver to receive the i+1-level broadcast message sent by any i-level node. Since the optional node is used to select the i+1-level node so that the i+1-level broadcast message can be sent to each i+1-level node later, a network connection needs to be established between the optional node and any i-level node. In other words, any i-level node needs to determine the optional node from its own neighbor nodes.
[0046] In one embodiment, if any i-level node is a broadcast initiator, none of the neighboring nodes of the node has received the broadcast message containing the target data. At this time, any i-level node can determine all of its neighboring nodes as its corresponding optional nodes.
[0047] In another embodiment, if any of the i-level nodes is not a broadcast initiator, the node can determine the i-level Bloom filter contained in the message in response to the i-level broadcast message sent by the i-1-level node received by itself, and the i-level Bloom filter records the identity information of each node and its brother node on any broadcast path whose level is not higher than i-level. Based on this, any i-level node can further determine the nodes represented by the identity information recorded by the i-level Bloom filter (i.e., each node and its brother node whose level is not higher than i-level on any broadcast path-this part of nodes is considered to have received the broadcast message containing the target data), and then determine the other neighbor nodes except these nodes among its own neighbor nodes as the optional nodes corresponding to itself. In this way, any i-level node can exclude the nodes among its own neighbor nodes that have received the broadcast message containing the target data, thereby determining the other neighbor nodes that have not received the broadcast message containing the target data as optional nodes, ensuring that each optional node (before the current moment) will not repeatedly receive the broadcast message containing the target data.
[0048] 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. Figure 3 As shown in the figure, assuming that node0 is the broadcast initiator, take this node as the starting point and follow Figure 3 In the order of a→b→c→d, broadcast messages containing target data are sent to other nodes step by step, and finally the target data is broadcast to the whole network.
[0049] For node0, which is the initiator of the broadcast, it can determine all of its neighboring nodes as optional nodes, namely node1 and node2 (abbreviated as node1~2, the same below) and node11~13. Assuming that node0 selects node1 and node2 as the first-level nodes, for node2, the first-level Bloom filter contained in the first-level broadcast message sent by node0 that it receives can record the node identifier of node1, and of course, the node identifiers of node0 and node2 can also be recorded. Based on this, node2 can determine the remaining neighboring nodes (namely node4~5) except node0 among its own neighboring nodes (namely node0 and node4~5) as its corresponding optional nodes. Similarly, node1 can determine that the optional node corresponding to itself is node3, and the specific process will not be repeated here.
[0050] Below Figure 3 The broadcast process is briefly described as shown in the figure. Figure 3 As shown in a, as the broadcast initiator (i.e., zero-level node), node0 identifies two first-level nodes, node1 and node2, and sends a first-level broadcast message to each of them. Figure 3 As shown in b, in response to the received primary broadcast message, node1 determines the secondary node ndoe3 and sends a secondary broadcast message to it; node2 determines the secondary nodes node4 and node5 and sends secondary broadcast messages to them respectively. Figure 3 As shown in c, in response to the received second-level broadcast message, node3 determines the third-level nodes ndoe6 and node7, and sends the third-level broadcast message to them respectively; node4 determines the third-level node node8, and sends the third-level broadcast message to it; node5 determines the third-level nodes ndoe9 and node10. And sends the third-level broadcast message to them respectively. The subsequent broadcast process of multiple levels is similar to this, and will not be repeated one by one. Finally, as shown in Figure 3 As shown in d, after each node in the unstructured P2P network stops broadcasting the target data, each node in the network receives a broadcast message containing the target data.
[0051] Corresponding to the above broadcast process, the broadcast path of each node can form a tree structure. For details, see Figure 4 .like Figure 4 As shown, node0→node1 is the broadcast path corresponding to the first-level node node1, node0→node2→node4 is the broadcast path corresponding to the second-level node node4, node0→node1→node3→node6 is the broadcast path corresponding to the third-level node node6, and the broadcast paths corresponding to nodes at other levels are not repeated one by one.
[0052] In addition, Figure 3 As shown, node8, node9 and node10 each have only one neighbor node. Therefore, after receiving the third-level broadcast messages sent by their respective neighbor nodes (respectively second-level nodes), these three third-level nodes cannot determine the optional nodes corresponding to themselves, so they can stop broadcasting the target data. However, node6 and node7 each have multiple neighbor nodes. Therefore, after receiving the third-level broadcast messages sent by their respective connected second-level nodes, they can further determine the optional nodes corresponding to themselves, such as node has 4 optional nodes, node7 has 2 optional nodes, etc. Based on this, node6 and node7 can further determine the fourth-level node and send a fourth-level broadcast message. The specific process will not be repeated (such as Figure 4 ellipsis).
[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 selects at least one i+1-level node from the optional nodes arranged in order, and the position of the i+1-level node in the arrangement order of the optional nodes is positively correlated with i; and, sends an i+1-level broadcast message to each i+1-level node respectively, wherein the i+1-level broadcast message contains an i+1-level Bloom filter, i+1-level level information and the target data, the i+1-level Bloom filter records the identity information of each node and its brother nodes whose level is not higher than the i+1 level on any broadcast path, which is used to indicate to the i+1-level node that the node has received the broadcast message containing the target data, and the i+1-level level information is used to indicate to the i+1-level node that it is at the i+1th level on any broadcast path.
[0055] Since the optional nodes have 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) among the neighbor nodes of any i-level node that has not received the broadcast message containing the target data. At this time, any i-level node can select at least one i+1-level node from the optional nodes, and send an i+1-level broadcast message to each i+1-level node. It should be noted that the neighbor nodes of any two nodes in an unstructured P2P network may be the same or different. For any node, the node first determines the optional nodes from its own neighbor nodes, and then selects the next-level node from the optional nodes.
[0056] In one embodiment, when the number of the optional nodes is not less than the preset broadcast path, any i-level node can select optional nodes whose number is the preset broadcast path from the optional nodes as i+1-level nodes; and when the number of the 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 unstructured 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 unstructured P2P network (i.e., the actual size 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 one embodiment, the nodes in the unstructured 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 unstructured P2P network may infer the common broadcast path of the data based on the above node selection results. Therefore, malicious nodes may attack the unstructured 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.
[0059] 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 at least one i+1-level node from other optional nodes other than 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 length 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 unstructured P2P networks to a certain extent.
[0060] like Figure 3 As shown, when node0, as the broadcast initiator, selects a first-level node, if node12 is a preceding optional node, node12 can be avoided from being selected as a first-level node; when node5, as a second-level node, selects a second-level node, if node14 is a preceding optional node, node14 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 node1, if at least node3 is a preceding optional node among its corresponding optional nodes, but since there is only one optional node, node3, and no more than two second-level nodes need to be selected from it, node3 can (and can only) be selected as a second-level node. For another example, for the first-level node node2, if at least node4 is a preceding optional node among its corresponding optional nodes, but since there are only two optional nodes, node4 and node5, and two second-level nodes need to be selected from it, node4 and node5 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.
[0061] 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 4 As shown, node0 as the broadcast initiator determines two first-level nodes, and node1 as the first-level node determines one second-level node node3. It can be seen that in the case of i=0, j=1, the number of i-level nodes is different from the number of j-level nodes. The second-level node node3 determines two third-level nodes node6 and node7, and the first-level node node2 determines two second-level nodes node4 and node5. It can be seen that in the case of i=0, j=3, or i=2, j=3, the number of i-level nodes is the same as the number of j-level nodes.
[0062] Each optional node determined by any i-level node can be arranged in a certain order, such as being arranged in order of the size of node identifiers (such as from small to large or from large to small), being arranged in order of joining the unstructured P2P network, being arranged in order of the size of IP addresses, etc. In addition, any i-level node can perform the above arrangement on each of its neighboring nodes in advance, so that after determining the optional nodes from the neighboring nodes, these optional nodes are naturally also arranged; or, any i-level node can also perform the above arrangement on each optional node after determining the optional nodes, and the embodiments of this specification are not limited to this.
[0063] In one embodiment, when the i-level node is the broadcast initiator, it can select at least one optional node with the smallest sequence number (such as arranged at the front) in the arrangement order as the i+1-level node, or it can also select at least one optional node with the largest sequence number (such as arranged at the end) in the arrangement order as the i+1-level node. In this way, it can be ensured that each first-level node selected by the broadcast initiator as the starting point of the broadcast is at one end of the arrangement order, thereby ensuring that nodes of each level are selected layer by layer starting from this end in the subsequent broadcast process.
[0064] In another embodiment, when any of the i-level nodes is not a broadcast initiator, the i-level node can determine the optional nodes in response to the i-level broadcast message sent by the i-1-level node, and further select the i+1-level node from the optional nodes. At this time, the node can determine the arrangement order of the optional nodes, and determine the i-th level of itself on any of the broadcast paths according to the i-level level information contained in the i-level broadcast message; then determine at least one optional node whose position in the arrangement order is positively correlated with i as the i+1-level node.
[0065] As mentioned above, the position of each selected i+1 level node in the arrangement order of the optional nodes is positively correlated with i. To ensure that the i+1 level node meets this rule, the i level node can select the i+1 level node in the following multiple ways. The optional nodes are arranged in order of the size of the node identifier.
[0066] In one embodiment, a parameter k1 or k2 may be set, wherein any parameter of k1 and k2 may be a preset constant, which is a positive number; or may be a preset array, wherein any value in the preset array is a positive number. The k1 or k2 may be uniformly set for an unstructured P2P network as a global parameter for each node in the network. Alternatively, the k1 or k2 may be set for each node in the network, and the k1 or k2 set for any node may be used by the node to select the next level node when participating in the broadcast process - the node may use the k1 or k2 when participating in the broadcast process of each data. Alternatively, the k1 or k2 can also be set for a specific level or a specific type of data of each node in the network: for example, if k1 or k2 is set for the x level of any node, then the node can be used to select the x+1 level node when participating in the broadcast process as the x level node in the broadcast path; for another example, if k1 or k2 is set for a certain data type of any node, then the node can be used to select the x+1 level node when participating in the broadcast process of the type of data as the x level node in the broadcast path. The above multiple settings of k1 or k2 can meet the node selection requirements of different broadcast scenarios.
[0067] When selecting an i+1 level node from the optional nodes, if any of the i-level nodes is preset with a parameter k1, the node can determine its own level i based on the i-level level information contained in the received i-level broadcast message, and then determine the k1*ith optional node in the arrangement order as the i+1 level node. It can be understood that because k1 and i are both positive numbers (i>0 as mentioned above), the product k1*i of the two is also a positive number. At this time, the optional node with the serial number of the product can be used as the i+1 level node. Among them, if k1 is a preset constant, an i+1 level node can be determined; or, if k1 is a preset array containing multiple values (different from each other), multiple i+1 level nodes can be determined.
[0068] If any of the i-level nodes is preset with parameter k2, the node can randomly select at least one positioning optional node from the optional nodes, and determine the serial number hop_num of each positioning optional node in the arrangement order, and then determine at least one optional node in the arrangement order whose serial number is close to hop_num+k2*i as the i+1-level node. It can be understood that if k2 is a preset constant, a positioning optional node can be selected to determine an i+1-level node; if k2 is a preset array containing multiple numerical values (different from each other), the same number of positioning optional nodes as the numerical value can be selected to determine the corresponding number of i+1-level nodes; in other words, the number of positioning optional nodes should be consistent with the number of numerical values in the preset constant or preset array corresponding to k2. After determining the serial numbers of each positioning optional node;
[0069] It should also be noted that if the preset constant or value of k1 or k2 is a decimal, k1*i or k2*i may not be an integer. In this case, it can be processed according to the preset rounding rules: taking k1*i as an example, when k1*i=2.5, the second or third optional node can be used as the i+1 level node; when k1*i=2.2, the second optional node can be used as the i+1 level node; when k1*i=2.7, the third optional node can be used as the i+1 level node.
[0070] like Figure 5 As shown in a, suppose there are 15 nodes in the network, and the node IDs are 0, 1, 2, ... 14. At this time, the 15 nodes are sorted from small to large in the order of node IDs as 0 → 1 → 2 → ... → 14. Assuming node0 is any i-1 level node, if it determines five optional nodes ndoe1 to 5 from its neighbor nodes, node0 can select the i-level node from node1 to 5.
[0071] Assume that i=2. If node0 is set with k2={1,3}, then since k2*(i-1)={1,3}, node0 can determine the nodes with sequence numbers 1 and 3 (i.e. node1 and node3) as i-level nodes (i.e. second-level nodes). Figure 5 Alternatively, node0 can also randomly select two nodes from node1 to 5 as optional nodes for positioning, such as selecting node2 and node4. In this case, hop_num = {2, 4}, hop_num + k2*i = {2 + 1*1, 4 + 3*4} = {3, 16}. Since 16 is greater than the total number of optional nodes, 5, the optional node with the largest sequence number can be selected as the first-level node, and finally node3 and node5 can be selected as the second-level nodes.
[0072] In another embodiment, when any i-level node is not a broadcast initiator, any i-level node can determine the i-th level of itself on any broadcast path according to the i-level level information contained in the i-level broadcast message sent by the i-1-level node received by itself; and determine the maximum level max_hop, and divide the optional nodes into max_hop groups according to the arrangement order. Among them, the maximum level max_hop can be reasonably set according to the actual situation such as the scale of the unstructured P2P network (that is, the total number of nodes in the network at the current moment), the type and delay requirements of the target data of each node, and the message forwarding capability of any i-level node, such as 3, 10 or 5, etc., and the embodiment of this specification does not limit this. In the case where the quotient of the total number of optional nodes and the max_hop is not an integer, forensic processing can be performed according to the preset rounding rule to ensure that each group contains an integer (and at least one) optional node. Based on the above grouping, the optional nodes in the i-th group can be determined as i+1-level nodes; or, the optional nodes in the adjacent group close to the i-th group can also be determined as i+1-level nodes.
[0073] Successor to Figure 5 b, at this time node0 selects node1 and node3 as secondary nodes. The secondary broadcast message sent by node0 to node1 and node3 contains a secondary Bloom filter (recording the identity information of node1 and node3 and their sibling nodes), target data and i+1 level information (such as "grade=2"). Further assume that the preset maximum level max_hop=5; and, node1 determines nine nodes, node6~14, from its own neighbor nodes, and node3 determines six nodes, node6, node8~9 and node11~13, from its own neighbor nodes. After receiving the secondary Bloom filter, node1 can determine that the current i=2 according to the i+1 level information, and determine the maximum level max_hop=5. At this time, the above nine optional nodes can be divided into 5 groups. Considering that 9 / 5 is not an integer, the grouping results after rounding can be {node6}, {node7,node8}, {node9,node10}, {node11,node12}, {node13,node14}, see Figure 5As shown in the dashed box in c (the first group only contains node6, and the corresponding dashed box is not drawn). Then, each optional node in the second group (i.e., node7 and node8) can be determined as a third-level node. Similar to node1, the grouping result of node2 for each optional node can be {node6}, {node8}, {node9}, {node11}, {node12, node13}, see Figure 5 As shown in the dashed box in c (the first four groups only contain one node, and the corresponding dashed box is not drawn). Furthermore, each optional node in the second group (ie, node8) can be determined as a third-level node.
[0074] like Figure 5 It can be seen that the position of the secondary node in the arrangement order is relatively later (with a larger sequence number) than that of the primary node. It can be understood that Figure 5 If the secondary nodes node7 and node8 shown further select the third-level nodes in the above manner, then the position of each third-level node in the arrangement will be further back (with a larger sequence number) relative to the above-mentioned secondary nodes. It can be seen that for nodes of each level as the receiver of the broadcast message, the above selection method can achieve the following effect: the higher the level of the node, the further back it is in the arrangement order (of course, it can also be closer to the front depending on the sorting direction), and different nodes of the same level are closer in the arrangement order. Because of this, compared with randomly selecting the nodes of the next level at each level, this scheme can make the distribution of nodes at each level more regular, and can reduce the probability that some nodes (when using a random algorithm) cannot be selected to a certain extent, thereby helping to reduce the broadcast blind area.
[0075] After selecting at least one 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 respectively, wherein the broadcast message includes an i+1-level Bloom filter, i+1-level level information and the target data. The i+1-level Bloom filter records the identity information of each node and its sibling nodes whose level is not higher than the i+1 level on any broadcast path, and is used to indicate to the i+1-level node the node that has received the broadcast message containing the target data. The i+1-level level information is used to indicate to the i+1-level node that it is at the i+1th level on any broadcast path. It can be understood that after receiving the i+1-level broadcast message, the i+1-level node can determine that it is at the i+1th level based on the i+1-level level information contained therein, and then after determining the optional nodes from its own neighbor nodes, it can select at least one i+2-level node from these optional nodes arranged in order, and send i+2-level broadcast messages to each i+2-level node respectively, and the position of the selected i+2-level node in the arrangement order of these optional nodes is positively correlated with i+1. Among them, the specific way in which the i+1-level node selects the i+2-level node can refer to the aforementioned embodiment of the i-level node selecting the i+1-level node, and the specific way in which the i+1-level node sends the i+2-level broadcast message to the i+2-level node can refer to the aforementioned embodiment of the i-level node sending the i+1-level broadcast message to the i+1-level node, which will not be repeated here.
[0076] The Bloom filter described in the embodiments of this specification is essentially a very long binary vector and a series of random mapping functions, which can be used to retrieve whether an element exists in a set. Specifically, considering that the nodes represented by each identity information recorded in the i+1-level Bloom filter are nodes in the i+1 level and its lower levels that have received broadcast messages containing target data, the set consisting of this part of nodes can be regarded as the i+1-level received node set corresponding to the i+1-level Bloom filter. Based on this, in response to receiving the i+1-level broadcast message, the i+1-level node can detect whether each of its own neighbor nodes exists in the i+1-level received node set according to the i+1-level Bloom filter: if each neighbor node exists in the set, there is no optional node; if not all neighbor nodes exist in the set (that is, none of them exist in the set or some of them exist in the set), the i+1-level node can determine the optional node corresponding to itself, that is, the neighbor node that does not exist in the i+1-level received node set.
[0077] In one embodiment, any i-level node may record the identity information of at least one i+1-level node in an i+1-level Bloom filter, and construct an i+1-level broadcast message including the i+1-level Bloom filter and the target data, and then send the constructed i+1-level broadcast message to each i+1-level node. It can be seen that the i+1-level broadcast messages sent by any i-level node to different i+1-level nodes contain the same content, specifically, the i+1-level Bloom filter and the target data. In this way, any i-level node can accurately specify to the i+1-level node the nodes that are related to the current broadcast path (i.e., the broadcast path to which any i-level node belongs) and have received broadcast messages containing target data (i.e., each node in the broadcast path and its sibling nodes, hereinafter referred to as excluded nodes), so that each i+1-level node can ensure that the excluded nodes among its own neighbor nodes are not determined as optional nodes, so as to avoid sending i+1-level broadcast messages containing target data to the excluded nodes, that is, avoiding the excluded nodes from repeatedly receiving broadcast messages containing target data, which significantly reduces the redundancy of the broadcast process and helps to reduce the resources required for the broadcast process.
[0078] As mentioned above, any of the i-level nodes may be a broadcast initiator or not a broadcast initiator. Depending on the role of the node, it may use different methods to record the identity information of the at least one i+1-level node in the i+1-level Bloom filter. For example, in the case where any of the i-level nodes is a broadcast initiator, the node may add the identity information of the at least one i+1-level node to a blank Bloom filter, thereby obtaining an i+1-level Bloom filter. The blank Bloom filter is a Bloom filter that has not recorded the identity information of any node—at this time, the identity information of the excluded nodes is not recorded in the Bloom filter. In the above manner, the identity information of the at least one i+1-level node (i.e., each first-level node) may be recorded in the first-level Bloom filter. Of course, the identity information of the broadcast initiator itself may also be recorded in the Bloom filter at the same time, which will not be repeated.
[0079] Alternatively, in the case where any i-level node is not the broadcast initiator, any i-level node can extract the i-level Bloom filter from the i-level broadcast message sent by the i-1-level node and add the identity information of at least one i+1-level node to the i-level Bloom filter to obtain the i+1-level Bloom filter. It can be seen that the identity information recorded in the i+1-level Bloom filter is the union of the identity information recorded in the i-level Bloom filter and the identity information of each i+1-level node. Obviously, in this way, the accumulation of identity information recorded by Bloom filters of different levels can be achieved.
[0080] In one embodiment, the i-level node may construct the i+1-level broadcast message in a variety of ways. For example, the i+1-level Bloom filter may be serialized, and the processed serialized data may be recorded in the i+1-level broadcast message. Alternatively, the i+1-level Bloom filter and the target data may be recorded in the i+1-level broadcast message, and the i+1-level broadcast message may be serialized to obtain the i+1-level broadcast message to be transmitted. The specific process of serializing any data may be referred to the records in the relevant technology, and will not be repeated in this specification.
[0081] In one embodiment, the protobuf (protocol buffers) structure can be used to construct the i+1 level broadcast message. Among them, protobuf is a tool library with efficient protocol data exchange format provided by Google. It is a language-independent, platform-independent, and scalable method of serializing structured data, which can be used for data communication protocols and data storage, etc. It has flexible, efficient and automated mechanisms. The structure has the advantages of smaller size after encoding, faster encoding and decoding speed, and higher conversion efficiency (such as time efficiency and space efficiency). Exemplarily, the i+1 level broadcast message constructed using protobuf can be as follows:
[0082]
[0083] Among them, the ProtoBloomFilter can also be constructed through protobuf, as follows:
[0084]
[0085] Of course, the contents of the above i+1 level broadcast message and Bloom filter are only exemplary. During the solution application stage, the specific contents of the above i+1 level broadcast message and Bloom filter can be customized according to actual needs, and the embodiments of this specification do not limit this.
[0086] It should be noted that the brother nodes described in the embodiments of this specification are nodes with the same parent node, that is, if the parent nodes of any multiple nodes are the same, then these nodes are brother nodes to each other. Figure 4 As shown, node1 and node2 are sibling nodes, node6 and node5 are sibling nodes, but node3 and node4 (or node5) are not sibling nodes.
[0087] like Figure 4As shown, the first-level broadcast message sent by the zero-level node node0 to the first-level nodes node1 and node2 includes a first-level Bloom filter and target data, and the first-level Bloom filter records the identity information of node1~2 (such as node identification), or may also record the identity information of node0~2. The following nodes take this as an example. Further, the second-level broadcast message sent by node1 to the second-level node node3 includes a second-level Bloom filter and target data, and the second-level Bloom filter records the identity information of node0~3. Similarly, the second-level broadcast message sent by node2 to the second-level nodes node4 and node5 includes a second-level Bloom filter and target data, and the second-level Bloom filter records the identity information of node0~5. Further, the third-level broadcast message sent by node3 to the third-level nodes node6 and node7 includes a third-level Bloom filter and target data, and the third-level Bloom filter records the identity information of node0~3 and node6~7. Similarly, the third-level broadcast message sent by node4 to the third-level node node8 includes a third-level Bloom filter and target data, and the third-level Bloom filter records the identity information of node0-2, node4-5 and node8. The third-level broadcast message sent by node5 to the third-level nodes node9 and node10 includes a third-level Bloom filter and target data, and the third-level Bloom filter records the identity information of node0-2, node4-5 and node9-10.
[0088] It can be seen from the identity information recorded by the above-mentioned Bloom filters that for the broadcast messages sent by each node on any broadcast path, the identity information recorded by the Bloom filters in each broadcast message is accumulated layer by layer. Taking the broadcast path of node0→node2→node5→node10 as an example, the identity information of node0~2 is recorded in the first-level Bloom filter, the identity information of node0~2 and node4~5 is recorded in the second-level Bloom filter, and the identity information of node0~2, node4~5 and node9~10 is recorded in the third-level Bloom filter. In this way, the nodes in the previous layer can clearly indicate the excluded nodes to the nodes in the next layer.
[0089] Step 204b: when the number of the optional nodes is zero, any i-level node stops broadcasting the target data.
[0090] Since the optional nodes have not received the broadcast message containing the target data, if the number of optional nodes is zero (such as the identity information of all neighbor nodes of any JJ is recorded in the i-level Bloom filter contained in the i-level message received by itself), it means that there is no node among the neighbor nodes of any i-level node that has not received the broadcast message containing the target data, that is, each neighbor node 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 target data can be stopped from being broadcast.
[0091] Of course, from the global perspective of the unstructured 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 unstructured P2P network stop broadcasting the target data according to the above steps of this solution, the broadcast process of the data in the unstructured P2P network ends, and at this time, the N nodes will respectively obtain the target data broadcasted by the broadcast initiator.
[0092] After obtaining the target data broadcast by the broadcast initiator, each node in the unstructured 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.
[0093] In the embodiment of the present specification, when the number of optional nodes is not zero, any i-level node on any broadcast path selects at least one i+1-level node from the optional nodes, and sends an i+1-level broadcast message containing an i+1-level Bloom filter and the target data to each i+1-level node. The position of the selected i+1-level node in the arrangement sequence of the optional nodes is positively correlated with i; and the i+1-level Bloom filter records the identity information of each node and its sibling nodes on any broadcast path whose level is not higher than i+1, which is used to indicate to the i+1-level node the node that has received the broadcast message containing the target data.
[0094] It can be seen that the previous level node on any broadcast path can clearly indicate to the next level node the nodes that have received the broadcast message containing the target data through the i+1 level Bloom filter, thereby avoiding the next level node from selecting these nodes as the next level nodes corresponding to itself, effectively avoiding the probability of the same node repeatedly receiving the broadcast message containing the target data, thereby reducing the redundancy of the broadcast process and saving the resource overhead of the broadcast process. Moreover, since the previous level node does not need to confirm with the next level node when sending a broadcast message to the next level node, and any node does not need to cache the broadcast message it receives for subsequent judgment, and can clearly know when it should stop broadcasting the target data according to the number of optional nodes corresponding to itself (that is, the number of optional nodes is zero), broadcast convergence can be guaranteed even in high TPS scenarios, thereby effectively avoiding the inability to terminate the broadcast. In addition, because the position of the next-level node in the arrangement order of the optional nodes of the previous-level node is positively correlated with i (i.e., the level of the previous-level node, used to characterize the number of hops of the node in the broadcast path), it can ensure that the nodes selected at each level (for receiving broadcast messages) are offset in the same direction in the arrangement order, thereby solving the problem that some nodes cannot be selected as recipients of broadcast messages to a certain extent, helping to narrow the broadcast blind spot and ultimately achieving a more complete broadcast coverage effect.
[0095] It is understandable that, since the internal structure of the unstructured P2P network (i.e., the connection relationship between each node) is difficult to predict, in this solution, each broadcast path starting from the broadcast initiator may intersect. Based on this, the repeated transmission of broadcast messages can be further reduced by merging Bloom filters.
[0096] For example, any i-level node may cache the i-level Bloom filter contained in the i-level broadcast message locally in response to receiving the i-level broadcast message sent by the i-1-level node. Then, in the case of receiving any broadcast message containing any Bloom filter and any data, if the any data is the target data, the any i-level node may merge the i-level Bloom filter with the any Bloom filter into the latest Bloom filter, and the identity information recorded in the latest Bloom filter is recorded in the i-level Bloom filter and / or any Bloom filter. It can be understood that the any data is the target data, which means that the any broadcast message received by the any i-level node contains the same data as the aforementioned i-level broadcast message, that is, the node repeatedly receives different broadcast messages containing the same data, which further indicates that the two broadcast paths in the data broadcast process intersect at the node. At this time, the i-level Bloom filter is merged with any one of the Bloom filters, and the identity information recorded in the latest Bloom filter is the union of the identity information recorded respectively in the i-level Bloom filter and any one of the Bloom filters - the identity information of any node recorded in the latest Bloom filter may be recorded only in the i-level Bloom filter, or may be recorded only in any one of the Bloom filters, or may be recorded respectively in the i-level Bloom filter and any one of the Bloom filters.
[0097] Furthermore, any i-level node can select at least one latest i+1-level node from its neighboring nodes except the node represented by the node identifier recorded in the latest Bloom filter, and send a combined broadcast message containing the latest Bloom filter and the target data to each latest i+1-level node. Because the identity information recorded in the latest Bloom filter is the union of the identity information recorded by the i-level Bloom filter and any Bloom filter, the latest i+1-level node does not belong to the broadcast path corresponding to the i-level Bloom filter, nor does it belong to the broadcast path corresponding to any Bloom filter, so the latest i+1-level node has a greater probability of not having received any broadcast message containing the target data. In this way, more nodes that have received broadcast messages containing the target data can be excluded in the selection process of the latest i+1-level node, thereby further reducing the possibility that the latest i+1-level node repeatedly receives such broadcast messages, which helps to reduce the redundancy of the broadcast process.
[0098] As mentioned above, for node6, it is a third-level node in the broadcast path "node0→node1→node3→node6" (hereinafter referred to as trace1); assuming that in the broadcast process of the target data, node0 also selects node12 as the first-level node and node12 selects node6 as the second-level node, then node6 is a second-level node in the broadcast path "node0→node12→node6" (hereinafter referred to as trace2). Let's assume that the message transmission time between different levels is relatively close, then node6 will first receive the second-level broadcast message sent by node12, and then receive the third-level broadcast message sent by node7.
[0099] In this regard, node6 can cache the secondary Bloom filter contained in the secondary broadcast message sent by node12 locally, wherein a first hash value can be calculated based on the message sequence number of the secondary broadcast message (such as the aforementioned P2PMessage.msg_id) and the target data (such as the aforementioned P2PMessage.msg), and the first hash value is used as the index when storing the secondary Bloom filter. Thereafter, for any broadcast message received, node6 can calculate a second hash value based on its message sequence number and the data carried, and determine whether the data carried by any broadcast message is the target data by comparing the first hash value and the second hash value. Therefore, in the case of receiving a third-level broadcast message sent by node7, node6 can determine that the message contains the target data based on the calculated second hash value being equal to the first hash value, and at this time it can be determined that L1 and L2 intersect at node6.
[0100] Then, node6 can merge the secondary broadcast message in the above secondary broadcast message with the third-level Bloom filter in the third-level broadcast message, and the latest Bloom filter obtained will contain the identity information of node0~2, node3, node6~7 and node12. Furthermore, node6 can exclude node3 and node12 from the five neighboring nodes connected to it, determine the remaining three nodes as optional nodes, and then further select the latest third-level node and send a third-level broadcast message to it. In this way, the merger of trace1 and trace2 is realized, which helps to further reduce the probability that subsequent nodes may repeatedly receive broadcast messages containing target data, thereby reducing the redundancy of the target data broadcast process.
[0101] Corresponding to the embodiment of the message broadcasting method described above, the present solution also proposes an embodiment of an unstructured P2P network. Each node in the unstructured P2P network is respectively connected to at least one neighboring node, and each node in the unstructured P2P network forms M levels on the broadcast path of the target data, and the nodes of the i-th level are i-level nodes, M and i are both integers, M>1, M≥i≥0; wherein any i-level node on any broadcast path is used for:
[0102] Determine, from its own neighbor nodes, an optional node that has not received the broadcast message containing the target data;
[0103] In the case where the number of the optional nodes is not zero, at least one i+1-level node is selected from the optional nodes arranged in order, and the position of the i+1-level node in the arrangement order of the optional nodes is positively correlated with i; and, an i+1-level broadcast message is sent to each i+1-level node respectively, wherein the i+1-level broadcast message contains an i+1-level Bloom filter, i+1-level level information and the target data, and the i+1-level Bloom filter records the identity information of each node and its brother nodes whose level is not higher than the i+1 level on any broadcast path, which is used to indicate to the i+1-level node that the broadcast message containing the target data has been received, and the i+1-level level information is used to indicate to the i+1-level node that it is at the i+1th level on any broadcast path;
[0104] When the number of the selectable nodes is zero, the broadcasting of the target data is stopped.
[0105] The specific process of broadcasting target data by any i-level node in the unstructured P2P network can be found in the detailed description of the aforementioned method embodiment, which will not be repeated here.
[0106] Figure 6 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 6 At the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile memory 610, 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 602 reading the corresponding computer program from the non-volatile memory 610 into the memory 608 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.
[0107] like Figure 7 As shown, Figure 7 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 6 The device shown in the figure is used to implement the technical solution of this specification. The device is applied to an unstructured P2P network, each node in the unstructured P2P network is connected to at least one neighbor node, each node in the unstructured P2P network forms M levels on the broadcast path of the target data, the nodes of the i-th level are i-level nodes, M and i are both integers, M>1, M≥i≥0; the device includes:
[0108] A determination unit 701 is configured to enable any i-level node on any broadcast path to determine, from its neighboring nodes, an optional node that has not received a broadcast message containing the target data;
[0109] A sending unit 702 is used for, when the number of optional nodes is not zero, enabling any i-level node to select at least one i+1-level node from the optional nodes arranged in order, and the position of the i+1-level node in the arrangement order of the optional nodes is positively correlated with i; and, sending an i+1-level broadcast message to each i+1-level node respectively, wherein the i+1-level broadcast message includes an i+1-level Bloom filter, i+1-level level information and the target data, and the i+1-level Bloom filter records the identity information of each node and its brother nodes whose level is not higher than the i+1 level on any broadcast path, and is used to indicate to the i+1-level node that the broadcast message containing the target data has been received, and the i+1-level level information is used to indicate to the i+1-level node that it is at the i+1th level on any broadcast path;
[0110] The stopping unit 703 is configured to, when the number of the optional nodes is zero, cause any i-level node to stop broadcasting the target data.
[0111] Optionally, the determining unit 701 is specifically configured to:
[0112] In the case where any i-level node is a broadcast initiator, making any i-level node determine all of its neighboring nodes as the optional nodes;
[0113] In the case that any of the i-level nodes is not the broadcast initiator, any of the i-level nodes determines the i-level Bloom filter contained in the i-level broadcast message sent by the i-1-level node and receives it, and determines other neighbor nodes among its own neighbor nodes except the nodes represented by the identity information recorded by the i-level Bloom filter as the optional nodes.
[0114] Optionally, the sending unit 702 is specifically configured to:
[0115] 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 at least one i+1-level node is selected from the other optional nodes among the optional nodes except the at least one preceding optional node.
[0116] Optionally, when any of the i-level nodes is not a broadcast initiator, the sending unit 702 is specifically configured to:
[0117] Determine the arrangement order of the optional nodes, and determine the i-th level of itself on any of the broadcast paths according to the i-level level information contained in the i-level broadcast message sent by the i-1-level node received by itself;
[0118] At least one optional node whose position in the arrangement sequence is positively correlated with i is determined as an i+1 level node.
[0119] Optionally, the sending unit 702 is specifically configured to:
[0120] Determine the k1*ith optional node in the arrangement sequence as the i+1 level node; or,
[0121] Randomly select at least one positioning optional node from the optional nodes, and determine the sequence number hop_num of each positioning optional node in the arrangement sequence; and determine at least one optional node whose sequence number is close to hop_num+k2*i in the arrangement sequence as the i+1 level node;
[0122] Among them, k1 and k2 are preset constants or preset arrays respectively, and any value in the preset constants or the preset arrays is a positive number.
[0123] Optionally, when any of the i-level nodes is not a broadcast initiator, the sending unit 702 is specifically configured to:
[0124] Determine the i-th level of the node on any of the broadcast paths according to the i-level level information contained in the i-level broadcast message sent by the i-1-level node; and determine the maximum level max_hop, and divide the optional nodes into max_hop groups according to the arrangement order;
[0125] The optional nodes in the i-th group or the adjacent group close to the i-th group are determined as i+1-level nodes.
[0126] Optionally, the sending unit 702 is specifically configured to:
[0127] 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,
[0128] 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.
[0129] Optionally, the sending unit 702 is specifically configured to:
[0130] Recording the identity information of the at least one i+1-level node into an i+1-level Bloom filter, and constructing an i+1-level broadcast message including the i+1-level Bloom filter and the target data;
[0131] The constructed i+1 level broadcast message is sent to each i+1 level node respectively.
[0132] Optionally, the sending unit 702 is specifically configured to:
[0133] In the case where any of the i-level nodes is a broadcast initiator, adding the identity information of the at least one i+1-level node to a blank Bloom filter to obtain an i+1-level Bloom filter;
[0134] When any of the i-level nodes is not the broadcast initiator, the i-level Bloom filter is extracted from the i-level broadcast message sent by the i-1-level node received by itself, and the identity information of the at least one i+1-level node is added to the i-level Bloom filter to obtain the i+1-level Bloom filter.
[0135] Optionally, the sending unit 702 is specifically configured to:
[0136] Performing serialization processing on the i+1 level Bloom filter, and recording the processed serialized data in the i+1 level broadcast message; or,
[0137] The i+1-level Bloom filter and the target data are recorded in an i+1-level broadcast message, and the i+1-level broadcast message is serialized to obtain an i+1-level broadcast message to be transmitted.
[0138] Optionally, when any of the i-level nodes is not a broadcast initiator, the apparatus further includes:
[0139] The cache unit 704 is used to enable any i-level node to cache the i-level Bloom filter contained in the i-level broadcast message locally in response to receiving the i-level broadcast message sent by the i-1-level node;
[0140] The merging unit 705 is used to enable any i-level node, when receiving any broadcast message containing any Bloom filter and any data, to merge the i-level Bloom filter with any Bloom filter into the latest Bloom filter if the any data is the target data, and the identity information recorded in the latest Bloom filter is recorded in the i-level Bloom filter and / or any Bloom filter; and to select at least one latest i+1-level node from its own neighboring nodes except the node represented by the node identifier recorded in the latest Bloom filter, and send the latest broadcast message containing the latest Bloom filter and the target data to each latest i+1-level node respectively.
[0141] Optionally, the unstructured P2P network is used to build a blockchain network.
[0142] 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.
[0143] 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.
[0144] 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.
[0145] 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.
[0146] 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.
[0147] 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.
[0148] 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 including 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.
[0149] 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.
[0150] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0151] 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.
[0152] 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.
[0153] 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.
[0154] 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.
[0155] 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.
[0156] 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 an unstructured P2P network, wherein each node in the unstructured P2P network is connected to at least one neighbor node, each node in the unstructured P2P network forms M levels on the broadcast path of target data, the nodes of the i-th level are i-level nodes, M and i are both integers, M>1, M≥i≥0; the method include: Any i-level node on any broadcast path determines, from its own neighbor nodes, optional nodes that have not received a broadcast message containing the target data, including: when any i-level node is a broadcast initiator, determining all of its own neighbor nodes as the optional nodes; when any i-level node is not a broadcast initiator, determining the i-level Bloom filter contained in the i-level broadcast message sent by the i-1-level node received by itself, and determining other neighbor nodes among its own neighbor nodes except the nodes represented by the identity information recorded by the i-level Bloom filter as the optional nodes; In the case that the number of optional nodes is not zero, any i-level node selects at least one i+1-level node from the optional nodes arranged in order, and the position of the i+1-level node in the arrangement order of the optional nodes is positively correlated with i; and, an i+1-level broadcast message is sent to each i+1-level node respectively, wherein the i+1-level broadcast message contains an i+1-level Bloom filter, i+1-level level information and the target data, and the i+1-level Bloom filter records the identity information of each node and its brother nodes whose level is not higher than the i+1 level on any broadcast path, which is used to indicate to the i+1-level node that the broadcast message containing the target data has been received, and the i+1-level level information is used to indicate to the i+1-level node that it is at the i+1th level on any broadcast path; 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 at least one i+1-level node from the optional nodes arranged in order, 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 at least one i+1-level node is selected from the other optional nodes among the optional nodes except the at least one preceding optional node.
3. The method according to claim 1, in the case where any i-level node is not a broadcast initiator, any i-level node selects at least one i+1-level node from the optional nodes arranged in order, include: Determine the arrangement order of the optional nodes, and determine the i-th level of itself on any of the broadcast paths according to the i-level level information contained in the i-level broadcast message sent by the i-1-level node received by itself; At least one optional node whose position in the arrangement sequence is positively correlated with i is determined as an i+1 level node.
4. The method according to claim 3, wherein at least one optional node whose position in the arrangement sequence is positively correlated with i is determined as an i+1 level node, include: Determine the k1*ith optional node in the arrangement sequence as an i+1-level node; or, Randomly select at least one positioning optional node from the optional nodes, and determine the sequence number hop_num of each positioning optional node in the arrangement sequence; and determine at least one optional node whose sequence number is close to hop_num+k2*i in the arrangement sequence as the i+1 level node; Among them, k1 and k2 are preset constants or preset arrays respectively, and any value in the preset constants or the preset arrays is a positive number.
5. The method according to claim 3, wherein when any of the i-level nodes is not a broadcast initiator, at least one optional node whose position in the arrangement sequence is positively correlated with i is determined as an i+1-level node, include: Determine the i-th level of the node on any of the broadcast paths according to the i-level level information contained in the i-level broadcast message sent by the i-1-level node; and determine the maximum level max_hop, and divide the optional nodes into max_hop groups according to the arrangement order; The optional nodes in the i-th group or the adjacent group close to the i-th group are determined as i+1-level nodes.
6. The method according to claim 1, wherein any i-level node selects at least one i+1-level node from the selectable nodes arranged in order, 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.
7. The method according to claim 1, wherein any i-level node sends an i+1-level broadcast message to each i+1-level node. include: Recording the identity information of the at least one i+1-level node into an i+1-level Bloom filter, and constructing an i+1-level broadcast message including the i+1-level Bloom filter and the target data; The constructed i+1 level broadcast message is sent to each i+1 level node respectively.
8. The method according to claim 7, wherein the identity information of the at least one i+1 level node is recorded in the i+1 level Bloom filter, include: In the case where any of the i-level nodes is a broadcast initiator, adding the identity information of the at least one i+1-level node to a blank Bloom filter to obtain an i+1-level Bloom filter; When any of the i-level nodes is not the broadcast initiator, the i-level Bloom filter is extracted from the i-level broadcast message sent by the i-1-level node received by itself, and the identity information of the at least one i+1-level node is added to the i-level Bloom filter to obtain the i+1-level Bloom filter.
9. The method according to claim 7, wherein the constructing comprises the i+1-level Bloom filter and the i+1-level broadcast message of the target data. include: Performing serialization processing on the i+1 level Bloom filter, and recording the processed serialized data in the i+1 level broadcast message; or, The i+1-level Bloom filter and the target data are recorded in an i+1-level broadcast message, and the i+1-level broadcast message is serialized to obtain an i+1-level broadcast message to be transmitted.
10. The method according to claim 1, wherein when any of the i-level nodes is not a broadcast initiator, the method further include: In response to receiving the i-level broadcast message sent by the i-1-level node, any i-level node caches the i-level Bloom filter contained in the i-level broadcast message locally; When any i-level node receives any broadcast message including any Bloom filter and any data, if the any data is the target data, the i-level Bloom filter and the any Bloom filter are merged into the latest Bloom filter, and the identity information recorded in the latest Bloom filter is recorded in the i-level Bloom filter and / or any Bloom filter; And, select at least one latest i+1 level node from its own neighbor nodes except the node represented by the node identifier recorded in the latest Bloom filter, and send the latest broadcast message containing the latest Bloom filter and the target data to each latest i+1 level node respectively.
11. The method according to claim 1, wherein the unstructured P2P network is used to build a blockchain network.
12. A message broadcasting device, applied to an unstructured P2P network, wherein each node in the unstructured P2P network is connected to at least one neighboring node, each node in the unstructured P2P network forms M levels on the broadcast path of target data, the nodes of the i-th level are i-level nodes, M and i are both integers, M>1, M≥i≥0; the device include: A determination unit, used to enable any i-level node on any broadcast path to determine, from its own neighbor nodes, optional nodes that have not yet received a broadcast message containing the target data. The determination unit is specifically used to, when any i-level node is a broadcast initiator, determine all of its own neighbor nodes as the optional nodes; when any i-level node is not a broadcast initiator, determine the i-level Bloom filter contained in the i-level broadcast message sent by the i-1-level node received by itself, and determine other neighbor nodes among its own neighbor nodes except the nodes represented by the identity information recorded by the i-level Bloom filter as the optional nodes; A sending unit, used for, when the number of optional nodes is not zero, enabling any i-level node to select at least one i+1-level node from the optional nodes arranged in order, wherein the position of the i+1-level node in the arrangement order of the optional nodes is positively correlated with i; and, sending an i+1-level broadcast message to each i+1-level node respectively, wherein the i+1-level broadcast message includes an i+1-level Bloom filter, i+1-level level information and the target data, the i+1-level Bloom filter records the identity information of each node and its brother nodes whose level is not higher than the i+1 level on any broadcast path, and is used to indicate to the i+1-level node the node that has received the broadcast message containing the target data, and the i+1-level level information is used to indicate to the i+1-level node that it is at the i+1th level on any broadcast path; 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.
13. 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 11 by running the executable instructions.
14. 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 11.
Citation Information
Patent Citations
System and method for broadcasting message in structural peer-to-peer network
CN102055655A
Cross-chain interaction method and device
CN113922971A
Message broadcasting method for block chain network, block chain node and block chain system
CN114390063A
Reliable broadcast in a federation of nodes
US20110194558A1
