WO2021135744A1 - Data synchronization method and device for blockchain nodes - Google Patents

Data synchronization method and device for blockchain nodes Download PDF

Info

Publication number
WO2021135744A1
WO2021135744A1 PCT/CN2020/131812 CN2020131812W WO2021135744A1 WO 2021135744 A1 WO2021135744 A1 WO 2021135744A1 CN 2020131812 W CN2020131812 W CN 2020131812W WO 2021135744 A1 WO2021135744 A1 WO 2021135744A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
synchronized
blockchain
node
block
Prior art date
Application number
PCT/CN2020/131812
Other languages
French (fr)
Chinese (zh)
Inventor
陈锐
Original Assignee
支付宝(杭州)信息技术有限公司
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 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021135744A1 publication Critical patent/WO2021135744A1/en

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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • G06F16/275Synchronous replication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Definitions

  • the embodiments of this specification relate to the field of blockchain technology, in particular, to a data synchronization method and device for blockchain nodes.
  • the blockchain system is a decentralized distributed data storage system involving multiple nodes. Once data is written to the blockchain on each node, on the one hand, it means that the data is disclosed in the blockchain network. On the other hand, the data written to the blockchain is also difficult to delete and tamper with.
  • centralized devices can also store data in a manner similar to blockchain storage (which can be regarded as centralized blockchain storage).
  • Blockchain nodes There are usually multiple participating nodes (blockchain nodes) in a blockchain system. There are consensus protocols between participating nodes to ensure the consistency of their respective data. However, when a participating node fails, a new participating node joins, or various other reasons, the data of a certain participating node may lag behind other normal participating nodes. Therefore, the blockchain system needs to use a data synchronization protocol to ensure that the backward participating nodes can make the locally maintained data catch up with other normal participating nodes, thereby participating in the normal consensus process.
  • a participating node finds that the data it maintains lags behind other normal nodes, it can initiate a data synchronization process, that is, request the normal participating nodes for the missing data.
  • the normal node receives the data request, it can include the data requested by the backward participating node in the response message and send it to the backward participating node.
  • the embodiments of this specification provide a data synchronization method and device for blockchain nodes.
  • a data synchronization method for blockchain nodes including: dividing each data to be synchronized of a first blockchain node into multiple data sets to be synchronized; Multiple data sets to be synchronized are allocated to multiple second blockchain nodes; a data synchronization request message is sent to the second blockchain nodes corresponding to each data set to be synchronized to request to obtain the data to be synchronized in the data set to be synchronized Data; and obtain the data to be synchronized in the corresponding data set to be synchronized from the second blockchain node corresponding to each data set to be synchronized.
  • dividing each data to be synchronized of the first blockchain node into multiple data sets to be synchronized may include: based on the block chain node list information in the blockchain system, dividing each data to be synchronized The data is divided into multiple data sets to be synchronized.
  • dividing each data to be synchronized into multiple data sets to be synchronized may include: obtaining load information of the multiple second blockchain nodes; and based on the multiple second blocks The load information of the link node divides each data to be synchronized into multiple data sets to be synchronized.
  • the method may further include: based on the second block chain node corresponding to each data set to be synchronized The blockchain node adjusts the respective data sets to be synchronized according to the response result of the corresponding data synchronization request message.
  • the response result may include: the response speed of the second blockchain node to the corresponding data synchronization request message; and/or the response speed received from the second blockchain node The amount of data to be synchronized.
  • the respective data to be synchronized may include block data to be synchronized.
  • a data synchronization device for blockchain nodes including: a data segmentation unit to be synchronized, which divides each data to be synchronized of the first blockchain node into a plurality of data to be synchronized Collection; a data allocation unit to be synchronized, which allocates the multiple data sets to be synchronized to a plurality of second blockchain nodes; a data synchronization request sending unit, which sends to the second blockchain node corresponding to each data set to be synchronized A data synchronization request message to request to obtain the data to be synchronized in the to-be-synchronized data set; and the to-be-synchronized data acquisition unit obtains the corresponding data in the to-be-synchronized data set from the second blockchain node corresponding to each to-be-synchronized data set Data to be synchronized.
  • the to-be-synchronized data splitting unit splits each to-be-synchronized data into multiple to-be-synchronized data sets based on block chain node list information in the blockchain system.
  • the to-be-synchronized data segmentation unit may include: a load information acquisition module that acquires load information of the multiple second blockchain nodes; and a to-be-synchronized data segmentation module, based on the multiple The load information of the second blockchain node divides each data to be synchronized into multiple data sets to be synchronized.
  • the device may further include: a to-be-synchronized data set adjustment unit, after sending a data synchronization request message to the second blockchain node corresponding to each to-be-synchronized data set, based on the data synchronization request message corresponding to each The second blockchain node of the data set to be synchronized adjusts the respective data sets to be synchronized according to the response result of the corresponding data synchronization request message.
  • a to-be-synchronized data set adjustment unit after sending a data synchronization request message to the second blockchain node corresponding to each to-be-synchronized data set, based on the data synchronization request message corresponding to each
  • the second blockchain node of the data set to be synchronized adjusts the respective data sets to be synchronized according to the response result of the corresponding data synchronization request message.
  • a computing device including: at least one processor; and a memory, the memory stores instructions, and when the instructions are executed by the at least one processor, the At least one processor executes the method as described above.
  • a non-transitory machine-readable storage medium which stores executable instructions, which when executed cause the machine to execute the method as described above.
  • the data synchronization process can be occupied. Distribute the resources of multiple second blockchain nodes to avoid overloading a single second blockchain node.
  • Fig. 1 shows a schematic diagram of an example of an environment that can be used to execute a data synchronization method according to an embodiment of the present specification
  • Fig. 2 shows a schematic diagram of an example of a system architecture for executing a data synchronization method according to an embodiment of the present specification
  • Fig. 3 is a flowchart for explaining an exemplary application scenario of a data synchronization method according to an embodiment of the present specification
  • Fig. 4 is a flowchart of a data synchronization method according to an embodiment of the present specification
  • Fig. 5 is a flowchart of an example of a data segmentation process to be synchronized in a data synchronization method according to an embodiment of the present specification
  • FIG. 6 is a flowchart of an example of the adjustment process of the data set to be synchronized in the data synchronization method according to an embodiment of the present specification
  • Fig. 7 is a structural block diagram of a data synchronization device according to an embodiment of the present specification.
  • FIG. 8 is a structural block diagram of an example of a data division unit to be synchronized in the data synchronization device shown in FIG. 7;
  • Fig. 9 is a structural block diagram of a computing device for a data synchronization method according to an embodiment of the present specification.
  • the term “including” and its variations mean open terms, meaning “including but not limited to”.
  • the term “based on” means “based at least in part on.”
  • the terms “one embodiment” and “an embodiment” mean “at least one embodiment.”
  • the term “another embodiment” means “at least one other embodiment.”
  • the terms “first”, “second”, etc. may refer to different or the same objects. Other definitions can be included below, whether explicit or implicit. Unless clearly indicated in the context, the definition of a term is consistent throughout the specification.
  • Blockchain is a chain data structure that connects and combines data blocks sequentially in chronological order, and cryptographically ensures that the data blocks cannot be tampered with or forged.
  • the blockchain includes one or more blocks. Each block in the blockchain is linked to the previous block by including the encrypted hash of the immediately preceding block in the blockchain. Each block also includes a timestamp, a cryptographic hash of the block, and one or more transactions.
  • the transaction that has been verified by the nodes of the blockchain network is hashed and a Merkle tree is formed. In the Merkle tree, the data at the leaf nodes is hashed, and for each branch of the Merkle tree, all the hash values of the branch are concatenated at the root of the branch.
  • the above processing is performed on the Merkle tree until the root node of the entire Merkle tree.
  • the root node of the Merkle tree stores hash values representing all data in the Merkle tree.
  • Blockchain is a data structure used to store transactions.
  • the blockchain network is a network of computing nodes used to manage, update and maintain one or more blockchain structures.
  • the blockchain network can include a public blockchain network, a private blockchain network, or a consortium blockchain network.
  • the consensus process is controlled by the nodes of the consensus network.
  • the public blockchain network can be considered as a public network of participating entities.
  • most entities nodes must sign each block in sequence, and add the signed block to the blockchain of the blockchain network.
  • Examples of public blockchain networks may include specific peer-to-peer payment networks.
  • blockchain does not specifically refer to any particular blockchain.
  • the public blockchain network supports public transactions. Public transactions are shared among all nodes in the public blockchain network and stored in the global blockchain.
  • a global blockchain refers to a blockchain that is replicated across all nodes.
  • consensus protocols include but are not limited to: proof-of-work (POW), proof-of-stake (POS), and proof-of-authority (POA).
  • POW is used as a non-limiting example.
  • Private blockchain networks are provided for specific entities.
  • the read and write permissions of each node in the private blockchain network are strictly controlled. Therefore, a private blockchain network is usually also called a permissioned network, which restricts who is allowed to participate in the network and the level of network participation (for example, only in certain transaction situations).
  • a private blockchain network various types of access control mechanisms can be used (for example, existing participants vote to add new entities, regulatory agencies control permissions, etc.).
  • the alliance blockchain network is private among participating entities.
  • the consensus process is controlled by authorized nodes.
  • a consortium composed of several (for example, 10) entities (for example, financial institutions, insurance companies) can operate a consortium blockchain network, and each entity operates at least one node in the consortium blockchain network. Therefore, the consortium blockchain network can be considered as a private network of participating entities.
  • each participating entity node
  • each block may be signed by a subset of participating entities (nodes) (for example, at least 7 entities), and the block may be added to the blockchain.
  • Blockchain is a tamper-proof shared digital ledger that records transactions in a public or private peer-to-peer network.
  • the ledger is distributed to all member nodes in the network, and the history of asset transactions that occurred in the network is permanently recorded in the block.
  • the consensus mechanism ensures that all network nodes in the distributed blockchain network execute transactions in the same order and then write to the same ledger.
  • the consensus model aims to solve the Byzantine problem.
  • components such as servers or network nodes in the distributed blockchain network may malfunction or deliberately spread wrong information to other nodes. Since other network nodes need to reach a consensus on which network node fails first, it is difficult for other network nodes to declare the component failure and exclude it from the blockchain network.
  • FIG. 1 shows a schematic diagram of an example of an environment 100 that can be used to execute a data synchronization method according to an embodiment of the present specification.
  • the environment 100 enables entities to participate in the blockchain network 102.
  • the environment 100 includes a network 104, and computing devices/systems 106, 108.
  • the network 104 may include a local area network (LAN), a wide area network (WAN), the Internet, or a combination thereof, and connect a website, a user device (for example, a computing device), and a back-end system.
  • the network 104 may be accessed through a wired and/or wireless communication link.
  • the computing devices/systems 106 and 108 communicate with each other through the network 104, and communicate with the blockchain network 102 through the network 104, and the nodes (or node devices) in the blockchain network 102 pass through The network 104 communicates.
  • the network 104 represents one or more communication networks.
  • the computing devices/systems 106, 108 may be nodes of a cloud computing system (not shown), or each computing device/system 106, 108 may be a separate cloud computing system, including interconnection through the network 104 Multiple computers and used as a distributed processing system.
  • each of the computing devices/systems 106, 108 may include any suitable computing system capable of participating as a node in the blockchain network 102.
  • Examples of computing devices/systems include, but are not limited to, servers, desktop computers, laptops, tablet devices, smart phones, etc.
  • one or more computer-implemented services for interacting with the blockchain network 102 may be installed on the computing device/system 106, 108.
  • the computing device/system 106 may be installed with the services of the first entity (for example, user A), for example, the first entity is used to manage transactions with one or more other entities (for example, other users). Management system.
  • the computing device/system 108 may be installed with services of a second entity (for example, user B), for example, a transaction management system used by the second entity to manage transactions with one or more other entities (for example, other users) .
  • a second entity for example, user B
  • a transaction management system used by the second entity to manage transactions with one or more other entities (for example, other users) .
  • the blockchain network 102 is represented as a peer-to-peer network of nodes, and the computing devices/systems 106, 108 serve as the nodes of the first entity and the second entity participating in the blockchain network 102, respectively.
  • FIG. 2 shows a schematic diagram of an example of a system architecture 200 for executing the data synchronization method according to an embodiment of the present specification.
  • An example of the system architecture 200 includes the participant systems 202, 204, and 206 corresponding to the participant A, the participant B, and the participant C, respectively.
  • Each participant eg, user, enterprise
  • the blockchain network 212 includes a plurality of nodes 214, wherein at least some of the nodes 214 record information in the blockchain 216, and the recorded information cannot be changed.
  • a single blockchain 216 is schematically shown within the blockchain network 212, multiple copies of the blockchain 216 may be provided, and multiple copies are maintained in the blockchain network 212, as described in detail later of.
  • each participant system 202, 204, 206 is provided by participant A, participant B, and participant C, or provided as participant A, participant B, and participant C, respectively, And it serves as the corresponding node 214 in the blockchain network 212.
  • a node generally refers to a single system (eg, computer, server) connected to the blockchain network 212 and enables corresponding participants to participate in the blockchain network.
  • the participant corresponds to each node 214.
  • one participant can operate multiple nodes 214 within the blockchain network 212, and/or multiple participants can share a single node 214.
  • the participant systems 202, 204, 206 use protocols (e.g., Hypertext Transfer Protocol Security (HTTPS)) and/or use remote procedure calls (RPC) to communicate with the blockchain network 212, or through the blockchain
  • HTTPS Hypertext Transfer Protocol Security
  • RPC remote procedure calls
  • the degree of participation of the node 214 in the blockchain network 212 may vary. For example, some nodes 214 may participate in the consensus process (eg, as miner nodes that add blocks to the blockchain 216), while other nodes 214 do not participate in the consensus process. As another example, some nodes 214 store a complete copy of the blockchain 216, while other nodes 214 only store a partial copy of the blockchain 216. In the example of Figure 2, the participant systems 202, 204, 206 each store a complete copy of the blockchain 216 216', 216", 216"'.
  • a blockchain (for example, the blockchain 216 in FIG. 2) is composed of a series of blocks, and each block stores data.
  • Examples of data may include transaction data representing transactions between two or more participants.
  • transactions are used as a non-limiting example, and it is expected that any appropriate data can be stored in the blockchain (for example, documents, images, videos, audios).
  • Examples of transactions may include, but are not limited to, the exchange of valuable things (for example, assets, products, services, currency, etc.).
  • Transaction data is stored immutably in the blockchain.
  • hash Before storing in the block, hash the transaction data. Hashing is the process of converting transaction data (provided as string data) into a fixed-length hash value (also provided as string data). After the transaction data is hashed, even a slight change in the transaction data will result in a completely different hash value.
  • the hash value is usually generated by hashing transaction data using a hash function. Examples of hash functions include, but are not limited to, Secure Hash Algorithm (SHA)-256, which outputs a 256-bit hash value.
  • SHA Secure Hash Algorithm
  • the transaction data of multiple transactions can be stored in the block after being hashed. For example, two transaction data are hashed to obtain two hash values, and then the two obtained hash values are hashed again to obtain another hash value. This process is repeated until a single hash value is obtained for all transactions to be stored in the block.
  • This hash value is called the Merkle root hash and is stored at the head of the block. Any change in the transaction will cause its hash value to change, and eventually the Merkle root hash value will change.
  • the block is added to the blockchain through a consensus protocol.
  • Multiple nodes in the blockchain network participate in the consensus protocol and add blocks to the blockchain after competition.
  • Such nodes are called miner nodes (or accounting nodes).
  • the POW introduced above serves as a non-limiting example.
  • Miner nodes perform a consensus process to add transactions (corresponding blocks) to the blockchain. Although multiple miner nodes participate in the consensus process, only one miner node can write a block to the blockchain. In other words, miner nodes compete in the consensus process to add their blocks to the blockchain. In more detail, the miner node periodically collects pending transactions from the transaction pool (for example, until a predetermined limit on the number of transactions that can be included in the block is reached, if any). The transaction pool includes transaction messages from participants in the blockchain network. Miner nodes create blocks and add transactions to the blocks. Before adding the transaction to the block, the miner node checks whether there is a transaction in the block of the blockchain among the transactions to be added. If the transaction has been added to another block, the transaction will be discarded.
  • the miner node generates a block header, hashes all transactions in the block, and combines the hash values in pairs to generate further hash values until a single hash value (Merkle root) is obtained for all transactions in the block. Hash). Then, add the Merkle root hash to the block header.
  • the miner also determines the hash value of the latest block in the blockchain (ie, the last block added to the blockchain). Miner nodes can also add random values (noune values) and timestamps to the block header.
  • the miner node tries to find a hash value that meets the required parameters. The miner node keeps changing the nonce value until it finds a hash value that meets the required parameters.
  • Every miner in the blockchain network tries to find a hash value that meets the required parameters and competes with each other in this way.
  • a miner node finds a hash value that meets the required parameters and advertises the hash value to all other miner nodes in the blockchain network.
  • Other miner nodes verify the hash value, and if it is determined to be correct, verify each transaction in the block, accept the block, and attach the block to their copy of the blockchain. In this way, the global state of the blockchain is agreed upon on all miner nodes within the blockchain network.
  • the above process is a POW consensus protocol.
  • participant A wants to send a certain amount of funds to participant B.
  • Participant A generates a transaction message and sends the transaction message to the blockchain network, and the transaction message is added to the transaction pool.
  • Each miner node in the blockchain network creates a block, obtains transactions from the transaction pool, and adds the transaction to the block. In this way, the transaction issued by participant A is added to the block of the miner node.
  • cryptography is implemented to maintain the privacy of transactions. For example, if two nodes want to maintain the privacy of the transaction so that other nodes in the blockchain network cannot learn the details of the transaction, the node can encrypt the transaction data.
  • encryption methods include, but are not limited to, symmetric encryption and asymmetric encryption.
  • Symmetric encryption refers to the encryption process that uses a single key to encrypt (generate ciphertext based on plaintext) and decrypt (generate plaintext based on ciphertext).
  • symmetric encryption multiple nodes can use the same key, so each node can encrypt/decrypt transaction data.
  • Asymmetric encryption refers to the use of key pairs for encryption.
  • Each key pair includes a private key and a public key.
  • the private key is only known to the corresponding node, and the public key is known to any or all other nodes in the blockchain network.
  • a node can use another node's public key to encrypt data, and can use another node's private key to decrypt the encrypted data.
  • Participant A can use the public key of participant B to encrypt data and send the encrypted data to participant B.
  • Participant B can use its private key to decrypt the encrypted data (ciphertext) and extract the original data (plain text). Messages encrypted with the public key of the node can only be decrypted with the private key of the node.
  • Asymmetric encryption is used to provide digital signatures, which enables participants in a transaction to confirm other participants in the transaction and the validity of the transaction. For example, a node can digitally sign a message, and another node can confirm that the message was sent by the node based on the digital signature of participant A. Digital signatures can also be used to ensure that messages are not tampered with during transmission. For example, refer to Figure 1 again. Participant A will send a message to participant B. Participant A generates a hash value of the message, and then uses its private key to encrypt the hash value to generate a digital signature. Participant A attaches the digital signature to the message, and sends the message with the digital signature to participant B.
  • Participant B uses the public key of participant A to decrypt the digital signature, thereby decrypting the corresponding hash value. Participant B hashes the received message to obtain another hash value, and then compares the two hash values. If the hash value is the same, participant B can confirm that the message is indeed from participant A and has not been tampered with.
  • Fig. 3 is a flowchart for explaining an exemplary application scenario of a data synchronization method according to an embodiment of the present specification.
  • the first blockchain node may send a highest block request message to the second blockchain node to request to determine the highest block information stored at the second blockchain node.
  • the first blockchain node may be any participating node in the blockchain system, and the second blockchain node may be any participating node except the first blockchain node.
  • the second blockchain node may send the locally stored highest block information to the first blockchain node in response to the highest block request message.
  • each blockchain node in the blockchain system may periodically broadcast the highest block request message to the second blockchain node.
  • other blockchain nodes monitor the highest block request message, they can send the block height of the highest block stored locally to the sender of the highest block request message.
  • the block height is used to indicate the order of each block in the blockchain. For example, each block can be numbered sequentially from the genesis block (that is, the first block in the blockchain), and this number can be used as the block height of the corresponding block.
  • each blockchain node may periodically send the highest block request message to one or more second blockchain nodes that it trusts.
  • the second blockchain node trusted by the first blockchain node can be determined based on the historical data of the interaction between the first blockchain node and each second blockchain node. For example, the blockchain node with the shortest message response delay can be selected Or the blockchain node with the highest verification pass rate of the data received from the other party is used as the trusted node.
  • the trusted node information can also be maintained locally, so that the trusted second blockchain node can be obtained from the trusted node information.
  • data lag means that for a certain type of data (such as block data in this example), the type of data stored at a certain blockchain node is missing relative to other blockchain nodes. For example, if the highest block information of the second blockchain node indicates that the block height of the highest block at the second blockchain node is 100, and the block height of the highest block at the first blockchain node is 80, It indicates that the block data at the first blockchain node lags behind the second blockchain node.
  • Lagging nodes can be blockchain nodes that have joined the blockchain network but have missing data due to failures or network delays, or they can be new nodes that have joined the blockchain network.
  • the first block chain node sends a data synchronization request message to the second block chain node to request the locally missing block data.
  • the process of completing local block data to be consistent with other blockchain nodes can be referred to as a block synchronization data process.
  • the block data at the first blockchain node is completed from a block with a block height of 80 to a block with a block height of 100
  • the process consistent with the second blockchain node is Block data synchronization process.
  • the data synchronization request message may include the block data information to be synchronized, for example, may include the block height range (for example, 81 to 100) of the block data to be synchronized.
  • the second blockchain node After receiving the block data request message, the second blockchain node assembles multiple block data requested by the data synchronization request message into a response message in block 310 in response to the data synchronization request. Since the size of a single message is usually limited in the blockchain network (for example, a single message is limited to no more than 16M), the second blockchain node can assemble the response message in batches, that is, when a response message cannot be used When sending all the block data to be synchronized to the first block chain node, the block data to be synchronized requested by the first block chain node may be grouped into multiple batch response messages.
  • the second blockchain node After the response message is assembled, at 312, the second blockchain node sends the assembled response message to the first blockchain node.
  • each batch of response messages can be sent to the first blockchain node.
  • Block data verification may include verification processes such as block data integrity verification to verify whether the received block data is correct.
  • the block data verification process can be performed using any verification method known in the art, for example, it can be performed by verifying the signature data in the block data.
  • the first block chain node adds the verified block data to the local block chain to realize the block data synchronization process.
  • FIG. 3 uses the block data synchronization process as an example to describe the application scenario of the data synchronization method of the embodiment of this specification
  • the data synchronization method of this specification can be applied to the synchronization process for any data.
  • the consensus process of block data when each blockchain node lacks consensus messages in part of the consensus phase, and thus requests other blockchain nodes to synchronize the missing consensus messages, the data synchronization method in this manual can also be applied .
  • Fig. 4 is a flowchart of a data synchronization method according to an embodiment of the present specification.
  • each data to be synchronized of the first blockchain node is divided into multiple data sets to be synchronized. Then, at block 404, multiple data sets to be synchronized are allocated to multiple second blockchain nodes.
  • the data to be synchronized can be divided in any manner.
  • each data to be synchronized can be divided into multiple data sets to be synchronized based on the block chain node list information in the block chain system. For example, based on the number of blockchain nodes in the blockchain node list information, each data to be synchronized can be equally divided into a corresponding number of data sets to be synchronized.
  • the block chain node list information may also include information about whether each block chain node is a trusted node, so that it can be divided based on the number of trusted nodes.
  • the block chain node list information may also include the trust level of each block chain node, so that the data to be synchronized can be divided based on the trust level.
  • blockchain nodes with a higher trust level may be allocated more data to be synchronized, and blockchain nodes with a trust level lower than a predetermined level may be allocated less data to be synchronized or no data to be synchronized may be allocated to them.
  • the data to be synchronized can be divided with reference to FIG. 5 below.
  • a data synchronization request message is sent to the second blockchain node corresponding to each data set to be synchronized to request to obtain the data to be synchronized
  • the data synchronization request message may include corresponding data collection information to be synchronized. For example, when the data to be synchronized is block data, the block height of each data to be synchronized in the data set to be synchronized may be included.
  • the data to be synchronized is a consensus phase message, it may include the identification of each consensus phase message to be synchronized.
  • the second blockchain node After receiving the data synchronization request message, the second blockchain node can obtain the data to be synchronized requested by the first blockchain node.
  • the first blockchain node obtains the data to be synchronized in the corresponding data set to be synchronized from the second blockchain node corresponding to each data set to be synchronized.
  • each data to be synchronized when the data to be synchronized has a data sequence (for example, the block data has an order in the blockchain), for each data to be synchronized, after receiving the previous data to be synchronized, the corresponding area
  • the block chain node sends a data synchronization request message for the data to be synchronized.
  • each data to be synchronized may be divided into multiple data sets to be synchronized based on the sequence of the data to be synchronized, and then a corresponding data request to be synchronized is sent to the corresponding second blockchain node based on the data sequence of the data set to be synchronized.
  • the block height of the block data to be synchronized is 80 to 120, it can be divided into four block data sets to be synchronized in order from the block height 80 to 120, such as 80-90, 91-100, 101-110 , 111-120. Then, first send a data synchronization request message for 80-90 to one of the blockchain nodes, and after receiving the corresponding block data to be synchronized, send the data synchronization request for 91-100 to another second zone Block chain node.
  • the sequence of the data in the data set to be synchronized may not be continuous. In this example, data synchronization request messages may be sent for each data to be synchronized.
  • Block data when the previous block data to be synchronized cannot be received or the previous block data to be synchronized cannot pass the local verification of the first blockchain node, even if the subsequent block to be synchronized is received Block data may also temporarily fail to link the block data to be synchronized. At this time, storage space is required to store the block data to be synchronized later. Therefore, through this example, the utilization of storage resources can be avoided, and local storage resources can be allocated reasonably.
  • the load of the second blockchain node may be too high or for a long time. Problems such as not getting a response from the second blockchain node.
  • the synchronization load of the data to be synchronized can be distributed to multiple second blockchain nodes, thereby avoiding excessive occupation of resources of one node.
  • the blockchain node list information includes trust level information
  • the blockchain nodes can be sorted based on the trust level of each blockchain node.
  • the number of data sets to be synchronized can be determined based on the number of data to be synchronized, and a corresponding number of second blockchain nodes with a higher trust level can be selected from the ranking result of the blockchain nodes.
  • each second blockchain node can be allocated a predetermined number of data to be synchronized during each round of allocation. After completing one round of allocation, proceed to the next round until all The data to be synchronized is allocated to the corresponding second blockchain node. After the distribution process of all the data to be synchronized is completed, a set of block data to be synchronized for each second blockchain node can be obtained.
  • Fig. 5 is a flowchart of an example of the data segmentation process to be synchronized in the data synchronization method according to an embodiment of the present specification.
  • the load information of a plurality of second blockchain nodes is obtained.
  • the load information of each second blockchain node may be determined based on the interaction history between the second blockchain node and the first blockchain node.
  • the load information of the second blockchain node may be determined based on information such as the amount of data received from the second blockchain node and the frequency of data received from the second blockchain node during the most recent predetermined period of time.
  • each data to be synchronized is divided into multiple data sets to be synchronized based on the load information of the multiple second blockchain nodes. It is possible to allocate less data to be synchronized to the second blockchain node with a higher load, that is, the number of data to be synchronized in the data set to be synchronized for the second blockchain node may not exceed a predetermined number, or the data to be synchronized The ratio of the quantity to the total quantity of data to be synchronized may not exceed a predetermined ratio.
  • the number of data to be synchronized in the to-be-synchronized data set for the second blockchain node with a lower load can be reduced, that is, the number of to-be-synchronized data in the to-be-synchronized data set may not be less than the predetermined number, or account for The ratio of the total amount of data to be synchronized is not lower than the predetermined ratio.
  • the data synchronization load allocated to each second blockchain node can be adapted to the load of the second blockchain node itself, thereby improving the resource utilization efficiency of each second blockchain node and maximizing Therefore, the response speed of each second blockchain node to the data synchronization request message is improved, thereby improving the efficiency of data synchronization.
  • Fig. 6 is a flowchart of an example of the adjustment process of the data set to be synchronized in the data synchronization method according to an embodiment of the present specification.
  • the response result of each second blockchain node for the corresponding data synchronization request message is obtained.
  • the response result can be the response speed of the second blockchain node to the corresponding data to be synchronized, the amount of data to be synchronized received from the second blockchain node, or the amount of data received within a predetermined period of time after the data synchronization message is sent. The number of data received to be synchronized.
  • each data set to be synchronized is adjusted based on the response result of the second blockchain node corresponding to each data set to be synchronized to the corresponding data synchronization request message. For example, a predetermined amount of data to be synchronized may be removed from the data set to be synchronized of the second blockchain node whose response time exceeds the first predetermined time. Then, the removed data to be synchronized can be added to the to-be-synchronized data set of the second blockchain node whose response time is lower than the second predetermined time. It is also possible to reduce the number of data to be synchronized in the data set to be synchronized for the second blockchain node when the amount of data to be synchronized received from the second blockchain node is lower than the predetermined amount.
  • the data synchronization load allocated to each second blockchain node can be adjusted according to the response result of the second blockchain node during the data synchronization process, so that the waiting time allocated to each second blockchain node can be adjusted.
  • the amount of synchronized data is adapted to the real-time load of each second blockchain node to improve the efficiency of data synchronization.
  • Fig. 7 is a structural block diagram of a data synchronization device according to an embodiment of the present specification.
  • the data synchronization apparatus 700 includes a to-be-synchronized data dividing unit 710, a to-be-synchronized data distributing unit 720, a data synchronization request sending unit 730, and a to-be-synchronized data acquiring unit 740.
  • the to-be-synchronized data dividing unit 710 divides each to-be-synchronized data of the first blockchain node into multiple to-be-synchronized data sets.
  • the to-be-synchronized data splitting unit 710 may split each to-be-synchronized data into multiple to-be-synchronized data sets based on the block chain node list information in the blockchain system.
  • the to-be-synchronized data distribution unit 720 distributes multiple to-be-synchronized data sets to multiple second blockchain nodes.
  • the data synchronization request sending unit 730 sends a data synchronization request message to the second blockchain node corresponding to each data set to be synchronized, so as to request to obtain the data to be synchronized in the data set to be synchronized.
  • the to-be-synchronized data obtaining unit 740 obtains the to-be-synchronized data in the corresponding to-be-synchronized data set from the second blockchain node corresponding to each to-be-synchronized data set.
  • the data synchronization device 700 may further include a data set adjustment unit to be synchronized.
  • the to-be-synchronized data set adjustment unit After sending the data synchronization request message to the second blockchain node corresponding to each data set to be synchronized, the to-be-synchronized data set adjustment unit responds to the corresponding data synchronization request message based on the second blockchain node corresponding to each data set to be synchronized According to the response result, adjust each data set to be synchronized.
  • FIG. 8 is a structural block diagram of an example of a data dividing unit to be synchronized in the data synchronization device shown in FIG. 7.
  • the to-be-synchronized data segmentation unit 710 includes a load information acquisition module 711 and a to-be-synchronized data segmentation module 712.
  • the load information acquiring module 711 acquires load information of multiple second blockchain nodes.
  • the to-be-synchronized data segmentation module 712 divides each to-be-synchronized data into multiple to-be-synchronized data sets based on the load information of the multiple second blockchain nodes.
  • the data synchronization device in the embodiments of this specification may be implemented by hardware, or may be implemented by software or a combination of hardware and software.
  • the various embodiments in this specification are described in a progressive manner, and the same or similar parts among the various embodiments are referred to each other.
  • the data synchronization device in the embodiments of this specification may be implemented by hardware, or may be implemented by software or a combination of hardware and software. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the memory into the memory through the processor of the device where it is located. In the embodiment of the present specification, the device for generating the blockchain can be realized by using a computing device, for example.
  • Fig. 9 is a structural block diagram of a computing device for a data synchronization method according to an embodiment of the present specification.
  • the computing device 900 includes a processor 910, a memory 920, a memory 930, a communication interface 940, and an internal bus 950, and the processor 910, a memory (for example, a non-volatile memory) 920, a memory 930, and a communication interface 940 are connected together via a bus 950.
  • the computing device 900 may include at least one processor 910 that executes at least one computer-readable instruction (ie, the aforementioned Elements implemented in software).
  • computer-executable instructions are stored in the memory 920, which, when executed, cause at least one processor 910 to: divide each data to be synchronized of the first blockchain node into multiple data sets to be synchronized; The multiple data sets to be synchronized are allocated to multiple second blockchain nodes; a data synchronization request message is sent to the second blockchain nodes corresponding to each data set to be synchronized to request to obtain the data sets to be synchronized. Synchronizing data; and obtaining the data to be synchronized in the corresponding data set to be synchronized from the second blockchain node corresponding to each data set to be synchronized.
  • a program product such as a non-transitory machine-readable medium.
  • the non-transitory machine-readable medium may have instructions (that is, the above-mentioned elements implemented in the form of software), which when executed by a machine, cause the machine to execute the above described in conjunction with FIGS. 1-8 in the various embodiments of the embodiments of this specification.
  • instructions that is, the above-mentioned elements implemented in the form of software
  • a system or device equipped with a readable storage medium may be provided, and the software program code for realizing the function of any one of the above-mentioned embodiments is stored on the readable storage medium, and the computer or device of the system or device The processor reads and executes the instructions stored in the readable storage medium.
  • the program code itself read from the readable medium can implement the function of any one of the above embodiments, so the machine readable code and the readable storage medium storing the machine readable code constitute the present invention a part of.
  • Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tape, Volatile memory card and ROM.
  • the program code can be downloaded from the server computer or the cloud via the communication network.
  • the device structure described in the foregoing embodiments may be a physical structure or a logical structure, that is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or may be implemented by multiple physical entities. Some components in independent devices are implemented together.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A data synchronization method for blockchain nodes, comprising: segmenting each piece of data to be synchronized of a first blockchain node into a plurality of data sets to be synchronized (402); allocating the plurality of data sets to be synchronized to a plurality of second blockchain nodes (406); sending a data synchronization request message to the second blockchain node corresponding to each data set to be synchronized, so as to request to obtain the data to be synchronized in the data set to be synchronized (408); and obtaining, from the second blockchain node corresponding to each data set to be synchronized, the data to be synchronized corresponding to the data set to be synchronized (410).

Description

用于区块链节点的数据同步方法及装置Data synchronization method and device for blockchain nodes 技术领域Technical field
本说明书实施例涉及区块链技术领域,具体地,涉及用于区块链节点的数据同步方法及装置。The embodiments of this specification relate to the field of blockchain technology, in particular, to a data synchronization method and device for blockchain nodes.
背景技术Background technique
区块链系统是一种去中心化的、由多个节点参与的分布式数据存储系统。数据一旦被写入每个节点上的区块链,一方面,意味着数据在区块链网络中被公开,另一方面,写入区块链的数据也难以被删除与篡改。此外,中心化设备也可以采用类似于区块链存储(可以视为中心化的区块链存储)的方式对数据进行存储。The blockchain system is a decentralized distributed data storage system involving multiple nodes. Once data is written to the blockchain on each node, on the one hand, it means that the data is disclosed in the blockchain network. On the other hand, the data written to the blockchain is also difficult to delete and tamper with. In addition, centralized devices can also store data in a manner similar to blockchain storage (which can be regarded as centralized blockchain storage).
区块链系统中通常存在多个参与节点(区块链节点)。已有参与节点之间通过共识协议来确保各自数据的一致性。但是,当出现参与节点出现故障、新参与节点加入或者其他各种原因时,可能导致某参与节点的数据落后于其它正常的参与节点。因而,区块链系统需要通过数据同步协议,来确保落后的参与节点能够使本地所维护的数据追赶上其它正常参与节点,从而参与到正常的共识过程中。当某参与节点发现自己所维护的数据落后于其它正常节点时,可以发起数据同步过程,即向正常参与节点请求其缺少的数据。正常节点在接收到数据请求时,可以将落后的参与节点所请求的数据包括在应答消息中发送给落后参与节点。There are usually multiple participating nodes (blockchain nodes) in a blockchain system. There are consensus protocols between participating nodes to ensure the consistency of their respective data. However, when a participating node fails, a new participating node joins, or various other reasons, the data of a certain participating node may lag behind other normal participating nodes. Therefore, the blockchain system needs to use a data synchronization protocol to ensure that the backward participating nodes can make the locally maintained data catch up with other normal participating nodes, thereby participating in the normal consensus process. When a participating node finds that the data it maintains lags behind other normal nodes, it can initiate a data synchronization process, that is, request the normal participating nodes for the missing data. When the normal node receives the data request, it can include the data requested by the backward participating node in the response message and send it to the backward participating node.
发明内容Summary of the invention
鉴于上述,本说明书实施例提供了一种用于区块链节点的数据同步方法及装置。In view of the above, the embodiments of this specification provide a data synchronization method and device for blockchain nodes.
根据本说明书实施例的一个方面,提供了一种用于区块链节点的数据同步方法,包括:将第一区块链节点的各个待同步数据分割成多个待同步数据集合;将所述多个待同步数据集合分配给多个第二区块链节点;向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息,以请求获取该待同步数据集合中的待同步数据;以及从对应于各个待同步数据集合的第二区块链节点处获取对应待同步数据集合中的待同步数据。According to one aspect of the embodiments of this specification, a data synchronization method for blockchain nodes is provided, including: dividing each data to be synchronized of a first blockchain node into multiple data sets to be synchronized; Multiple data sets to be synchronized are allocated to multiple second blockchain nodes; a data synchronization request message is sent to the second blockchain nodes corresponding to each data set to be synchronized to request to obtain the data to be synchronized in the data set to be synchronized Data; and obtain the data to be synchronized in the corresponding data set to be synchronized from the second blockchain node corresponding to each data set to be synchronized.
可选的,在一个示例中,将第一区块链节点的各个待同步数据分割成多个待同步 数据集合可以包括:基于区块链系统中的区块链节点列表信息,将各个待同步数据分割成多个待同步数据集合。Optionally, in an example, dividing each data to be synchronized of the first blockchain node into multiple data sets to be synchronized may include: based on the block chain node list information in the blockchain system, dividing each data to be synchronized The data is divided into multiple data sets to be synchronized.
可选的,在一个示例中,将各个待同步数据分割成多个待同步数据集合可以包括:获取所述多个第二区块链节点的负载信息;以及基于所述多个第二区块链节点的负载信息来将各个待同步数据分割成多个待同步数据集合。Optionally, in an example, dividing each data to be synchronized into multiple data sets to be synchronized may include: obtaining load information of the multiple second blockchain nodes; and based on the multiple second blocks The load information of the link node divides each data to be synchronized into multiple data sets to be synchronized.
可选的,在一个示例中,在向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息之后,所述方法还可以包括:基于对应于各个待同步数据集合的第二区块链节点针对对应数据同步请求消息的响应结果,调整所述各个待同步数据集合。Optionally, in an example, after sending the data synchronization request message to the second blockchain node corresponding to each data set to be synchronized, the method may further include: based on the second block chain node corresponding to each data set to be synchronized The blockchain node adjusts the respective data sets to be synchronized according to the response result of the corresponding data synchronization request message.
可选的,在一个示例中,所述响应结果可以包括:所述第二区块链节点针对对应数据同步请求消息的响应速度;和/或从所述第二区块链节点所接收到的待同步数据数量。Optionally, in an example, the response result may include: the response speed of the second blockchain node to the corresponding data synchronization request message; and/or the response speed received from the second blockchain node The amount of data to be synchronized.
可选的,在一个示例中,所述各个待同步数据可以包括待同步区块数据。Optionally, in an example, the respective data to be synchronized may include block data to be synchronized.
根据本公开的另一方面,还提供一种用于区块链节点的数据同步装置,包括:待同步数据分割单元,将第一区块链节点的各个待同步数据分割成多个待同步数据集合;待同步数据分配单元,将所述多个待同步数据集合分配给多个第二区块链节点;数据同步请求发送单元,向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息,以请求获取该待同步数据集合中的待同步数据;以及待同步数据获取单元,从对应于各个待同步数据集合的第二区块链节点处获取对应待同步数据集合中的待同步数据。According to another aspect of the present disclosure, there is also provided a data synchronization device for blockchain nodes, including: a data segmentation unit to be synchronized, which divides each data to be synchronized of the first blockchain node into a plurality of data to be synchronized Collection; a data allocation unit to be synchronized, which allocates the multiple data sets to be synchronized to a plurality of second blockchain nodes; a data synchronization request sending unit, which sends to the second blockchain node corresponding to each data set to be synchronized A data synchronization request message to request to obtain the data to be synchronized in the to-be-synchronized data set; and the to-be-synchronized data acquisition unit obtains the corresponding data in the to-be-synchronized data set from the second blockchain node corresponding to each to-be-synchronized data set Data to be synchronized.
可选的,在一个示例中,所述待同步数据分割单元基于区块链系统中的区块链节点列表信息,将各个待同步数据分割成多个待同步数据集合。Optionally, in an example, the to-be-synchronized data splitting unit splits each to-be-synchronized data into multiple to-be-synchronized data sets based on block chain node list information in the blockchain system.
可选的,在一个示例中,所述待同步数据分割单元可以包括:负载信息获取模块,获取所述多个第二区块链节点的负载信息;以及待同步数据分割模块,基于所述多个第二区块链节点的负载信息来将各个待同步数据分割成多个待同步数据集合。Optionally, in an example, the to-be-synchronized data segmentation unit may include: a load information acquisition module that acquires load information of the multiple second blockchain nodes; and a to-be-synchronized data segmentation module, based on the multiple The load information of the second blockchain node divides each data to be synchronized into multiple data sets to be synchronized.
可选的,在一个示例中,所述装置还可以包括:待同步数据集合调整单元,在向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息之后,基于对应于各个待同步数据集合的第二区块链节点针对对应数据同步请求消息的响应结果,调整所述各个待同步数据集合。Optionally, in an example, the device may further include: a to-be-synchronized data set adjustment unit, after sending a data synchronization request message to the second blockchain node corresponding to each to-be-synchronized data set, based on the data synchronization request message corresponding to each The second blockchain node of the data set to be synchronized adjusts the respective data sets to be synchronized according to the response result of the corresponding data synchronization request message.
根据本说明书实施例的另一方面,还提供一种计算设备,包括:至少一个处理器;以及存储器,所述存储器存储指令,当所述指令被所述至少一个处理器执行时,使得所述至少一个处理器执行如上所述的方法。According to another aspect of the embodiments of this specification, there is also provided a computing device, including: at least one processor; and a memory, the memory stores instructions, and when the instructions are executed by the at least one processor, the At least one processor executes the method as described above.
根据本说明书实施例的另一方面,还提供一种非暂时性机器可读存储介质,其存储有可执行指令,所述指令当被执行时使得所述机器执行如上所述的方法。According to another aspect of the embodiments of the present specification, there is also provided a non-transitory machine-readable storage medium, which stores executable instructions, which when executed cause the machine to execute the method as described above.
利用本说明书实施例的方法和装置,通过将待同步数据分割成多个待同步数据集合,并将多个待同步数据集合分配给多个第二区块链节点,能够将数据同步过程所占用的资源分散给多个第二区块链节点,避免使得单个第二区块链节点的负载过高。Using the method and device of the embodiment of this specification, by dividing the data to be synchronized into multiple data sets to be synchronized, and assigning the multiple data sets to be synchronized to multiple second blockchain nodes, the data synchronization process can be occupied. Distribute the resources of multiple second blockchain nodes to avoid overloading a single second blockchain node.
附图说明Description of the drawings
通过参照下面的附图,可以实现对于本说明书实施例内容的本质和优点的进一步理解。在附图中,类似组件或特征可以具有相同的附图标记。附图是用来提供对本发明实施例的进一步理解,并且构成说明书的一部分,与下面的具体实施方式一起用于解释本说明书实施例的实施例,但并不构成对本说明书实施例的实施例的限制。在附图中:By referring to the following drawings, a further understanding of the nature and advantages of the contents of the embodiments of this specification can be achieved. In the drawings, similar components or features may have the same reference signs. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention, and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the embodiments of the specification, but do not constitute an example of the embodiments of the specification. limit. In the attached picture:
图1示出了可用于执行根据本说明书实施例的数据同步方法的环境的示例的示意图;Fig. 1 shows a schematic diagram of an example of an environment that can be used to execute a data synchronization method according to an embodiment of the present specification;
图2示出了执行根据本说明书实施例的数据同步方法的系统架构的示例的示意图;Fig. 2 shows a schematic diagram of an example of a system architecture for executing a data synchronization method according to an embodiment of the present specification;
图3是用于说明根据本说明书实施例的数据同步方法的示例性应用场景的流程图;Fig. 3 is a flowchart for explaining an exemplary application scenario of a data synchronization method according to an embodiment of the present specification;
图4是根据本说明书的一个实施例的数据同步方法的流程图;Fig. 4 is a flowchart of a data synchronization method according to an embodiment of the present specification;
图5是根据本说明书的一个实施例的数据同步方法中的待同步数据分割过程的一个示例的流程图;Fig. 5 is a flowchart of an example of a data segmentation process to be synchronized in a data synchronization method according to an embodiment of the present specification;
图6是根据本说明书的一个实施例的数同步方法中的待同步数据集合调整过程的一个示例的流程图;6 is a flowchart of an example of the adjustment process of the data set to be synchronized in the data synchronization method according to an embodiment of the present specification;
图7是根据本说明书的一个实施例的数据同步装置的结构框图;Fig. 7 is a structural block diagram of a data synchronization device according to an embodiment of the present specification;
图8是图7所示的数据同步装置中的待同步数据分割单元的一个示例的结构框图;以及FIG. 8 is a structural block diagram of an example of a data division unit to be synchronized in the data synchronization device shown in FIG. 7; and
图9是根据本说明书实施例的一个实施例的用于数据同步方法的计算设备的结构框图。Fig. 9 is a structural block diagram of a computing device for a data synchronization method according to an embodiment of the present specification.
具体实施方式Detailed ways
以下将参考示例实施方式讨论本文描述的主题。应该理解,讨论这些实施方式只 是为了使得本领域技术人员能够更好地理解从而实现本文描述的主题,并非是对权利要求书中所阐述的保护范围、适用性或者示例的限制。可以在不脱离本说明书实施例内容的保护范围的情况下,对所讨论的元素的功能和排列进行改变。各个示例可以根据需要,省略、替代或者添加各种过程或组件。另外,相对一些示例所描述的特征在其它例子中也可以进行组合。The subject described herein will be discussed below with reference to example embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and realize the subject described herein, and is not to limit the scope of protection, applicability, or examples set forth in the claims. The function and arrangement of the discussed elements can be changed without departing from the protection scope of the content of the embodiments of this specification. Various examples can omit, substitute, or add various procedures or components as needed. In addition, features described with respect to some examples can also be combined in other examples.
如本文中使用的,术语“包括”及其变型表示开放的术语,含义是“包括但不限于”。术语“基于”表示“至少部分地基于”。术语“一个实施例”和“一实施例”表示“至少一个实施例”。术语“另一个实施例”表示“至少一个其他实施例”。术语“第一”、“第二”等可以指代不同的或相同的对象。下面可以包括其他的定义,无论是明确的还是隐含的。除非上下文中明确地指明,否则一个术语的定义在整个说明书中是一致的。As used herein, the term "including" and its variations mean open terms, meaning "including but not limited to". The term "based on" means "based at least in part on." The terms "one embodiment" and "an embodiment" mean "at least one embodiment." The term "another embodiment" means "at least one other embodiment." The terms "first", "second", etc. may refer to different or the same objects. Other definitions can be included below, whether explicit or implicit. Unless clearly indicated in the context, the definition of a term is consistent throughout the specification.
现在结合附图来描述本说明书实施例的数据同步方法及装置。The data synchronization method and device of the embodiments of this specification will now be described with reference to the accompanying drawings.
区块链是一种按照时间顺序来将数据区块顺序相连组合而成的链式数据结构,并且以密码学方式保证数据区块不可篡改和不可伪造。区块链包括一个或多个区块。区块链中的每个区块通过包括该区块链中紧接其之前的前一个区块的加密散列而链接到该前一个区块。每个区块还包括时间戳、该区块的加密哈希以及一个或多个交易(transaction)。对已经被区块链网络的节点验证的交易进行哈希处理并形成Merkle树。在Merkle树中,对叶节点处的数据进行哈希处理,并且针对Merkle树的每个分支,在该分支的根处级联该分支的所有哈希值。针对Merkle树执行上述处理,直到整个Merkle树的根节点。Merkle树的根节点存储代表该Merkle树中的所有数据的哈希值。当一个哈希值声称是Merkle树中存储的交易时,可以通过判断该哈希值是否与Merkle树的结构一致来进行快速验证。Blockchain is a chain data structure that connects and combines data blocks sequentially in chronological order, and cryptographically ensures that the data blocks cannot be tampered with or forged. The blockchain includes one or more blocks. Each block in the blockchain is linked to the previous block by including the encrypted hash of the immediately preceding block in the blockchain. Each block also includes a timestamp, a cryptographic hash of the block, and one or more transactions. The transaction that has been verified by the nodes of the blockchain network is hashed and a Merkle tree is formed. In the Merkle tree, the data at the leaf nodes is hashed, and for each branch of the Merkle tree, all the hash values of the branch are concatenated at the root of the branch. The above processing is performed on the Merkle tree until the root node of the entire Merkle tree. The root node of the Merkle tree stores hash values representing all data in the Merkle tree. When a hash value claims to be a transaction stored in the Merkle tree, it can be quickly verified by judging whether the hash value is consistent with the structure of the Merkle tree.
区块链是用于存储交易的数据结构。区块链网络是用于管理、更新和维护一个或多个区块链结构的计算节点网络。如上所述,区块链网络可以包括公有区块链网络、私有区块链网络或联盟区块链网络。Blockchain is a data structure used to store transactions. The blockchain network is a network of computing nodes used to manage, update and maintain one or more blockchain structures. As mentioned above, the blockchain network can include a public blockchain network, a private blockchain network, or a consortium blockchain network.
在公有区块链网络中,共识过程由共识网络的节点控制。例如,在公有区块链网络中可以存在成千上万个实体协作处理,每个实体操作该公有区块链网络中的至少一个节点。因此,公有区块链网络可以被认为是参与实体的公有网络。在一些示例中,大多数实体(节点)必须按序对每个区块进行签名,并且将签名后的区块添加到区块链网络的区块链中。公有区块链网络的示例可以包括特定对等支付网络。此外,术语“区块链” 不特别指代任何特定的区块链。In the public blockchain network, the consensus process is controlled by the nodes of the consensus network. For example, there may be thousands of entities in a public blockchain network for collaborative processing, and each entity operates at least one node in the public blockchain network. Therefore, the public blockchain network can be considered as a public network of participating entities. In some examples, most entities (nodes) must sign each block in sequence, and add the signed block to the blockchain of the blockchain network. Examples of public blockchain networks may include specific peer-to-peer payment networks. In addition, the term "blockchain" does not specifically refer to any particular blockchain.
公有区块链网络支持公有交易。公有交易在公有区块链网络内的所有节点之间共享,并且存储在全局区块链中。全局区块链是指跨所有节点复制的区块链。为了达成共识(例如,同意向区块链添加区块),在公有区块链网络内实现共识协议。共识协议的示例包括但不限于:工作量证明(POW,proof-of-work),权益证明(POS,proof-of-stake)和权威证明(POA,proof-of-authority)。在本说明书实施例中,采用POW作为非限制性示例。The public blockchain network supports public transactions. Public transactions are shared among all nodes in the public blockchain network and stored in the global blockchain. A global blockchain refers to a blockchain that is replicated across all nodes. In order to reach a consensus (for example, agree to add a block to the blockchain), a consensus agreement is implemented in the public blockchain network. Examples of consensus protocols include but are not limited to: proof-of-work (POW), proof-of-stake (POS), and proof-of-authority (POA). In the embodiments of this specification, POW is used as a non-limiting example.
私有区块链网络被提供来用于特定实体。私有区块链网络中的各个节点的读写权限被严格控制。因此,私有区块链网络通常也称为许可网络,其对允许谁参与网络以及的网络参与水平(例如,仅在某些交易情形下)进行限制。在私有区块链网络中,可以使用各种类型的访问控制机制(例如,现有参与方对添加新实体进行投票,监管机构控制许可等)。Private blockchain networks are provided for specific entities. The read and write permissions of each node in the private blockchain network are strictly controlled. Therefore, a private blockchain network is usually also called a permissioned network, which restricts who is allowed to participate in the network and the level of network participation (for example, only in certain transaction situations). In a private blockchain network, various types of access control mechanisms can be used (for example, existing participants vote to add new entities, regulatory agencies control permissions, etc.).
联盟区块链网络在参与实体之间是私有的。在联盟区块链网络中,共识过程由授权节点控制。例如,由若干个(例如,10个)实体(例如,金融机构,保险公司)组成的联盟可以操作联盟区块链网络,每个实体操作该联盟区块链网络中的至少一个节点。因此,联盟区块链网络可以被认为是参与实体的私有网络。在一些示例中,每个参与实体(节点)必须按序对每个区块进行签名,并将该区块添加到区块链。在一些示例中,可以由参与实体(节点)的子集(例如,至少7个实体)来对每个区块进行签名,并将该区块添加到区块链。The alliance blockchain network is private among participating entities. In the alliance blockchain network, the consensus process is controlled by authorized nodes. For example, a consortium composed of several (for example, 10) entities (for example, financial institutions, insurance companies) can operate a consortium blockchain network, and each entity operates at least one node in the consortium blockchain network. Therefore, the consortium blockchain network can be considered as a private network of participating entities. In some examples, each participating entity (node) must sign each block in sequence and add the block to the blockchain. In some examples, each block may be signed by a subset of participating entities (nodes) (for example, at least 7 entities), and the block may be added to the blockchain.
在本说明书实施例中参考联盟区块链网络来详细描述本说明书实施例的实施例。然而,可以预期,本说明书实施例的实施例可以在任何适合的区块链网络中实现。In the embodiments of this specification, the embodiments of the embodiments of this specification are described in detail with reference to the alliance blockchain network. However, it is expected that the embodiments of the embodiments of the present specification can be implemented in any suitable blockchain network.
区块链是防篡改的共享数字分类账,其在公有或私有对等网络中记录交易。分类账被分发到网络中的所有成员节点,并且网络中发生的资产交易历史记录被永久记录在区块中。Blockchain is a tamper-proof shared digital ledger that records transactions in a public or private peer-to-peer network. The ledger is distributed to all member nodes in the network, and the history of asset transactions that occurred in the network is permanently recorded in the block.
共识机制确保分布式区块链网络中的所有网络节点按照相同的顺序执行交易,并且随后写入相同的分类账。共识模型旨在解决拜占庭问题。在拜占庭问题中,分布式区块链网络中的比如服务器或网络节点的组件可能会出现故障,或者故意向其他节点传播错误的信息。由于其他网络节点需要首先就哪个网络节点首先失败达成共识,从而其他网络节点很难将该组件声明失败并将其排除出区块链网络。The consensus mechanism ensures that all network nodes in the distributed blockchain network execute transactions in the same order and then write to the same ledger. The consensus model aims to solve the Byzantine problem. In the Byzantine problem, components such as servers or network nodes in the distributed blockchain network may malfunction or deliberately spread wrong information to other nodes. Since other network nodes need to reach a consensus on which network node fails first, it is difficult for other network nodes to declare the component failure and exclude it from the blockchain network.
图1示出了可用于执行根据本说明书实施例的数据同步方法的环境100的示例的示意图。在一些示例中,环境100使得实体能够参与区块链网络102。如图1所示,环境100包括网络104、和计算设备/系统106、108。在一些示例中,网络104可以包括局域网(LAN),广域网(WAN),因特网或其组合,并且连接网站、用户设备(例如,计算设备)和后端系统。在一些示例中,可以通过有线和/或无线通信链路来访问网络104。在一些示例中,计算设备/系统106、108通过网络104相互通信,以及通过网络104实现与区块链网络102之间的通信,以及区块链网络102中的节点(或,节点设备)通过网络104来进行通信。通常,网络104表示一个或多个通信网络。在一些情况下,计算设备/系统106、108可以是云计算系统(未示出)的节点,或者每个计算设备/系统106、108可以是单独的云计算系统,其包括通过网络104互连的多个计算机并且用作分布式处理系统。FIG. 1 shows a schematic diagram of an example of an environment 100 that can be used to execute a data synchronization method according to an embodiment of the present specification. In some examples, the environment 100 enables entities to participate in the blockchain network 102. As shown in FIG. 1, the environment 100 includes a network 104, and computing devices/ systems 106, 108. In some examples, the network 104 may include a local area network (LAN), a wide area network (WAN), the Internet, or a combination thereof, and connect a website, a user device (for example, a computing device), and a back-end system. In some examples, the network 104 may be accessed through a wired and/or wireless communication link. In some examples, the computing devices/ systems 106 and 108 communicate with each other through the network 104, and communicate with the blockchain network 102 through the network 104, and the nodes (or node devices) in the blockchain network 102 pass through The network 104 communicates. Generally, the network 104 represents one or more communication networks. In some cases, the computing devices/ systems 106, 108 may be nodes of a cloud computing system (not shown), or each computing device/ system 106, 108 may be a separate cloud computing system, including interconnection through the network 104 Multiple computers and used as a distributed processing system.
在所说明的示例中,计算设备/系统106、108中的每个可以包括能够参与作为区块链网络102中的节点的任何合适的计算系统。计算设备/系统的示例包括但不限于,服务器,台式计算机,笔记本电脑,平板电脑设备和智能手机等。在一些示例中,计算设备/系统106、108上可以安装有用于与区块链网络102交互的一个或多个计算机实现的服务。例如,计算设备/系统106可以上可以安装有第一实体(例如,用户A)的服务,比如,第一实体用于管理其与一个或多个其他实体(例如,其他用户)的交易的交易管理系统。计算设备/系统108可以上可以安装有第二实体(例如,用户B)的服务,比如,第二实体用于管理其与一个或多个其他实体(例如,其他用户)的交易的交易管理系统。在图1的示例中,区块链网络102被表示为节点的对等网络,并且计算设备/系统106、108分别作为参与区块链网络102的第一实体和第二实体的节点。In the illustrated example, each of the computing devices/ systems 106, 108 may include any suitable computing system capable of participating as a node in the blockchain network 102. Examples of computing devices/systems include, but are not limited to, servers, desktop computers, laptops, tablet devices, smart phones, etc. In some examples, one or more computer-implemented services for interacting with the blockchain network 102 may be installed on the computing device/ system 106, 108. For example, the computing device/system 106 may be installed with the services of the first entity (for example, user A), for example, the first entity is used to manage transactions with one or more other entities (for example, other users). Management system. The computing device/system 108 may be installed with services of a second entity (for example, user B), for example, a transaction management system used by the second entity to manage transactions with one or more other entities (for example, other users) . In the example of FIG. 1, the blockchain network 102 is represented as a peer-to-peer network of nodes, and the computing devices/ systems 106, 108 serve as the nodes of the first entity and the second entity participating in the blockchain network 102, respectively.
图2示出了执行根据本说明书实施例的数据同步方法的系统架构200的示例的示意图。系统架构200的示例包括分别与参与方A,参与方B和参与方C对应的参与方系统202、204、206。每个参与方(例如,用户,企业)参与被提供来作为对等网络的区块链网络212。区块链网络212包括多个节点214,其中,节点214中的至少一些节点在区块链216中记录信息,并且所记录的信息不可更改。尽管在区块链网络212内示意性地示出了单个区块链216,但是可以提供区块链216的多个副本,并且在区块链网络212中维护多个副本,如稍后详细描述的。FIG. 2 shows a schematic diagram of an example of a system architecture 200 for executing the data synchronization method according to an embodiment of the present specification. An example of the system architecture 200 includes the participant systems 202, 204, and 206 corresponding to the participant A, the participant B, and the participant C, respectively. Each participant (eg, user, enterprise) participates in the blockchain network 212 provided as a peer-to-peer network. The blockchain network 212 includes a plurality of nodes 214, wherein at least some of the nodes 214 record information in the blockchain 216, and the recorded information cannot be changed. Although a single blockchain 216 is schematically shown within the blockchain network 212, multiple copies of the blockchain 216 may be provided, and multiple copies are maintained in the blockchain network 212, as described in detail later of.
在所示出的示例中,每个参与方系统202、204、206分别由参与方A,参与方B和参与方C提供,或者被提供来作为参与方A,参与方B和参与方C,并且充当区块链 网络212内的对应节点214。如这里所使用的,节点通常是指连接到区块链网络212的单个系统(例如,计算机,服务器),并且使得相应的参与方能够参与区块链网络。在图2示出的示例中,参与方对应于每个节点214。然而,一个参与方可以操作区块链网络212内的多个节点214,和/或多个参与方可以共享单个节点214。在一些示例中,参与方系统202、204、206使用协议(例如,超文本传输协议安全(HTTPS))和/或使用远程过程调用(RPC)来与区块链网络212通信,或者通过区块链网络212进行通信。In the example shown, each participant system 202, 204, 206 is provided by participant A, participant B, and participant C, or provided as participant A, participant B, and participant C, respectively, And it serves as the corresponding node 214 in the blockchain network 212. As used herein, a node generally refers to a single system (eg, computer, server) connected to the blockchain network 212 and enables corresponding participants to participate in the blockchain network. In the example shown in FIG. 2, the participant corresponds to each node 214. However, one participant can operate multiple nodes 214 within the blockchain network 212, and/or multiple participants can share a single node 214. In some examples, the participant systems 202, 204, 206 use protocols (e.g., Hypertext Transfer Protocol Security (HTTPS)) and/or use remote procedure calls (RPC) to communicate with the blockchain network 212, or through the blockchain The chain network 212 communicates.
节点214在区块链网络212的参与度可以不同。例如,一些节点214可以参与共识过程(例如,作为将区块添加到区块链216的矿工节点),而其他节点214不参与共识过程。作为另一示例,一些节点214存储区块链216的完整副本,而其他节点214仅存储区块链216的部分副本。在图2的示例中,参与方系统202、204、206各自存储区块链216的完整副本216'、216”、216”'。The degree of participation of the node 214 in the blockchain network 212 may vary. For example, some nodes 214 may participate in the consensus process (eg, as miner nodes that add blocks to the blockchain 216), while other nodes 214 do not participate in the consensus process. As another example, some nodes 214 store a complete copy of the blockchain 216, while other nodes 214 only store a partial copy of the blockchain 216. In the example of Figure 2, the participant systems 202, 204, 206 each store a complete copy of the blockchain 216 216', 216", 216"'.
区块链(例如,图2中的区块链216)由一连串的区块组成,每个区块存储数据。数据的示例可以包括表示两个或更多参与方之间的交易的交易数据。在本说明书实施例中,交易被使用来作为非限制性示例,可以预期的是,任何适当的数据都可以存储在区块链中(例如,文档,图像,视频,音频)。交易的示例可以包括但不限于交换有价值的东西(例如,资产,产品,服务和货币等)。交易数据被不可更改地存储在区块链中。A blockchain (for example, the blockchain 216 in FIG. 2) is composed of a series of blocks, and each block stores data. Examples of data may include transaction data representing transactions between two or more participants. In the embodiments of this specification, transactions are used as a non-limiting example, and it is expected that any appropriate data can be stored in the blockchain (for example, documents, images, videos, audios). Examples of transactions may include, but are not limited to, the exchange of valuable things (for example, assets, products, services, currency, etc.). Transaction data is stored immutably in the blockchain.
在存储在区块中之前,对交易数据进行哈希处理。哈希处理是将(作为字符串数据提供的)交易数据转换为固定长度的哈希值(也被作为字符串数据提供)的过程。通过对交易数据进行哈希处理后,即使交易数据出现轻微更改,也会导致得到完全不同的哈希值。哈希值通常是通过使用哈希函数来对交易数据进行哈希处理而生成的。哈希函数的示例包括但不限于安全散列算法(SHA)-256,其输出256比特的哈希值。Before storing in the block, hash the transaction data. Hashing is the process of converting transaction data (provided as string data) into a fixed-length hash value (also provided as string data). After the transaction data is hashed, even a slight change in the transaction data will result in a completely different hash value. The hash value is usually generated by hashing transaction data using a hash function. Examples of hash functions include, but are not limited to, Secure Hash Algorithm (SHA)-256, which outputs a 256-bit hash value.
多个交易的交易数据可以在被哈希化之后存储在区块中。例如,对两个交易数据进行哈希处理得到两个哈希值,然后,对所得到的两个哈希值再次进行哈希处理以得到另一哈希值。重复该过程,直到对于要存储在区块中的所有交易,得到单个哈希值。该哈希值被称为Merkle根哈希,并且被存储在区块的头部。任何交易的更改都会导致其哈希值发生变化,最终导致Merkle根哈希值发生变化。The transaction data of multiple transactions can be stored in the block after being hashed. For example, two transaction data are hashed to obtain two hash values, and then the two obtained hash values are hashed again to obtain another hash value. This process is repeated until a single hash value is obtained for all transactions to be stored in the block. This hash value is called the Merkle root hash and is stored at the head of the block. Any change in the transaction will cause its hash value to change, and eventually the Merkle root hash value will change.
通过共识协议来将区块添加到区块链中。区块链网络中的多个节点参与共识协议,并且经过竞争之后将区块添加到区块链中。这样的节点被称为矿工节点(或记账节点)。以上介绍的POW用作非限制性示例。The block is added to the blockchain through a consensus protocol. Multiple nodes in the blockchain network participate in the consensus protocol and add blocks to the blockchain after competition. Such nodes are called miner nodes (or accounting nodes). The POW introduced above serves as a non-limiting example.
矿工节点执行共识过程来将交易(所对应的区块)添加到区块链。虽然多个矿工节点参与共识过程,但只有一个矿工节点可以将区块写入区块链。也就是说,矿工节点在共识过程中竞争以将其区块添加到区块链中。更详细地,矿工节点周期性地从交易池中收集待处理的交易(例如,直到达到在区块中可以包括的交易数量的预定限制,如果有的话)。交易池包括来自区块链网络中的参与方的交易消息。矿工节点创建区块,并将交易添加到区块中。在将交易添加到区块之前,矿工节点检查待添加的交易中是否存在区块链的区块中具有的交易。如果该交易已被添加到另一个区块中,则该交易将被丢弃。Miner nodes perform a consensus process to add transactions (corresponding blocks) to the blockchain. Although multiple miner nodes participate in the consensus process, only one miner node can write a block to the blockchain. In other words, miner nodes compete in the consensus process to add their blocks to the blockchain. In more detail, the miner node periodically collects pending transactions from the transaction pool (for example, until a predetermined limit on the number of transactions that can be included in the block is reached, if any). The transaction pool includes transaction messages from participants in the blockchain network. Miner nodes create blocks and add transactions to the blocks. Before adding the transaction to the block, the miner node checks whether there is a transaction in the block of the blockchain among the transactions to be added. If the transaction has been added to another block, the transaction will be discarded.
矿工节点生成区块头,对区块中的所有交易进行哈希处理,并且成对地组合哈希值以生成进一步的哈希值,直到针对区块中的所有交易得到单个哈希值(Merkle根哈希)。然后,将Merkle根哈希添加到区块头中。矿工还确定区块链中的最新区块(即,添加到区块链的最后一个区块)的哈希值。矿工节点还可以在区块头中添加随机数值(noune值)和时间戳。在挖掘过程中,矿工节点尝试找到满足所需参数的哈希值。矿工节点不断更改nonce值,直到找到满足所需参数的哈希值。The miner node generates a block header, hashes all transactions in the block, and combines the hash values in pairs to generate further hash values until a single hash value (Merkle root) is obtained for all transactions in the block. Hash). Then, add the Merkle root hash to the block header. The miner also determines the hash value of the latest block in the blockchain (ie, the last block added to the blockchain). Miner nodes can also add random values (noune values) and timestamps to the block header. During the mining process, the miner node tries to find a hash value that meets the required parameters. The miner node keeps changing the nonce value until it finds a hash value that meets the required parameters.
区块链网络中的每个矿工都试图找到满足所需参数的哈希值,并且以这种方式彼此竞争。最终,一个矿工节点找到满足所需参数的哈希值,并将该哈希值通告给区块链网络中的所有其他矿工节点。其他矿工节点验证哈希值,如果确定为正确,则验证区块中的每个交易,接受该区块,并将该区块附加到它们的区块链副本中。以这种方式,区块链的全局状态在区块链网络内的所有矿工节点上达成一致。上述过程是POW共识协议。Every miner in the blockchain network tries to find a hash value that meets the required parameters and competes with each other in this way. Finally, a miner node finds a hash value that meets the required parameters and advertises the hash value to all other miner nodes in the blockchain network. Other miner nodes verify the hash value, and if it is determined to be correct, verify each transaction in the block, accept the block, and attach the block to their copy of the blockchain. In this way, the global state of the blockchain is agreed upon on all miner nodes within the blockchain network. The above process is a POW consensus protocol.
在图2所提供的示例中,参与方A想要向参与方B发送一定数量的资金。参与方A生成交易消息,并将交易消息发送到区块链网络,该交易消息被增加到交易池中。区块链网络中的每个矿工节点创建区块,并从交易池中获取交易,并将交易添加到区块。按照这种方式,参与方A所发布的交易被添加到矿工节点的区块中。In the example provided in Figure 2, participant A wants to send a certain amount of funds to participant B. Participant A generates a transaction message and sends the transaction message to the blockchain network, and the transaction message is added to the transaction pool. Each miner node in the blockchain network creates a block, obtains transactions from the transaction pool, and adds the transaction to the block. In this way, the transaction issued by participant A is added to the block of the miner node.
在一些区块链网络中,实施密码技术来维护交易的隐私性。例如,如果两个节点想要保持交易私密性,使得区块链网络中的其他节点不能获悉交易细节,则节点可以对交易数据进行加密处理。加密方法的示例包括但不限于对称加密和非对称加密。对称加密是指使用单个密钥进行加密(根据明文生成密文)和解密(根据密文生成明文)的加密过程。在对称加密中,多个节点可以使用相同的密钥,因此每个节点都可以对交易数据进行加密/解密。In some blockchain networks, cryptography is implemented to maintain the privacy of transactions. For example, if two nodes want to maintain the privacy of the transaction so that other nodes in the blockchain network cannot learn the details of the transaction, the node can encrypt the transaction data. Examples of encryption methods include, but are not limited to, symmetric encryption and asymmetric encryption. Symmetric encryption refers to the encryption process that uses a single key to encrypt (generate ciphertext based on plaintext) and decrypt (generate plaintext based on ciphertext). In symmetric encryption, multiple nodes can use the same key, so each node can encrypt/decrypt transaction data.
非对称加密是指使用密钥对来进行加密。每个密钥对包括私钥和公钥,私钥仅对于相应节点是已知的,并且公钥对于区块链网络中的任何或所有其他节点是已知的。节点可以使用另一个节点的公钥来加密数据,并且可以使用其他节点的私钥来解密经过加密的数据。例如,再次参考图1。参与方A可以使用参与方B的公钥来加密数据,并将加密数据发送给参与方B.参与方B可以使用其私钥来解密加密数据(密文)并提取原始数据(明文)。使用节点的公钥加密的消息,只能使用该节点的私钥解密。Asymmetric encryption refers to the use of key pairs for encryption. Each key pair includes a private key and a public key. The private key is only known to the corresponding node, and the public key is known to any or all other nodes in the blockchain network. A node can use another node's public key to encrypt data, and can use another node's private key to decrypt the encrypted data. For example, refer to Figure 1 again. Participant A can use the public key of participant B to encrypt data and send the encrypted data to participant B. Participant B can use its private key to decrypt the encrypted data (ciphertext) and extract the original data (plain text). Messages encrypted with the public key of the node can only be decrypted with the private key of the node.
非对称加密用于提供数字签名,这使得交易中的参与方能够确认交易中的其他参与方以及交易的有效性。例如,节点可以对消息进行数字签名,而另一个节点可以根据参与方A的数字签名确认消息是由该节点发送的。数字签名还可以用于确保消息在传输过程中不被篡改。例如,再次参考图1。参与方A将向参与方B发送消息。参与方A生成消息的哈希值,然后使用其私钥对哈希值进行加密来生成数字签名。参与方A将该数字签名附加到消息,并将具有数字签名的消息发送给参与方B。参与方B使用参与方A的公钥解密数字签名,从而解密出对应的哈希值。参与方B对所接收的消息进行哈希处理以得到另一哈希值,然后比较两个哈希值。如果哈希值相同,则参与方B可以确认该消息确实来自参与方A,并且未被篡改。Asymmetric encryption is used to provide digital signatures, which enables participants in a transaction to confirm other participants in the transaction and the validity of the transaction. For example, a node can digitally sign a message, and another node can confirm that the message was sent by the node based on the digital signature of participant A. Digital signatures can also be used to ensure that messages are not tampered with during transmission. For example, refer to Figure 1 again. Participant A will send a message to participant B. Participant A generates a hash value of the message, and then uses its private key to encrypt the hash value to generate a digital signature. Participant A attaches the digital signature to the message, and sends the message with the digital signature to participant B. Participant B uses the public key of participant A to decrypt the digital signature, thereby decrypting the corresponding hash value. Participant B hashes the received message to obtain another hash value, and then compares the two hash values. If the hash value is the same, participant B can confirm that the message is indeed from participant A and has not been tampered with.
图3是用于说明根据本说明书实施例的数据同步方法的示例性应用场景的流程图。Fig. 3 is a flowchart for explaining an exemplary application scenario of a data synchronization method according to an embodiment of the present specification.
如图3所示,在302,第一区块链节点可以向第二区块链节点发送最高区块请求消息,以请求确定第二区块链节点处所存储的最高区块信息。第一区块链节点可以是区块链系统中的任意参与节点,第二区块链节点可以是除第一区块链节点的任意参与节点。As shown in FIG. 3, at 302, the first blockchain node may send a highest block request message to the second blockchain node to request to determine the highest block information stored at the second blockchain node. The first blockchain node may be any participating node in the blockchain system, and the second blockchain node may be any participating node except the first blockchain node.
然后,在304,第二区块链节点可以响应于最高区块请求消息,向第一区块链节点发送本地存储的最高区块信息。Then, at 304, the second blockchain node may send the locally stored highest block information to the first blockchain node in response to the highest block request message.
在一个示例,区块链系统中的各个区块链节点可以周期性地向第二区块链节点广播最高区块请求消息。其它区块链节点在监听到最高区块请求消息时,可以将本地所存储的最高区块的块高发送给最高区块请求消息的发送方。块高用于指示各个区块在区块链中的顺序。例如,可以从创世区块(即区块链中的第一个区块)起顺序地为各个区块进行编号,该编号可以作为相应区块的块高。In an example, each blockchain node in the blockchain system may periodically broadcast the highest block request message to the second blockchain node. When other blockchain nodes monitor the highest block request message, they can send the block height of the highest block stored locally to the sender of the highest block request message. The block height is used to indicate the order of each block in the blockchain. For example, each block can be numbered sequentially from the genesis block (that is, the first block in the blockchain), and this number can be used as the block height of the corresponding block.
在另一示例中,各个区块链节点可以向其所信任的一个或多个第二区块链节点周期性地发送最高区块请求消息。第一区块链节点所信任的第二区块链节点可以基于第一区块链节点与各个第二区块链节点的交互历史数据来确定,例如可以选取消息响应延迟 最短的区块链节点或者从对方所接收的数据的验证通过率最高的区块链节点以作为信任节点。此外,还可以在本地维护信任节点信息,从而可以从信任节点信息中获取所信任的第二区块链节点。In another example, each blockchain node may periodically send the highest block request message to one or more second blockchain nodes that it trusts. The second blockchain node trusted by the first blockchain node can be determined based on the historical data of the interaction between the first blockchain node and each second blockchain node. For example, the blockchain node with the shortest message response delay can be selected Or the blockchain node with the highest verification pass rate of the data received from the other party is used as the trusted node. In addition, the trusted node information can also be maintained locally, so that the trusted second blockchain node can be obtained from the trusted node information.
第一区块链节点在接收到第二区块链节点所发送的最高区块信息时,在306,基于所收到的最高区块信息和第一区块链节点处的最高区块信息,来确定本地的区块数据是否落后于第二区块链节点。在本说明书中,数据落后是指,针对某一类数据(如本示例中的区块数据),某区块链节点处存储的该类数据相对于其它区块链节点出现缺失。例如,如果第二区块链节点的最高区块信息表明第二区块链节点处的最高区块的块高为100,而第一区块链节点处的最高区块的块高为80,则表明第一区块链节点处的区块数据落后于第二区块链节点。在本说明书中,本地所拥有的某类数据相于出其它区块链节点出现缺失的区块链节点可以被称为落后节点。落后节点可以是已加入区块链网络但由于故障或网络延迟等原因出现数据缺失的区块链节点,还可以是新加入区块链网络的节点。When the first blockchain node receives the highest block information sent by the second blockchain node, at 306, based on the highest block information received and the highest block information at the first blockchain node, To determine whether the local block data lags behind the second blockchain node. In this specification, data lag means that for a certain type of data (such as block data in this example), the type of data stored at a certain blockchain node is missing relative to other blockchain nodes. For example, if the highest block information of the second blockchain node indicates that the block height of the highest block at the second blockchain node is 100, and the block height of the highest block at the first blockchain node is 80, It indicates that the block data at the first blockchain node lags behind the second blockchain node. In this specification, a blockchain node whose locally owned certain type of data is missing from other blockchain nodes can be referred to as a backward node. Lagging nodes can be blockchain nodes that have joined the blockchain network but have missing data due to failures or network delays, or they can be new nodes that have joined the blockchain network.
当确定区块数据落后于第二区块链节点时,在308,第一区块链节点向第二区块链节点发送数据同步请求消息,以请求获取本地缺失的区块数据。在本说明书中,将本地的区块数据补全至与其它区块链节点一致的过程可以称为区块同步数据过程。例如,在上述示例中,将第一区块链节点处的区块数据从块高为80的区块补全至块高为100的区块,以与第二区块链节点一致的过程即区块数据同步过程。在数据同步请求消息中,可以包括待同步区块数据信息,例如可以包括待同步区块数据的块高范围(例如81至100)。When it is determined that the block data is behind the second block chain node, at 308, the first block chain node sends a data synchronization request message to the second block chain node to request the locally missing block data. In this specification, the process of completing local block data to be consistent with other blockchain nodes can be referred to as a block synchronization data process. For example, in the above example, the block data at the first blockchain node is completed from a block with a block height of 80 to a block with a block height of 100, and the process consistent with the second blockchain node is Block data synchronization process. The data synchronization request message may include the block data information to be synchronized, for example, may include the block height range (for example, 81 to 100) of the block data to be synchronized.
第二区块链节点在接收到区块数据请求消息之后,在块310,响应于数据同步请求,将数据同步请求消息所请求的多个区块数据组装入应答消息。由于区块链网络中通常对单个消息的大小进行了限制(例如限制为单个消息不超过16M),因而第二区块链节点可以分批次组装应答消息,即,当无法在利用一个应答消息将全部待同步区块数据发送给第一区块链节点时,可以将第一区块链节点所请求的待同步区块数据分组组装入多个批次应答消息中。After receiving the block data request message, the second blockchain node assembles multiple block data requested by the data synchronization request message into a response message in block 310 in response to the data synchronization request. Since the size of a single message is usually limited in the blockchain network (for example, a single message is limited to no more than 16M), the second blockchain node can assemble the response message in batches, that is, when a response message cannot be used When sending all the block data to be synchronized to the first block chain node, the block data to be synchronized requested by the first block chain node may be grouped into multiple batch response messages.
在应答消息组装完成之后,在312,第二区块链节点将所组装的应答消息发送给第一区块链节点。在分批次组装应答消息时,可以将各个批次应答消息发送给第一区块链节点。After the response message is assembled, at 312, the second blockchain node sends the assembled response message to the first blockchain node. When assembling the response messages in batches, each batch of response messages can be sent to the first blockchain node.
第一区块链节点接收到应答消息之后,在314,对应答消息中的区块数据进行验证, 并在316,确定区块数据是否验证通过。区块数据验证可以包括区块数据完整性验证等验证过程,以验证所接收到的区块数据是否正确。区块数据验证过程可以采用本领域公知的任意验证方法来执行,例如可以通过验证区块数据中的签名数据来进行。在区块数据验证通过时,在318,第一区块链节点将验证通过的区块数据加入到本地的区块链中,以实现区块数据同步过程。After the first blockchain node receives the response message, at 314, the block data in the response message is verified, and at 316, it is determined whether the block data is verified. Block data verification may include verification processes such as block data integrity verification to verify whether the received block data is correct. The block data verification process can be performed using any verification method known in the art, for example, it can be performed by verifying the signature data in the block data. When the block data is verified, at 318, the first block chain node adds the verified block data to the local block chain to realize the block data synchronization process.
虽然图3中以区块数据同步过程为例对本说明书实施例的数据同步方法的应用场景进行了描述,但是本说明书的数据同步方法可以适用于针对任意数据的同步过程。例如,在区块数据的共识过程中,当各个区块链节点缺少部分共识阶段的共识消息,从而向其它区块链节点请求同步所缺少的共识消息时,也可以适用本说明书的数据同步方法。Although FIG. 3 uses the block data synchronization process as an example to describe the application scenario of the data synchronization method of the embodiment of this specification, the data synchronization method of this specification can be applied to the synchronization process for any data. For example, in the consensus process of block data, when each blockchain node lacks consensus messages in part of the consensus phase, and thus requests other blockchain nodes to synchronize the missing consensus messages, the data synchronization method in this manual can also be applied .
以下参考图4至图6,对本说明书实施例的数据同步方法的示例进行说明。Hereinafter, an example of the data synchronization method according to the embodiment of this specification will be described with reference to FIGS. 4 to 6.
图4是根据本说明书的一个实施例的数据同步方法的流程图。Fig. 4 is a flowchart of a data synchronization method according to an embodiment of the present specification.
如图4所示,在块402,将第一区块链节点的各个待同步数据分割成多个待同步数据集合。然后,在块404,将多个待同步数据集合分配给多个第二区块链节点。As shown in FIG. 4, at block 402, each data to be synchronized of the first blockchain node is divided into multiple data sets to be synchronized. Then, at block 404, multiple data sets to be synchronized are allocated to multiple second blockchain nodes.
可以采用任意方式对各个待同步数据进行分割。在一个示例中,可以基于区块链系统中的区块链节点列表信息,将各个待同步数据分割成多个待同步数据集合。例如,可以基于区块链节点列表信息中的区块链节点数量,将各个待同步数据平均分割成对应数量的待同步数据集合。在另一示例中,区块链节点列表信息中还可以包括各个区块链节点是否是信任节点的信息,从而可以基于信任节点的数量进行分割。在另一示例中,区块链节点列表信息中还可以包括各个区块链节点的信任等级,从而可以基于信任等级来对待同步数据进行分割。例如,可以对信任等级较高的区块链节点分配较多的待同步数据,对信任等级低于预定等级的区块链节点分配较少的待同步数据或向不向其分配待同步数据。在另一示例中,还可以参考下述图5来对待同步数据进行分割。The data to be synchronized can be divided in any manner. In an example, each data to be synchronized can be divided into multiple data sets to be synchronized based on the block chain node list information in the block chain system. For example, based on the number of blockchain nodes in the blockchain node list information, each data to be synchronized can be equally divided into a corresponding number of data sets to be synchronized. In another example, the block chain node list information may also include information about whether each block chain node is a trusted node, so that it can be divided based on the number of trusted nodes. In another example, the block chain node list information may also include the trust level of each block chain node, so that the data to be synchronized can be divided based on the trust level. For example, blockchain nodes with a higher trust level may be allocated more data to be synchronized, and blockchain nodes with a trust level lower than a predetermined level may be allocated less data to be synchronized or no data to be synchronized may be allocated to them. In another example, the data to be synchronized can be divided with reference to FIG. 5 below.
在将各个待同步数据集合分配给各个第二区块链节点之后,在块408,向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息,以请求获取该待同步数据集合中的待同步数据。数据同步请求消息中可以包括对应的待同步数据集合信息。例如,当待同步数据是区块数据时,可以包括该待同步数据集合中的各个待同步数据的块高。当待同步数据是共识阶段消息时,可以包括各个待同步的共识阶段消息标识。第二区块链节点在接收到数据同步请求消息之后,可以从中获取第一区块链节点所请求的待同步数据。After each data set to be synchronized is allocated to each second blockchain node, in block 408, a data synchronization request message is sent to the second blockchain node corresponding to each data set to be synchronized to request to obtain the data to be synchronized The data to be synchronized in the collection. The data synchronization request message may include corresponding data collection information to be synchronized. For example, when the data to be synchronized is block data, the block height of each data to be synchronized in the data set to be synchronized may be included. When the data to be synchronized is a consensus phase message, it may include the identification of each consensus phase message to be synchronized. After receiving the data synchronization request message, the second blockchain node can obtain the data to be synchronized requested by the first blockchain node.
然后,在块410,第一区块链节点从对应于各个待同步数据集合的第二区块链节点处获取对应待同步数据集合中的待同步数据。Then, in block 410, the first blockchain node obtains the data to be synchronized in the corresponding data set to be synchronized from the second blockchain node corresponding to each data set to be synchronized.
在一个示例中,当待同步数据具有数据顺序时(例如区块数据具有在区块链中的顺序),针对各个待同步数据,可以在接收到在前的待同步数据之后,向相应的区块链节点发送针对该待同步数据的数据同步请求消息。例如,可以基于待同步数据的顺序将各个待同步数据分割成多个待同步数据集合,然后基于待同步数据集合的数据顺序向对应第二区块链节点发送相应的待同步数据请求。例如,当待同步区块数据的块高为80至120时,可以从块高80至120,依次按顺序分成四个待同步区块数据集合,例如80-90、91-100、101-110、111-120。然后,首先向其中一个区块链节点发送针对80-90的数据同步请求消息,在接收到相应的待同步区块数据之后,将针对91-100的待同步数据请求发送给另一第二区块链节点。此外,待同步数据集合中的数据顺序可以不是连续的,在该示例中,可以分别针对各个待同步数据发送数据同步请求消息。以区块数据为例,当不能接收到在前的待同步区块数据或在前的待同步区块数据不能通过第一区块链节点的本地验证时,即使接收到了在后的待同步区块数据也会出现暂时不能将待同步区块数据上链的情况,此时需要耗费存储空间来存储在后的待同步区块数据。因而,通过本示例,能够避免存储资源利用,并能合理分配本地存储资源。In an example, when the data to be synchronized has a data sequence (for example, the block data has an order in the blockchain), for each data to be synchronized, after receiving the previous data to be synchronized, the corresponding area The block chain node sends a data synchronization request message for the data to be synchronized. For example, each data to be synchronized may be divided into multiple data sets to be synchronized based on the sequence of the data to be synchronized, and then a corresponding data request to be synchronized is sent to the corresponding second blockchain node based on the data sequence of the data set to be synchronized. For example, when the block height of the block data to be synchronized is 80 to 120, it can be divided into four block data sets to be synchronized in order from the block height 80 to 120, such as 80-90, 91-100, 101-110 , 111-120. Then, first send a data synchronization request message for 80-90 to one of the blockchain nodes, and after receiving the corresponding block data to be synchronized, send the data synchronization request for 91-100 to another second zone Block chain node. In addition, the sequence of the data in the data set to be synchronized may not be continuous. In this example, data synchronization request messages may be sent for each data to be synchronized. Taking block data as an example, when the previous block data to be synchronized cannot be received or the previous block data to be synchronized cannot pass the local verification of the first blockchain node, even if the subsequent block to be synchronized is received Block data may also temporarily fail to link the block data to be synchronized. At this time, storage space is required to store the block data to be synchronized later. Therefore, through this example, the utilization of storage resources can be avoided, and local storage resources can be allocated reasonably.
在执行数据同步的过程中,在存在多个待同步数据的情况下,如果向同一个第二区块链节点请求待同步数据,可能会造成该第二区块链节点负载过高或长时间得不到第二区块链节点的响应等问题。通过本实施例,能够将待同步数据的同步负载分散给多个第二区块链节点,从而避免过多地占用一个节点的资源。在一个示例中,当区块链节点列表信息中包括信任等级信息时,可以基于各个区块链节点的信任等级对区块链节点进行排序。在对待同步数据进行分割时,可以基于待同步数据的数量确定待同步数据集合的数量,并从区块链节点的排序结果中选取信任等级较高的对应数量的第二区块链节点。In the process of performing data synchronization, if there are multiple data to be synchronized, if the data to be synchronized is requested from the same second blockchain node, the load of the second blockchain node may be too high or for a long time. Problems such as not getting a response from the second blockchain node. Through this embodiment, the synchronization load of the data to be synchronized can be distributed to multiple second blockchain nodes, thereby avoiding excessive occupation of resources of one node. In an example, when the blockchain node list information includes trust level information, the blockchain nodes can be sorted based on the trust level of each blockchain node. When splitting the data to be synchronized, the number of data sets to be synchronized can be determined based on the number of data to be synchronized, and a corresponding number of second blockchain nodes with a higher trust level can be selected from the ranking result of the blockchain nodes.
需要说明的是,虽然在图4中将待同步数据分割过程和待同步数据分配过程作为两个过程进行了说明,但是在本说明书的其它示例中,二者可以存在互相交叉和融合。例如,可以按照待同步区块数据的顺序,在每轮分配过程中为各个第二区块链节点分别分配预定数量的待同步数据,在完成一轮分配过程之后进行下一轮,直到将所有待同步数据分配给对应的第二区块链节点。在完成所有待同步数据的分配过程之后,可以获得针对各个第二区块链节点的待同步区块数据集合。It should be noted that although the data segmentation process to be synchronized and the data allocation process to be synchronized are described as two processes in FIG. 4, in other examples in this specification, the two may cross and merge with each other. For example, according to the order of the block data to be synchronized, each second blockchain node can be allocated a predetermined number of data to be synchronized during each round of allocation. After completing one round of allocation, proceed to the next round until all The data to be synchronized is allocated to the corresponding second blockchain node. After the distribution process of all the data to be synchronized is completed, a set of block data to be synchronized for each second blockchain node can be obtained.
图5是根据本说明书的一个实施例的数据同步方法中的待同步数据分割过程的一 个示例的流程图。Fig. 5 is a flowchart of an example of the data segmentation process to be synchronized in the data synchronization method according to an embodiment of the present specification.
如图5所示,在块502,获取多个第二区块链节点的负载信息。各个第二区块链节点的负载信息可以是基于该第二区块链节点与第一区块链节点的交互历史确定的。例如,可以基于最近预定时间段时,从第二区块链节点接收的数据数量、从第二区块链节点接收到数据的频率等信息来确定第二区块链节点的负载信息。As shown in FIG. 5, in block 502, the load information of a plurality of second blockchain nodes is obtained. The load information of each second blockchain node may be determined based on the interaction history between the second blockchain node and the first blockchain node. For example, the load information of the second blockchain node may be determined based on information such as the amount of data received from the second blockchain node and the frequency of data received from the second blockchain node during the most recent predetermined period of time.
在获取负载信息之后,在块504,基于多个第二区块链节点的负载信息来将各个待同步数据分割成多个待同步数据集合。可以为负载较高的第二区块链节点分配较少的待同步数据,即针对该第二区块链节点的待同步数据集合中的待同步数据数量可以不超过预定数量,或待同步数据数量占总待同步数据数量的比率可以不超过预定比率。相应地,可以使得针对负载较低的第二区块链节点的待同步数据集合中的待同步数据数量较少,即待同步数据集合中的待同步数据数量可以不低于预定数量,或占总待同步数据数量的比率不低于预定比率。After the load information is obtained, in block 504, each data to be synchronized is divided into multiple data sets to be synchronized based on the load information of the multiple second blockchain nodes. It is possible to allocate less data to be synchronized to the second blockchain node with a higher load, that is, the number of data to be synchronized in the data set to be synchronized for the second blockchain node may not exceed a predetermined number, or the data to be synchronized The ratio of the quantity to the total quantity of data to be synchronized may not exceed a predetermined ratio. Correspondingly, the number of data to be synchronized in the to-be-synchronized data set for the second blockchain node with a lower load can be reduced, that is, the number of to-be-synchronized data in the to-be-synchronized data set may not be less than the predetermined number, or account for The ratio of the total amount of data to be synchronized is not lower than the predetermined ratio.
通过该示例,能够使得分配给各个第二区块链节点的数据同步负载与第二区块链节点自身的负载相适应,从而提高对各个第二区块链节点的资源利用效率,并最大程度地提高各个第二区块链节点对数据同步请求消息的响应速度,从而提高数据同步效率。Through this example, the data synchronization load allocated to each second blockchain node can be adapted to the load of the second blockchain node itself, thereby improving the resource utilization efficiency of each second blockchain node and maximizing Therefore, the response speed of each second blockchain node to the data synchronization request message is improved, thereby improving the efficiency of data synchronization.
图6是根据本说明书的一个实施例的数同步方法中的待同步数据集合调整过程的一个示例的流程图。Fig. 6 is a flowchart of an example of the adjustment process of the data set to be synchronized in the data synchronization method according to an embodiment of the present specification.
如图6所示,在块602,获取各个第二区块链节点针对对应数据同步请求消息的响应结果。响应结果可以是第二区块链节点针对对应待同步数据的响应速度,还可以是从第二区块链节点处接收到的待同步数据数量,或在发送数据同步消息后预定时间段内所接收到的待同步数据数量。As shown in FIG. 6, in block 602, the response result of each second blockchain node for the corresponding data synchronization request message is obtained. The response result can be the response speed of the second blockchain node to the corresponding data to be synchronized, the amount of data to be synchronized received from the second blockchain node, or the amount of data received within a predetermined period of time after the data synchronization message is sent. The number of data received to be synchronized.
然后,在块604,基于对应于各个待同步数据集合的第二区块链节点针对对应数据同步请求消息的响应结果,调整各个待同步数据集合。例如,可以将从响应时间超过第一预定时间的第二区块链节点的待同步数据集合中去掉预定数量的待同步数据。然后,可以将所去掉的待同步数据加入到响应时间低于第二预定时间的第二区块链节点的待同步数据集合中。还可以在从第二区块链节点处收到的待同步数据数量低于预定数量时,减少针对该第二区块链节点的待同步数据集合中的待同步数据数量。Then, in block 604, each data set to be synchronized is adjusted based on the response result of the second blockchain node corresponding to each data set to be synchronized to the corresponding data synchronization request message. For example, a predetermined amount of data to be synchronized may be removed from the data set to be synchronized of the second blockchain node whose response time exceeds the first predetermined time. Then, the removed data to be synchronized can be added to the to-be-synchronized data set of the second blockchain node whose response time is lower than the second predetermined time. It is also possible to reduce the number of data to be synchronized in the data set to be synchronized for the second blockchain node when the amount of data to be synchronized received from the second blockchain node is lower than the predetermined amount.
通过本示例,能够在数据同步过程中根据第二区块链节点的响应结果来调整分配给各个第二区块链节点的数据同步负载,从而能够使分配给各个第二区块链节点的待同 步数据数量与各个第二区块链节点的实时负载相适应,以提高数据同步效率。Through this example, the data synchronization load allocated to each second blockchain node can be adjusted according to the response result of the second blockchain node during the data synchronization process, so that the waiting time allocated to each second blockchain node can be adjusted. The amount of synchronized data is adapted to the real-time load of each second blockchain node to improve the efficiency of data synchronization.
图7是根据本说明书的一个实施例的数据同步装置的结构框图。如图7所示,数据同步装置700包括待同步数据分割单元710、待同步数据分配单元720、数据同步请求发送单元730和待同步数据获取单元740。Fig. 7 is a structural block diagram of a data synchronization device according to an embodiment of the present specification. As shown in FIG. 7, the data synchronization apparatus 700 includes a to-be-synchronized data dividing unit 710, a to-be-synchronized data distributing unit 720, a data synchronization request sending unit 730, and a to-be-synchronized data acquiring unit 740.
待同步数据分割单元710将第一区块链节点的各个待同步数据分割成多个待同步数据集合。待同步数据分割单元710可以基于区块链系统中的区块链节点列表信息,将各个待同步数据分割成多个待同步数据集合。待同步数据分配单元720将多个待同步数据集合分配给多个第二区块链节点。数据同步请求发送单元730向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息,以请求获取该待同步数据集合中的待同步数据。待同步数据获取单元740从对应于各个待同步数据集合的第二区块链节点处获取对应待同步数据集合中的待同步数据。The to-be-synchronized data dividing unit 710 divides each to-be-synchronized data of the first blockchain node into multiple to-be-synchronized data sets. The to-be-synchronized data splitting unit 710 may split each to-be-synchronized data into multiple to-be-synchronized data sets based on the block chain node list information in the blockchain system. The to-be-synchronized data distribution unit 720 distributes multiple to-be-synchronized data sets to multiple second blockchain nodes. The data synchronization request sending unit 730 sends a data synchronization request message to the second blockchain node corresponding to each data set to be synchronized, so as to request to obtain the data to be synchronized in the data set to be synchronized. The to-be-synchronized data obtaining unit 740 obtains the to-be-synchronized data in the corresponding to-be-synchronized data set from the second blockchain node corresponding to each to-be-synchronized data set.
此外,虽然图7中未示出,数据同步装置700还可以包括待同步数据集合调整单元。待同步数据集合调整单元在向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息之后,基于对应于各个待同步数据集合的第二区块链节点针对对应数据同步请求消息的响应结果,调整各个待同步数据集合。In addition, although not shown in FIG. 7, the data synchronization device 700 may further include a data set adjustment unit to be synchronized. After sending the data synchronization request message to the second blockchain node corresponding to each data set to be synchronized, the to-be-synchronized data set adjustment unit responds to the corresponding data synchronization request message based on the second blockchain node corresponding to each data set to be synchronized According to the response result, adjust each data set to be synchronized.
图8是图7所示的数据同步装置中的待同步数据分割单元的一个示例的结构框图。待同步数据分割单元710包括负载信息获取模块711和待同步数据分割模块712。FIG. 8 is a structural block diagram of an example of a data dividing unit to be synchronized in the data synchronization device shown in FIG. 7. The to-be-synchronized data segmentation unit 710 includes a load information acquisition module 711 and a to-be-synchronized data segmentation module 712.
负载信息获取模块711获取多个第二区块链节点的负载信息。待同步数据分割模块712基于多个第二区块链节点的负载信息来将各个待同步数据分割成多个待同步数据集合。The load information acquiring module 711 acquires load information of multiple second blockchain nodes. The to-be-synchronized data segmentation module 712 divides each to-be-synchronized data into multiple to-be-synchronized data sets based on the load information of the multiple second blockchain nodes.
以上参照图1到图8,对根据本说明书实施例的数据同步方法及装置的实施例进行了描述。在以上对方法实施例的描述中所提及的细节,同样适用于本说明书实施例的装置的实施例。The embodiments of the data synchronization method and device according to the embodiments of this specification have been described above with reference to FIGS. 1 to 8. The details mentioned in the above description of the method embodiment are also applicable to the embodiment of the device in the embodiment of this specification.
本说明书实施例的数据同步装置可以采用硬件实现,也可以采用软件或者硬件和软件的组合来实现。本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见。The data synchronization device in the embodiments of this specification may be implemented by hardware, or may be implemented by software or a combination of hardware and software. The various embodiments in this specification are described in a progressive manner, and the same or similar parts among the various embodiments are referred to each other.
本说明书实施例的数据同步装置可以采用硬件实现,也可以采用软件或者硬件和软件的组合来实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在设备的处理器将存储器中对应的计算机程序指令读取到内存中运行形成的。在本说明书实施 例中,用于生成区块链的装置例如可以利用计算设备实现。The data synchronization device in the embodiments of this specification may be implemented by hardware, or may be implemented by software or a combination of hardware and software. Taking software implementation as an example, as a logical device, it is formed by reading the corresponding computer program instructions in the memory into the memory through the processor of the device where it is located. In the embodiment of the present specification, the device for generating the blockchain can be realized by using a computing device, for example.
图9是根据本说明书实施例的一个实施例的用于数据同步方法的计算设备的结构框图。如图9所示,计算设备900包括处理器910、存储器920、内存930、通信接口940和内部总线950,并且处理器910、存储器(例如,非易失性存储器)920、内存930、通信接口940经由总线950连接在一起。根据一个实施例,计算设备900可以包括至少一个处理器910,该至少一个处理器910执行在计算机可读存储介质(即,存储器920)中存储或编码的至少一个计算机可读指令(即,上述以软件形式实现的元素)。Fig. 9 is a structural block diagram of a computing device for a data synchronization method according to an embodiment of the present specification. As shown in FIG. 9, the computing device 900 includes a processor 910, a memory 920, a memory 930, a communication interface 940, and an internal bus 950, and the processor 910, a memory (for example, a non-volatile memory) 920, a memory 930, and a communication interface 940 are connected together via a bus 950. According to an embodiment, the computing device 900 may include at least one processor 910 that executes at least one computer-readable instruction (ie, the aforementioned Elements implemented in software).
在一个实施例中,在存储器920中存储计算机可执行指令,其当执行时使得至少一个处理器910:将第一区块链节点的各个待同步数据分割成多个待同步数据集合;将所述多个待同步数据集合分配给多个第二区块链节点;向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息,以请求获取该待同步数据集合中的待同步数据;以及从对应于各个待同步数据集合的第二区块链节点处获取对应待同步数据集合中的待同步数据。In one embodiment, computer-executable instructions are stored in the memory 920, which, when executed, cause at least one processor 910 to: divide each data to be synchronized of the first blockchain node into multiple data sets to be synchronized; The multiple data sets to be synchronized are allocated to multiple second blockchain nodes; a data synchronization request message is sent to the second blockchain nodes corresponding to each data set to be synchronized to request to obtain the data sets to be synchronized. Synchronizing data; and obtaining the data to be synchronized in the corresponding data set to be synchronized from the second blockchain node corresponding to each data set to be synchronized.
应该理解,在存储器920中存储的计算机可执行指令当执行时使得至少一个处理器910进行本说明书实施例的各个实施例中以上结合图1-8描述的各种操作和功能。It should be understood that the computer-executable instructions stored in the memory 920, when executed, cause at least one processor 910 to perform the various operations and functions described above in conjunction with FIGS. 1-8 in the various embodiments of the embodiments of this specification.
根据一个实施例,提供了一种例如非暂时性机器可读介质的程序产品。非暂时性机器可读介质可以具有指令(即,上述以软件形式实现的元素),该指令当被机器执行时,使得机器执行本说明书实施例的各个实施例中以上结合图1-8描述的各种操作和功能。According to one embodiment, a program product such as a non-transitory machine-readable medium is provided. The non-transitory machine-readable medium may have instructions (that is, the above-mentioned elements implemented in the form of software), which when executed by a machine, cause the machine to execute the above described in conjunction with FIGS. 1-8 in the various embodiments of the embodiments of this specification. Various operations and functions.
具体地,可以提供配有可读存储介质的系统或者装置,在该可读存储介质上存储着实现上述实施例中任一实施例的功能的软件程序代码,且使该系统或者装置的计算机或处理器读出并执行存储在该可读存储介质中的指令。Specifically, a system or device equipped with a readable storage medium may be provided, and the software program code for realizing the function of any one of the above-mentioned embodiments is stored on the readable storage medium, and the computer or device of the system or device The processor reads and executes the instructions stored in the readable storage medium.
在这种情况下,从可读介质读取的程序代码本身可实现上述实施例中任何一项实施例的功能,因此机器可读代码和存储机器可读代码的可读存储介质构成了本发明的一部分。In this case, the program code itself read from the readable medium can implement the function of any one of the above embodiments, so the machine readable code and the readable storage medium storing the machine readable code constitute the present invention a part of.
可读存储介质的实施例包括软盘、硬盘、磁光盘、光盘(如CD-ROM、CD-R、CD-RW、DVD-ROM、DVD-RAM、DVD-RW、DVD-RW)、磁带、非易失性存储卡和ROM。可选择地,可以由通信网络从服务器计算机上或云上下载程序代码。Examples of readable storage media include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tape, Volatile memory card and ROM. Alternatively, the program code can be downloaded from the server computer or the cloud via the communication network.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。 在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown in order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
上述各流程和各系统结构图中不是所有的步骤和单元都是必须的,可以根据实际的需要忽略某些步骤或单元。各步骤的执行顺序不是固定的,可以根据需要进行确定。上述各实施例中描述的装置结构可以是物理结构,也可以是逻辑结构,即,有些单元可能由同一物理实体实现,或者,有些单元可能分由多个物理实体实现,或者,可以由多个独立设备中的某些部件共同实现。Not all steps and units in the above processes and system structure diagrams are necessary, and some steps or units can be omitted according to actual needs. The order of execution of each step is not fixed and can be determined as needed. The device structure described in the foregoing embodiments may be a physical structure or a logical structure, that is, some units may be implemented by the same physical entity, or some units may be implemented by multiple physical entities, or may be implemented by multiple physical entities. Some components in independent devices are implemented together.
在整个本说明书中使用的术语“示例性”意味着“用作示例、实例或例示”,并不意味着比其它实施例“优选”或“具有优势”。出于提供对所描述技术的理解的目的,具体实施方式包括具体细节。然而,可以在没有这些具体细节的情况下实施这些技术。在一些实例中,为了避免对所描述的实施例的概念造成难以理解,公知的结构和装置以框图形式示出。The term "exemplary" used throughout this specification means "serving as an example, instance, or illustration", and does not mean "preferred" or "advantageous" over other embodiments. The detailed description includes specific details for the purpose of providing an understanding of the described technology. However, these techniques can be implemented without these specific details. In some instances, in order to avoid incomprehensibility to the concepts of the described embodiments, well-known structures and devices are shown in the form of block diagrams.
以上结合附图详细描述了本说明书实施例的实施例的可选实施方式,但是,本说明书实施例的实施例并不限于上述实施方式中的具体细节,在本说明书实施例的实施例的技术构思范围内,可以对本说明书实施例的实施例的技术方案进行多种简单变型,这些简单变型均属于本说明书实施例的实施例的保护范围。The above describes in detail the optional implementation manners of the embodiments of the embodiments of this specification with reference to the accompanying drawings. However, the embodiments of the embodiments of this specification are not limited to the specific details in the above-mentioned embodiments. Within the scope of the conception, a variety of simple modifications can be made to the technical solutions of the embodiments of the embodiments of the present specification, and these simple modifications all belong to the protection scope of the embodiments of the embodiments of the present specification.
本说明书实施例内容的上述描述被提供来使得本领域任何普通技术人员能够实现或者使用本说明书实施例内容。对于本领域普通技术人员来说,对本说明书实施例内容进行的各种修改是显而易见的,并且,也可以在不脱离本说明书实施例内容的保护范围的情况下,将本文所定义的一般性原理应用于其它变型。因此,本说明书实施例内容并不限于本文所描述的示例和设计,而是与符合本文公开的原理和新颖性特征的最广范围相一致。The foregoing description of the content of the embodiments of this specification is provided to enable any person of ordinary skill in the art to implement or use the content of the embodiments of this specification. It is obvious to a person of ordinary skill in the art that various modifications made to the content of the embodiments of this specification are obvious, and the general principles defined herein can also be used without departing from the scope of protection of the content of the embodiments of this specification. Apply to other variants. Therefore, the contents of the embodiments of this specification are not limited to the examples and designs described herein, but are consistent with the widest scope that conforms to the principles and novel features disclosed herein.

