CN108805570B - Data processing method, device and storage medium - Google Patents

Data processing method, device and storage medium Download PDF

Info

Publication number
CN108805570B
CN108805570B CN201810557875.XA CN201810557875A CN108805570B CN 108805570 B CN108805570 B CN 108805570B CN 201810557875 A CN201810557875 A CN 201810557875A CN 108805570 B CN108805570 B CN 108805570B
Authority
CN
China
Prior art keywords
block
account data
data backup
blocks
node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810557875.XA
Other languages
Chinese (zh)
Other versions
CN108805570A (en
Inventor
郭锐
李茂材
王宗友
屠海涛
孔利
周开班
杨常青
王楠
丁勇
时一防
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810557875.XA priority Critical patent/CN108805570B/en
Publication of CN108805570A publication Critical patent/CN108805570A/en
Application granted granted Critical
Publication of CN108805570B publication Critical patent/CN108805570B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06QDATA PROCESSING SYSTEMS OR METHODS, SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3827Use of message hashing
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06QDATA PROCESSING SYSTEMS OR METHODS, SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL, SUPERVISORY OR FORECASTING PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment protocols; Details thereof insuring higher security of transaction involving key management

Abstract

The application provides a data processing method, which comprises the following steps: when the block height of a block recently added in a block chain is determined to meet a set condition, acquiring a current account data backup, and associating and storing the account data backup and the block height; when receiving a query request from a node, sending an account data backup associated with the maximum block height to the node, so that the node starts to download blocks which are linked up in the block chain from the block height associated with the account data backup and adds the blocks into the block chain locally stored by the node according to the account data backup. The application also provides a corresponding device and a storage medium, which can improve the speed of adding or recovering the nodes in the block chain network.

Description

Data processing method, device and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method, an apparatus, and a storage medium.
Background
The block chain technology, bt (block chain technology) for short, also called distributed book technology, is an internet database technology, and is characterized by decentralization and public transparency, so that everyone can participate in database recording. The blockchain technology is originally a basic technology for implementing bitcoin transactions, and is currently applied to various fields such as finance.
Disclosure of Invention
The application example provides a data processing method, which comprises the following steps: when the block height of a block recently added in a block chain is determined to meet a set condition, acquiring a current account data backup, and associating and storing the account data backup and the block height; when receiving a query request from a node, sending an account data backup associated with the maximum block height to the node, so that the node starts to download blocks which are linked up in the block chain from the block height associated with the account data backup and adds the blocks into the block chain locally stored by the node according to the account data backup.
In some examples, the setting conditions include: the block height is equal to the value calculated according to the set algorithm.
In some examples, the setting algorithm is represented by the following formula: y is a + b N, where Y is a calculated value, a and b are both set values, and N is an arbitrary integer.
In some examples, when a new block is added to the blockchain, determining whether the new block meets the set condition, and when the block height of the new block meets the set condition, performing the step of obtaining the current account data backup.
In some examples, the account data backup includes a backup of transaction output information generated by transactions that have occurred.
In some examples, the account data backup includes a snapshot of the account data.
In some examples, the method further comprises: generating identification and verification information of the account data backup; generating and issuing transaction information containing the identification and verification information of the account data backup; and linking the blocks which are processed by the consensus and contain the transaction information; wherein sending the account data backup associated with the maximum block height to the node comprises: inquiring and obtaining the identification and verification information of the latest uplink account data backup from the block chain; and sending the inquired identification and verification information of the account data backup to the node so that the node downloads the data of the account data backup according to the identification of the account data backup and verifies the downloaded data according to the verification information.
In some examples, the transaction information including identification and authentication information for the account data backup further includes: the block height and corresponding block header hash value; the above method further comprises: associating the identifier and verification information of the account data backup with the block height and the corresponding block head hash value; when transaction information issued by other nodes is received, if the transaction information is determined to contain account data backup information according to a transaction type field in the transaction information, executing the following processing: reading the identification, the verification information, the block height and the block head hash value of the account data backup from the transaction information; determining whether the account data backup corresponding to the block height is uplink or not according to the read identification of the account data backup, the block height and the block head hash value; when determining that the account data backup corresponding to the block height is uplink, determining that the transaction information issued by the other nodes is not credible; and when determining that the account data backup corresponding to the block height is not linked, verifying whether the transaction information issued by the other node is credible according to the locally stored block head hash value and/or verification information of the account data backup corresponding to the block height and the verification information and/or block head hash value read from the transaction information.
In some examples, the method further comprises: when the node is to be added into the block chain network or the data is recovered, sending a query request to other nodes in the block chain network; receiving account data backups associated with the maximum block heights sent by other nodes in response to the query request; downloading blocks that have been uplinked in the block chain starting from their associated block heights based on the account data backup.
In some examples, the method further comprises: and downloading part or all of the blocks from the created blocks to the blocks corresponding to the maximum block height in the block chain from other nodes, and sequentially adding the downloaded blocks into the locally stored block chain.
The embodiment of the present application further provides a data processing method, including: when the node is to be added into the block chain network or the data is recovered, sending a query request to other nodes in the block chain network; receiving account data backups associated with one block height sent by other nodes in response to the query request; downloading blocks that have been uplinked in a block chain starting from the block height associated with the account data backup.
In some examples, receiving a copy of account data associated with a block height sent by the other node in response to the query request comprises: receiving identification and verification information of the account data backup sent by other nodes in response to the query request; and downloading the data of the account data backup from other nodes according to the identification of the account data backup, and verifying the downloaded data according to the verification information.
In some examples, the method further comprises: and downloading part or all of the blocks from the created blocks to the blocks corresponding to the maximum block height in the block chain from other nodes, and sequentially adding the downloaded blocks into the locally stored block chain.
In some examples, the downloading, from the other node, some or all of the blocks in the block chain from the created block to the block corresponding to the maximum block height and sequentially adding the downloaded blocks to the block chain stored locally includes: downloading said founding blocks from other nodes; obtaining current account data according to the transaction output information of the creating block; downloading blocks which are linked in the block chain from the created blocks according to the current account data, adding the blocks into the block chain which is stored locally, and updating the current account data according to the transaction output information of the block when one block is added into the block chain.
In some examples, the downloading, from the other node, some or all of the blocks in the block chain from the created block to the block corresponding to the maximum block height and sequentially adding the downloaded blocks to the block chain stored locally includes: inquiring from other nodes to obtain a second account data backup corresponding to the second block height, and using the second account data backup as current account data; and downloading blocks which are linked up in the block chain from the second block height according to the current account data, adding the blocks into the block chain which is locally stored, and updating the current account data according to the transaction output information of the blocks when one block is added into the block chain.
The example of the application provides a data processing device, which comprises: the backup module is used for acquiring a current account data backup, associating the account data backup with the block height and storing the account data backup when the block height of a block which is added recently in the block chain is determined to meet a set condition; and the sending module is used for sending the account data backup associated with the maximum block height to the node when receiving a query request from the node, so that the node starts to download the blocks which are linked up in the block chain from the block height associated with the account data backup according to the account data backup and adds the blocks into the block chain locally stored by the node.
In some examples, the apparatus further comprises: the transaction information issuing module generates the identification and the verification information of the account data backup, generates a piece of transaction information containing the identification and the verification information of the account data backup and issues the transaction information; the uplink module uplinks the blocks which are subjected to the consensus processing and contain the transaction information; the sending module inquires and obtains the identification and verification information of the account data backup of the last chain from the block chain, and sends the inquired identification and verification information of the account data backup to the node, so that the node downloads the data of the account data backup according to the identification of the account data backup and verifies the downloaded data according to the verification information.
In some examples, the transaction information including identification and authentication information for the account data backup further includes: the block height and corresponding block header hash value; wherein the backup module further associates the identifier and the verification information of the account data backup with the block height and the corresponding block header hash value; the apparatus further comprises: the verification module is used for executing the following processing if the transaction information is determined to contain the information of account data backup according to the transaction type field in the transaction information when the transaction information issued by other nodes is received: reading the identification, the verification information, the block height and the block head hash value of the account data backup from the transaction information; determining whether the account data backup corresponding to the block height is uplink or not according to the read identification of the account data backup, the block height and the block head hash value; when determining that the account data backup corresponding to the block height is uplink, determining that the transaction information issued by the other nodes is not credible; and when determining that the account data backup corresponding to the block height is not linked, verifying whether the transaction information issued by the other node is credible according to the locally stored block head hash value and/or verification information of the account data backup corresponding to the block height and the verification information and/or block head hash value read from the transaction information.
In some examples, the apparatus further comprises: and the data synchronization module is used for sending an inquiry request to other nodes in the blockchain network when the data is to be added into the blockchain network or recovered, receiving account data backup which is sent by other nodes in response to the inquiry request and is associated with the maximum block height, and starting to download the blocks which are linked up in the blockchain from the associated block height according to the account data backup.
In some examples, the data synchronization module further downloads some or all of the blocks in the block chain from the founder block to the maximum block height corresponding block from other nodes and sequentially adds the downloaded blocks to the locally saved block chain.
The present application also provides a data processing apparatus, including: the request module is used for sending a query request to other nodes in the block chain network when the block chain network is to be added or data is to be recovered; and the data synchronization module receives an account data backup which is sent by other nodes in response to the query request and is associated with a block height, and downloads blocks which are linked up in a block chain from the associated block height according to the account data backup.
In some examples, the data synchronization module further downloads some or all of the blocks in the block chain from the founder block to the maximum block height corresponding block from other nodes and sequentially adds the downloaded blocks to the locally saved block chain.
By adopting the scheme provided by the application, the rapid joining and the data recovery of the block chain nodes can be realized, so that the nodes can recover the operation of the block chain as soon as possible, and the system performance is improved.
Drawings
In order to more clearly illustrate the technical solutions in the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only examples of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive effort. Wherein the content of the first and second substances,
FIG. 1 is a diagram of a system architecture to which an example of the present application relates;
FIG. 2A is a block diagram of a data structure;
FIG. 2B is a partial schematic view of a blockchain in an example of the present application;
FIG. 3 is a diagram illustrating an application scenario in an example of the present application;
FIG. 4 is a diagram of message interactions in an example of the present application;
fig. 5A shows an example of a transaction information data structure recorded in the block body;
FIG. 5B shows an example data structure of transaction information in an example of the present application;
FIGS. 6A-6B are flow diagrams of methods provided by examples of the present application;
FIG. 7 is a schematic view of an apparatus provided in an example of the present application;
FIG. 8 is a schematic view of an apparatus provided in an example of the present application; and
FIG. 9 is a block diagram of a computing device in an example of the present application.
Detailed Description
For simplicity and clarity of description, the invention will be described below by describing several representative embodiments. Not all embodiments are shown herein. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention. Some embodiments are not described in detail, but rather are merely provided as frameworks, in order to avoid unnecessarily obscuring aspects of the invention. Hereinafter, "including" means "including but not limited to", "according to … …" means "at least according to … …, but not limited to … … only". The word "comprising" in the description and in the claims is intended to include at least to some extent, and should be interpreted as including other features which may be present in addition to those mentioned later.
The present application provides a data processing method, which can be applied to the block chain system 100 shown in fig. 1. As shown in fig. 1, the system 100 includes at least: an application layer 101, a network layer 103, and a data layer 104, and may further include an extension layer 102, and the like. The application layer 101 provides user-oriented application clients 11 and 12 (such as wallet clients for digital asset transactions, etc.) and a trading platform 13. The application clients 11 and 12 run on a terminal device, and the terminal device may include: PC, cell-phone, panel computer, palm computer, super polar, wearable equipment etc.. The user can log in the trading platform 13 to complete various trading operations by operating the User Interfaces (UI) provided by the application clients 11 and 12, such as: digital asset transactions, shared ledger lookups, and the like; trading platform 13 may comprise a server or a cluster of servers, and may also comprise a distributed system. The extension layer 102 provides some extended application service functions, including side-chain applications such as intelligent contracts, and may also include storage and sharing functions of user data files such as documents, pictures, videos, and the like. The UI provided by the user by operating the application clients 11 and 12 can implement functions such as intelligent contract signing, data file storage and sharing, and the like through the extension layer 102. The network layer 103 includes a plurality of blockchain nodes 14 distributed in various regions, the nodes 14 form a blockchain network, each node 14 may be a computing device with peer-to-peer communication function, such as a desktop computer, a notebook computer, a tablet computer, etc., the blockchain nodes 14 form a peer-to-peer (P2P) network, and each node 14 stores complete data of a blockchain 15. The network layer 103 is used for implementing communication between the nodes 14, and encapsulates a P2P networking mechanism, a data propagation mechanism, a verification mechanism, and the like between the nodes 14. The blockchain network is essentially a P2P network, where each node 14 both receives and generates information, and a common blockchain is maintained between nodes 14 to maintain communications. In a blockchain network, each node 14 can create a new block, and after the new block is created, other nodes are notified in a broadcast manner, and verify the block, and when more than 51% of the nodes in the whole blockchain network verify, the new block can be added to the blockchain. The data layer 104 encapsulates the data structure of the blockchain 15. As shown in fig. 1, a block chain 15 is formed by linking a plurality of blocks (block 0 to block n). The first established block 0 is a 'created block', and then the blocks with the same data structure established under a certain rule are sequentially connected through a chain structure to form a main chain. As the running time is longer, new blocks are continuously added to the main chain after being verified, and the main chain is also continuously prolonged.
Fig. 1 shows a part of a blockchain system 100, and in practical applications, a consensus layer, a driver layer, and the like are also provided on a network layer 103. The consensus layer encapsulates a consensus mechanism, so that the highly dispersed nodes 14 can efficiently achieve consensus on the validity of the block data in the decentralized system, that is, it is agreed how to achieve consensus among all the nodes 14 to determine the validity of a transaction record set, which is a determination means and a tamper-proof means. The common consensus mechanisms are mainly as follows: proof of workload (Proof of Work), Proof of rights (Proof of stamp), Proof of authorized shares (released Proof of stamp).
In a Block chain system, data is permanently recorded in the form of files, which may be referred to as blocks (blocks). A block may contain a set of transaction records that occurred over a period of time and that were not recorded by previous blocks, each block recording all events that occurred before it was created. The blocks created are linked in sequence, and typically a new block will load the end of the block chain and link to the previous block. Wherein, the Transaction (Transaction) represents a user operation in the Transaction system, which causes a change of the state of the ledger, and adds a record in the ledger; the block records the transaction and state results occurring within a period of time, which is a common consensus on the current account book state; the Chain (Chain) is formed by connecting blocks in series according to the creation time sequence and is a log record of the state change of the whole account book.
A tile is a data structure that records transactions. Each block consists of a block head and a block body, the block body is responsible for recording all transaction information in a previous period, and the block head records information for linking a parent block, mining competition and transaction data verification. Fig. 2A shows a data structure of the block 200A. As shown in fig. 2A, the block 200A includes a block header 21 and a block body 22. The field block 22 records the number of transactions and information for each transaction that occurred over a period of time, such as transaction 1, transaction 2, … …, and transaction m. The block header 21 records the following pieces of information:
1. the version number is used for identifying the relevant version information of the software and the protocol;
2. the parent block hash value is a block head hash value of a parent block of the block 200A, and blocks can be connected end to form a block chain through the value, and the value plays an important role in the safety of the block chain;
3. a Merkle root, which is a numerical value calculated by hashing the hash values of all the transaction information in the block 22 step by step, and is mainly used for verifying whether a transaction exists in the block;
4. a timestamp recording the time of creation of the block 200A, which may be accurate to seconds;
5. the difficulty value is the target difficulty value of the relevant mathematical problem of the block 200A;
6. random number (Nonce), which records the value of the answer to decrypt the associated mathematical question of block 200A.
After the block 200A joins the blockchain, all miners (i.e., individual blockchain nodes 14) begin the next blockchain generation, including:
1. recording the transaction information in the local memory into the block;
2. generating a Merkle tree of all transaction information in the block, and storing the value of a Merkle tree root (namely the Merkle root) in a block header;
3. generating a hash value by using the SHA256 algorithm on the data of the block head of the parent block of the block 200A which is added into the block chain recently, and filling the hash value into the hash value of the parent block of the current block;
4. saving the current time in a timestamp field;
5. the difficulty value field is adjusted according to the average generation time of the blocks in a previous period of time to deal with the overall calculation total quantity which changes continuously in the whole network, if the calculation total quantity is increased, the system can increase the difficulty value of the mathematical problem, and the time for expecting to finish the next block is still in a certain time.
For a chunk, the chunk header hash value may identify only one chunk, and any node 14 may independently obtain the chunk header hash value by hashing the chunk header. The chunk header hash value is not actually included in the data structure of the chunk, and the chunk header hash value is calculated by a node 14 when the chunk is received by the node 14 from the blockchain network. The chunk header hash value may be stored as part of the chunk metadata in a separate database table to facilitate indexing and faster retrieval of the chunk from disk. In addition, the block also has a block height (block height) in the block chain, which can be used to identify the position of the block in the block chain. The block height of the first block (i.e., the created block) is 0, the height of the block referencing the created block is 1, and so on, each block subsequently stored in the chain of blocks is "higher" by one position than the previous block by a block height value equal to the block height value of the previous block plus one. Unlike the hash value of the chunk header, the chunk height is not the unique identifier of the chunk, and two or more chunks may have the same chunk height, competing for the same location in the chunk chain. The block height is also not part of the block data structure and it is not stored in the block. When the node 14 receives a block from the blockchain network, the location of the block within the blockchain (i.e., the block height) is dynamically identified. Block heights may also be stored as metadata in an index database table for quick retrieval.
Fig. 2B shows a partial schematic diagram of a blockchain 200B in an example of the present application. Three blocks 23, 24 and 25 are shown in fig. 2B, and the block height and the block header hash value of each block are not recorded inside the block, but determine the linking relationship between the blocks. The chunk height and chunk header hash values for each chunk may be maintained in a chunk chain metadata table in the local database of the chunk chain node 14.
In a blockchain network, new nodes may join at any time, and data of the current blockchain needs to be downloaded from other nodes when the new nodes join. In some examples, as shown in fig. 3 in the blockchain network 300, there are three nodes 14, and when a new node 34 requests to join, the new node 34 will establish a P2P connection with other nodes 14 and achieve information synchronization, wherein the new node 34 will download the complete data of the current blockchain 15 from other nodes, so that all nodes 14 and 34 in the network 300 will maintain the same full amount of data of the blockchain 15. When a failure, such as a downtime, occurs in a node 14 or 34, data recovery is required, as well as downloading complete data for blockchain 15 from other nodes in network 300. With the continuous expansion of the block chains and the increase of the number of the block chains in the network, the data amount stored by each node is more and more, a bottleneck of data synchronization occurs at a certain stage, and when a new node is added or an existing node recovers data, the data synchronization process consumes a large amount of processing resources and even seriously affects the system performance.
In other examples, a data processing method is applied in a single blockchain node 14 to backup blockchain data and restore the backed-up data to the node 14 or 34. Fig. 4 shows a flow chart of such a data processing method as proposed in an example of the present application. As shown in fig. 4, the data processing method 400 begins at step S401.
In step S401, when determining that the block height of the block recently added to the block chain meets the set condition, the node 14 obtains the current account data backup and saves the account data backup.
In some examples, the increment value N of the block height may be set in advance, and N is a fixed value, such as N is equal to 1 ten thousand or 10 ten thousand, where the setting condition is that the block height is equal to a multiple of N, so that one account data backup can be obtained every N blocks. For example: if N is set to be equal to 1 ten thousand, the node 14 will obtain the account data backup when the block height of the latest added block is equal to a multiple of 1 ten thousand, that is, when the block heights of the block chain reach 1 ten thousand, 2 ten thousand, … …, and N ten thousand, respectively, the node 14 will obtain the account data backup at that time.
In other examples, the setting condition may be set according to other rules, for example, the increment value N of the block height is set according to implementation needs to be changed according to a certain rule, for example, when the block height meets a certain setting formula, so that one account data backup is not obtained every fixed number of blocks, but a plurality of account data backups corresponding to different block heights in the block chain may be obtained within a period of time.
In some examples, when a new block is added to the blockchain by the node 14, if the block height of the new block meets the set condition, the current account data backup is acquired.
In some examples, the account data backup is a backup of the processed content of the transaction recorded in the node 14, such as: an Unspent Transaction Output (UTXO) table in a bitcoin Transaction, or an account database table in an ethernet Transaction. In the blockchain system, the account data includes the asset balance (including the remaining amount of the digital assets, the remaining amount of the physical assets, and the like) of each account generated in each transaction. For example, in a bitcoin transaction scenario, the UTXO table is used to record the set of all bitcoins that have been dug out that are not spent. Each UTXO has a face value and an owner address (essentially defined by the address of the cryptographic public key). A transaction includes one or more inputs and one or more outputs. Each input contains a reference to the existing UTXO and a cryptographic signature created by the private key corresponding to the owner address. Each output contains a new UTXO.
Fig. 5A shows several examples of transaction information recorded in the block 500A. In fig. 5A, in a transaction with a transaction number of "# 1001", the transaction output information 51 records that the account balance of the account "a" is 12.5, in a transaction with a transaction number of "# 2001", the transaction output information 52 records that the account balance of the account "a" is 10, the account balance of the account "B" is 2.5, and in a transaction with a transaction number of "# 3001", the transaction output information 53 records that the account balance of the account "a" is 7.5, and the account balance of the account "C" is 5. It can be seen that in the transaction with the transaction number "# 2001", the transaction output of the account B is used up, and the balance of the account B is not recorded in the current account data (e.g., UTXO table).
In some instances, the retrieved backup of account data may be a snapshot (snapshot) of the account data.
In some instances, the corresponding block height may be recorded when the account data backup is saved.
In some examples, the account data backup is maintained locally at node 14 or in a centralized or distributed database system to which node 14 is connected, wherein block heights may be maintained in association with the account data backup.
In some examples, account data backup may be further linked in order to ensure the correctness of the account data backup due to the presence of malicious nodes. Specifically, the information backed up by the account data may be recorded in the block as a piece of transaction information. For example, after obtaining the account data backup of one block, the identification and summary information of the account data backup may be generated, and then the Identification (ID) and summary information of the account data backup may be recorded in a transaction message of another block, wherein a complete account data backup may be obtained through the identification and summary information of the account data backup. Here, the account data backup may be a snapshot of the account data, the identification of the account data backup may be a snapshot ID, and the digest information of the account data backup may be a verification code (e.g., MD5 value) obtained by using a data digest algorithm.
In some examples, when a transaction message is generated based on the information of the account data backup, the correctness of the backup may be recognized based on the recognition mechanism of the blockchain system itself, and the information of the account data backup subjected to recognition is linked. Such as: in the voting consensus, the account data snapshot can be considered to be correct when the specified number of votes is reached. For another example: proof of work (POW) consensus that a snapshot of account data is correct if a specified number of blocks are generated after the blocks that contain the snapshot.
In some examples, the data structure for recording transaction information in the block may include: one or more transaction inputs and one or more transaction outputs, wherein a transaction input comprises at least: hash value of previous transaction, number of transaction output spent; a transaction output includes at least an output value (which may be a monetary value or other business data) and an output address. In some examples, the data structure for recording transaction information may include a transaction type indicating whether the transaction information is recorded with asset balance or account data backup information or other business data, and the data structure for the transaction information may be different according to the recorded data type indicated by the transaction type. In the block 500B shown in fig. 5B, in the transaction information with the transaction number "# 4001", the transaction information 54 includes a transaction type field, and the transaction type field indicates "snapshot", so that the transaction information 54 includes fields corresponding to the "snapshot" type, including: snapshot ID, digest (e.g., MD5 value), chunk height, and chunk hash value. In the transaction information having a transaction number of "# 3001", the transaction information 55 includes a transaction type field indicating "asset transaction", and the transaction information 55 may include transaction input and transaction output fields corresponding to the "asset transaction" type. In other examples, a specific field may be included in the transaction number or version number, and the specific field may indicate that the piece of transaction information has the account data backup information recorded therein.
When the node 14 receives the candidate blocks issued by other nodes, each transaction message is verified based on the consensus mechanism. When the certain transaction information is analyzed to contain the information of the account data backup, the correctness of the account data backup can be verified. In some examples, when generating an account data backup, the node 14 records the block height, the hash value of the block, and the like corresponding to the account data backup in its own connected database. When the node 14 obtains the information issued by other nodes and containing the account data backup corresponding to a certain block height, it queries the metadata base of the block chain to determine whether the account data backup corresponding to the block height is linked. And if the information of the currently acquired account data backup is determined to be uplink, the information is not credible, and the verification is not passed. If it is determined that no link is established, it may be verified whether the account data backup generated by itself at the block height is consistent with account data backups issued by other nodes according to information recorded by itself, for example, whether digital digests (e.g., MD5 values) of the two account data backups are consistent, whether block hash values corresponding to the two account data backups are consistent, and the like.
In step S402, when the new node 34 requests to join the blockchain network, a backup of account data corresponding to the highest block height is queried for each node 14, and the backup of account data is used as current account data.
In some examples, the account data backup is linked in step S401, that is, the information of the account data backup is recorded in a certain block. In step S402, the new node 34 may query information of a latest available account data backup recorded in the blockchain from each node 14 (for example, query information of a latest available snapshot ID and an MD5 value), and may download complete data of the account data backup according to the information of the account data backup, where snapshot data may be obtained according to the snapshot ID, and integrity of the snapshot data may be verified according to the MD5 value. In this way, it can be ensured that the node 34 can obtain a correct account data backup, and prevent an attack from a malicious node.
In step S403, the new node 34 starts to add a subsequent uplink block in the blockchain based on the current account data, including: the uplink blocks above the highest block height are downloaded and uplink from the other nodes 14 and local account data (such as UTXO tables) is updated each time a block is added locally to record the transaction output information recorded in the currently added block in the account data.
For example: if the account data backup queried from each node 14 has a block height of 10000, and the account data backup includes transaction output information recorded in a block with a block height of 10000 (hereinafter referred to as block 10000), then node 34 downloads a block with a block height of 10001 (hereinafter referred to as block 10001, and so on, a block with a block height of N is referred to as block N) from other nodes 14, and also queries other nodes 14 for a block header hash value of block 10000, so that after block 10001 is linked to block 10000, local account data (such as UTXO table) is updated according to the transaction output information recorded in block 10001, and similarly, blocks with a link height of more than 10001 can be downloaded from other nodes 14 and linked together, local account data is updated each time a block is linked, and the block header hash value of the block is calculated, and recording the block head hash value and the block height of the block in a local block metadata base.
Through the above processing, the new node 34 does not need to download all the blocks that have been linked up before from the blockchain network, but can download the blocks that have been linked up from the height of the block corresponding to the most recently backed up account data, so that the new node can be quickly added to the blockchain network to start processing new transaction information as soon as possible. The new node 34 may also be a node that needs to perform data recovery due to a fault such as downtime existing in the blockchain network, and the specific processing flow is similar and will not be described in detail herein.
After joining the blockchain network, the node 34 creates a candidate block, adds new transaction information that has occurred in the recent period of time to the candidate block and broadcasts the candidate block to the blockchain network, and chains up the identified block and updates the local account data in step S404. Thereafter, the node 34 may add subsequent blocks in the same manner, and detailed processing is not repeated herein.
Assuming that the block height of the block chain has reached 10010, the blocks 10001-10010 are downloaded first, and then candidate blocks 10011 are created through a mining process, the identified blocks 10011 are added to the block chain and the local account data is updated. The uplink block 10011 may be a common block 10011 created by the node 34 itself or a common block 10011 received from other nodes 14. Here, each node will collect transaction information occurring in the latest period of time into a candidate block created by itself, continuously generate random character strings and calculate random number answers, but when the obtained answers match with the random numbers, the candidate block is broadcast to each node in the block chain network, each node verifies the transactions in the candidate block, when the transactions in the candidate block reach a certain proportion of node verifications, for example, more than 51% of node verifications pass, each node agrees with the block, and the block is accepted, so that the block can be uplinked.
In some examples, the node 34 also needs to download the block corresponding to the highest block height in step S402 and the previous block. Step S405 may be performed. In step S405, the node 34 queries and downloads the block corresponding to the highest block height in step S402 and some or all of the previous blocks from each node 14.
In some examples, in step S405, the node 34 queries each node 14 for a backup of account data corresponding to a certain block height, and uses the backup of account data as current account data. The node 34 starts to add subsequent blocks that have been linked up in the blockchain based on the current account data, including: the uplink blocks above the block height are downloaded and uplink from other nodes 14, and whenever a block is added locally, i.e. the local account data is updated, the transaction output information recorded in the currently added block is recorded in the account data.
In some examples, in step S405, node 34 may download the created blocks (i.e., blocks with a block height of zero) from each node 14 and obtain the primary account data according to the transaction output information of the created blocks, so that node 34 may start to add each block after the created block in the block chain based on the primary account data. Similar to the previous steps, every time a block is added locally, i.e. the local account data is updated, the transaction output information recorded in the currently added block is recorded in the account data.
The present example proposes a data processing method applied to a node 14, and as shown in fig. 6A, the method 600A starts with step S601.
In step S601, when the node 14 determines that the block height of the block recently added to the block chain meets the set condition, the current account data backup is obtained, and the account data backup is associated with the block height and stored.
In step S602, when receiving the query request from the node 34, the account data backup associated with the maximum block height is sent to the node 34, so that the node 34 starts to download blocks that have been linked up in the block chain from the block height associated with the account data backup and adds the blocks to the block chain locally stored in the node 34 according to the account data backup.
In this example, each node 14 in the blockchain network may back up account data at multiple block heights, and when a new node 34 wants to join the network or restore data, the newly backed up account data (i.e., the account data corresponding to the maximum block height) may be provided to the new node 34 in response to an inquiry request of the new node 34, so that the new node 34 may start synchronizing the uplink blocks from the block height corresponding to the newly backed up account data, thereby significantly increasing the speed of joining the network and restoring data by the node 34, saving processing resources, enabling the node 34 to start to run the blockchain quickly, and improving system performance. Since the account data backed up by different nodes 14 at the same block height is the same, the accuracy of the account data backup obtained by the new node 34 in this example can be ensured, thereby ensuring the accuracy of the data recovered by each block by the node 34.
In some examples, the setting conditions include: the block height is equal to the value calculated according to the set algorithm. This setting algorithm can be represented by the following formula: y is a + b N, where Y is a calculated value, a and b are both set values, a and b may be the same or different values, and N is any integer. Thus, node 14 may obtain a backup of account data for every certain number of blocks.
In some examples, in step S601, when a new block is added to the blockchain, the node 14 determines whether the new block meets the set condition, and when it is determined that the block height of the new block meets the set condition, the step of obtaining the current account data backup is performed.
In some examples, the account data backup includes a backup of transaction output information generated by a transaction that has occurred, such as a UTXO table in a bitcoin system, an account data table in an ethernet system.
In some examples, the account data backup includes a snapshot of the account data. Specific details have been described above.
In some examples, the step S601 may further include: the node 14 generates the identification and verification information of the account data backup, generates and issues a piece of transaction information including the identification and verification information of the account data backup, and links the block including the transaction information after the consensus processing (the block linked up may be issued by the node 14 or may be issued by other nodes). In step S602, the sending the account data backup associated with the maximum block height to the node 34 includes: the node 14 queries the block chain to obtain the identification and verification information (such as the snapshot identification of the account data and the MD5 value thereof) of the last linked account data backup; and sending the inquired identification and verification information of the account data backup to the node 34, so that the node 34 downloads the data of the account data backup according to the identification of the account data backup and verifies the downloaded data according to the verification information. In this example, the node 14 may chain up the obtained account backup, so as to prevent the attack of a malicious node, and further ensure the data security.
In some examples, the transaction information generated by node 14 that includes the identification and verification information for the account data backup may further include: the account data backup is associated with a chunk height and a corresponding chunk header hash value. The method 600A may further include:
1. the identification of the account data backup, authentication information, and the block height and corresponding block header hash value are associated.
2. When transaction information issued by other nodes is received, if the transaction information is determined to contain account data backup information according to a transaction type field in the transaction information, executing the following processing:
1) reading the identification, the verification information, the block height and the block head hash value of the account data backup from the transaction information;
2) determining whether the account data backup corresponding to the block height is uplink or not according to the read identification of the account data backup, the block height and the block head hash value;
3) when determining that the account data backup corresponding to the block height is uplink, determining that the transaction information issued by the other nodes is not credible; and
4) and when determining that the account data backup corresponding to the block height is not linked, verifying whether the transaction information issued by the other node is credible according to the locally stored block head hash value and/or verification information of the account data backup corresponding to the block height and the verification information and/or block head hash value read from the transaction information.
In this way, the node 14 can also verify the account data backups issued by other nodes according to the information related to the account data backups generated by the node, thereby completing the consensus process of the account data backups, and linking the account data backups which are known by the nodes (i.e. trusted).
In the above example, the node 14, as an existing node in the blockchain network, can respectively backup account data at multiple block heights, so that a backup of account data at a certain block height can be provided for a new node 34 or a node 34 requesting to restore data, so that the node 34 can quickly complete block data synchronization.
In some instances, the node 14 may request to rejoin the network or recover data in some cases, at which point the method 600A further includes step S603. In step S603, when a node wants to join the blockchain network or recover data, the node 14 sends a query request to other nodes in the blockchain network; receiving account data backups associated with the maximum block heights sent by other nodes in response to the query request; downloading blocks that have been uplinked in the block chain starting from their associated block heights based on the account data backup. Thus, the node 14 recovers data of a part of the block, and can start a normal operation of the block chain, and add a new block to the block chain.
After node 14 begins normal operation of the blockchain, node 14 may further download some or all of the other uplinked blocks locally and add to the locally stored blockchain as needed. In some examples, the method may further include step S604, in which the node 14 downloads some or all of the blocks in the block chain from the created block to the maximum block height corresponding block from other nodes and sequentially adds the downloaded blocks to the block chain stored locally. Thus, the node 14 first recovers some blocks of the last uplink to allow the block chain to run quickly, and then synchronizes some blocks of the previous uplink as required, thereby ensuring the timeliness of the node joining the network or recovering data and also considering the requirement of block data synchronization.
The present embodiment also provides a data processing method, which is applied to a node 34 that wants to join a blockchain network or requests to recover data. As shown in fig. 6B, the method 600B begins at step S611.
In step S611, when the node 34 wants to join the blockchain network or recover data, it sends a query request to other nodes 14 in the blockchain network.
In step S612, a backup of account data associated with a block height sent by the other node 14 in response to the query request is received, and blocks already uplink in the block chain are downloaded from the block height associated with the backup of account data according to the backup of account data. This block height may be the block height corresponding to the most recently acquired copy of account data by node 14.
Thus, the node 34 does not need to synchronize all blocks in the blockchain, but synchronizes the linked blocks according to the account data backup from a certain block height, so that the synchronization of the necessary blocks can be completed quickly, and the blockchain can be started to run and add new blocks to the blockchain.
In the above example, in step S612, the receiving the account data backup associated with a block height sent by the other node in response to the query request includes: receiving identification and verification information of the account data backup sent by other nodes in response to the query request; and downloading the data of the account data backup from other nodes according to the identification of the account data backup, and verifying the downloaded data according to the verification information.
In the above example, the method 600B may further include step S613, in which the node 34 downloads some or all of the blocks in the block chain from the created block to the maximum block height corresponding block from other nodes 14 and sequentially adds the downloaded blocks to the locally stored block chain.
In some examples, the node 34 downloads all blocks in the block chain from the created block to the block corresponding to the maximum block height from the other nodes 14, and sequentially adds the downloaded blocks to the block chain stored locally, specifically including: downloading the foundational blocks from other nodes 14; obtaining current account data according to the transaction output information of the creating block; downloading blocks which are linked in the block chain from the created blocks according to the current account data, adding the blocks into the block chain which is stored locally, and updating the current account data according to the transaction output information of the block when one block is added into the block chain.
In some examples, the downloading, by the node 34, part of the blocks in the block chain from the created block to the block corresponding to the maximum block height from the other node 14 and sequentially adding the downloaded blocks to the locally stored block chain specifically includes: inquiring from other nodes to obtain a second account data backup corresponding to the second block height, and using the second account data backup as current account data; and downloading blocks which are linked up in the block chain from the second block height according to the current account data, adding the blocks into the block chain which is locally stored, and updating the current account data according to the transaction output information of the blocks when one block is added into the block chain. Here, the second block height may be lower than the block height in step S612, specifically, from which block height the block is downloaded, depending on the implementation requirement.
Based on the above method example, the application example also provides a corresponding data processing device.
Fig. 7 shows a data processing apparatus, which is applied to a node 14, and as shown in fig. 7, an apparatus 700 includes:
the backup module 701, when it is determined that the block height of the block recently added to the block chain meets the set condition, obtains the current account data backup, associates the account data backup with the block height, and stores the account data backup.
The sending module 702, when receiving a query request from a node 34, sends the account data backup associated with the largest block height to the node 34, so that the node 34 starts to download the blocks that have been linked up in the block chain from their associated block heights according to the account data backup and adds the blocks to the block chain locally stored by the node 34.
In some examples, the apparatus 700 further comprises:
the transaction information publishing module 703 generates the identifier and the verification information of the account data backup, generates a piece of transaction information including the identifier and the verification information of the account data backup, and publishes the transaction information.
The uplink module 704 uplinks the block containing the transaction information that is processed by the consensus.
The sending module 702 obtains the identifier and the verification information of the last uplink account data backup by querying from the block chain, and sends the queried identifier and the verification information of the account data backup to the node 34, so that the node 34 downloads the account data backup data according to the identifier of the account data backup and verifies the downloaded account data according to the verification information.
In some examples, the transaction information including identification and authentication information for the account data backup further includes: the chunk height and corresponding chunk header hash value. The backup module 701 further associates the identifier and the verification information of the account data backup with the block height and the corresponding block header hash value. The apparatus 700 further comprises: the verification module 705, when receiving transaction information issued by other nodes, if determining that the transaction information includes information of account data backup according to a transaction type field in the transaction information, performs the following processing:
1) reading the identification, the verification information, the block height and the block head hash value of the account data backup from the transaction information;
2) determining whether the account data backup corresponding to the block height is uplink or not according to the read identification of the account data backup, the block height and the block head hash value;
3) when determining that the account data backup corresponding to the block height is uplink, determining that the transaction information issued by the other nodes is not credible; and
4) and when determining that the account data backup corresponding to the block height is not linked, verifying whether the transaction information issued by the other node is credible according to the locally stored block head hash value and/or verification information of the account data backup corresponding to the block height and the verification information and/or block head hash value read from the transaction information.
In some examples, the apparatus 700 further comprises: the data synchronization module 706, when it is desired to join the blockchain network or recover data, sends an inquiry request to another node in the blockchain network, receives an account data backup associated with the maximum block height sent by the other node in response to the inquiry request, and starts to download blocks that have been uplinked in the blockchain from the associated block height according to the account data backup.
In some examples, the data synchronization module 706 further downloads some or all of the blocks in the block chain from the founder block to the maximum block height corresponding block from other nodes and sequentially adds the downloaded blocks to the locally saved block chain.
Fig. 8 shows a data processing apparatus, which is applied to the node 34, and as shown in fig. 8, the apparatus 800 includes:
the request module 801 sends a query request to other nodes 14 in the blockchain network when the node wants to join the blockchain network or recover data.
The data synchronization module 802 receives an account data backup associated with a block height sent by the other node 14 in response to the query request, and starts downloading blocks that have been uplink in the block chain from the block height associated with the account data backup.
In some examples, the data synchronization module 802 further downloads some or all of the blocks in the block chain from the founder block to the maximum block-height corresponding block from other nodes 14 and sequentially adds the downloaded blocks to the block chain stored locally.
The implementation principle of the functions of the above modules has been described in detail previously, and is not described in detail herein.
In some examples, the data processing apparatus 700 and 800 described above may be run in various computing devices and loaded in a memory of the computing device. The nodes 14 and 34 described above may be implemented as network node servers.
Fig. 9 shows a component block diagram of a computing device in which the data processing apparatus 700 or 800 is located. As shown in fig. 9, the computing device includes one or more processors (CPUs) 902, a communications module 904, a memory 906, a user interface 910, and a communications bus 908 for interconnecting these components.
The processor 902 can receive and transmit data via the communication module 904 to enable network communications and/or local communications.
User interface 910 includes one or more output devices 912 including one or more speakers and/or one or more visual displays. The user interface 910 also includes one or more input devices 914, including, for example, a keyboard, a mouse, a voice command input unit or microphone, a touch screen display, a touch-sensitive tablet, a gesture-capture camera or other input buttons or controls, and the like.
The memory 906 may be a high-speed random access memory such as DRAM, SRAM, DDR RAM, or other random access solid state memory devices; or non-volatile memory, such as one or more magnetic disk storage devices, optical disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
The memory 906 stores a set of instructions executable by the processor 902, including:
an operating system 916 including programs for handling various basic system services and for performing hardware related tasks;
applications 918, including various application programs, that enable the process flow in the examples described above, may include, for example, apparatus 700 shown in FIG. 7 and/or apparatus 800 shown in FIG. 8. In some examples, apparatus 700 may include some or all of the various modules 701-706 shown in FIG. 7, and each of the modules 701-706 may store machine-executable instructions. The processor 902 can implement the functions of the modules 701-706 by executing the machine-executable instructions in the modules 701-706 in the memory 906. In some examples, the apparatus 800 may include some or all of the various modules 801-802 shown in FIG. 8, and each of the modules 801-802 may store machine-executable instructions. The processor 902 can implement the functions of the modules 801-802 by executing the machine-executable instructions of the modules 801-802 in the memory 906.
It should be noted that not all steps and modules in the above flows and structures are necessary, and some steps or modules may be omitted according to actual needs. The execution order of the steps is not fixed and can be adjusted as required. The division of each module is only for convenience of describing adopted functional division, and in actual implementation, one module may be divided into multiple modules, and the functions of multiple modules may also be implemented by the same module, and these modules may be located in the same device or in different devices.
The hardware modules in the embodiments may be implemented in hardware or a hardware platform plus software. The software includes machine-readable instructions stored on a non-volatile storage medium. Thus, embodiments may also be embodied as software products.
In various examples, the hardware may be implemented by specialized hardware or hardware executing machine-readable instructions. For example, the hardware may be specially designed permanent circuits or logic devices (e.g., special purpose processors, such as FPGAs or ASICs) for performing the specified operations. Hardware may also include programmable logic devices or circuits temporarily configured by software (e.g., including a general purpose processor or other programmable processor) to perform certain operations.
In addition, each example of the present application can be realized by a data processing program executed by a data processing apparatus such as a computer. It is clear that a data processing program constitutes the present application. Further, the data processing program, which is generally stored in one storage medium, is executed by directly reading the program out of the storage medium or by installing or copying the program into a storage device (such as a hard disk and/or a memory) of the data processing device. Such a storage medium therefore also constitutes the present application, which also provides a non-volatile storage medium in which a data processing program is stored, which data processing program can be used to carry out any one of the above-mentioned method examples of the present application.
Machine-readable instructions corresponding to the modules in fig. 7 and 8 may cause an operating system or the like operating on the computer to perform some or all of the operations described herein. The nonvolatile computer-readable storage medium may be a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer. A CPU or the like mounted on the expansion board or the expansion unit may perform part or all of the actual operations according to the instructions.
The nonvolatile computer readable storage medium includes a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD + RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer via a communications network.
In view of the above, the scope of the claims should not be limited to the embodiments in the examples described above, but should be given the broadest interpretation given the description as a whole.

