CN110737664A - block link point synchronization method and device - Google Patents

block link point synchronization method and device Download PDF

Info

Publication number
CN110737664A
CN110737664A CN201910999466.XA CN201910999466A CN110737664A CN 110737664 A CN110737664 A CN 110737664A CN 201910999466 A CN201910999466 A CN 201910999466A CN 110737664 A CN110737664 A CN 110737664A
Authority
CN
China
Prior art keywords
target
node
block
block height
target node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910999466.XA
Other languages
Chinese (zh)
Other versions
CN110737664B (en
Inventor
陈宇
莫楠
李辉忠
张开翔
范瑞彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910999466.XA priority Critical patent/CN110737664B/en
Publication of CN110737664A publication Critical patent/CN110737664A/en
Priority to PCT/CN2020/116439 priority patent/WO2021077962A1/en
Application granted granted Critical
Publication of CN110737664B publication Critical patent/CN110737664B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Abstract

The invention discloses a method and a device for block link point synchronization, wherein the method comprises the steps of determining multiple target nodes from a block chain network, determining target contract accounts from system table entries according to target block heights, determining a target contract account requested from a target node for each target node, generating a synchronization request and sending the synchronization request to a target node, and determining and returning state data of the corresponding target contract account on the target block heights by a target node.

Description

block link point synchronization method and device
Technical Field
The embodiment of the invention relates to the field of financial technology (Fintech), in particular to a method and a device for synchronizing block link points.
Background
With the development of computer technology, more and more technologies (such as block chain, cloud computing or big data) are applied in the financial field, the traditional financial industry is gradually changing to the financial technology, the block chain technology is no exception, but due to the security and real-time requirements of the financial and payment industries, higher requirements are also put forward on the block chain technology.
When a new node is added in the block chain network, the newly added node can be used as a consensus node to participate in consensus after the state data of the existing node is correctly synchronized. In the prior art, a newly added node synchronizes a block from an existing node, executes a transaction in the block after verifying that the synchronized block is correct, and updates corresponding state data after verifying that a transaction result (modification of chain state data of the block by the transaction) conforms to a preset state. In this way, since the newly added node is required to serially execute all transactions in all blocks from the creation block to update the state data, the block synchronization process takes a long time when the number of history blocks is large.
Disclosure of Invention
The embodiment of the invention provides block link point synchronization methods and devices, which are used for improving the efficiency of block synchronization.
The block link point synchronization method provided by the embodiment of the invention comprises the following steps:
determining th target nodes from the blockchain network, wherein the root hash of the state tree of each th target node on the target block height is the same, and the target block height is determined according to the lowest block height in the current block heights of the th target nodes;
determining a target contract account from a system table entry according to the target block height; the block height when each contract account is created is recorded in the system table entry, and the block height when the target contract account is created is less than or equal to the target block height;
and for each th target node, determining a target contract account requested from the th target node, generating a synchronization request and sending the synchronization request to the th target node, wherein the synchronization request is used for the th target node to determine and return the state data of the corresponding target contract account on the target block height.
In the technical scheme, when a new joining node joins in a block chain network, a target contract account needing synchronous state data is determined directly according to a system table entry instead of synchronizing a block and executing a transaction in the block, and then the state data of the target contract account on the target block height is synchronized in each th target node (each th target node has the same state tree root hash on the target block height and guarantees the correctness of the state data on each th target node), so that the synchronous data amount is small, the transaction in the block does not need to be executed again.
Optionally, after the determining, for each th target node, a target contract account requested from the th target node, generating a synchronization request, and sending the synchronization request to the th target node, the method further includes:
after receiving state data of the corresponding target contract account on the target chunk height returned by each th target node of the plurality of th target nodes, computing a second state tree root hash;
and if the second state tree root hash is the same as the th state tree root hash, storing state data of the corresponding target contract account returned by each th target node on the target block height into a local database, wherein the th state tree root hash is the state tree root hash of each th target node on the target block height.
In the above technical solution, after the newly added node receives the status data returned by each th target node, the hash value of the status data may be determined according to all the received status data, that is, the status tree root hash corresponding to the target block height is determined, and it is determined whether the hash value matches the status tree root hash previously acquired from each th target node, if yes, the acquired status data is determined to be correct data, and the disk-dropping storage may be performed, thereby completing the synchronization operation of the status data of the target block height.
Optionally, after the storing the status data of the corresponding target contract account returned by each th target node at the target block height in the local database, the method further includes:
determining a second target node of which the current block is higher than the target block from the block chain network;
obtaining th tile from the second target node after the target tile height;
executing the transaction in block , generating modified contract account status data, and updating the modified contract account status data to the local database.
In the above technical solution, after the newly added node completes the synchronization operation of the state data of the target block, steps may be further performed to start the processes of synchronizing the subsequent blocks and executing the transaction of the newly added block, so as to synchronize the newly added block in the block link network in the state data synchronization operation process, so as to complete the update of the state data corresponding to the newly added block, and implement that the state data of the newly added node is the same as that of other existing nodes, and can participate in consensus as a new consensus node.
Optionally, the th target node includes a third target node, and the synchronization request sent to the third target node is also used by the third target node to determine system status data and return the system status data.
In the technical scheme, the newly added node synchronizes the system state data and synchronizes the system configuration information in the block chain network, so that the synchronization of all the state data in the block chain network is completed.
Correspondingly, the embodiment of the invention also provides an block link point synchronization device, which comprises:
a determining unit and a processing unit;
the determining unit is used for determining th target nodes from the block chain network, wherein the state tree root hash of each th target node on the target block height is the same, and the target block height is determined according to the lowest block height in the current block heights of the th target nodes;
the determining unit is further configured to determine a target contract account from the system table entry according to the target block height; the block height when each contract account is created is recorded in the system table entry, and the block height when the target contract account is created is less than or equal to the target block height;
the processing unit is used for determining a target contract account requested by the th target node for each th target node, generating a synchronization request and sending the synchronization request to the th target node, wherein the synchronization request is used for the th target node to determine the state data of the corresponding target contract account on the target block height and returning the state data.
Optionally, the processing unit is further configured to:
after the target contract account requested from the th target node is determined, a synchronization request is generated and sent to the th target node for each th target node, a second state tree root hash is computed after receiving state data on the target block height of the corresponding target contract account returned by each th target node of the plurality of th target nodes;
and if the second state tree root hash is the same as the th state tree root hash, storing state data of the corresponding target contract account returned by each th target node on the target block height into a local database, wherein the th state tree root hash is the state tree root hash of each th target node on the target block height.
Optionally, the processing unit is further configured to:
after the status data of the corresponding target contract account returned by each th target node on the target block height is stored in a local database, determining a second target node with the current block height higher than the target block height from the block chain network;
obtaining th tile from the second target node after the target tile height;
executing the transaction in block , generating modified contract account status data, and updating the modified contract account status data to the local database.
Optionally, the th target node includes a third target node, and the synchronization request sent to the third target node is also used by the third target node to determine system status data and return the system status data.
Correspondingly, the embodiment of the present invention further provides kinds of computing devices, including:
a memory for storing program instructions;
and the processor is used for calling the program instruction stored in the memory and executing the method for synchronizing the block chain nodes according to the obtained program.
Accordingly, computer-readable non-volatile storage media are provided according to embodiments of the present invention, and include computer-readable instructions, which when read and executed by a computer, cause the computer to perform the above method for blockchain node synchronization.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of system architectures according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for synchronizing block link points according to an embodiment of the present invention;
fig. 3 is a schematic flow chart of another block link point synchronization methods provided by the embodiments of the present invention;
fig. 4 is a schematic structural diagram of an block link point synchronization device according to an embodiment of the present invention.
Detailed Description
For purposes of clarity, technical solutions and advantages of the present invention, the present invention will be described in further detail with reference to the accompanying drawings , and it is obvious that the described embodiment is only a partial embodiment of the , rather than a complete embodiment.
For better explaining the embodiments of the present invention, the terms or knowledge related to the embodiments of the present invention are described as follows:
() Classification of blockchain state data
The state data of the block chain can be divided into two categories, wherein the category is system state data related to the overall state of the block chain, such as the contents of a node list participating in consensus when the block chain is high, and the block chain configuration (such as the maximum transaction amount that each block can pack), and the like, and the category is contract account data recording the balance of the contract account, the hash of the contract code, and the like.
Access restriction for blockchain database engine
The database engines mainly used by the current block chain comprise a levelDB and a rocksDB, both of which are NoSQL databases (non-relational databases), and the NoSQL databases are physically stored in a Key value pair mode and only provide a specified Key and traversal operation to obtain related record values. Therefore, if all the state data stored in the key value pair manner on the block chain needs to be acquired, the state data can be acquired only by serially traversing the database instance.
(III) Block chain status data verification scheme
For the state data under the height of a specific block, the root hash of the MPT tree (i.e. the root hash of the state tree, StateRoot) needs to be calculated, and the root hash of the MPT tree is also stored in the Header (Header) of the specific block.
An embodiment of the present invention provides a system architecture to which a method for synchronizing block link nodes is applied, and as shown in fig. 1, the system architecture may be a block link network, where the block link network includes a newly added node and an existing node, and when the newly added node is added to the block link network, the newly added node sends a request for synchronizing state data to the existing node and receives state data responded by the existing node, thereby completing synchronization of the state data.
In addition, the system architecture may further include a plurality of newly added nodes, and each newly added node may send a request for synchronizing the state data to the existing node and receive the state data returned by the existing node, thereby completing synchronization of the state data.
Based on the above description, fig. 2 exemplarily shows a flow of the methods for block-link point synchronization provided by the embodiment of the present invention, where the flow may be performed by a device for block-link point synchronization, and the device may newly join a node, and may be the newly joined node.
As shown in fig. 2, the process specifically includes:
at step 201, a plurality of th target nodes are determined from the blockchain network.
After a newly added node is added into a block chain network, a synchronization operation is triggered, the newly added node acquires the number of existing nodes in the current block chain network and the current block height of each existing node, and determines a plurality of th target nodes and target block heights for the synchronization operation, wherein the root hashes of the state trees of the th target nodes on the target block heights are the same, the target block heights are determined according to the current block heights of the th target nodes, when the target block heights are determined according to the current block heights of the th target nodes, the maximum values which are smaller than the lowest block height and are integer multiples of a preset value can be taken, for example, the lowest block height is 3430, the preset value is 100, the maximum value which is smaller than 3430 and is 100 is 3400, the value which is the value obtained by subtracting the preset value from the lowest block height, for example, the lowest block height is 3430, the preset value is 5, the value obtained by subtracting 3430 is 3425, and the preset value can be determined according to experience in the two modes.
Specifically, the blockchain network may have N existing nodes, and the newly added node may determine k th target nodes from the N existing nodes according to different consensus algorithms, where when the consensus algorithm is PBFT (Practical byzantine fault Tolerance), the newly added node may determine k (N-1)/3+1, and when the consensus algorithm is POW (Proof of Work), the newly added node may determine k 50% × N +1, taking PBFT as an example, and when the blockchain network includes 10 existing nodes, the newly added node may determine 4 th target nodes.
In the process of determining k target nodes by a newly added node, the newly added node may sort existing nodes from high to low according to current block heights of the existing nodes in a block chain network, determine a preset block height according to the current block heights of the existing nodes of the kth existing node (where the preset block height is the same as the determined target block height), obtain state tree root hashes of the existing nodes on the preset block height in the previous k existing nodes, and determine whether the k state tree root hashes are the same, if so, determine that the previous k existing nodes are k target nodes, and the preset block height is the target block height, otherwise, update the preset block height according to the current block heights of the k +1 existing nodes, obtain the state tree roots of the existing nodes on the updated preset block height in the previous k +1 existing nodes, determine whether k identical state tree root hashes exist, and determine that the k identical state tree root hashes exist, if so, use the existing node corresponding to the k identical state tree root hashes as the k 63k tree root and determine that the current block nodes correspond to the k high tree root nodes, and determine that the k existing nodes are the same state tree root nodes after the updated preset block height is the k +1 node, and determine that the k existing tree root nodes correspond to the preset block height, and the k high node, and the preset block height of the target block height, and determine that the current block height corresponds to the k node, and the preset node corresponding to the preset node, and the target block height of the k node, and.
For example, when four existing nodes A, B, C and D in the front blockchain network are present, and the current block height corresponding to each of A, B, C and D is 3430, 3320, 3450 and 3100, it is determined that k is 2 according to PBFT, the current block heights corresponding to A, B, C and D are sorted from high to low, and the sorting is C, A, B, D, the first 2 existing nodes are determined to be C and A, the current block height corresponding to node A is 3430, the maximum 3400 which is less than 3430 and is an integer multiple of 100 is taken as the preset block height, if it is determined that the state tree root hash of node C on the block height 3400 and the state tree root hash of node A on the block height 3400 are consistent, C and A are correct nodes, C and A can be taken as two target nodes, and the preset block height is high, the preset block height node B is taken as the high target node B3300, if it is determined that the state tree root of node C on the block height 3400 and the state tree root hash node B on the block height 3400 is not 630, and the preset tree root hash node B is taken as the hash node B3300, and the hash node B is taken as the hash node B which is a node B which is consistent with the state tree root node B which is a 3300, and the preset node B which is equal to be equal to 3300, and the high node B, and the hash node B which is taken as the high node B which is equal to be equal to 3300, and the hash node B which is equal to be equal to 3300, and the hash node B which is equal to be equal to 3300, and equal to be equal to 3300, and the hash node B which is equal to the hash node B, and equal to be equal to 3300 which is equal to be equal to.
Step 202, a target contract account is determined from the system table entries based on the target block height.
In order to improve the efficiency of synchronizing state data of a newly added node, system entries are provided, wherein the system entries are lists used for recording contract Account data, and illustratively, as shown in table 1, the system entries record block heights when contract accounts are created, for example, a contract Account2 is created when a block height is 1, and a contract Account Account890 is created when a block height is 3450.
TABLE 1
Contract account Block height
Account0 0
Account1 0
Account2 1
Account3 5
…… ……
Account798 3400
Account799 3400
Account800 3401
…… ……
Account890 3450
According to the system table entry, the new joining node can determine which contract accounts have been created before the target block height in the block chain network, and the new joining node can know which contract account status data should be synchronized from the block chain network. As in Table 1, if the target block height is determined to be 3400, then the contract accounts that have been created before the target block height 3400 and the target block height 3400 may be determined to have Account0 through Account799, i.e., the contract accounts Account0 through Account799 are target contract accounts.
In step 203, for each th target node, a target contract account requested from the th target node is determined, and a synchronization request is generated and sent to the th target node.
After the target contract Account is determined, the newly joining node allocates the target contract Account to each th target node according to preset rules, for example, it is determined that there are Account0 to Account799 for the contract accounts created before the target block height 3400 and the target block height 3400, and 500 is taken as data intervals to divide the contract accounts, so that Account0 to Account499 can be allocated to the node a, Account500 to Account799 can be allocated to the node C, so that the newly joining node can synchronize the state data of Account0 to Account499 from the node a, and synchronize the state data of Account500 to Account799 from the node C.
Specifically, it can be stated that target nodes in the synchronization request include target contract accounts and target block heights requested by the target node, the newly joining node determines a target contract Account requested by the target node and sends a synchronization request corresponding to the target node to the target node, the synchronization request corresponding to the target node is used for the target node to determine the state data of the corresponding target contract Account on the target block height and returns the data to the newly joining node.
In another aspect, after the th target node obtains the synchronization request, it determines the state data according to the target contract Account and the target block height in the synchronization request, for example, if the synchronization request received by the node C includes that the target contract Account is Account500 and the target block height is 3400, the node C determines the state data of Account500 on the target block height 3400, and returns the state data to the newly added node.
In the above embodiment, when a new joining node joins the blockchain network, instead of synchronizing a block and executing a transaction in the block from an existing node, a target contract account requiring synchronized state data is directly determined according to a system table entry, and then state data of the target contract account on a target block height is synchronized from each th target node (each th target node has the same state tree root hash on the target block height, and the correctness of the state data on each th target node is guaranteed).
After sending a synchronization request corresponding to each th target node to each th target node, the newly added node may further receive state data of a corresponding target contract account on a target block height returned by each th target node, and after determining that the state data returned by all th target nodes are received completely, determine whether the received state data is correct state data.
Continuing to explain by taking the foregoing example as an example, after the newly added node acquires the state data returned by the node a and the node C, the newly added node analyzes and constructs complete state data and calculates the hash of the state tree root, and after the verification is passed, the constructed state data is subjected to disk-dropping storage, and the data state of the node itself at height of 3400 blocks is established. At this time, the data state of the newly added node at 3400 block height is equivalent to the data state of the founder block of the newly added node.
In the above embodiment, after the newly added node receives the status data returned by each th target node, the hash value of the status data may be determined according to all the received status data, that is, the status tree root hash corresponding to the target block height is determined, and it is determined whether the hash value matches the status tree root hash previously acquired from each th target node, if yes, the acquired status data is determined to be correct data, and the disk-dropping storage may be performed, so that the synchronization operation of the status data of the target block height is completed.
Specifically, the newly joining node determines a second target node with the current block height higher than the target block height from the block chain network, acquires a th block after the target block height from the second target node, executes the transaction in the th block, generates state data of the modified contract account, and updates the state data of the modified contract account to the local database, where the second target node may be at least , and when determining the second target node, the newly joining node may determine that at least nodes with the current block height higher than the target block height from the block chain network are used as the second target node, and exemplarily, after determining the current block height of the newly joining node, the newly joining node may determine that the current block height is higher than the target block height of the target block 395, and then determine that the current block height is higher than the target block height of the newly joining node in the block chain network, and then determine that the current block height is higher than the target block height of the current block is higher than the target block height of the target block of the current block of the target node.
The block height of the newly added node is equal to the highest block height of the existing node, which means that the newly added node has completed the synchronization operation of the state data of other common nodes in the synchronization block chain network and can participate in common identification as the new common node, the block chain network continues to generate blocks and reaches the block height of 3455 in the process of synchronizing the state data of the newly added node on the synchronization target block height, and after the data state of the newly added node under 3400 block height is established, the blocks of 3401 and 3455 are synchronized to the node A, B, C with the current block height being higher than 3400 in the block chain network until the block height of the newly added node is equal to the highest block height of the existing node in the block chain network.
In the above embodiment, after completing the synchronization operation of the state data of the target block, the newly added node may further start a process of synchronizing the subsequent blocks and executing the transaction of the newly added block, so as to synchronize the newly added block in the block chain network in the state data synchronization operation process, so as to complete the update of the state data corresponding to the newly added block, and implement that the state data of the newly added node is the same as the state data of other existing nodes, and may participate in consensus as a new consensus node.
In the embodiment of the present invention, a newly added node not only needs to synchronize state data of a contract account, but also needs to synchronize system state data, the newly added node may synchronize the system state data to any th th target node in th target nodes, if the th target node is taken as a third target node, a synchronization request sent by the newly added node to the third target node is also used by the third target node to determine system state data, the synchronization request may further include an identifier of the system state data, and the third target node determines account data corresponding to the contract account on a target block height and determines the system state data according to the received synchronization request and returns the system state data to the newly added node.
In the synchronous process, a newly added node may be used as an execution main body for executing the process, or may be a third party node, where the third party node is used as an intermediate node for interaction between the newly added node and an existing node in the blockchain network, for example, after the third party node determines the newly added node in the blockchain network, a plurality of th target nodes may be determined from the current blockchain network, a target contract account may be determined from the system table entry according to the target block height, a target contract account requested from each th target node may be determined for each target node, a synchronization request corresponding to each th target node may be generated and sent to each th target node, after receiving state data of the corresponding target contract account on the block height returned by each th target node in the plurality of th target nodes, a second state tree hash root may be calculated, and if it is determined that the second state tree root is the same as the state hash of the state tree root, the state data of the corresponding target contract account on the target block height returned by each th target node may be sent to the newly added node, so that other nodes are not added locally, and other nodes are not stored.
The embodiment of the present invention further provides another flow of methods for block link point synchronization, and as shown in the specific flow of fig. 3, a new node of the main body and a th target node are executed.
Step 301, a newly added node determines a target node list and a target block height for pulling state data;
the target node list includes th target nodes determined by the newly added node.
Step 302, dividing the state data of the target block height by the newly added node, and distributing the state data to the corresponding th target node;
step 303, the newly joining node generates a synchronization request of state data for each th target node;
step 304, the newly added node sends the synchronization request to the corresponding th target node;
step 305, the th target node generates a response data packet recorded with state data corresponding to the synchronization request according to the received synchronization request;
step 306, the th target node sends the response data packet to the newly joining node;
step 307, the newly added node analyzes the response data packet to generate state data, and the state data is stored in a disk after the verification is passed;
step 308, after the newly added node completes the synchronization of the historical state data, the synchronization process of the subsequent blocks is started.
Based on the same inventive concept, fig. 4 exemplarily shows the structure of block link point synchronization apparatuses provided by the embodiments of the present invention, which can execute the flow of the block link point synchronization method.
The device includes:
a determination unit 401 and a processing unit 402;
the determining unit 401 is configured to determine th target nodes from the blockchain network, wherein the state tree root hashes of the th target nodes on the target block heights are the same, and the target block heights are determined according to the lowest block height among the current block heights of the th target nodes;
the determining unit 401 is further configured to determine a target contract account from system table entries according to the target block height; the block height when each contract account is created is recorded in the system table entry, and the block height when the target contract account is created is less than or equal to the target block height;
the processing unit 402 is configured to, for each th target node, determine a target contract account requested from the th target node, generate a synchronization request for the th target node to determine and return status data of the corresponding target contract account on the target block height, and send the synchronization request to the th target node.
Optionally, the processing unit 402 is further configured to:
after the target contract account requested from the th target node is determined, a synchronization request is generated and sent to the th target node for each th target node, a second state tree root hash is computed after receiving state data on the target block height of the corresponding target contract account returned by each th target node of the plurality of th target nodes;
and if the second state tree root hash is the same as the th state tree root hash, storing state data of the corresponding target contract account returned by each th target node on the target block height into a local database, wherein the th state tree root hash is the state tree root hash of each th target node on the target block height.
Optionally, the processing unit 402 is further configured to:
after the status data of the corresponding target contract account returned by each th target node on the target block height is stored in a local database, determining a second target node with the current block height higher than the target block height from the block chain network;
obtaining th tile from the second target node after the target tile height;
executing the transaction in block , generating modified contract account status data, and updating the modified contract account status data to the local database.
Optionally, the th target node includes a third target node, and the synchronization request sent to the third target node is also used by the third target node to determine system status data and return the system status data.
Based on the same inventive concept of , embodiments of the present invention further provide kinds of computing devices, including:
a memory for storing program instructions;
and the processor is used for calling the program instruction stored in the memory and executing the method for synchronizing the block chain nodes according to the obtained program.
Based on the same inventive concept as , embodiments of the present invention also provide computer-readable non-volatile storage media, which include computer-readable instructions, when read and executed by a computer, cause the computer to perform the above method for blockchain node synchronization.
It is to be understood that each flow and/or block in the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions which can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagram flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Having described preferred embodiments of the invention, further alterations and modifications may be effected to these embodiments by those skilled in the art having the benefit of the basic inventive concepts .
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1, method for block link point synchronization, comprising:
determining th target nodes from the blockchain network, wherein the root hash of the state tree of each th target node on the target block height is the same, and the target block height is determined according to the lowest block height in the current block heights of the th target nodes;
determining a target contract account from a system table entry according to the target block height; the block height when each contract account is created is recorded in the system table entry, and the block height when the target contract account is created is less than or equal to the target block height;
and for each th target node, determining a target contract account requested from the th target node, generating a synchronization request and sending the synchronization request to the th target node, wherein the synchronization request is used for the th target node to determine and return the state data of the corresponding target contract account on the target block height.
2. The method as claimed in claim 1, wherein after said determining, for each th target node, a target contract account requested from the th target node, generating and sending a synchronization request to the th target node, further comprising:
after receiving state data of the corresponding target contract account on the target chunk height returned by each th target node of the plurality of th target nodes, computing a second state tree root hash;
and if the second state tree root hash is the same as the th state tree root hash, storing state data of the corresponding target contract account returned by each th target node on the target block height into a local database, wherein the th state tree root hash is the state tree root hash of each th target node on the target block height.
3. The method of claim 2, wherein after said storing the status data of the corresponding target contract account returned by each -th target node at the target block height in a local database, further comprising:
determining a second target node of which the current block is higher than the target block from the block chain network;
obtaining th tile from the second target node after the target tile height;
executing the transaction in block , generating modified contract account status data, and updating the modified contract account status data to the local database.
4. The method of claim 1 wherein said target nodes include a third target node, and wherein a synchronization request sent to said third target node is further used by said third target node to determine system state data and return said system state data.
The device for synchronizing the block link points of types is characterized by comprising:
a determining unit and a processing unit;
the determining unit is used for determining th target nodes from the block chain network, wherein the state tree root hash of each th target node on the target block height is the same, and the target block height is determined according to the lowest block height in the current block heights of the th target nodes;
the determining unit is further configured to determine a target contract account from the system table entry according to the target block height; the block height when each contract account is created is recorded in the system table entry, and the block height when the target contract account is created is less than or equal to the target block height;
the processing unit is used for determining a target contract account requested by the th target node for each th target node, generating a synchronization request and sending the synchronization request to the th target node, wherein the synchronization request is used for the th target node to determine the state data of the corresponding target contract account on the target block height and returning the state data.
6. The apparatus as recited in claim 5, said processing unit to further:
after the target contract account requested from the th target node is determined, a synchronization request is generated and sent to the th target node for each th target node, a second state tree root hash is computed after receiving state data on the target block height of the corresponding target contract account returned by each th target node of the plurality of th target nodes;
and if the second state tree root hash is the same as the th state tree root hash, storing state data of the corresponding target contract account returned by each th target node on the target block height into a local database, wherein the th state tree root hash is the state tree root hash of each th target node on the target block height.
7. The apparatus as recited in claim 6, said processing unit to further:
after the status data of the corresponding target contract account returned by each th target node on the target block height is stored in a local database, determining a second target node with the current block height higher than the target block height from the block chain network;
obtaining th tile from the second target node after the target tile height;
executing the transaction in block , generating modified contract account status data, and updating the modified contract account status data to the local database.
8. The apparatus of claim 5 wherein said target nodes include a third target node, and wherein a synchronization request sent to said third target node is further used by said third target node to determine system state data and return said system state data.
A computing device of , comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory to perform the method of any of claims 1 to 4 at according to the program obtained.
10, computer-readable non-transitory storage media comprising computer-readable instructions that, when read and executed by a computer, cause the computer to perform the method of any of claims 1-4 to .
CN201910999466.XA 2019-10-21 2019-10-21 Method and device for synchronizing block chain link points Active CN110737664B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910999466.XA CN110737664B (en) 2019-10-21 2019-10-21 Method and device for synchronizing block chain link points
PCT/CN2020/116439 WO2021077962A1 (en) 2019-10-21 2020-09-21 Method and apparatus for blockchain node synchronization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910999466.XA CN110737664B (en) 2019-10-21 2019-10-21 Method and device for synchronizing block chain link points

Publications (2)

Publication Number Publication Date
CN110737664A true CN110737664A (en) 2020-01-31
CN110737664B CN110737664B (en) 2022-11-25

Family

ID=69270322

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910999466.XA Active CN110737664B (en) 2019-10-21 2019-10-21 Method and device for synchronizing block chain link points

Country Status (2)

Country Link
CN (1) CN110737664B (en)
WO (1) WO2021077962A1 (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059089A (en) * 2019-03-27 2019-07-26 深圳前海达闼云端智能科技有限公司 Data synchronization method and device, storage medium and electronic equipment
CN111432009A (en) * 2020-03-30 2020-07-17 深圳壹账通智能科技有限公司 Method and device for synchronizing block chain data, electronic equipment and storage medium
CN111630830A (en) * 2020-04-15 2020-09-04 支付宝(杭州)信息技术有限公司 Distributed blockchain data storage under account model
CN111935315A (en) * 2020-09-25 2020-11-13 支付宝(杭州)信息技术有限公司 Block synchronization method and device
CN111949634A (en) * 2020-08-07 2020-11-17 广州科创空间信息科技有限公司 Method for synchronously migrating block chain data
WO2021077962A1 (en) * 2019-10-21 2021-04-29 深圳前海微众银行股份有限公司 Method and apparatus for blockchain node synchronization
CN113364847A (en) * 2021-05-31 2021-09-07 新疆大学 Data synchronization method and device of block chain nodes and storage medium
US11218402B2 (en) 2020-09-25 2022-01-04 Alipay (Hangzhou) Information Technology Co., Ltd. Blockchain systems, and message transmission methods and apparatuses
US11233849B2 (en) 2020-09-25 2022-01-25 Alipay (Hangzhou) Information Technology Co., Ltd. Message transmission methods and apparatuses
US11336558B2 (en) 2020-09-25 2022-05-17 Alipay (Hangzhou) Information Technology Co., Ltd. Message transmission methods and apparatuses
US11388229B2 (en) 2020-09-25 2022-07-12 Alipay (Hangzhou) Information Technology Co., Ltd. Methods and apparatuses for transmitting messages
US11445016B2 (en) 2020-09-25 2022-09-13 Alipay (Hangzhou) Information Technology Co., Ltd. Methods and apparatuses for transmitting messages
US11463278B2 (en) 2020-09-25 2022-10-04 Alipay (Hangzhou) Information Technology Co., Ltd. Message transmission methods and apparatuses
US11556516B2 (en) 2020-04-20 2023-01-17 Alipay (Hangzhou) Information Technology Co., Ltd. Distributed blockchain data storage under account model
US11722318B2 (en) 2020-09-25 2023-08-08 Alipay (Hangzhou) Information Technology Co., Ltd. Message transmission methods and apparatuses

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108805570A (en) * 2018-06-01 2018-11-13 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
US20190018887A1 (en) * 2017-04-12 2019-01-17 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability, Decentralization, and Security for Fast and Low-Cost Payment and Transaction Processing
CN109325039A (en) * 2018-06-07 2019-02-12 海南新软软件有限公司 A kind of block chain browser and block chain information browsing method
CN109522362A (en) * 2018-10-17 2019-03-26 北京瑞卓喜投科技发展有限公司 Incomplete markets synchronous method, system and equipment based on block chain data
CN109587263A (en) * 2018-12-20 2019-04-05 众安信息技术服务有限公司 A kind of block synchronous method and system
CN109714412A (en) * 2018-12-25 2019-05-03 深圳前海微众银行股份有限公司 Block synchronous method, device, equipment and computer readable storage medium
CN110113408A (en) * 2019-04-30 2019-08-09 杭州复杂美科技有限公司 A kind of block synchronous method, equipment and storage medium
WO2019193363A1 (en) * 2018-04-05 2019-10-10 Electroneum Ltd Hybrid blockchain transaction system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101930825B1 (en) * 2017-01-23 2018-12-19 주식회사 데일리인텔리전스 System and method for authenticating users and synchronizing blocks using a block-chain network
CN107103054B (en) * 2017-04-12 2019-03-26 北京航空航天大学 A kind of intelligent contract asynchronous execution storage system and implementation method of privately owned block chain
CN107332876B (en) * 2017-05-31 2020-05-08 深圳前海微众银行股份有限公司 Method and device for synchronizing block chain state
CN109086325A (en) * 2018-06-29 2018-12-25 阿里巴巴集团控股有限公司 Data processing method and device based on block chain
CN109063109A (en) * 2018-07-27 2018-12-21 电子科技大学 A kind of data query system based on ether mill
CN110737664B (en) * 2019-10-21 2022-11-25 深圳前海微众银行股份有限公司 Method and device for synchronizing block chain link points

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190018887A1 (en) * 2017-04-12 2019-01-17 Vijay K. Madisetti Method and System for Tuning Blockchain Scalability, Decentralization, and Security for Fast and Low-Cost Payment and Transaction Processing
WO2019193363A1 (en) * 2018-04-05 2019-10-10 Electroneum Ltd Hybrid blockchain transaction system
CN108805570A (en) * 2018-06-01 2018-11-13 腾讯科技(深圳)有限公司 Data processing method, device and storage medium
CN109325039A (en) * 2018-06-07 2019-02-12 海南新软软件有限公司 A kind of block chain browser and block chain information browsing method
CN109522362A (en) * 2018-10-17 2019-03-26 北京瑞卓喜投科技发展有限公司 Incomplete markets synchronous method, system and equipment based on block chain data
CN109587263A (en) * 2018-12-20 2019-04-05 众安信息技术服务有限公司 A kind of block synchronous method and system
CN109714412A (en) * 2018-12-25 2019-05-03 深圳前海微众银行股份有限公司 Block synchronous method, device, equipment and computer readable storage medium
CN110113408A (en) * 2019-04-30 2019-08-09 杭州复杂美科技有限公司 A kind of block synchronous method, equipment and storage medium

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110059089B (en) * 2019-03-27 2021-01-22 深圳前海达闼云端智能科技有限公司 Data synchronization method and device, storage medium and electronic equipment
CN110059089A (en) * 2019-03-27 2019-07-26 深圳前海达闼云端智能科技有限公司 Data synchronization method and device, storage medium and electronic equipment
WO2021077962A1 (en) * 2019-10-21 2021-04-29 深圳前海微众银行股份有限公司 Method and apparatus for blockchain node synchronization
CN111432009A (en) * 2020-03-30 2020-07-17 深圳壹账通智能科技有限公司 Method and device for synchronizing block chain data, electronic equipment and storage medium
CN111432009B (en) * 2020-03-30 2023-04-07 深圳壹账通智能科技有限公司 Method and device for synchronizing block chain data, electronic equipment and storage medium
US11526488B2 (en) 2020-04-15 2022-12-13 Alipay (Hangzhou) Information Technology Co., Ltd. Distributed blockchain data storage under account model
CN111630830A (en) * 2020-04-15 2020-09-04 支付宝(杭州)信息技术有限公司 Distributed blockchain data storage under account model
CN111630830B (en) * 2020-04-15 2023-07-04 支付宝(杭州)信息技术有限公司 Distributed blockchain data storage under account model
WO2020143852A3 (en) * 2020-04-15 2021-02-25 Alipay (Hangzhou) Information Technology Co., Ltd. Distributed blockchain data storage under account model
US11556516B2 (en) 2020-04-20 2023-01-17 Alipay (Hangzhou) Information Technology Co., Ltd. Distributed blockchain data storage under account model
CN111949634A (en) * 2020-08-07 2020-11-17 广州科创空间信息科技有限公司 Method for synchronously migrating block chain data
US11233849B2 (en) 2020-09-25 2022-01-25 Alipay (Hangzhou) Information Technology Co., Ltd. Message transmission methods and apparatuses
US11336558B2 (en) 2020-09-25 2022-05-17 Alipay (Hangzhou) Information Technology Co., Ltd. Message transmission methods and apparatuses
US11388229B2 (en) 2020-09-25 2022-07-12 Alipay (Hangzhou) Information Technology Co., Ltd. Methods and apparatuses for transmitting messages
US11445016B2 (en) 2020-09-25 2022-09-13 Alipay (Hangzhou) Information Technology Co., Ltd. Methods and apparatuses for transmitting messages
US11463278B2 (en) 2020-09-25 2022-10-04 Alipay (Hangzhou) Information Technology Co., Ltd. Message transmission methods and apparatuses
US11316921B2 (en) 2020-09-25 2022-04-26 Alipay (Hangzhou) Information Technology Co., Ltd. Block synchronization methods and apparatuses
US11218402B2 (en) 2020-09-25 2022-01-04 Alipay (Hangzhou) Information Technology Co., Ltd. Blockchain systems, and message transmission methods and apparatuses
CN111935315A (en) * 2020-09-25 2020-11-13 支付宝(杭州)信息技术有限公司 Block synchronization method and device
US11722318B2 (en) 2020-09-25 2023-08-08 Alipay (Hangzhou) Information Technology Co., Ltd. Message transmission methods and apparatuses
US11924276B2 (en) 2020-09-25 2024-03-05 Alipay (Hangzhou) Information Technology Co., Ltd. Methods and apparatuses for transmitting messages
CN113364847A (en) * 2021-05-31 2021-09-07 新疆大学 Data synchronization method and device of block chain nodes and storage medium

Also Published As

Publication number Publication date
CN110737664B (en) 2022-11-25
WO2021077962A1 (en) 2021-04-29

Similar Documents

Publication Publication Date Title
CN110737664B (en) Method and device for synchronizing block chain link points
CN113329031B (en) Method and device for generating state tree of block
CN109034809B (en) Block chain generation method and device, block chain node and storage medium
EP3678346B1 (en) Blockchain smart contract verification method and apparatus, and storage medium
US11281644B2 (en) Blockchain logging of data from multiple systems
CN107688999B (en) Block chain-based parallel transaction execution method
US20200356537A1 (en) Resharding method and system for a distributed storage system
CN109313752B (en) Method and system for forming an efficient consensus mechanism for licensed blockchains using audit guarantees
CN110471923B (en) Processing method and device for blockchain transaction records
CN105608086A (en) Transaction processing method and device of distributed database system
CN104036029B (en) Large data consistency control methods and system
CN106611064B (en) Data processing method and device for distributed relational database
CN111008521B (en) Method, device and computer storage medium for generating wide table
CN110704438B (en) Method and device for generating bloom filter in blockchain
CN106227799B (en) A kind of sql sentence processing method based on distributed data base
WO2021036260A1 (en) Method and apparatus for concurrently executing transactions in blockchain
CN110597835B (en) Transaction data deleting method and device based on blockchain
CN110599166A (en) Method and device for acquiring transaction dependency relationship in block chain
CN109739684A (en) The copy restorative procedure and device of distributed key value database based on vector clock
CN114529415A (en) Transaction verification method and device based on block chain and electronic equipment
CN110119947B (en) Method and apparatus for shared workload proof computing power generation of symbiotic blockchains
CN112069259B (en) Multi-cloud environment data storage system and method based on blockchain
CN113111125A (en) Business evidence storage method based on block chain
CN113411373A (en) Transaction data storage method, tracking and tracing method and block chain network
CN114157550B (en) Alliance block chain system based on conflict-free transaction merging

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant