Block chain system, data synchronization method and apparatus, and computing device cluster
By dividing the node clusters in the blockchain system and grouping connections according to the delay, the data synchronization method from the central cluster to the surrounding clusters is realized, which solves the problem of slow data synchronization rate between nodes, improves synchronization efficiency and reduces network consumption. .
Patent Information
- Application Number
- CN202310300452.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-03-24
AI Technical Summary
In the blockchain system, the data synchronization rate between nodes is slow and it is difficult to meet the current data synchronization requirements, especially in large-scale blockchain networks, resulting in high network consumption and low synchronization efficiency.
By dividing node clusters in the blockchain system, and performing group connections according to the delay between clusters, data is synchronized by spreading from the central cluster to surrounding clusters, so that the network consumption is small when synchronizing data between clusters and within clusters. Improved data synchronization efficiency.
It effectively improves the data synchronization efficiency in the blockchain system, reduces network consumption, and ensures the consistency of data between nodes and the stability of the system.
Smart Images

Figure CN118740358A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information technology (IT), and in particular to a blockchain system, a data synchronization method, an apparatus, and a computing device cluster. Background Art
[0002] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. In the blockchain system, data blocks are combined into a chain data structure in a sequential manner according to time order, and cryptography is used to ensure that the data cannot be tampered with or forged. Due to the characteristics of decentralization, information cannot be tampered with, and autonomy, blockchain has also received more and more attention and application. In the blockchain, each participant holds the same account book. Based on this ability, for large-scale blockchain networks, as transactions are sent, the block synchronization rate between nodes is fast or slow, which is difficult to meet the current data synchronization requirements. Summary of the invention
[0003] The present application provides a blockchain system, a data synchronization method, an apparatus, a computing device cluster, a computer storage medium, and a computer product, which can improve the data synchronization efficiency in the blockchain system.
[0004] In a first aspect, the present application provides a blockchain system, comprising: a consensus cluster, a first node cluster, and a second node cluster, and the delay between the consensus cluster and the first node cluster is less than the delay between the consensus cluster and the second node cluster.
[0005] Among them, the consensus cluster includes: multiple consensus nodes.
[0006] The first node cluster includes: one or more first blockchain nodes and one or more second blockchain nodes. The first blockchain node is responsible for obtaining the new block reached by the consensus node from the consensus node in the consensus cluster and storing the new block in the local blockchain. In addition, the first blockchain node is also responsible for synchronizing the new block to the second blockchain node so that the second blockchain node stores the new block in the local blockchain.
[0007] The second node cluster includes: one or more third blockchain nodes and one or more fourth blockchain nodes. The third blockchain node is responsible for obtaining a new block from the first blockchain node or the second blockchain node in the first node cluster, and storing the new block in the local blockchain. In addition, the third blockchain node may also be responsible for synchronizing the new block to the fourth blockchain node so that the fourth blockchain node stores the new block in the local blockchain.
[0008] In this way, when synchronizing blocks in the blockchain system, some nodes in a cluster can obtain new blocks from some nodes in the upstream cluster of the cluster and store them on these nodes, and synchronize the new blocks to other nodes in the cluster so that other nodes can also obtain new blocks and store them. As a result, the amount of data synchronized between clusters is limited, which reduces the network consumption when synchronizing data between clusters; at the same time, since the number of nodes in the cluster is also within a certain range, the network consumption when synchronizing node data in the cluster is also small. This improves the synchronization efficiency of data in the blockchain.
[0009] In a possible implementation, the first blockchain node is elected by the blockchain nodes in the first node cluster. The third blockchain node is elected by the blockchain nodes in the second node cluster. Thus, the elected first blockchain node can be used to coordinate and manage other nodes in the cluster to ensure the orderly operation of the cluster and the consistency of data between nodes.
[0010] In a possible implementation, in the first node cluster, the delay between the first blockchain node and the consensus node is less than the delay between the second blockchain node and the consensus node. In the second node cluster, the delay between the third blockchain node and the first blockchain node is less than the delay between the fourth blockchain node and the first blockchain node. In this way, data synchronization between clusters can be carried out efficiently, avoiding the situation where data synchronization efficiency is low due to excessive delay.
[0011] In a possible implementation, in the first node cluster, the first blockchain node is also responsible for reaching consensus on the new block through a consensus mechanism before synchronizing the new block to the second blockchain node. In the second node cluster, the third blockchain node is also responsible for reaching consensus on the new block through a consensus mechanism before synchronizing the new block to the fourth blockchain node, thereby ensuring the accuracy of the new block.
[0012] In a possible implementation, in the first node cluster, the synchronization order of the new block in the second blockchain node is determined based on the time delay between the second blockchain node and the first blockchain node. In the second node cluster, the synchronization order of the new block in the fourth blockchain node is determined based on the time delay between the fourth blockchain node and the third blockchain node. In this way, when the new block is synchronized in the second blockchain node or the fourth blockchain node, it can also be synchronized along the path with the highest synchronization efficiency, thereby improving the efficiency of data synchronization.
[0013] In one possible implementation, the blockchain nodes in the first node cluster are in the same region, and the blockchain nodes in the second node cluster are in the same region. Since the latency between nodes in the same region is generally small, this can ensure the data synchronization efficiency between nodes within the cluster.
[0014] In a second aspect, the present application provides a data synchronization method, which can be applied to a blockchain system. The blockchain system includes: a consensus cluster, a first node cluster, and a second node cluster. Among them, the consensus cluster includes multiple consensus nodes, the first node cluster includes a first blockchain node and a second blockchain node, the second node cluster includes a third blockchain node and a fourth blockchain node, and the delay between the consensus cluster and the first node cluster is less than the delay between the consensus cluster and the second node cluster.
[0015] The method includes: when consensus nodes in a consensus cluster reach a consensus on a new block, transmitting the new block to a first blockchain node in a first node cluster through the consensus nodes in the consensus cluster; receiving the new block through the first blockchain node and storing the new block in a local blockchain, and synchronizing the new block to a second blockchain node and storing the new block in a local blockchain through the second blockchain node; transmitting the new block to a third blockchain node in a second node cluster through the first blockchain node or the second blockchain node; receiving the new block through the third blockchain node and storing the new block in a local blockchain, and synchronizing the new block to a fourth blockchain node and storing the new block in a local blockchain through the fourth blockchain node.
[0016] In a possible implementation, the method further includes: when there are multiple second blockchain nodes, determining the synchronization order of the new block in the multiple second blockchain nodes based on the time delay between the second blockchain node and the first blockchain node. When there are multiple fourth blockchain nodes, determining the synchronization order of the new block in the multiple fourth blockchain nodes based on the time delay between the fourth blockchain node and the third blockchain node.
[0017] In a possible implementation, it also includes: based on the delay between the blockchain node in the blockchain system and the consensus node in the consensus cluster, re-dividing the node cluster to which the blockchain node in the blockchain system belongs.
[0018] In a third aspect, the present application provides a data synchronization device, which is deployed in a blockchain system. The blockchain system includes: a consensus cluster, a first node cluster, and a second node cluster. Among them, the consensus cluster includes multiple consensus nodes, the first node cluster includes a first blockchain node and a second blockchain node, the second node cluster includes a third blockchain node and a fourth blockchain node, and the delay between the consensus cluster and the first node cluster is less than the delay between the consensus cluster and the second node cluster.
[0019] The device includes: a communication module and a processing module. The communication module is used to transmit the new block to the first blockchain node in the first node cluster through the consensus node in the consensus cluster when the consensus nodes in the consensus cluster reach a consensus on the new block. The processing module is used to receive the new block through the first blockchain node and store the new block in the local blockchain, and synchronize the new block to the second blockchain node and store the new block in the local blockchain through the second blockchain node. The communication module is also used to transmit the new block to the third blockchain node in the second node cluster through the first blockchain node or the second blockchain node. The processing module is also used to receive the new block through the third blockchain node and store the new block in the local blockchain, and synchronize the new block to the fourth blockchain node and store the new block in the local blockchain through the fourth blockchain node.
[0020] In one possible implementation, the processing module is further used to: when there are multiple second blockchain nodes, determine the synchronization order of the new block in the multiple second blockchain nodes based on the time delay between the second blockchain node and the first blockchain node; when there are multiple fourth blockchain nodes, determine the synchronization order of the new block in the multiple fourth blockchain nodes based on the time delay between the fourth blockchain node and the third blockchain node.
[0021] In a possible implementation, the processing module is further used to: re-divide the node clusters to which the blockchain nodes in the blockchain system belong based on the time delay between the blockchain nodes in the blockchain system and the consensus nodes in the consensus cluster.
[0022] In a fourth aspect, the present application provides a computing device cluster, comprising at least one computing device, each computing device comprising a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster performs the method described in the second aspect or any possible implementation of the second aspect.
[0023] In a fifth aspect, the present application provides a computer-readable storage medium comprising computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the method described in the second aspect or any possible implementation of the second aspect; or, when the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method described in the second aspect or any possible implementation of the second aspect.
[0024] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when executed by a computing device, causes the computing device to execute the method described in the second aspect or any possible implementation of the second aspect; or, when executed by a computing device cluster, causes the computing device cluster to execute the method described in the second aspect or any possible implementation of the second aspect.
[0025] It can be understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a schematic diagram of the architecture of a blockchain system provided by an embodiment of the present application;
[0027] Figure 2 This is a schematic diagram of a data synchronization process between different sub-networks in a blockchain system provided by an embodiment of the present application;
[0028] Figure 3 This is a schematic diagram of cluster division within a subnetwork of a blockchain system provided in an embodiment of the present application;
[0029] Figure 4 It is a flowchart of a data synchronization method provided in an embodiment of the present application;
[0030] Figure 5 is a structural diagram of a data synchronization device provided in an embodiment of the present application;
[0031] Figure 6 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0032] Figure 7 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0033] Figure 8 It is a structural diagram of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0034] The term "and / or" in this article is a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The symbol " / " in this article indicates that the associated objects are in an or relationship, for example, A / B means A or B.
[0035] The terms "first" and "second" in the specification and claims herein are used to distinguish different objects rather than to describe a specific order of the objects. For example, a first response message and a second response message are used to distinguish different response messages rather than to describe a specific order of the response messages.
[0036] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0037] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more than two. For example, multiple processing units refer to two or more processing units, etc.; multiple elements refer to two or more elements, etc.
[0038] Generally, a fully distributed peer-to-peer network is often used in blockchain. The characteristic of this network topology is that there is no hierarchical relationship between nodes. In this network topology, nodes can join and exit at will, but the problem with this structure is that node discovery and data synchronization can only be carried out through flooding, which consumes too much network and has relatively low data synchronization efficiency. In addition, as the application of blockchain becomes more and more extensive, in different alliance chain scenarios, such as city chain networks, more than a thousand nodes will be required to join the same blockchain network. The blockchain data synchronization distribution system based on peer-to-peer networks is even more difficult to meet the data synchronization requirements in alliance chain scenarios.
[0039] In view of this, an embodiment of the present application provides a blockchain system, in which all nodes in the blockchain system are divided into clusters, and grouped based on the delay between clusters, and then clusters in different groups are connected. Among them, each cluster can have at least one first node responsible for data synchronization (such as block synchronization, etc.) with the upstream cluster, and the nodes other than the first node in each cluster can synchronize data directly or indirectly from the first node, rather than synchronizing data from other clusters. In addition, each cluster can also have at least one second node responsible for data synchronization with the downstream cluster. When each cluster synchronizes data to its downstream cluster, it can send the data to be synchronized (such as: blocks, etc.) to the first node in its downstream cluster through the second node in the cluster, instead of sending data to all nodes in the downstream cluster. In this way, when performing data synchronization, a method of spreading from the central cluster to the surrounding clusters can be adopted, so that the data synchronization process can spread from the center to the outside like water ripples. Since the amount of data that needs to be synchronized between clusters is limited, less bandwidth can be occupied when synchronizing data between clusters, that is, the network consumption is small; at the same time, since the number of nodes in the cluster is also within a certain range, the bandwidth occupied when synchronizing data within the cluster is also small, that is, the network consumption is small. Due to this cluster connection method, the network consumption is small when synchronizing data, so the synchronization efficiency of data in the blockchain can be improved.
[0040] For example, Figure 1 The following is a schematic diagram of the architecture of a blockchain system provided by an embodiment of the present application. Figure 1As shown, the blockchain system 100 includes multiple nodes. These nodes are divided into 7 clusters, namely: clusters 111, 121, 122, 123, 131, 132 and 133. Each cluster includes one or more nodes. Exemplarily, the maximum number of nodes in the cluster can be, but is not limited to, specified by the tenant. Each node in the cluster can be any device, server or equipment cluster with computing and processing capabilities. The nodes in the cluster can, but are not limited to, meet the Byzantine fault tolerance (BFT) requirements. The Byzantine fault tolerance requirement can be understood as Byzantine nodes can exist inside the blockchain, and the blockchain does not reflect Byzantine behavior to the outside. In general, some Byzantine fault tolerance algorithms require that the number of nodes is greater than (3f+1), where f is the number of Byzantine nodes, such as the practical Byzantine fault tolerance algorithm (PBFT). These nodes in the blockchain system 100 can store the full amount of ledgers, that is, store the status of all blocks and all accounts. Among them, each node in the blockchain system can generate the same state in the blockchain by executing the same transaction, and each node in the blockchain system can store the same state database. It can be understood that Figure 1 The blockchain system shown in can be but not limited to a consortium chain. In addition, Figure 1 Although it is shown that the blockchain system includes 7 clusters, this embodiment is not limited thereto, but may include other numbers of clusters. Specifically, the number of clusters may be, but is not limited to, specified by the tenant.
[0041] exist Figure 1 In the blockchain system 100 shown, 7 clusters are divided into three groups. Cluster 111 is in the first group, which is equivalent to the central cluster. Clusters 121, 122 and 123 are in the second group. Clusters 131, 132 and 133 are in the third group. There is an upstream-downstream relationship between the first group and the second group, that is, the first group is the upstream group of the second group, and the second group is the downstream group of the first group; there is an upstream-downstream relationship between the second group and the third group. It can be understood that Figure 1 Although the clusters in the blockchain system 100 are divided into three groups, this embodiment is not limited thereto, but may include other numbers of groups. The specific number of divided groups may be determined based on, but not limited to, the maximum network bandwidth that each cluster can bear, or may be specified by the tenant. For example, if the maximum network bandwidth that cluster 111 can bear can support 6 clusters, then Figure 1The blockchain system 100 shown can be divided into two groups. In addition, each group may also include other numbers of clusters. Exemplarily, the nodes in the same cluster in the blockchain system 100 may be located in the same region, for example, all located in Beijing or all located in a country in Europe. Of course, the nodes in the same cluster may also be located in different regions. Among them, the division of clusters can be obtained by, but not limited to, the configuration of tenants. In addition, the division of clusters can also be divided by the delay between nodes in the blockchain system, for example, nodes with a delay less than a preset value are divided into one cluster.
[0042] In this embodiment, in the blockchain system, the cluster at the center (i.e., the central cluster) may have one or more downstream clusters, and the cluster does not have an upstream cluster, because the central cluster is the most upstream cluster in the blockchain system. Figure 1 , cluster 111 has multiple downstream clusters (i.e., clusters 121, 122, and 123), but cluster 111 has no upstream cluster. In a blockchain system, the most peripheral cluster can have one upstream cluster, and the cluster has no downstream clusters, because the cluster is the most downstream cluster in the blockchain system. For example, continue to refer to Figure 1 , cluster 131 has an upstream cluster (i.e., cluster 121). In a blockchain system, a cluster in the middle can have an upstream cluster, and one or more downstream clusters; or, only one upstream cluster. For example, continue to refer to Figure 1 , cluster 123 has an upstream cluster (i.e., cluster 111) and a downstream cluster (i.e., cluster 133). In this embodiment, among the clusters having an upstream and downstream relationship, the delay between the cluster in the middle position and its upstream cluster is less than the delay between the downstream cluster of the cluster in the middle position and the upstream cluster of the cluster in the middle position. For example, continue to refer to Figure 1 , the delay between cluster 123 and cluster 111 is less than the delay between cluster 133 and cluster 111. In this way, when synchronizing blocks in the blockchain system, blocks can be synchronized along the path with the highest synchronization efficiency, thereby improving data synchronization efficiency. Exemplarily, the delay between clusters can be the average value of the delays of all nodes between clusters, or the average value between some nodes, etc., which is not limited here.
[0043] In this embodiment, in the blockchain system, when a cluster has an upstream cluster, some nodes in the cluster can be responsible for communicating with the upstream cluster to obtain new blocks from the upstream cluster and store the new blocks on these nodes (i.e., stored in the local blockchain); at the same time, these nodes can synchronize the obtained new blocks to other nodes in the cluster, so that other nodes in the cluster (these nodes do not communicate with the upstream cluster) can also obtain the new blocks and store them (i.e., stored in the local blockchain). For example, see Figure 2 , the upstream cluster of cluster 121 is cluster 111, in which node 21 can communicate with cluster 111 to obtain block a and synchronize block a to other nodes in cluster 121; other nodes in cluster 121 do not communicate with cluster 111. In some embodiments, the latency between a node in a cluster responsible for communicating with an upstream cluster and a node in the upstream cluster responsible for communicating with a downstream cluster is less than the latency between other nodes in the cluster and a node in the upstream cluster responsible for communicating with a downstream cluster. For example, continue to refer to Figure 2 ,exist Figure 2 In (B), the delay between node 21 and node 11 is less than the delay between node 22 and node 11. This ensures that data synchronization between clusters can be performed efficiently, avoiding the situation where data synchronization efficiency is low due to excessively high delay.
[0044] When a cluster has downstream clusters, some nodes in the cluster can be responsible for communicating with the downstream clusters to synchronize new blocks to the downstream clusters. Figure 2 ,exist Figure 2 In (A), the downstream cluster of cluster 121 is cluster 131 , and node 21 in cluster 121 can communicate with cluster 131 to synchronize block a to cluster 131 .
[0045] When a cluster has a downstream cluster, the cluster can have both nodes responsible for communicating with the upstream cluster and nodes responsible for communicating with the downstream cluster, and these two nodes can be the same node or different nodes. Figure 2 ,exist Figure 2 In (A), node 21 in cluster 121 is responsible for communicating with both cluster 111 and cluster 131; Figure 2 In (A), node 21 in cluster 121 is responsible for communicating with cluster 111 , and node 22 is responsible for communicating with cluster 131 .
[0046] In this embodiment, the nodes in a cluster that are responsible for communicating with other clusters can be elected by the nodes in the cluster, so that the elected nodes can be used to coordinate and manage other nodes in the cluster to ensure the orderly operation of the cluster and the consistency of data between nodes. In some embodiments, these nodes can also be specified by tenants. In addition, when some nodes in a cluster obtain a new block from an upstream cluster, these nodes can also first reach a consensus on the new block through a consensus mechanism, and after reaching a consensus, synchronize the new block to other nodes in the cluster, thereby ensuring the accuracy of the new block.
[0047] In this embodiment, when data synchronization is performed in the blockchain system, it can be gradually spread from the central cluster to the peripheral cluster. Figure 1 ,exist Figure 1 In the blockchain system 100 shown, when synchronizing data, the nodes in cluster 111 can first synchronize data. Afterwards, the node in cluster 111 responsible for data synchronization with the downstream cluster can synchronize data with the downstream cluster (such as clusters 121, 122, 123, etc.) to synchronize data to the nodes in the downstream cluster. Taking the downstream cluster as cluster 121 as an example, after cluster 121 obtains the data synchronized by cluster 111, the nodes in cluster 121 can first synchronize data. After the data in cluster 121 is synchronized, the node in cluster 121 responsible for data synchronization with the downstream cluster can synchronize data with the downstream cluster 131. After cluster 131 obtains the data synchronized by cluster 121, the nodes in cluster 131 can synchronize data. Of course, when synchronizing data, data synchronization between clusters can also be performed first, and then data synchronization within the cluster, or both can be performed at the same time, which is not limited here. In this way, compared with the related technology, all nodes in the related technology are at the same level, and they need to be synchronized at the same time when synchronizing data, which consumes too much network. In this embodiment, when synchronizing data, the method of spreading from the central cluster to the surrounding clusters is adopted, and the amount of data required to be synchronized between clusters is limited. Since the number of nodes in the cluster is also limited, the amount of data required to be synchronized in all clusters is also limited. Therefore, whether it is data synchronization between clusters or data synchronization within a cluster, the network consumption is small, thereby improving the synchronization efficiency of data in the blockchain.
[0048] In some embodiments, Figure 1 In the blockchain system 100 shown, the nodes in cluster 111 can be consensus nodes in the blockchain. In this case, cluster 111 can be called a consensus cluster. After the nodes in cluster 111 reach a consensus on a block, the block can be synchronized to other clusters cascaded with it, such as Figure 1Clusters 121, 122 and 123 in the second group. Exemplarily, in the blockchain system 100, clusters other than cluster 111 can be referred to as node clusters, and nodes in these clusters can be referred to as blockchain nodes.
[0049] In some embodiments, Figure 1 In the blockchain system 100 shown, for clusters other than the central cluster (i.e., the cluster in the first group), a cluster may use a node in the cluster to maintain node information of each node therein, such as: the node's identification in the cluster, network location, network routing information, etc. At this time, the node may serve as a master node, which may be, but is not limited to, a node for the cluster to communicate with an upstream cluster and / or a downstream cluster.
[0050] In addition, a cluster can also use multiple nodes in the cluster to maintain the node information of each node within it, that is, use the cluster mode to maintain node information. Master-slave replication or reliable, replicated, redundant, and fault-tolerant (Raft) protocol can be used between these multiple nodes to ensure the consistency of information between these multiple nodes. These multiple nodes can elect one or more nodes as master nodes. The master node can be, but is not limited to, a node for the cluster to communicate with the upstream cluster and / or downstream cluster, such as: obtaining data from the nodes in the upstream cluster, or sending data to the nodes in the downstream cluster. For example, with Figure 1 As an example, the cluster 121 shown in FIG. 1 includes 12 nodes. Figure 3 As shown, cluster 121 may include two subclusters, one subcluster being a Coordinator cluster and the other being a Peer cluster, wherein the Coordinator cluster may be used to maintain node information in cluster 121, and may also be used to pull data from an upstream cluster or send data to a downstream cluster.
[0051] For clusters other than the central cluster, nodes other than those used to maintain node information of nodes in a cluster can form a sub-cluster, in which data can be synchronized using a specific protocol. For ease of description, the cluster composed of nodes used to maintain node information of nodes in a cluster is called a Coordinator cluster, and the cluster composed of nodes other than those used to maintain node information of nodes in a cluster is called a Peer cluster. Among them, the Peer cluster can be constructed in two ways: semi-centralized and decentralized.
[0052] In this embodiment, when the Peer cluster is constructed in a semi-centralized mode, the network routing information of the nodes in the Peer cluster can be allocated by the nodes in the Coordinator cluster in the cluster where the Peer cluster is located. Figure 3 In cluster 121, the cluster composed of nodes for maintaining node information of nodes in the cluster is a Coordinator cluster, and the cluster composed of nodes other than the Coordinator cluster is a Peer cluster. The network routing information of nodes in the Peer cluster can be allocated by nodes other than the Coordinator cluster.
[0053] In addition, the network location of each node in the Peer cluster can be determined by the nodes in the Coordinator cluster, and the nodes in the Coordinator cluster can also assign an identifier to each node in the Peer cluster. The size of the node identifier determines the method by which the node establishes a network connection. When the cluster state is stable, the network topology of the nodes in the Coordinator cluster and the Peer cluster can form a directed acyclic graph. When data is synchronized, the data is diffused and synchronized throughout the cluster along the direction of the network.
[0054] For example, see Figure 3 , Node 1 in the Coordinator cluster can pull data from the upstream cluster and synchronize the data to nodes 2 and 3, and node 5 in the Peer cluster. Node 2 in the Coordinator cluster can synchronize data to node 4 in the Peer cluster, and node 3 in the Coordinator cluster can synchronize data to node 6 in the Peer cluster. Node 5 in the Peer cluster can synchronize data to nodes 4, 6, and 9 in the Peer cluster, respectively. Node 4 in the Peer cluster can synchronize data to nodes 7 and 8 in the Peer cluster, and so on.
[0055] When determining the network position (i.e., the position on the data synchronization path) of each node in the Peer cluster, the nodes in the Coordinator cluster can determine it through the evaluation value and / or delay of each node in the Peer cluster. Exemplarily, the nodes in the Coordinator cluster can communicate with the nodes in the Peer cluster respectively and perform delay detection to obtain the delay between the node and each node in the Peer cluster. In the Peer cluster, each node can also communicate with each other and perform delay detection to obtain the delay between two nodes, and send the delay to the nodes in the Coordinator cluster. In addition, the nodes in the Coordinator cluster can evaluate the nodes in the Peer cluster based on at least the working status, bandwidth, number of nodes under the node, etc. of the nodes in the Peer cluster to obtain the evaluation value of each node.
[0056] Afterwards, the nodes in the Coordinator cluster can determine the network position of the nodes in the Peer cluster based on the evaluation value and delay. Specifically, the nodes in the Coordinator cluster can select nodes with high evaluation values and low communication delay as upstream nodes in the Peer cluster. Then, the nodes with low delay and high evaluation value with the upstream node can be hung on the corresponding upstream node. When the number of nodes hanging from a certain upstream node reaches a preset value, the nodes can be hung on the upstream node. This goes back and forth until a directed acyclic graph is formed. Among them, the directed acyclic graph can be updated periodically (for example: weekly, monthly, etc.), and when updating, it is also updated using the evaluation values of the nodes periodically obtained and the delays between the nodes, so that the synchronization network can be dynamically adjusted to improve data synchronization efficiency.
[0057] After completing the construction of the directed acyclic graph, the nodes in the Coordinator cluster can send the network routing information of the upstream and downstream nodes of the node to the corresponding nodes. In this way, the subsequent nodes can know which nodes to pull data from and which nodes to send data to.
[0058] When a new node joins the Peer cluster, the nodes in the Coordinator cluster assign a network location to the new node based on the delay between them and the new node and the default evaluation value, and send the network routing information of the upstream node of the new node to the new node; after that, the new node can communicate with its upstream node to complete data synchronization.
[0059] In addition, when determining the network position of a node in the Peer cluster, the nodes in the Coordinator cluster can also be determined based only on the latency between them and the nodes in the Peer cluster. For example, the nodes in the Coordinator cluster can sort the detected latency, and then select the nodes with the lowest latency as upstream nodes, and select the nodes with the lowest latency from the nodes that have not been assigned network positions to hang on these upstream nodes. For example, each upstream node can hang on to two nodes, and so on, until a directed acyclic graph is formed.
[0060] In this embodiment, when the Peer cluster is constructed in a decentralized mode, the network routing information between nodes in the Peer cluster and the node information of the nodes can be maintained by the P2P protocol. At this time, the Coordinator cluster only serves as an entry for updating data. After the nodes in the Coordinator cluster obtain the data, they can send it to one or more nodes in the Peer cluster. After the nodes in the Peer cluster obtain the data, they can synchronize the data through P2P. When a new node joins the Peer cluster, an active node can be specified for the new node, and the communication address of the active node can be informed to the new node; after that, the new node can communicate with the active node to obtain the communication addresses of other nodes in the Peer cluster, etc.
[0061] In some embodiments, when there are multiple nodes in the Coordinator cluster in a cluster, the nodes in the Coordinator cluster can simultaneously pull data from the upstream cluster of the cluster, and synchronize in the Coordinator cluster after obtaining the data. This allows a certain number of redundant connections to be maintained between clusters, avoiding the situation where data synchronization cannot be performed due to a node failure, thereby improving the stability of the system. In addition, the nodes in the Coordinator cluster can also elect a node as the master node through a consensus algorithm, and pull data from the upstream cluster of the cluster through the master node, and / or send data to the downstream cluster.
[0062] In some embodiments, the data synchronized in the blockchain system may be, but is not limited to, new blocks reached by consensus nodes in the blockchain system.
[0063] The above is an introduction to the blockchain system provided by the embodiment of the present application. Next, based on the above content, a data synchronization method provided by the embodiment of the present application is introduced.
[0064] For example, Figure 4A flow chart of a data synchronization method is shown. The method can be applied to, but is not limited to, a blockchain system. The blockchain system may include: a consensus cluster, a first node cluster, and a second node cluster. The consensus cluster includes multiple consensus nodes. The first node cluster includes a first blockchain node and a second blockchain node. The first blockchain node is mainly responsible for communicating with the consensus cluster. The second node cluster includes a third blockchain node and a fourth blockchain node. The third blockchain node is mainly responsible for communicating with the first blockchain node or the second blockchain node. Among them, the delay between the consensus cluster and the first node cluster is less than the delay between the consensus cluster and the second node cluster. Exemplarily, the consensus cluster may be the aforementioned cluster 111, the first node cluster may be the aforementioned cluster 121, and the third cluster may be the aforementioned cluster 131.
[0065] like Figure 4 As shown, the data synchronization method may include the following steps:
[0066] S401. When the consensus nodes in the consensus cluster reach a consensus on the new block, the new block is transmitted to the first blockchain node in the first node cluster through the consensus nodes in the consensus cluster.
[0067] In this embodiment, after the consensus nodes reach a consensus on a new block, the new block can be transmitted to the first blockchain node in the first node cluster.
[0068] S402, receiving a new block through a first blockchain node in the first node cluster, and storing the new block in a local blockchain, and synchronizing the new block to a second blockchain node in the first node cluster, and storing the new block in a local blockchain through the second blockchain node.
[0069] In this embodiment, after the first blockchain node receives the new block, it can store the new block, that is, store it in the local blockchain. Then, the first blockchain node can synchronize the new block to the second blockchain node. After that, the second blockchain node can store the new blockchain, that is, store it in the local blockchain.
[0070] S403. Transmit the new block to the third blockchain node in the second node cluster through the first blockchain node or the second blockchain node in the first node cluster.
[0071] In this embodiment, after the first blockchain node in the first node cluster receives the new block, the first blockchain node can transmit the new block to the third blockchain node in the second node cluster. Alternatively, after the second blockchain node in the first node cluster receives the new block, the second blockchain node can transmit the new block to the third blockchain node in the second node cluster.
[0072] S404, receiving the new block through the third blockchain node in the second node cluster, and storing the new block in the local blockchain, and synchronizing the new block to the fourth blockchain node in the second node cluster, and storing the new block in the local blockchain through the fourth blockchain node.
[0073] In this embodiment, after receiving the new block, the third blockchain node in the second node cluster can store the new block, that is, the blockchain stored locally. Then, the third blockchain node can synchronize the new block to the fourth blockchain node in the second node cluster. After that, the fourth blockchain node can store the new blockchain, that is, the blockchain stored locally.
[0074] In this way, when synchronizing blocks in a blockchain system, some nodes in a cluster can obtain new blocks from some nodes in the upstream cluster of the cluster and store them on these nodes, and synchronize the new blocks to other nodes in the cluster so that other nodes can also obtain new blocks and store them. As a result, the amount of data synchronized between clusters is limited, which reduces the network consumption when synchronizing data between clusters; at the same time, since the number of nodes in a cluster is also within a certain range, the network consumption when synchronizing node data in the cluster is also small. This improves the synchronization efficiency of data in the blockchain.
[0075] In some embodiments, when there are multiple second blockchain nodes, the synchronization order of the new block in multiple second blockchain nodes can also be determined based on the time delay between the second blockchain node and the first blockchain node. The first blockchain node can periodically detect the time delay between it and each second blockchain, and determine the position of each second blockchain node on the synchronization path based on the time delay. The second blockchain node with a smaller time delay has an earlier synchronization order, so the synchronization order of the new block in the second blockchain node is determined. In this way, when the new block is synchronized in the second blockchain node, it can also be synchronized along the path with the highest synchronization efficiency, thereby improving the efficiency of data synchronization.
[0076] Similarly, when there are multiple fourth blockchain nodes, the synchronization order of new blocks in multiple fourth blockchain nodes can also be determined based on the time delay between the fourth blockchain node and the third blockchain node.
[0077] In some embodiments, the node clusters to which the blockchain nodes in the blockchain system belong can also be re-divided based on the time delay between the blockchain nodes in the blockchain system and the consensus nodes in the consensus cluster. The time delay between the blockchain nodes and the consensus nodes can be detected periodically. In this way, some nodes with smaller time delay differences can be divided into the same cluster, avoiding the occurrence of nodes with larger time delay differences in the cluster, and improving the data synchronization efficiency within the cluster.
[0078] Based on the method in the above embodiment, the embodiment of the present application also provides a data synchronization device.
[0079] For example, Figure 5 A structural schematic diagram of a data synchronization device provided by an embodiment of the present application is shown. The data synchronization device can be deployed in a blockchain system. The blockchain system includes: a consensus cluster, a first node cluster, and a second node cluster, the consensus cluster includes multiple consensus nodes, the first node cluster includes a first blockchain node and a second blockchain node, the second node cluster includes a third blockchain node and a fourth blockchain node, and the delay between the consensus cluster and the first node cluster is less than the delay between the consensus cluster and the second node cluster. Exemplarily, the consensus cluster can be the aforementioned cluster 111, the first node cluster can be the aforementioned cluster 121, and the third cluster can be the aforementioned cluster 131.
[0080] like Figure 5 As shown, the data synchronization device 500 may include: a communication module 501 and a processing module 502. Among them, the communication module 501 is used to transmit the new block to the first blockchain node in the first node cluster through the consensus node in the consensus cluster when the consensus nodes in the consensus cluster reach a consensus on the new block. The processing module 502 is used to receive the new block through the first blockchain node and store the new block in the local blockchain, and synchronize the new block to the second blockchain node, and store the new block in the local blockchain through the second blockchain node. The communication module 501 is also used to transmit the new block to the third blockchain node in the second node cluster through the first blockchain node or the second blockchain node. The processing module 502 is also used to receive the new block through the third blockchain node and store the new block in the local blockchain, and synchronize the new block to the fourth blockchain node, and store the new block in the local blockchain through the fourth blockchain node.
[0081] In some embodiments, the processing module 502 is further used to: when there are multiple second blockchain nodes, determine the synchronization order of the new block in the multiple second blockchain nodes based on the time delay between the second blockchain node and the first blockchain node; when there are multiple fourth blockchain nodes, determine the synchronization order of the new block in the multiple fourth blockchain nodes based on the time delay between the fourth blockchain node and the third blockchain node.
[0082] In some embodiments, the processing module 502 is further used to: re-divide the node cluster to which the blockchain node in the blockchain system belongs based on the delay between the blockchain node in the blockchain system and the consensus node in the consensus cluster.
[0083] In some embodiments, the communication module 501 and the processing module 502 can be implemented by software or hardware. For example, the implementation of the communication module 501 is described below by taking the communication module 501 as an example. Similarly, the implementation of the processing module 502 can refer to the implementation of the communication module 501.
[0084] As an example of a software functional unit, the communication module 501 may include code running on a computing instance. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above-mentioned computing instance may be one or more. For example, the communication module 501 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including a data center or multiple data centers with similar geographical locations. Among them, usually a region may include multiple AZs.
[0085] Similarly, multiple hosts / virtual machines / containers used to run the code can be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, a VPC is set up in a region. For cross-region communication between two VPCs in the same region and between VPCs in different regions, a communication gateway needs to be set up in each VPC to achieve interconnection between VPCs through the communication gateway.
[0086] As an example of a hardware functional unit, the communication module 501 may include at least one computing device, such as a server, etc. Alternatively, the communication module 501 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0087] The multiple computing devices included in the communication module 501 can be distributed in the same region or in different regions. The multiple computing devices included in the communication module 501 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the communication module 501 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0088] It should be noted that, in other embodiments, the communication module 501 can be used to execute any step in the method described above, and the processing module 502 can be used to execute any step in the method described above, or the steps that the communication module 501 and the processing module 502 are responsible for implementing can be specified as needed, and all functions of the data synchronization device 500 can be realized by respectively implementing different steps in the method provided in the above embodiments through the communication module 501 and the processing module 502.
[0089] The present application also provides a computing device 600. Figure 6 As shown, computing device 600 includes: bus 602, processor 604, memory 606 and communication interface 608. Processor 604, memory 606 and communication interface 608 communicate through bus 602. Computing device 600 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in computing device 600.
[0090] The bus 602 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The bus 604 is represented by only one line, but does not mean that there is only one bus or one type of bus. The bus 604 may include a path for transmitting information between various components of the computing device 600 (eg, the memory 606, the processor 604, and the communication interface 608).
[0091] The processor 604 may include any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0092] The memory 606 may include a volatile memory, such as a random access memory (RAM). The processor 604 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0093] The memory 606 stores executable program codes, and the processor 604 executes the executable program codes to respectively implement the functions of the aforementioned communication module 501 and the processing module 502, thereby implementing all or part of the steps of the method in the above embodiment. That is, the memory 606 stores instructions for executing all or part of the steps of the method in the above embodiment.
[0094] Alternatively, the memory 606 stores executable codes, and the processor 604 executes the executable codes to respectively implement the functions of the aforementioned data synchronization device 500, thereby implementing all or part of the steps in the above-mentioned embodiment method. That is, the memory 606 stores instructions for executing all or part of the steps in the above-mentioned embodiment method.
[0095] The communication interface 603 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 600 and other devices or a communication network.
[0096] The embodiment of the present application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smart phone.
[0097] like Figure 7 As shown, the computing device cluster includes at least one computing device 600. The memory 606 in one or more computing devices 600 in the computing device cluster may store the same instructions for executing all or part of the steps in the above embodiment method.
[0098] In some possible implementations, the memory 606 of one or more computing devices 600 in the computing device cluster may also store partial instructions for executing all or part of the steps in the above-mentioned embodiment method. In other words, the combination of one or more computing devices 600 may jointly execute instructions for executing all or part of the steps in the above-mentioned embodiment method.
[0099] It should be noted that the memory 606 in different computing devices 600 in the computing device cluster can store different instructions, which are respectively used to execute part of the functions of the data synchronization device 500. That is, the instructions stored in the memory 606 in different computing devices 600 can implement the functions of one or more modules in the aforementioned communication module 501 and processing module 502.
[0100] In some possible implementations, one or more computing devices in the computing device cluster may be connected via a network, which may be a wide area network or a local area network. Figure 8 A possible implementation is shown. Figure 8 As shown, two computing devices 600A and 600B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 606 in the computing device 600A stores instructions for executing the functions of the communication module 501. At the same time, the memory 606 in the computing device 600B stores instructions for executing the functions of the processing module 502.
[0101] It should be understood that Figure 8 The functions of the computing device 600A shown in FIG. 6A may also be completed by multiple computing devices 600. Similarly, the functions of the computing device 600B may also be completed by multiple computing devices 600.
[0102] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similar to that of Figure 7 and Figure 8 The connection mode of the computing device cluster is different in that the memory 606 in one or more computing devices 600 in the computing device cluster may store the same instructions for executing the method in the above embodiment.
[0103] In some possible implementations, the memory 606 of one or more computing devices 600 in the computing device cluster may also store some instructions for executing the aforementioned data processing method. In other words, the combination of one or more computing devices 600 may jointly execute instructions for executing the aforementioned data processing method.
[0104] Based on the method in the above embodiment, the embodiment of the present application provides a computer-readable storage medium, including computer program instructions. When the computer program instructions are executed by a computing device, the computing device executes the method in the above embodiment; or, when the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method in the above embodiment. Exemplarily, the computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0105] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product containing instructions, which, when executed by a computing device, enables the computing device to execute the method in the above embodiment, or, when executed by a computing device cluster, enables the computing device cluster to execute the method in the above embodiment.
[0106] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0107] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0108] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)), etc.
[0109] It should be understood that the various numerical numbers involved in the embodiments of the present application are only used for the convenience of description and are not used to limit the scope of the embodiments of the present application.
Claims
1. A blockchain system, characterized in that: include: Consensus cluster, including: multiple consensus nodes; The first node cluster includes: one or more first blockchain nodes and one or more second blockchain nodes; wherein the first blockchain node is responsible for obtaining a new block reached by the consensus node from the consensus node and storing the new block in a local blockchain, and is responsible for synchronizing the new block to the second blockchain node so that the second blockchain node stores the new block in a local blockchain; The second node cluster includes: one or more third blockchain nodes and one or more fourth blockchain nodes; wherein the third blockchain node is responsible for obtaining the new block from the first blockchain node or the second blockchain node and storing the new block in a local blockchain, and is responsible for synchronizing the new block to the fourth blockchain node so that the fourth blockchain node stores the new block in a local blockchain; The delay between the consensus cluster and the first node cluster is smaller than the delay between the consensus cluster and the second node cluster.
2. The blockchain system according to claim 1, characterized in that: The first blockchain node is obtained by election of blockchain nodes in the first node cluster; The third blockchain node is obtained through election of blockchain nodes in the second node cluster.
3. The blockchain system according to claim 1 or 2, characterized in that: In the first node cluster, the delay between the first blockchain node and the consensus node is less than the delay between the second blockchain node and the consensus node; In the second node cluster, the delay between the third blockchain node and the first blockchain node is less than the delay between the fourth blockchain node and the first blockchain node.
4. The blockchain system according to any one of claims 1 to 3, characterized in that: In the first node cluster, the first blockchain node is also responsible for reaching consensus on the new block through a consensus mechanism before synchronizing the new block to the second blockchain node; In the second node cluster, the third blockchain node is also responsible for reaching consensus on the new block through a consensus mechanism before synchronizing the new block to the fourth blockchain node.
5. The blockchain system according to any one of claims 1 to 4, characterized in that: In the first node cluster, the synchronization order of the new block in the second blockchain node is determined based on the delay between the second blockchain node and the first blockchain node; In the second node cluster, the synchronization order of the new blocks in the fourth blockchain node is determined based on the delay between the fourth blockchain node and the third blockchain node.
6. The blockchain system according to any one of claims 1 to 5, characterized in that: The blockchain nodes in the first node cluster are in the same region, and the blockchain nodes in the second node cluster are in the same region.
7. A data synchronization method, characterized in that: Applied to a blockchain system, the blockchain system comprising: a consensus cluster, a first node cluster, and a second node cluster, the consensus cluster comprising a plurality of consensus nodes, the first node cluster comprising a first blockchain node and a second blockchain node, the second node cluster comprising a third blockchain node and a fourth blockchain node, and the delay between the consensus cluster and the first node cluster being less than the delay between the consensus cluster and the second node cluster; The method comprises: When the consensus nodes in the consensus cluster reach a consensus on the new block, the new block is transmitted to the first blockchain node in the first node cluster through the consensus nodes in the consensus cluster; Receiving the new block through the first blockchain node and storing the new block in the local blockchain, and synchronizing the new block to the second blockchain node and storing the new block in the local blockchain through the second blockchain node; Transmitting the new block to a third blockchain node in the second node cluster through the first blockchain node or the second blockchain node; The new block is received through the third blockchain node and stored in the local blockchain, and the new block is synchronized to the fourth blockchain node and stored in the local blockchain through the fourth blockchain node.
8. The method according to claim 7, characterized in that The method further comprises: In the case where there are multiple second blockchain nodes, determining the synchronization order of the new block in the multiple second blockchain nodes based on the time delay between the second blockchain node and the first blockchain node; In the case where there are multiple fourth blockchain nodes, the synchronization order of the new block in the multiple fourth blockchain nodes is determined based on the time delay between the fourth blockchain node and the third blockchain node.
9. The method according to claim 7 or 8, characterized in that: The method further comprises: Based on the time delay between the blockchain node in the blockchain system and the consensus node in the consensus cluster, the node cluster to which the blockchain node in the blockchain system belongs is re-divided.
10. A data synchronization device, characterized in that: Deployed in a blockchain system, the blockchain system comprising: a consensus cluster, a first node cluster, and a second node cluster, the consensus cluster comprising a plurality of consensus nodes, the first node cluster comprising a first blockchain node and a second blockchain node, the second node cluster comprising a third blockchain node and a fourth blockchain node, and the delay between the consensus cluster and the first node cluster being less than the delay between the consensus cluster and the second node cluster; The device comprises: A communication module, configured to transmit the new block to the first blockchain node in the first node cluster through the consensus nodes in the consensus cluster when the consensus nodes in the consensus cluster reach a consensus on the new block; A processing module, configured to receive the new block through the first blockchain node and store the new block in a local blockchain, and synchronize the new block to the second blockchain node and store the new block in a local blockchain through the second blockchain node; The communication module is further used to transmit the new block to a third blockchain node in the second node cluster through the first blockchain node or the second blockchain node; The processing module is also used to receive the new block through the third blockchain node and store the new block in the local blockchain, and to synchronize the new block to the fourth blockchain node and store the new block in the local blockchain through the fourth blockchain node.
11. The device according to claim 10, characterized in that The processing module is further used for: In the case where there are multiple second blockchain nodes, determining the synchronization order of the new block in the multiple second blockchain nodes based on the time delay between the second blockchain node and the first blockchain node; In the case where there are multiple fourth blockchain nodes, the synchronization order of the new block in the multiple fourth blockchain nodes is determined based on the time delay between the fourth blockchain node and the third blockchain node.
12. The device according to claim 10 or 11, characterized in that The processing module is further used for: Based on the time delay between the blockchain node in the blockchain system and the consensus node in the consensus cluster, the node clusters to which the blockchain node in the blockchain system belongs are re-divided.
13. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 7-9.
14. A computer-readable storage medium, characterized in that: comprising computer program instructions, when the computer program instructions are executed by a computing device, the computing device performs the method according to any one of claims 7 to 9; Alternatively, when the instruction is executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 7 to 9.
15. A computer program product comprising instructions, characterized in that When the instruction is executed by a computing device, the computing device executes the method according to any one of claims 7 to 9; Alternatively, when the instruction is executed by a computing device cluster, the computing device cluster executes the method according to any one of claims 7 to 9.
Citation Information
Patent Citations
Block chain layered consensus certification system structure and method based on cloud computing
CN111371905A
Data processing method and device
CN115601160A
Block chain implementation method,device, system and storage medium
WO2020224239A1