Claims (16)

1. A method of data processing, the method comprising:
when the block height of a block which is added recently in a block chain is determined to meet a set condition, acquiring a current account data backup, generating a transaction message containing an identification and verification information of the current account data backup, and linking the block which is subjected to consensus processing and contains the transaction message; and
when receiving a query request from a node, querying and obtaining the identification and verification information of the latest uplink account data backup from the block chain; and sending the identification and the verification information of the account data backup of the latest uplink to the node so that the node downloads the data of the account data backup of the latest uplink according to the received identification, verifies the downloaded data according to the received verification information, and downloads the uplink blocks in the block chain from the block height corresponding to the account data backup of the latest uplink and adds the uplink blocks into the block chain locally stored by the node.
2. The method of claim 1, wherein the setting conditions comprise: the block height is equal to a value calculated according to a set algorithm; wherein the setting algorithm is represented by the following formula:
Y-b-N, where Y is the block height, b is a multiple, N is the incremental value of the block height, and N is any positive integer.
3. The method of claim 1, wherein the account data backup comprises a backup of content after processing of the transaction that has occurred.
4. The method of claim 1, wherein the account data backup comprises a snapshot of the account data.
5. The method of claim 1, further comprising:
and when the block containing the transaction information which is subjected to the consensus processing is linked up, a transaction type field is included in a data structure and used for indicating that the transaction information record is information of account data backup.
6. The method of claim 1, wherein the transaction information further comprises: the block height and corresponding block header hash value;
the method further comprises:
associating the identification, the verification information and the block height of the account data backup with the corresponding block head hash value;
when second transaction information issued by other nodes is received, if the second transaction information is determined to contain account data backup information according to a transaction type field in the second transaction information, executing the following processing:
reading identification, verification information, block height and block head hash value of account data backup from the second transaction information;
determining whether the account data backup corresponding to the block height is uplink or not according to the read identification of the account data backup, the block height and the block head hash value;
when determining that the account data backup corresponding to the block height is uplink, determining that the second transaction information is not credible; and
and when determining that the account data backup corresponding to the block height is not linked, verifying whether the second transaction information is credible or not according to the locally stored block head hash value and/or verification information of the account data backup corresponding to the block height and the verification information and/or block head hash value read from the second transaction information.
7. The method of claim 1, wherein the query request is sent to other nodes in a blockchain network when joining the blockchain network or recovering data.
8. A method of data processing, the method comprising:
when the node is to be added into the block chain network or the data is recovered, sending a query request to other nodes in the block chain network;
receiving an identification and verification information of the account data backup of the last chain transmitted by other nodes in response to the query request, wherein when the other nodes determine that the block height of the block recently added in the block chain meets a set condition, the other nodes acquire the current account data backup, generate a piece of transaction information containing the identification and verification information of the current account data backup, and chain the block which is subjected to consensus processing and contains the transaction information; and
and downloading the data of the account data backup of the latest uplink according to the received identification, verifying the downloaded data according to the received verification information, and downloading the blocks which are uplink in the block chain from the block height corresponding to the account data backup of the latest uplink.
9. The method of claim 8, wherein the account data backup comprises a backup of content after processing of the transaction that has occurred.
10. The method of claim 8, further comprising:
after the current node starts to normally run the block chain, downloading part or all of the blocks in the block chain from the created block to the block corresponding to the maximum block height from other nodes, and sequentially adding the downloaded blocks into the block chain stored locally.
11. The method of claim 10, wherein the downloading, from the other nodes, some or all of the blocks in the block chain from the created blocks to the blocks corresponding to the maximum block height, and sequentially adding the downloaded blocks to the block chain stored locally comprises:
downloading said founding blocks from other nodes;
obtaining current account data according to the transaction output information of the creating block; and
downloading blocks which are linked in the block chain from the created blocks according to the current account data, adding the blocks into the block chain which is locally stored, and updating the current account data according to the transaction output information of the block when one block is added into the block chain.
12. The method of claim 10, wherein the downloading, from the other nodes, some or all of the blocks in the block chain from the created blocks to the blocks corresponding to the maximum block height, and sequentially adding the downloaded blocks to the block chain stored locally comprises:
inquiring from other nodes to obtain a second account data backup corresponding to the second block height, and taking the second account data backup as current account data; and
and downloading the blocks which are linked in the block chain from the height of the second block according to the current account data, adding the blocks into the block chain which is locally stored, and updating the current account data according to the transaction output information of the block when one block is added into the block chain.
13. A data processing apparatus, characterized in that the apparatus comprises:
the backup module is used for acquiring the current account data backup, generating a piece of transaction information containing the identification and verification information of the current account data backup and linking the block containing the transaction information after consensus processing when the block height of the block recently added into the block chain is determined to meet the set condition; and
the sending module is used for inquiring and obtaining the identification and the verification information of the latest uplink account data backup from the block chain when receiving an inquiry request from a node; and sending the identification and the verification information of the account data backup of the latest uplink to the node so that the node downloads the data of the account data backup of the latest uplink according to the received identification, verifies the downloaded data according to the received verification information, and downloads the uplink blocks in the block chain from the block height corresponding to the account data backup of the latest uplink and adds the uplink blocks into the block chain locally stored by the node.
14. A data processing apparatus, characterized in that the apparatus comprises:
the request module is used for sending a query request to other nodes in the block chain network when the block chain network is to be added or data is to be recovered;
the data synchronization module receives an identifier and verification information of the account data backup of the recent uplink sent by other nodes in response to the query request, wherein when the other nodes determine that the block height of a block recently added in a block chain meets a set condition, the other nodes acquire the current account data backup, generate transaction information containing the identifier and the verification information of the current account data backup, and uplink the block which is subjected to consensus processing and contains the transaction information; and downloading the data of the account data backup of the latest uplink according to the received identification, verifying the downloaded data according to the received verification information, and downloading the blocks which are uplink in the block chain from the block height corresponding to the account data backup of the latest uplink.
15. A storage medium having stored thereon machine readable instructions for causing at least one processor to perform the method of any one of claims 1-12.
16. A computing device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, implement the method of any of claims 1 to 12.
CN201810557875.XA 2018-06-01 2018-06-01 Data processing method, device and storage medium Active CN108805570B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810557875.XA CN108805570B (en) 2018-06-01 2018-06-01 Data processing method, device and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910682868.7A CN110400142B (en) 2018-06-01 2018-06-01 Data processing method, device and storage medium
CN201810557875.XA CN108805570B (en) 2018-06-01 2018-06-01 Data processing method, device and storage medium

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201910682868.7A Division CN110400142B (en) 2018-06-01 2018-06-01 Data processing method, device and storage medium