Claims (12)

  1. 一种用于区块链节点的数据同步方法,包括:A data synchronization method for blockchain nodes, including:
    将第一区块链节点的各个待同步数据分割成多个待同步数据集合;Dividing each data to be synchronized of the first blockchain node into multiple data sets to be synchronized;
    将所述多个待同步数据集合分配给多个第二区块链节点;Allocating the multiple data sets to be synchronized to multiple second blockchain nodes;
    向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息,以请求获取该待同步数据集合中的待同步数据;以及Send a data synchronization request message to the second blockchain node corresponding to each data set to be synchronized to request to obtain the data to be synchronized in the data set to be synchronized; and
    从对应于各个待同步数据集合的第二区块链节点处获取对应待同步数据集合中的待同步数据。Obtain the to-be-synchronized data in the corresponding to-be-synchronized data set from the second blockchain node corresponding to each to-be-synchronized data set.
  2. 如权利要求1所述的数据同步方法,其中,将所述第一区块链节点的各个待同步数据分割成多个待同步数据集合包括:8. The data synchronization method of claim 1, wherein dividing each data to be synchronized of the first blockchain node into a plurality of data sets to be synchronized comprises:
    基于区块链系统中的区块链节点列表信息,将各个待同步数据分割成多个待同步数据集合。Based on the block chain node list information in the block chain system, each data to be synchronized is divided into multiple data sets to be synchronized.
  3. 如权利要求1所述的数据同步方法,其中,将各个待同步数据分割成多个待同步数据集合包括:The data synchronization method according to claim 1, wherein dividing each data to be synchronized into a plurality of data sets to be synchronized comprises:
    获取所述多个第二区块链节点的负载信息;以及Acquiring load information of the plurality of second blockchain nodes; and
    基于所述多个第二区块链节点的负载信息来将各个待同步数据分割成多个待同步数据集合。Based on the load information of the plurality of second blockchain nodes, each data to be synchronized is divided into a plurality of data sets to be synchronized.
  4. 如权利要求1所述的数据同步方法,其中,在向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息之后,所述方法还包括:The data synchronization method according to claim 1, wherein after sending a data synchronization request message to the second blockchain node corresponding to each data set to be synchronized, the method further comprises:
    基于对应于各个待同步数据集合的第二区块链节点针对对应数据同步请求消息的响应结果,调整所述各个待同步数据集合。Based on the response result of the second blockchain node corresponding to each data set to be synchronized to the corresponding data synchronization request message, adjust the data set to be synchronized.
  5. 如权利要求4所述的数据同步方法,其中,所述响应结果包括:5. The data synchronization method according to claim 4, wherein the response result comprises:
    所述第二区块链节点针对对应数据同步请求消息的响应速度;和/或The response speed of the second blockchain node to the corresponding data synchronization request message; and/or
    从所述第二区块链节点所接收到的待同步数据数量。The number of data to be synchronized received from the second blockchain node.
  6. 如权利要求1所述的数据同步方法,其中,所述各个待同步数据包括待同步区块数据。8. The data synchronization method according to claim 1, wherein each of the data to be synchronized includes block data to be synchronized.
  7. 一种用于区块链节点的数据同步装置,包括:A data synchronization device for blockchain nodes, including:
    待同步数据分割单元,将第一区块链节点的各个待同步数据分割成多个待同步数据集合;The data segmentation unit to be synchronized divides each data to be synchronized of the first blockchain node into multiple data sets to be synchronized;
    待同步数据分配单元,将所述多个待同步数据集合分配给多个第二区块链节点;A data allocation unit to be synchronized, which allocates the plurality of data sets to be synchronized to a plurality of second blockchain nodes;
    数据同步请求发送单元,向对应于各个待同步数据集合的第二区块链节点发送数据 同步请求消息,以请求获取该待同步数据集合中的待同步数据;以及The data synchronization request sending unit sends a data synchronization request message to the second blockchain node corresponding to each data set to be synchronized to request to obtain the data to be synchronized in the data set to be synchronized; and
    待同步数据获取单元,从对应于各个待同步数据集合的第二区块链节点处获取对应待同步数据集合中的待同步数据。The to-be-synchronized data obtaining unit obtains the to-be-synchronized data in the corresponding to-be-synchronized data set from the second blockchain node corresponding to each to-be-synchronized data set.
  8. 如权利要求7所述的数据同步装置,其中,所述待同步数据分割单元基于区块链系统中的区块链节点列表信息,将各个待同步数据分割成多个待同步数据集合。7. The data synchronization device according to claim 7, wherein the to-be-synchronized data dividing unit divides each to-be-synchronized data into a plurality of to-be-synchronized data sets based on block chain node list information in the blockchain system.
  9. 如权利要求7所述的数据同步装置,其中,所述待同步数据分割单元包括:8. The data synchronization device according to claim 7, wherein the to-be-synchronized data dividing unit comprises:
    负载信息获取模块,获取所述多个第二区块链节点的负载信息;以及A load information obtaining module, which obtains load information of the plurality of second blockchain nodes; and
    待同步数据分割模块,基于所述多个第二区块链节点的负载信息来将各个待同步数据分割成多个待同步数据集合。The to-be-synchronized data splitting module splits each to-be-synchronized data into multiple to-be-synchronized data sets based on the load information of the plurality of second blockchain nodes.
  10. 如权利要求7所述的数据同步装置,还包括:The data synchronization device according to claim 7, further comprising:
    待同步数据集合调整单元,在向对应于各个待同步数据集合的第二区块链节点发送数据同步请求消息之后,基于对应于各个待同步数据集合的第二区块链节点针对对应数据同步请求消息的响应结果,调整所述各个待同步数据集合。The data set adjustment unit to be synchronized sends a data synchronization request message to the second blockchain node corresponding to each data set to be synchronized, and then requests the corresponding data synchronization based on the second blockchain node corresponding to each data set to be synchronized As a result of the message response, the respective data sets to be synchronized are adjusted.
  11. 一种计算设备,包括:A computing device including:
    至少一个处理器;以及At least one processor; and
    存储器,所述存储器存储指令,当所述指令被所述至少一个处理器执行时,使得所述至少一个处理器执行如权利要求1到6中任一所述的方法。A memory, where the memory stores instructions, and when the instructions are executed by the at least one processor, the at least one processor executes the method according to any one of claims 1 to 6.
  12. 一种非暂时性机器可读存储介质,其存储有可执行指令,所述指令当被执行时使得所述机器执行如权利要求1到6中任一所述的方法。A non-transitory machine-readable storage medium that stores executable instructions that, when executed, cause the machine to execute the method according to any one of claims 1 to 6.
