A water wave broadcasting method and system for blockchain
By adopting the water wave broadcast method and system in the decentralized P2P network, and using the combination of node manager, consensus manager and group manager to dynamically adjust the broadcast rules, the network congestion problem caused by data broadcast is solved and the network throughput is improved. capabilities and performance, enabling rapid diffusion of data in large-scale networks.
Patent Information
- Application Number
- CN201910768637.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-08-20
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2039-08-20
AI Technical Summary
In a decentralized P2P network, data broadcast needs to be carried out in a square growth manner, causing the network burden to grow rapidly as the number of nodes increases, which may lead to network paralysis, and the introduction of central nodes will destroy the original intention of the network design.
Using the water wave broadcast method and system, through the combination of node manager, consensus manager and group manager, the broadcast rules are selected according to the network scale, and the water wave transmission method is used to use the rectangular edge as the broadcast range to dynamically adjust and combine to avoid repeated broadcasts , improve network throughput.
It effectively solves the network congestion problem caused by data broadcast in large-scale P2P networks, improves network performance and throughput, realizes the rapid diffusion of data in networks of different sizes, and avoids network paralysis.
Smart Images

Figure CN112491935B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a water wave broadcasting method and system for blockchain. Background Art
[0002] Distributed network is an important component of the network in the future credit era, and the application of peer-to-peer P2P network will be everywhere. In the credit era, this P2P network will be the basis of people's work, life and study, so in this network, carrying a large amount of data communication needs will be an inevitable result. However, due to the particularity of the decentralized P2P network, there is no unified command node in this network to inform everyone of the data transmission situation. Therefore, when a piece of data is generated in this network, this node needs to broadcast the data to all nodes in the network to ensure that the data is fully received by other nodes in the network. Since each node does not know whether others have received this data, each node needs to broadcast to all other nodes. Even in the case of non-repeated broadcast, one piece of data needs to be broadcast N squared times, N is the number of nodes. If there are 10,000 nodes, then it needs to be broadcast 100 million times. If the number of nodes continues to increase, the square growth of the broadcast number will directly burst the entire network. In the era of credit, the number of nodes participating in the network must be in the hundreds of millions. In this case, this broadcasting method will inevitably lead to the paralysis of the network. However, if a central node is introduced to coordinate the broadcast of data, it will destroy the original design intention of this decentralized distributed network.
[0003] So, how to prevent the network broadcast burden from increasing rapidly with the increase in the number of nodes without setting up a central node has become an urgent problem that needs to be solved. Summary of the invention
[0004] The present invention aims to propose a water wave broadcasting method and system for blockchain. By adopting the water wave transmission method, the problem of rapid data diffusion in various large and small networks can be effectively solved, and the throughput capacity of the network can be greatly improved. The specific scheme is as follows:
[0005] A water wave broadcasting method for a blockchain, the broadcasting method comprising:
[0006] S1. Start the node and scan the network to obtain a node list, and establish connections with all nodes in the list and other nodes with which the nodes in the list have external connections;
[0007] S2. After the node completes the list of nodes with connection relationships, it extracts the consensus information of the current blockchain network and the broadcast rules in the consensus information, passes the broadcast rules to the node list and performs broadcast consensus execution calculation;
[0008] The process of performing broadcast consensus calculation in S2 includes: calculating the number of nodes N = Length (L), calculating the shortest side of the largest rectangle that can be formed by the list Calculate the other side of the matrix S2 = Floor (N * S1), calculate the position of the node itself I = index0f (sort (L)) and the starting position of its own group Start = N% I and the ending position End = S1 * Mod (N * I), and save the nodes of its own group by extracting the nodes of its own group List = Substr (N, Start, End);
[0009] S3, start sending broadcast data, extract the node list, and then obtain the node information, and send data to the node after establishing a connection relationship with the node in the list;
[0010] S4. After receiving the data, the node checks whether the data has been received before. If the data has been received, it is discarded. If the data has not been received, the consensus calculation and node data transmission are repeated.
[0011] Furthermore, the process of establishing a connection relationship described in S1 includes: extracting node information in the list, scanning whether the node itself has the node, if the node already exists in the database, skipping the establishment of the connection relationship, if not, analyzing the corresponding node type and adding it to its own node list, and ending the node check.
[0012] Furthermore, the broadcasting rules include: according to the principle of maximizing the square area, any edge on the rectangle is used as the extension range of the node broadcast, and any node in the square broadcasts to another node on the same line along the direction of any edge on the rectangle. When data cannot be received and sent on the same edge, other edges of the rectangle are reselected as the center point of the fault-tolerant water wave. The relationship between the number of nodes N and the number of data transmission times W is:
[0013]
[0014] The present invention further extends the above-mentioned broadcasting method and proposes a water wave broadcasting system for blockchain, the system comprising:
[0015] Node Manager: used to manage the nodes in the current network. The node will add itself to the node list and record it according to the current blockchain network access type. When recording, it will distinguish the node's connection method;
[0016] Consensus manager: used to manage the consensus method used by the current blockchain network, and select a single consensus method or a composite consensus method according to the complexity of the current blockchain network;
[0017] Group Manager: It is used to manage the group of the current node. It can group nodes in different ways according to different blockchain types. The group nodes are generated from the node list provided by the node manager.
[0018] In this system, the node manager starts the nodes in the blockchain network, establishes the connection relationship between the nodes and generates a node list through the node manager, the consensus manager extracts the consensus information in the current network and the broadcast rules in the consensus information, passes the broadcast rules to the node list and performs broadcast consensus execution calculations, and the consensus manager starts to execute consensus calculations. When the node manager obtains data sent from other nodes, the consensus manager checks whether the data has been received repeatedly. If it has not been received repeatedly, the data is sent according to the broadcast rules of the current blockchain network, and the group manager passes the data to the node lists of different groups. The node manager, consensus manager and group manager are cross-meshed and can access data from each other.
[0019] Furthermore, the node manager includes:
[0020] Node information management module: used to manage node information, including storing node data and providing node information query services for other modules of the system;
[0021] Node scanning module: used to scan new nodes in the network, check and analyze the types of nodes, and pass the results of node scanning and analysis to the node information management module for management and storage;
[0022] Node synchronization module: used to synchronize node information with other nodes. When new node information is found, the node scanning module is used to check the availability and analyze the type, and the node information management module is used to save it.
[0023] Furthermore, the consensus manager includes:
[0024] Consensus rule management module: used to define and manage the consensus rules supported by the current network. The consensus rules are defined in code form and include direct water wave broadcasting and relay water wave broadcasting. The direct water wave broadcasting is that the network transmits data in a single direction by establishing a water wave network. In the process, the fault tolerance defined by the consensus rules will be executed at different scales. The relay water wave broadcasting is that the network will be divided into several small-scale networks, and the broadcast rules will be executed in the small-scale networks according to the water wave network.
[0025] Consensus execution module: used to group the nodes provided by the node manager according to the consensus rule definition, and then hand over the group content to the group manager for management;
[0026] Broadcast management module: used to extract the target sending node according to the consensus rules and send the data to the node manager in sequence.
[0027] Furthermore, the group manager includes:
[0028] Group information management module: used to manage historical group information, receive the latest consensus rules to generate new groups, and provide group information for upper-layer applications according to the currently required groups.
[0029] Compared with the prior art, the present invention has the following advantages:
[0030] (1) The present invention focuses on solving the network congestion problem caused by data broadcasting in large-scale P2P networks through the combined access of node managers, consensus managers and group managers;
[0031] (2) Selecting a single or composite broadcast rule according to different network scales to achieve network broadcasts with different coverage and depths. Under the premise of allowing for fault tolerance, the network performance improvement effect is very significant;
[0032] (3) The water wave broadcasting proposed in the present invention is not used in a single form or in a static state, but is adjusted and used in combination according to the changes in the dynamic network. It can effectively solve the problem of rapid data diffusion in various large and small networks and greatly improve the network throughput. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 This is a flow chart of the steps of the water wave broadcasting method for blockchain mentioned in the present invention;
[0034] Figure 2 It is a schematic diagram of the composition of the water wave broadcasting system for blockchain mentioned in the present invention;
[0035] Figure 3 It is a schematic diagram of the composition of the node manager mentioned in the present invention;
[0036] Figure 4 It is a schematic diagram of the composition of the consensus manager mentioned in the present invention;
[0037] Figure 5 A schematic diagram of the composition of the group manager mentioned in the present invention;
[0038] Figure 6 It is the relationship equation between the number of nodes N and the number of data transmission times W in the water wave broadcast method for blockchain mentioned in the present invention;
[0039] Among them: 100 node manager; 200 consensus manager; 300 group manager; 101 node information management module; 102 node scanning module; 103 node synchronization module; 201 consensus rule management module; 202 consensus execution module; 203 broadcast management module; 301 group information management module. DETAILED DESCRIPTION
[0040] The present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0041] Blockchain is a decentralized, point-to-point network interconnected data transmission method. The so-called "decentralization" means that there is no longer any third-party node involved. All transactions and data transmission are only carried out one-to-one, one-to-many, many-to-many, etc. between the two nodes. Another meaning of transmission is network broadcasting. Traditional Internet technology requires a central server or a top-level transit node as the core distribution area of the broadcast. However, if there is still a third party in the blockchain network, and the role of the third party in determining the basic operation of the entire blockchain network, it will be contrary to the original design intention of the blockchain decentralization, especially in today's information age. Once a data node misbehaves or fails, it will have a fatal impact on the entire network. Especially for today's distributed networks, how to establish a set of effective broadcast rules between nodes and strictly broadcast data in accordance with the broadcast rules will be an important research direction that determines the future of blockchain technology.
[0042] Before explaining the method of the present invention, the definition of "P2P network" is explained first. The so-called "P2P network" is also called a peer-to-peer network, that is, a peer-to-peer computer network, which is a distributed application architecture that distributes tasks and workloads among peers. It is a networking or network form formed by a peer computing model at the application layer. In a P2P network environment, multiple computers connected to each other are in an equal position, and each computer has the same function without a master-slave distinction. A computer can be used as a server to set shared resources for use by other computers in the network, and can also be used as a workstation. The entire network generally does not rely on a dedicated centralized server, nor does it have a dedicated workstation. Each computer in the network can act as a requester of network services and respond to requests from other computers to provide resources, services and content. Usually these resources and services include: information sharing and exchange, computing resources (such as CPU computing power sharing), storage sharing (such as cache and disk space usage), network sharing, printer sharing, etc.
[0043] Aiming at the above research direction, the present invention proposes a water wave broadcasting method for blockchain based on the principle of water waves. This method is applied to distributed networks, such as Figure 1 The specific scheme is as follows:
[0044] S1. Start the node and scan the network to obtain a node list, and establish connections with all nodes in the list and other nodes with which the nodes in the list have external connections;
[0045] Preferably, the process of establishing a connection relationship in S1 includes: extracting node information in the list, scanning whether the node itself has the node, if the node already exists in the database, skipping the establishment of the connection relationship, if not, analyzing the corresponding node type and adding it to its own node list, and ending the node check.
[0046] Node inspection is a crucial part of establishing a connection between nodes, because one of the important characteristics of blockchain is trustworthiness. The premise of building connections between nodes is that they must undergo very strict legitimacy checks in the early stages of establishing a relationship. This is to ensure the accuracy and trustworthiness of data on the chain. Only through node inspection can the accuracy of subsequent data backtracking and the security of data nodes during block forging be guaranteed, thereby reducing a series of data attacks caused by later blockchain applications in the upper layer.
[0047] S2. After the node completes the list of nodes with connection relationships, it extracts the consensus information of the current blockchain network and the broadcast rules in the consensus information, passes the broadcast rules to the node list and performs broadcast consensus execution calculation;
[0048] Preferably, the process of performing broadcast consensus calculation in S2 includes: calculating the length of the node list N=Length(L), calculating the shortest side of the largest rectangle that can be formed by the list Calculate the other side of the matrix S2 = Floor (N / S1), calculate the position of the node itself I = index0f (sort (L)) and the starting position of its own group Start = N% I and the ending position End = S1*Mod (N*I), and save the nodes of its own group by extracting the nodes of its own group List = Substr (N, Start, End);
[0049] Preferably, Figure 6As shown in the figure, the broadcasting rules include: according to the principle of maximizing the square area, any edge on the rectangle is used as the extension range of the node broadcast, and any node in the square broadcasts along any edge of the rectangle to another node on the same line. When the same edge cannot receive and send data, the other edges of the rectangle are reselected as the center point of the fault-tolerant water wave. The relationship between the number of nodes N and the number of data transmission times W is:
[0050]
[0051] S3, start sending broadcast data, extract the node list, and then obtain the node information, and send data to the node after establishing a connection relationship with the node in the list;
[0052] S4. After receiving the data, the node checks whether the data has been received before. If the data has been received, it is discarded. If the data has not been received, the consensus calculation and node data transmission are repeated.
[0053] The operation process of the blockchain needs to define the consensus rules in code in advance. On the basis of the consensus rules, fault tolerance is allowed. The fault tolerance allowed for blockchain networks of different sizes is dynamically adjusted. The fault tolerance is simplified to be the number of times the consensus rule is executed in the current broadcast process. The setting of the fault tolerance is also limited, and the higher the better. Because once this is the case, although the coverage of the broadcast rules will be wider, the network's computing power and storage capacity and other expenses will also be greatly lost under this condition. Once the fault tolerance is equal to the number of nodes in the network, it will cause the overall paralysis of the network. Therefore, the fault tolerance is a combination of network capabilities and broadcast efficiency. Both, the pursuit of maximum efficiency, by adopting the above-mentioned water wave broadcasting method can not only increase the coverage of the broadcast as much as possible, but also take into account its certain fault tolerance.
[0054] Although the above-mentioned water wave broadcasting method can achieve a blockchain network with wide coverage and deep enough depth, the required blockchain length and network computing power will often increase accordingly. In order to meet the needs of a larger scale, the present invention also proposes a "wave-in-wave" broadcasting method. In terms of distributed networks, the network is subdivided into multiple subnets, and each subnet is a separate small distributed network. Because the number of nodes owned by each subnet is much less than that of the parent network, the time required for broadcasting and the computing power consumed by the network will be greatly reduced. Of course, the level of network splitting is not single, but is dynamically adjusted according to the needs of blockchain network broadcasting. Through splitting, the time consumed by broadcast diffusion can be made smaller and smaller. The higher the delay in message arrival, the splitting level will be determined according to these two situations, in order to achieve a balance between efficiency and time. The water wave broadcasting method of wave-in-wave can effectively solve the problem of rapid data diffusion in various large and small networks, and greatly improve the network throughput.
[0055] The present invention further extends the above method and proposes a water wave broadcast system for blockchain, including a node manager 100, a consensus manager 200 and a group manager 300. Figure 2-5 As shown, its specific contents and functions are as follows:
[0056] Node manager 100: used to manage the nodes in the current network. The node will add and record its own node list according to the current blockchain network access type, and distinguish the node connection mode when recording;
[0057] The node manager 100 further comprises:
[0058] Node information management module 101: used to manage node information, including storing node data, and providing node information query services for other modules of the system;
[0059] Node scanning module 102: used to scan new nodes in the network, check and analyze the types of nodes, and pass the results of node scanning and analysis to the node information module 101 for management and storage;
[0060] During the scanning process, information including but not limited to node connection speed, node response time, and node operating system is obtained. Since all nodes are operated according to a clear network transmission protocol, the node scanning module 102 only needs to follow the protocol to find out whether these nodes exist. Here, two transmission protocol methods are preferred:
[0061] 1) Protocol 1 is that all nodes open a fixed port, such as 9000. As long as the port numbered 9000 on the network address is open, the node can be found. The other one is safer;
[0062] 2) Protocol 2 is that all nodes develop a data request at a certain port, which can be an encryption and decryption request or a fixed data request. As long as the port is opened on a network address and the data returned conforms to the decryption algorithm of the port, the node can be found.
[0063] When discovering nodes, the above two transmission protocols can obtain information including but not limited to node connection speed, node response time, and node operating system from the initiation of scanning to node confirmation and protocol data returned from the node.
[0064] The operating premise of the node scanning module 102 is to ensure that the node has the ability to connect to the network. The ability to connect to the network comes from selecting different network connection methods according to different upper-level application environments. The network connection methods here include wired networks, wireless networks, cellular networks, 3G networks, 4G networks, and Bluetooth. The upper-level protocol supports HTTP, HTTPS, Webscoket, and WebRTC, which provides the node scanning module with network connection capabilities under these network environments.
[0065] Node synchronization module 103: used to synchronize node information with other nodes. When new node information is found, the node scanning module 102 checks the availability and analyzes the type, and the node information management module 101 saves it.
[0066] Consensus manager 200: used to manage the consensus method used by the current blockchain network. A single consensus method or a composite consensus method is selected according to the complexity of the current blockchain network. There may be multiple sets of consensus in a network, and the same set of consensus may be applied to different networks. For example, the main network and subnet can have different consensus methods. The fixed network and mobile network in the same network can also have different consensus methods. There can also be different consensus methods in the same network according to different node types. For example, the consensus methods of one-way nodes and proxy nodes are different.
[0067] The consensus manager 200 includes:
[0068] Consensus rule management module 201: used to define and manage the consensus rules supported by the current network. The consensus rules are defined in code form and include direct water wave broadcasting and relay water wave broadcasting.
[0069] The direct water wave broadcast is a network that transmits data in a single direction by establishing a water wave network. During the process, the fault tolerance defined by the consensus rules will be executed at different scales.
[0070] The relay-type water wave broadcast is to split the network into several small-scale networks, and execute the broadcast rules in the small-scale networks according to the water wave networking.
[0071] The consensus execution module 202 is used to group the nodes provided by the node manager 100 according to the consensus rule definition content, and then hand over the group content to the group manager 300 for management;
[0072] Broadcast management module 203: used to extract the target sending node according to the consensus rules, and send the data to the nodes in sequence. When broadcasting, it is only broadcast to the nodes in the current group. Although it is only broadcast to the nodes of one group here, almost all nodes will receive the broadcast data in the overall environment.
[0073] Group manager 300: used to manage the group of the current node. In different blockchains, the grouping may be one-time, permanent, or dynamically updated. The grouping of each round of group validity period will be recorded here. This grouping is generated based on the node list provided by the node manager 100. During the generation process, there is no need to worry about the grouping of other nodes.
[0074] The packet manager 300 includes:
[0075] Group information management module 301: used to manage historical group information, receive the latest consensus rules to generate new groups, and provide group information for upper-layer applications according to the currently required groups;
[0076] In this system, the node manager 100 starts the nodes in the blockchain network, establishes the connection relationship between the nodes and generates a node list through the node manager 100, and the consensus manager 200 extracts the consensus information in the current network and the broadcast rules in the consensus information, passes the node list to the broadcast rules, and the consensus manager 200 starts to perform consensus calculations. When the node manager 100 obtains data sent from other nodes, it checks whether the data has been received repeatedly through the consensus manager 200. If it has not been received repeatedly, the data is sent according to the broadcast rules of the current blockchain network, and the group manager 300 passes the data to the node lists of different groups. The node manager 100, the consensus manager 200 and the group manager 300 are cross-meshed and can access data from each other.
[0077] The water wave broadcasting proposed in the present invention is not used in a single form or statically, but is adjusted and used in combination according to the changes in the dynamic network. It can effectively solve the problem of rapid data diffusion in various large and small networks, greatly improve the network throughput, solve the network congestion problem caused by data broadcasting in large-scale P2P networks, and realize the rapid diffusion of data in large-scale P2P networks.
[0078] The above description is only a preferred embodiment of the present invention and does not limit the technical scope of the present invention.
[0079] Therefore, any changes or modifications made according to the claims and description of the present invention should fall within the scope of the patent of the present invention.
Claims
1. A water wave broadcasting method for blockchain, characterized in that: The broadcasting method comprises: S1. Start the node and scan the network to obtain a node list, and establish connections with all nodes in the list and other nodes with which the nodes in the list have external connections; S2. After the node completes the list of nodes with connection relationships, it extracts the consensus information of the current blockchain network and the broadcast rules in the consensus information, passes the broadcast rules to the node list and performs broadcast consensus execution calculation; The process of performing broadcast consensus calculation in S2 includes: calculating the number of nodes N = Length (L), calculating the shortest side of the largest rectangle that can be formed by the list Calculate the other side of the matrix S2 = Floor (N / S1), calculate the position of the node itself I = index0f (sort (L)) and the starting position of its own group Start = N% I and the ending position End = S1*Mod (N / I), and save the nodes of its own group by extracting the nodes of its own group List = Substr (N, Start, End); S3, start sending broadcast data, extract the node list, and then obtain the node information, and send data to the node after establishing a connection relationship with the node in the list; S4. After receiving the data, the node checks whether the data has been received before. If the data has been received, it is discarded. If the data has not been received, the consensus calculation and node data transmission are repeated.
2. A water wave broadcasting method for blockchain according to claim 1, characterized in that: The process of establishing a connection relationship in S1 includes: extracting node information from the list, scanning whether the node itself has the node, if the node already exists in the database, skipping the establishment of the connection relationship, if not, analyzing the corresponding node type and adding it to its own node list, and ending the node check.
3. A water wave broadcasting method for blockchain according to claim 1, characterized in that: The broadcasting rules include: according to the principle of maximizing the square area, any edge on the rectangle is used as the extension range of the node broadcast, and any node in the square broadcasts to another node on the same line along the direction of any edge on the rectangle. When data cannot be received and sent on the same edge, other edges of the rectangle are reselected as the center point of the fault-tolerant water wave. The relationship between the number of nodes N and the number of data transmission times W is:
4. A water wave broadcasting system for blockchain implementing the method as claimed in claim 1, characterized in that: The system comprises: Node Manager: used to manage the nodes in the current network. The node will add itself to the node list and record it according to the current blockchain network access type. When recording, it will distinguish the node's connection method; Consensus manager: used to manage the consensus method used by the current blockchain network, and select a single consensus method or a composite consensus method according to the complexity of the current blockchain network; Group Manager: It is used to manage the group of the current node. It can group nodes in different ways according to different blockchain types. The group nodes are generated from the node list provided by the node manager. In this system, the node manager starts the nodes in the blockchain network, establishes the connection relationship between the nodes and generates a node list through the node manager, the consensus manager extracts the consensus information in the current network and the broadcast rules in the consensus information, passes the broadcast rules to the node list and performs broadcast consensus execution calculations, and the consensus manager starts to execute consensus calculations. When the node manager obtains data sent from other nodes, the consensus manager checks whether the data has been received repeatedly. If it has not been received repeatedly, the data is sent according to the broadcast rules of the current blockchain network, and the group manager passes the data to the node lists of different groups. The node manager, consensus manager and group manager are cross-meshed and can access data from each other.
5. A water wave broadcasting system for blockchain according to claim 4, characterized in that: The node manager includes: Node information management module: used to manage node information, including storing node data and providing node information query services for other modules of the system; Node scanning module: used to scan new nodes in the network, check and analyze the types of nodes, and pass the results of node scanning and analysis to the node information management module for management and storage; Node synchronization module: used to synchronize node information with other nodes. When new node information is found, the node scanning module is used to check the availability and analyze the type, and the node information management module is used to save it.
6. A water wave broadcasting system for blockchain according to claim 4, characterized in that: The consensus manager includes: Consensus rule management module: used to define and manage the consensus rules supported by the current network. The consensus rules are defined in code form and include direct water wave broadcasting and relay water wave broadcasting. The direct water wave broadcasting is that the network transmits data in a single direction by establishing a water wave network. In the process, the fault tolerance defined by the consensus rules will be executed at different scales. The relay water wave broadcasting is that the network will be divided into several small-scale networks, and the broadcast rules will be executed in the small-scale networks according to the water wave network. Consensus execution module: used to group the nodes provided by the node manager according to the consensus rule definition, and then hand over the group content to the group manager for management; Broadcast management module: used to extract the target sending node according to the consensus rules and send the data to the node manager in sequence.
7. A water wave broadcasting system for blockchain according to claim 4, characterized in that: The group manager comprises: Group information management module: used to manage historical group information, receive the latest consensus rules to generate new groups, and provide group information for upper-layer applications according to the currently required groups.