Publications (2)

Publication Number Publication Date
CN108805570A CN108805570A (en) 2018-11-13
CN108805570B true CN108805570B (en) 2021-05-25

Family

ID=64090255

Family Applications (2)

Application Number Title Priority Date Filing Date
CN201910682868.7A Active CN110400142B (en) 2018-06-01 2018-06-01 Data processing method, device and storage medium
CN201810557875.XA Active CN108805570B (en) 2018-06-01 2018-06-01 Data processing method, device and storage medium

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN201910682868.7A Active CN110400142B (en) 2018-06-01 2018-06-01 Data processing method, device and storage medium

Country Status (1)

Country Link
CN (2) CN110400142B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109672755A (en) * 2019-01-24 2019-04-23 中国互联网络信息中心 A kind of domain name record update method and system based on block chain
CN109727040B (en) * 2019-01-28 2020-09-15 杭州复杂美科技有限公司 Data publishing method, data calling method, device and storage medium
CN110096505B (en) * 2019-03-31 2021-05-11 杭州复杂美科技有限公司 Data storage method, system, equipment and storage medium
WO2020199703A1 (en) * 2019-04-01 2020-10-08 杜晓楠 Method, device and system for blockchain transaction
CN110086856A (en) * 2019-04-01 2019-08-02 深圳前海达闼云端智能科技有限公司 Control method, device, storage medium and the electronic equipment of block chain node
CN110011788B (en) * 2019-04-10 2020-12-25 深圳市网心科技有限公司 Data processing method, system and related equipment based on block chain
CN110473104A (en) * 2019-08-20 2019-11-19 深圳市网心科技有限公司 A kind of transaction processing method and relevant device
CN110489488B (en) * 2019-08-21 2021-06-15 腾讯科技(深圳)有限公司 Data processing method and device
CN110609872B (en) * 2019-09-20 2021-03-05 北京海益同展信息科技有限公司 Method and apparatus for synchronizing node data
CN110933040A (en) * 2019-11-05 2020-03-27 武汉菲旺软件技术有限责任公司 Block chain based data uplink method, device, equipment and medium
CN112001731A (en) * 2020-04-02 2020-11-27 支付宝(杭州)信息技术有限公司 Block chain account balance deposit certificate and recovery method and device
CN111507720A (en) * 2020-04-22 2020-08-07 腾讯科技(深圳)有限公司 Data snapshot method and device based on block chain and computer readable storage medium
CN112184436B (en) * 2020-09-24 2021-07-16 成都质数斯达克科技有限公司 Data synchronization method, electronic device and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017104899A1 (en) * 2015-12-16 2017-06-22 (주)코인플러그 Block chain-based certificate authentication system and authentication method using same
CN107332876A (en) * 2017-05-31 2017-11-07 深圳前海微众银行股份有限公司 The synchronous method and device of block chain state
CN107423152A (en) * 2017-04-24 2017-12-01 杭州趣链科技有限公司 A kind of block chain common recognition node automatic recovery method
CN107526775A (en) * 2017-07-18 2017-12-29 杭州趣链科技有限公司 A kind of method of block chain data filing
CN108023896A (en) * 2017-12-28 2018-05-11 江苏通付盾科技有限公司 Block synchronous method and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106530088A (en) * 2016-12-19 2017-03-22 杜伯仁 Method for trading stock product based on block chain security nodes
CN107040594B (en) * 2017-04-12 2020-04-10 山大地纬软件股份有限公司 Method and device for allowing block chain node to be admitted based on PBFT
CN107729383B (en) * 2017-09-18 2021-06-29 联动优势科技有限公司 Index library generation method, data verification method, device and platform

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017104899A1 (en) * 2015-12-16 2017-06-22 (주)코인플러그 Block chain-based certificate authentication system and authentication method using same
CN107423152A (en) * 2017-04-24 2017-12-01 杭州趣链科技有限公司 A kind of block chain common recognition node automatic recovery method
CN107332876A (en) * 2017-05-31 2017-11-07 深圳前海微众银行股份有限公司 The synchronous method and device of block chain state
CN107526775A (en) * 2017-07-18 2017-12-29 杭州趣链科技有限公司 A kind of method of block chain data filing
CN108023896A (en) * 2017-12-28 2018-05-11 江苏通付盾科技有限公司 Block synchronous method and system