PCT/CN2020/131812 2020-01-02 2020-11-26 Data synchronization method and device for blockchain nodes WO2021135744A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010000796.6 2020-01-02
CN202010000796.6A CN111241593A (en) 2020-01-02 2020-01-02 Data synchronization method and device for block chain nodes

Publications (1)

Publication Number Publication Date
WO2021135744A1 true WO2021135744A1 (en) 2021-07-08

Family

ID=70864808

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/131812 WO2021135744A1 (en) 2020-01-02 2020-11-26 Data synchronization method and device for blockchain nodes

Country Status (2)

Country Link
CN (1) CN111241593A (en)
WO (1) WO2021135744A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111241593A (en) * 2020-01-02 2020-06-05 支付宝(杭州)信息技术有限公司 Data synchronization method and device for block chain nodes
CN112231415B (en) * 2020-12-16 2021-03-12 腾讯科技(深圳)有限公司 Data synchronization method and system of block chain network, electronic device and readable medium
CN112800129B (en) * 2020-12-31 2024-04-23 杭州趣链科技有限公司 Block state updating method, device, system and electronic equipment
CN113098970A (en) * 2021-04-12 2021-07-09 浙江永旗区块链科技有限公司 Distributed network node data synchronization method
CN113064768B (en) * 2021-04-19 2022-08-09 支付宝(杭州)信息技术有限公司 Method and device for switching fragment nodes in block chain system
CN113377757B (en) * 2021-06-24 2023-08-25 杭州数梦工场科技有限公司 Data checking method and device, electronic equipment and machine-readable storage medium
CN113626260B (en) * 2021-10-11 2022-02-22 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium of block chain network
CN115086350B (en) * 2022-06-13 2024-01-19 亿度科创(深圳)有限公司 Block chain node data synchronization method, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109525633A (en) * 2018-10-08 2019-03-26 上海点融信息科技有限责任公司 Block chain network, the message transmission based on block chain network, message receival method
CN109714412A (en) * 2018-12-25 2019-05-03 深圳前海微众银行股份有限公司 Block synchronous method, device, equipment and computer readable storage medium
WO2019133578A1 (en) * 2017-12-26 2019-07-04 Akamai Technologies, Inc. High performance distributed system of record with cryptographic service support
CN110365768A (en) * 2019-07-15 2019-10-22 腾讯科技(深圳)有限公司 Method of data synchronization, device, medium, the electronic equipment of distributed system
CN111241593A (en) * 2020-01-02 2020-06-05 支付宝(杭州)信息技术有限公司 Data synchronization method and device for block chain nodes

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108984697A (en) * 2018-07-05 2018-12-11 江苏恒宝智能系统技术有限公司 A kind of block chain interior joint method of data synchronization
CN109274754B (en) * 2018-10-11 2021-05-04 上海保险交易所股份有限公司 Method, apparatus, and storage medium for synchronizing data in a blockchain network
CN110569305B (en) * 2019-08-27 2021-09-03 网易(杭州)网络有限公司 Block synchronization method, device, medium and computing equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019133578A1 (en) * 2017-12-26 2019-07-04 Akamai Technologies, Inc. High performance distributed system of record with cryptographic service support
CN109525633A (en) * 2018-10-08 2019-03-26 上海点融信息科技有限责任公司 Block chain network, the message transmission based on block chain network, message receival method
CN109714412A (en) * 2018-12-25 2019-05-03 深圳前海微众银行股份有限公司 Block synchronous method, device, equipment and computer readable storage medium
CN110365768A (en) * 2019-07-15 2019-10-22 腾讯科技(深圳)有限公司 Method of data synchronization, device, medium, the electronic equipment of distributed system
CN111241593A (en) * 2020-01-02 2020-06-05 支付宝(杭州)信息技术有限公司 Data synchronization method and device for block chain nodes