Also Published As

Publication number Publication date
CN110400142A (en) 2019-11-01
CN108805570A (en) 2018-11-13
CN110400142B (en) 2021-06-25

Similar Documents

Publication Publication Date Title
CN108805570B (en) Data processing method, device and storage medium
KR20200107771A (en) Blockchain World State Merkle Patricia Tree Subtree Configuration
US20140298034A1 (en) Data authenticity assurance method, management computer, and storage medium
US9589153B2 (en) Securing integrity and consistency of a cloud storage service with efficient client operations
US20210027289A1 (en) Asset transaction method, storage medium, and computer device
US10671308B2 (en) Private and fault-tolerant storage of segmented data
US20210216528A1 (en) Distributed blockchain data storage under account model
US20210216522A1 (en) Distributed blockchain data storage under account model
Maiyya et al. Database and distributed computing foundations of blockchains
Wüst et al. ACE: Asynchronous and concurrent execution of complex smart contracts
US11100094B2 (en) Taking snapshots of blockchain data
CN110597922A (en) Data processing method, device, terminal and storage medium
US20200084041A1 (en) Automated Blockchain Protocol Update
CN112287033B (en) Data synchronization method, equipment and computer readable storage medium
CN112287034B (en) Data synchronization method, equipment and computer readable storage medium
TWI737392B (en) Computer-implemented method for processing blockchain data by a blockchain node of a blockchain network in a trusted execution environment (tee), system communicating shared blockchain data and apparatus for communicating shared blockchain data
US20210279358A1 (en) Cryptographic data entry blockchain data structure
WO2020098817A2 (en) Taking snapshots of blockchain data
US20200336294A1 (en) Database composite endorsement
TW202111568A (en) Shared blockchain data storage based on error correction coding in trusted execution environments
CN111339551A (en) Data verification method and related device and equipment
Spenger Using Blockchain for Tamper-Proof Broadcast Protocols
CN112035291A (en) Snapshot recovery
CN111418183A (en) Asynchronous processing of blockchain blocks
CN111831740A (en) Synchronization of peers

Legal Events

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