Also Published As

Publication number Publication date
CN111241593A (en) 2020-06-05

Similar Documents

Publication Publication Date Title
WO2021135744A1 (en) Data synchronization method and device for blockchain nodes
WO2020258831A1 (en) Method and device for master node handover processing in blockchain system
US11128522B2 (en) Changing a master node in a blockchain system
WO2021135857A1 (en) Method and device for updating trusted node information
US11934549B2 (en) Invoice access method and apparatus based on blockchain, and electronic device
TWI740423B (en) System and method for providing privacy and security protection in blockchain-based private transactions
US20200387503A1 (en) Blockchain Maintenance Method and Apparatus, Server, and Computer-Readable Storage Medium
US20210192512A1 (en) Method and apparatus for storing and obtaining merchant authentication data in blockchain network
US11283627B2 (en) Method and apparatus for generating blockchain transaction
WO2021184885A1 (en) Method and device for use in updating public key set at blockchain node
WO2021135757A1 (en) Method and apparatus for executing transaction correctness verification
WO2021008117A1 (en) Method and apparatus for performing transaction verification
US11126458B2 (en) Method, apparatus, and electronic device for resource allocation based on blockchain
CN111062716A (en) Method and device for generating block chain signature data and block chain transaction initiating system
US10951417B2 (en) Blockchain-based transaction verification
US11386426B2 (en) Invoice invalidation method and apparatus based on blockchain, and electronic device
US11514446B2 (en) Method and apparatus for starting smart contract, electronic device, and storage medium
EP4274155A1 (en) Data processing method and apparatus based on blockchain, and device and readable storage medium
WO2021135755A1 (en) Method and apparatus for sending response message for data request, and blockchain system
WO2021143364A1 (en) Method and apparatus for acquiring transaction processing state in decentralized application cluster
WO2021114796A1 (en) Method and apparatus for updating trusted point in multi-layer blockchain structure
CN110827034B (en) Method and apparatus for initiating a blockchain transaction
WO2021114926A1 (en) Method and device for use in generating multilayer blockchain structure
WO2024045552A1 (en) Data processing method and related devices
CN111162970B (en) Method and device for testing decentralized application server in block chain system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20910484

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20910484

Country of ref document: EP

Kind code of ref document: A1