WO2021082757A1 - 一种基于区块链系统的数据处理方法及装置 - Google Patents

一种基于区块链系统的数据处理方法及装置 Download PDF

Info

Publication number
WO2021082757A1
WO2021082757A1 PCT/CN2020/114568 CN2020114568W WO2021082757A1 WO 2021082757 A1 WO2021082757 A1 WO 2021082757A1 CN 2020114568 W CN2020114568 W CN 2020114568W WO 2021082757 A1 WO2021082757 A1 WO 2021082757A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
consensus node
data
backed
slicing
Prior art date
Application number
PCT/CN2020/114568
Other languages
English (en)
French (fr)
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 WO2021082757A1 publication Critical patent/WO2021082757A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • H04L67/108Resource delivery mechanisms characterised by resources being split in blocks or fragments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3247Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Definitions

  • the present invention relates to the technical field of financial technology (Fintech), in particular to a data processing method and device based on a blockchain system.
  • each consensus node in the blockchain system can usually back up the block to a remote location. End server. In this way, even if the block is trimmed during subsequent transactions, the consensus node can obtain the full amount of data of the block by accessing the remote server to ensure the integrity and security of the data in the blockchain system.
  • the remote server first obtains the full data of the block from each consensus node, and then compares the full data of each part of the block in each consensus node, and then according to the full data of each part The result of the comparison completes the backup of the block.
  • the full amount of data of a block usually has a relatively large amount of data, and this method requires the remote server to pull the full amount of data of the block from each consensus node, which will result in a large network communication overhead.
  • the process of parsing the full amount of data of a block and comparing the full amount of data of each part of the block of different consensus nodes is usually relatively time-consuming, so the efficiency of block backup in this manner is usually low.
  • the present invention provides a data processing method and device based on a blockchain system, which is used to solve the high network communication overhead and the efficiency of block backup caused by block backup based on the full data of the block in the consensus node in the prior art Low technical problems.
  • the present invention provides a data processing method based on a blockchain system.
  • the method is applied to a remote server.
  • the method includes: the remote server obtains the waiting information stored by each consensus node in the blockchain system. Back up the slicing result of the block, and determine whether to back up the block to be backed up according to the slicing result of the block to be backed up by each consensus node.
  • the slicing result of the block to be backed up by each consensus node is obtained by slicing the data file of the block to be backed up in the consensus node.
  • the data file includes block data and signature data
  • the slicing result includes the check value of multiple slices. And the positions of multiple slices in the data file, the block data is sliced using the first slice length, and the signature data is sliced using the second slice length.
  • each consensus node and remote server realize the backup of the block to be backed up by transmitting the slicing result of the block to be backed up, and the slicing result of the block to be backed up by each consensus node includes the check value and the slice of the slice.
  • the location in the data file it can be seen that the slicing result of the block to be backed up is smaller than the full amount of data in the block to be backed up. Therefore, this method can greatly reduce the amount of data transmission for network communication and is effective Reduce the cost of network communication and improve the efficiency of block backup.
  • the remote server obtains the slicing result of the block to be backed up stored by each consensus node in the blockchain system, including: the remote server first obtains the slicing result of the block to be backed up by the first consensus node, and The first consensus node sends the slicing result of the block to be backed up to other consensus nodes in the blockchain system, and then receives the slicing result of the block to be backed up by other consensus nodes sent by other consensus nodes.
  • the slicing result of the block to be backed up by the first consensus node is used by other consensus nodes to determine the slicing result of the backup block to be treated by other consensus nodes, and multiple slices in the slicing result of the backup block to be treated by other consensus nodes are corresponding first
  • the consensus node treats multiple slices in the slicing result of the backup block, and the slicing result of the backup block of other consensus nodes also includes block data or signature data corresponding to the slices that do not have a corresponding relationship.
  • the slicing result of the backup block to be treated by other consensus nodes is actually the comparison slicing result of the backup block to be treated by other consensus nodes relative to the first consensus node, that is, the slicing result of the backup block to be treated by other consensus nodes includes The slice information of the first consensus node corresponding to the corresponding slice (that is, the check value and position of the slice), and the full amount of data corresponding to the slice without the corresponding relationship (that is, block data or signature data).
  • the remote The server can directly determine the consistency of the block to be backed up in each consensus node based on the slicing result of the block to be backed up by the first consensus node and the comparison slicing result of the block to be backed up by other consensus nodes relative to the first consensus node. In this way, other consensus nodes may not need to transmit the full amount of data of the same slice as the first consensus node, thereby reducing the amount of data transmission. Moreover, this method enables the remote server to quickly determine whether to back up the block to be backed up based on the concise and clear correspondence, which also helps to improve the efficiency of block backup.
  • obtaining the slicing result of the block to be backed up by the first consensus node by the remote server includes: the remote server obtains the data file of the block to be backed up from the first consensus node, and uses the first slice length to compare the block data Perform slicing to obtain multiple slices of the block data by the first consensus node, and then calculate the check value of each slice, use the second slice length to slice the signature data, and obtain multiple slices of the signature data by the first consensus node , And calculate the check value of each slice, according to the check value of multiple slices of block data by the first consensus node, the position of multiple slices of block data in the data file, and the signature data of the first consensus node The check value of the multiple slices and the positions of the multiple slices of the signature data in the data file generate the slice result of the block to be backed up by the first consensus node.
  • Block backup can effectively reduce the amount of data transmission. Compared with the way that the remote server obtains the full data of each consensus node and compares it, it can also reduce the pressure on the remote server and improve the efficiency of block backup.
  • the remote server determines whether to back up the block to be backed up according to the slicing result of the block to be backed up by each consensus node, including: the remote server determines the block data according to the slicing result of the block data by each consensus node The number of consensus nodes with the same slicing result. If the number is greater than or equal to the preset threshold, the signature data set will be calculated according to the slicing results of the signature data of each consensus node, and the data file of the block to be backed up in the first consensus node The data file of the block is backed up with the signature data set, and if the number is determined to be less than the preset threshold, it is determined not to back up the block to be backed up.
  • the first consensus node reports the full amount of signature data
  • other consensus nodes report signature data different from the first consensus node.
  • the signature data of all consensus nodes can be obtained while reducing the amount of data transmission, thereby ensuring Accuracy of data backup.
  • by judging whether the slicing results of the block data by each consensus node are consistent it can be directly determined whether the block to be backed up has been tampered with. In this way, there is no need to perform block backup when it is determined that the block to be backed up has been tampered. Ensure the credibility and accuracy of backup results.
  • the remote server obtains the slicing results of the blocks to be backed up stored by each consensus node pair in the blockchain system, including: the remote server sends a slicing rule to each consensus node, and the slicing rule is used for each consensus node pair
  • the data files of the blocks to be backed up in each consensus node are sliced to obtain the slicing results of the blocks to be backed up by each consensus node.
  • the slicing rule includes the first slice length and the second slice length. The second slice length is used to identify each consensus node. The length of the digital signature.
  • the remote server sends the slicing rule to each consensus node, so that the slicing operation can be executed by each consensus node, thereby reducing the pressure on the remote server and improving the backup efficiency of the remote server.
  • each slice of the signature data can correspond to a digital signature. In this way, the slice comparison process of the signature data can be facilitated and the comparison efficiency can be improved.
  • the remote server determines whether to back up the block to be backed up according to the slicing result of the block to be backed up by each consensus node, including: the remote server determines the block data according to the slicing result of the block data by each consensus node If the number of consensus nodes with consistent slicing results is greater than or equal to the preset threshold, the first data request is sent to any consensus node, and the first data request is used to obtain block data of the consensus node.
  • the remote server divides each consensus node into multiple consensus node sets according to the slicing result of the signature data by each consensus node, and sends a second data request to any consensus node in each consensus node set, each The consensus nodes in the consensus node set have public signature data, and the second data request is used to obtain the public signature data in the consensus node set.
  • the remote server is based on the block data of the consensus node and the public signatures in the multiple consensus node sets. The data backs up the data file of the block.
  • the remote server first determines whether the block data of each consensus node is consistent according to the results of each consensus node's slicing of the block data.
  • the remote server does not need to execute The comparison process of the slicing results of the signature data can determine that no backup is required, thereby reducing unnecessary operation steps; accordingly, if they are consistent, it means that the block to be backed up can be backed up.
  • the remote server obtains block data from any consensus node that has not been tampered with, and uses the least data transmission method to obtain the full amount of signature data from each consensus node, which can obtain the full amount of block data with the least amount of data transmission. And signature data, which can effectively reduce the pressure of network communication.
  • the present invention provides a data processing device based on a blockchain system, the device including:
  • the obtaining module is used to obtain the slicing results of the blocks to be backed up stored by each consensus node in the blockchain system.
  • the slicing results of the blocks to be backed up by each consensus node are the data files of the blocks to be backed up in the consensus node
  • the data file obtained by slicing includes block data and signature data; the slicing result includes the check values of multiple slices and the positions of the multiple slices in the data file; wherein, the block data is sliced using the first slice length; The signature data is sliced using the second slice length;
  • the backup module is used to determine whether to back up the block to be backed up according to the slicing result of the block to be backed up by each consensus node.
  • the obtaining module is specifically used to: obtain the slicing result of the block to be backed up by the first consensus node, send the slicing result of the block to be backed up by the first consensus node to other consensus nodes in the blockchain system, and receive other consensus The slicing result of the block to be backed up by other consensus nodes sent by the node.
  • the slicing result of the block to be backed up by the first consensus node is used by other consensus nodes to determine the slicing result of the backup block to be treated by other consensus nodes, and multiple slices in the slicing result of the backup block to be treated by other consensus nodes are corresponding first
  • the consensus node treats multiple slices in the slicing result of the backup block, and the slicing result of the backup block of other consensus nodes also includes block data or signature data corresponding to the slices that do not have a corresponding relationship.
  • the obtaining module is specifically configured to: obtain the data file of the block to be backed up from the first consensus node, slice the block data using the first slice length, and obtain multiple slices of the block data by the first consensus node , And calculate the check value of each slice, use the second slice length to slice the signature data, get multiple slices of the signature data by the first consensus node, and calculate the check value of each slice, according to the first consensus node
  • the check value of multiple slices of block data, the position of multiple slices of block data in the data file, the check value of multiple slices of signature data by the first consensus node, and the multiple slices of signature data are in The position in the data file generates the slicing result of the block to be backed up by the first consensus node.
  • the backup module is specifically used to determine the number of consensus nodes that have the same slicing result of the block data according to the slicing result of each consensus node on the block data, and if the number is greater than or equal to a preset threshold, according to each consensus node
  • the node performs statistics on the slicing result of the signature data to obtain the signature data set, and backs up the data file of the block according to the data file and the signature data set of the block to be backed up in the first consensus node. If the number is determined to be less than the preset threshold, it is determined Do not back up the block to be backed up.
  • the obtaining module is specifically configured to: send a slicing rule to each consensus node.
  • the slicing rule is used by each consensus node to slice the data file of the block to be backed up in each consensus node to obtain the slicing result of the block to be backed up by each consensus node.
  • the slicing rule includes a first slice length and a second slice length. The second slice length is used to identify the length of the digital signature of each consensus node.
  • the backup module is specifically configured to: first determine the number of consensus nodes that have consistent slicing results for the block data according to the slicing results of each consensus node on the block data, and if the number is greater than or equal to a preset threshold, A consensus node sends a first data request, and the first data request is used to obtain block data of the consensus node. Then, according to the slicing result of each consensus node on the signature data, each consensus node is divided into multiple consensus node sets, and a second data request is sent to any consensus node in each consensus node set. The consensus node of has public signature data, and the second data request is used to obtain the public signature data in the consensus node set. Finally, the data file of the block is backed up according to the block data of the consensus node and the public signature data in the set of multiple consensus nodes.
  • the present invention provides a computing device, including at least one processor and at least one memory, wherein the memory stores a computer program, and when the program is executed by the processor, the processor executes The data processing method based on the blockchain system described in any of the above-mentioned first aspect.
  • the present invention provides a computer-readable storage medium that stores a computer program executable by a computing device.
  • the program runs on the computing device, the computing device executes any of the above-mentioned first aspects.
  • the described data processing method based on the blockchain system.
  • FIG. 1 is a schematic diagram of the architecture of a blockchain system to which an embodiment of the present invention is applicable;
  • FIG. 2 is a schematic flowchart of a data processing method based on a blockchain system applicable to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of the interaction flow of a data processing method based on a blockchain system applicable to an embodiment of the present invention
  • FIG. 4 is a schematic diagram of the interaction flow of another data processing method based on a blockchain system applicable to an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of a data processing device based on a blockchain system provided by an embodiment of the present invention.
  • Fig. 6 is a schematic structural diagram of a computing device provided by an embodiment of the present invention.
  • the field of financial technology usually involves a variety of transactions, and accordingly a large amount of transaction data will be generated.
  • the field of financial technology can also use blockchain technology to process transactions.
  • bank transactions can include card sales transactions, deposit transactions, loan transactions, insurance transactions, and wealth management transactions.
  • the daily transaction volume of banks can reach thousands or even tens of thousands.
  • related transactions can be processed synchronously by setting up an alliance chain, or the courts, customers, etc. can also be connected to the chain at the same time to jointly maintain the security and stability of the alliance chain.
  • the blockchain system can be a peer-to-peer (Peer To Peer, P2P) network composed of multiple nodes.
  • P2P is an application layer protocol that runs on the transmission control protocol (TCP) protocol.
  • TCP transmission control protocol
  • the nodes in the blockchain system can be equal to each other. There is no central node in the system, so each node can Randomly connect other nodes.
  • each node can be set up with a preset database, and each node jointly maintains the public ledger in the blockchain system through the preset database.
  • the preset database inside the node can store the data in the blockchain system.
  • Block data includes the block header and the block body.
  • the block header can include the hash value of the previous block, the hash value of this block, the block height of this block, the timestamp, the hash value of the transaction, Information such as the hash value of the receipt and the hash value of the status data.
  • the block body can include information such as transaction data, receipt, status data, and signature data.
  • FIG. 1 is a schematic diagram of the architecture of a blockchain system to which an embodiment of the present invention is applicable.
  • the blockchain system may include one or more consensus nodes, such as consensus node 101, consensus node 102, and consensus The node 103 and the consensus node 104. Any two consensus nodes in the blockchain system can be connected through wired communication or wirelessly, and the specifics are not limited.
  • the consensus node in the blockchain system may have multiple functions, such as routing function, transaction function, blockchain function, and consensus function.
  • any consensus node may also send the transaction reported by the client to other consensus nodes to realize the communication function between the consensus node and any other consensus node.
  • any consensus node can be used to record all historical transactions or all historical blocks of the blockchain system.
  • any consensus node can reach a consensus with other consensus nodes, thereby generating a new block based on a successful consensus transaction.
  • routing function is a function that each consensus node in the blockchain system must have, and other functions can be set by those skilled in the art according to actual needs.
  • the consensus node in the blockchain system may refer to a physical machine (server), or may also refer to a process or a series of processes running in the physical machine.
  • the consensus node 101 may be a consensus server, or may also be a process running on the consensus server, which is not specifically limited.
  • the system architecture may also include a remote server 110.
  • the remote server 110 may refer to a client device, or may be other devices provided outside the blockchain system, such as a backup server.
  • the remote server 110 may communicate with any consensus node in the blockchain system by accessing the network of the blockchain system, and the connection method may be a wired connection or a wireless connection. The details are not limited.
  • FIG. 2 is a schematic flowchart of a data processing method provided by an embodiment of the present invention.
  • the method is applicable to a remote server, such as the remote server 110 illustrated in FIG. 1.
  • the method includes:
  • Step 201 The remote server obtains the slicing results of the blocks to be backed up stored by each consensus node in the blockchain system.
  • the slicing result of the block to be backed up by the consensus node refers to the data file of the block to be backed up stored by the consensus node, and the data file of the block to be backed up It can include block data and signature data.
  • the block data can be sliced using the first slice length, and the signature data can be sliced using the second slice length. Therefore, the slice result of the block to be backed up by the consensus node may include the check values of multiple slices and the positions of the multiple slices in the data file.
  • step 202 the remote server determines whether to back up the blocks to be backed up according to the slicing results of the blocks to be backed up stored by each consensus node.
  • the remote server can first determine whether the block data of the block to be backed up in each consensus node is consistent according to the slicing results of each consensus node to the block to be backed up. If the block data is consistent with the consensus node If the number is greater than or equal to the preset number, it means that the blocks to be backed up in most consensus nodes of the blockchain system are the same, so the remote server can back up the blocks to be backed up. If the number of consensus nodes with consistent block data is less than the preset number, it means that most of the consensus nodes of the blockchain system have different blocks to be backed up, and most of the consensus nodes may all be tampered with. The remote server may not back up the block to be backed up.
  • each consensus node and the remote server realize the backup of the block to be backed up by transmitting the slicing result of the block to be backed up, and the slicing result of the block to be backed up by each consensus node includes the checksum of the slice.
  • the data processing method for backing up the block to be backed up in the slicing manner may have multiple implementation manners, and two possible implementation manners are mainly described below.
  • Figure 3 is a schematic diagram of the interaction flow of a data processing method based on a blockchain system provided by an embodiment of the present invention.
  • the method can be executed by a remote server, a first consensus node, and a second consensus node, as shown in Figure 1
  • the remote server 110 and the consensus node 101 to the consensus node 104 are outputted.
  • the method includes:
  • Step 301 The remote server obtains the data file of the block to be backed up in the first consensus node from the first consensus node.
  • the first consensus node may be any consensus node in the blockchain system, such as the consensus node 101, the consensus node 102, the consensus node 103, or the consensus node 104.
  • the data file of the block to be backed up may include the block data and signature data of the block to be backed up.
  • the block to be backed up may be one block or multiple blocks, so the area to be backed up
  • the data file of the block may include the block data of each block and the signature data of each block in the block to be backed up.
  • the block data of each block can include the transaction data, transaction receipt, status data, the hash value of the block, the hash value of the parent block, the hash value of the transaction data, and the transaction receipt.
  • the hash value of the state data, the hash value of the state data, etc., the signature data of each block can include the digital signatures of other consensus nodes in the blockchain system collected by the consensus node when the block is agreed, or it can be Including the digital signature of the consensus node is not limited.
  • the first consensus node can The block is stored in the database of the first consensus node, and the data file of the block can also be generated.
  • the content included in the block data file can be set by those skilled in the art based on experience. For example, it can include only block data and signature data, or it can also include block data and signature data, as well as block height and block height. Any one or more of the length of the data, the check value of the data file, and the slice length of the signature data (that is, the second slice length) are not specifically limited.
  • Table 1 is a schematic table of the format of a data file provided by an embodiment of the present invention.
  • Table 1 A schematic diagram of the format of a data file
  • Block data length Block height Block data Check value Signature data length Signature data Delimiter
  • the data file can store the full amount of data in one or more blocks, and the full amount of data in each block can include parts 1 to 7:
  • Part 1 occupies 8 bytes
  • the code storage space is used to store the length of the block data in the full data of the block.
  • the second part occupies a storage space of 32 bytes, which is used to store the block height of the block; the third part is used to store the block data of the block.
  • the fourth part occupies a storage space of 32 bytes, used to store the check value of the data file, such as the hash value of the data file.
  • the fifth part occupies the storage space of 8 bytes, which is used to store the length of the signature data in the full data of the block.
  • the sixth part is used to store the signature data of the block.
  • the seventh part occupies the storage space of 2 byte codes, which is used to store the separator, which is used to separate the full amount of data of multiple blocks in the data file.
  • the separator can be set by those skilled in the art based on experience, for example, it can be any one or any combination of numbers, letters and characters.
  • the remote server can obtain the data file of the block to be backed up from the first consensus node in various ways. The following describes several possible obtaining methods:
  • the remote server After determining the block to be backed up, the remote server generates an obtaining instruction according to the block height of the block to be backed up or the identifier of the data file of the block to be backed up, and sends the obtaining instruction to the first consensus node.
  • the first consensus node receives the acquisition instruction sent by the remote server, if the acquisition instruction includes the block height of the block to be backed up, it first determines the identity of the data file of the block to be backed up according to the block height of the block to be backed up , And then obtain the data file of the block to be backed up according to the identification of the data file of the block to be backed up.
  • the obtaining instruction includes the identification of the data file of the block to be backed up
  • the first consensus node generates a response message according to the data file of the block to be backed up, and sends the response message to the remote server.
  • the identifier of the data file may refer to the file name of the data file, and the file name of the data file is a unique identifier, which can be set based on the block stored in the data file, for example, it can be set to the block height of the stored block
  • the combination, the hash value combination of the stored block, etc. can also be composed of any one or any combination of numbers, letters, and characters, and is not limited.
  • the setting rules can be synchronized to other consensus nodes in the blockchain system, so that all the consensus nodes in the blockchain system adopt the same setting rules Set the ID of the digital file.
  • the first consensus node may also send the setting rules to the remote server, so that the remote server establishes the correspondence between the blocks in the first consensus node and the data file. In this way, after the remote server determines the block to be backed up, it can directly query the corresponding relationship between the block and the data file to determine the identity of the data file of the block to be backed up in the first consensus node.
  • the first consensus node can directly report the data file where the block is located to the remote server, so that the remote server can check the block chain system in real time.
  • the newly generated blocks are backed up.
  • the first consensus node may report the newly generated block to the remote server according to a preset period, so that the remote server can periodically back up the newly generated block in the blockchain system.
  • the first consensus node can be pre-deployed with data file transfer services and configured with file protocols related to data file transfer services, such as file transfer protocol (File Transfer Protocol, ftp), secure file transfer protocol (SSH File Transfer Protocol, sftp) ), (Hyper Text Transfer Protocol, http), Hypertext Transfer Protocol (Hyper Text Transfer Protocol over Secure Socket Layer, https) with security as the goal, etc.
  • file transfer protocol File Transfer Protocol, ftp
  • secure file transfer protocol SSH File Transfer Protocol, sftp
  • HTTP Hypertext Transfer Protocol
  • HTTP Hypertext Transfer Protocol
  • HTTP Hypertext Transfer Protocol over Secure Socket Layer
  • the remote server after the remote server determines the block to be backed up, it can generate a data request according to the block height of the block to be backed up or the identifier of the data file (such as data file 1.binlog) of the block to be backed up, and request the data Sent to the first consensus node.
  • the first consensus node receives the data request sent by the remote server, it can first obtain the data file of the block to be backed up according to the block height of the block to be backed up in the data request or the identification of the data file of the block to be backed up.
  • the data files of the block to be backed up are compressed and/or encrypted based on the file transfer service, and then the compressed and/or encrypted data files of the block to be backed up can be placed in the file address configured for the first consensus node on the remote server Or http access address.
  • the remote server can obtain the compressed and/or encrypted data file of the block to be backed up through the file address or http access address configured for the first consensus node.
  • the remote server obtains the compressed or encrypted data file of the block to be backed up
  • the corresponding decompression and/or decryption method can be used to compress and/or decrypt the data file.
  • the encrypted data file is decompressed and/or decrypted to obtain the data file of the block to be backed up.
  • the first consensus node can also directly place the data file of the block to be consensus on
  • the corresponding file address or http access address is not compressed and/or encrypted, or other processing can be performed on the data file of the consensus block first, and then placed in the corresponding file address or http access address, which is not limited.
  • Step 302 The remote server slices the data file of the block to be backed up in the first consensus node to obtain the slicing result of the block to be backed up by the first consensus node.
  • the remote server after the remote server obtains the data file of the block to be backed up from the first consensus node, it can parse the data file of the block to be backed up according to the separator, and separate each block from the data file of the block to be backed up.
  • the data file of each block includes the first to the seventh part, the first part is the length of the block data, the second part is the block height, the third part is the block data, and the fourth part is the data file For the check value, the fifth part is the second slice length, the sixth part is the signature data, and the seventh part is the separator between the block and the next block.
  • the remote server can use the first slice length to slice the block data (that is, the third part) in the data file to obtain multiple slices corresponding to the block data , And can use the preset check algorithm to calculate the check value of each slice.
  • the remote server can use the second slice length to slice the signature data (that is, the sixth part) in the data file to obtain multiple slices corresponding to the signature data, and can use a preset verification algorithm to calculate each The check value of the slice.
  • the preset verification algorithm can be set by those skilled in the art based on experience.
  • it can be a hash algorithm or other algorithms.
  • the preset verification algorithm and verification signature data of the slice corresponding to the verification block data can be set.
  • the preset verification algorithms of the corresponding slices may be the same or different, which is not specifically limited.
  • the signature data since the signature data includes the digital signatures of multiple consensus nodes, and the length of the digital signature of each consensus node is fixed to 128 byte codes, the second slice length can be set to an integer of 128 byte codes Therefore, each slice corresponding to the signature data corresponds to the digital signature of one or more consensus nodes.
  • the first slice length can be set as Any fixed value. By analyzing the length of the transaction data, it is found that when the first slice length is set to a fixed value between 500 bytecode and 1200 bytecode, the slice result of the block data is better.
  • the block data in the digital file of a certain block is 22000 bytecodes and the length of the signature data is 1280 bytecodes
  • the first slice length is set to 1100 bytecodes
  • the remote server 110 may first fill in the block data according to the first slice length, since the length of the block data is 22000 bytes Code, the length of the first slice is 1200 byte code, so you can fill in the setting character (such as 0) of 2000 byte code at the back of the block data, and then fill in the 24000 byte code after 0
  • the block data of the block data is segmented to obtain block data slice 1, block data slice 2, block data slice 3,..., block data slice 20; or, it can directly divide the block data of 22000 bytecode
  • the segmentation is performed to obtain block data slice 1, block data slice 2, block data slice 3, ..., block data slice 20, wherein the length of block data slice 20 is 1000 bytecodes.
  • each slice of the signature data can correspond to a digital signature. In this way, the slice comparison process of the signature data can be facilitated and the comparison efficiency can be improved.
  • the remote server can obtain the slicing result of the block to be backed up by the first consensus node.
  • the slicing result of the block to be backed up by the first consensus node may be as shown in Table 2:
  • the data file of the block to be backed up includes the data file of block 1 and the data file of block 2.
  • the block data in the data file of block 1 is sliced to obtain 4 block data Slicing is to slice the signature data in the data file of block 1 to obtain 6 signature data slices.
  • the block data in the data file of block 2 is sliced to obtain 8 block data slices, and the signature data in the data file of block 2 is sliced to obtain 3 signature data slices.
  • step 301 and step 302 are only exemplary descriptions.
  • the data file of the block to be backed up may also be sliced by the first consensus node to obtain the block to be backed up by the first consensus node.
  • the remote server directly obtains the slicing result of the block to be backed up by the first consensus node from the first consensus node, which is not specifically limited.
  • Step 303 The remote server sends the slicing result of the block to be backed up by the first consensus node to other consensus nodes in the blockchain system.
  • the remote server may obtain the comparison slicing results of the blocks to be backed up by other consensus nodes in a serial manner, or obtain the comparison slicing results of the blocks to be backed up by other consensus nodes in a parallel manner.
  • the remote server can only send the slicing result of the block to be backed up by the first consensus node to some other consensus node at a time, and receive the comparison slicing result of the block to be backed up by the other consensus node from the other consensus node.
  • the slicing result of the block to be backed up by the first consensus node is sent to the next other consensus node, until the comparison slicing results of all other consensus nodes to be backed up block are obtained, and the obtaining operation ends.
  • the remote server may also directly send the slicing result of the block to be backed up by the first consensus node to all other consensus nodes, and end the fetching operation after receiving the comparison slicing result of the block to be backed up by all other consensus nodes.
  • step 304 for any other consensus node, the other consensus node determines the comparison slicing result of the block to be backed up by the other consensus node according to the slicing result of the block to be backed up by the first consensus node.
  • the second consensus node is any other consensus node, and take the second consensus node as an example to describe the specific implementation process of obtaining the comparison slicing result of the backup block to be backed up by the second consensus node.
  • the second consensus node after the second consensus node receives the slicing result of the block to be backed up by the first consensus node sent by the remote server, it can first obtain the second consensus node from the second consensus node according to the check value of the data file in the slicing result. The data file of the block to be agreed in the consensus node is then obtained from the data file of the block to be agreed in the second consensus node according to the block height in the slicing result of each block. In this way, the second consensus node can obtain the correspondence between the data file of each block in the second consensus node and the slicing result of each block in the first consensus node.
  • the second consensus node can use the first slice length to split a block from the block data of the data file of the block each time data slice (slice a data block, such as 1), then the data block is calculated check value a 1 of the slice, and a plurality of first blocks from the common node corresponding to the block check value based on the data segment a 1 Determine whether there are slices with the same check value in the block data slice.
  • data slices may be recorded block a at position 2, and the correspondence relationship between the position of the check value a 1 of the block data slice; accordingly, if a plurality of blocks of data slice in a first common node check value are and a second check value consensus node a 1 block different data slice, the block may be recorded position data slice a total amount of block 2 and block data of a data segment a 2.
  • the second consensus node can slide the first slice length forward along the block data of the block, and use this as a new starting point, using the first
  • the slice length cuts another block data slice from the block data, and performs the above-mentioned comparison process until the end of the block data of the block is compared.
  • the second consensus node after the second consensus node has performed the above process on the block data, it can also compare the signature data in the same way, or it can perform a parallel comparison process on the block data and the signature data, and take out one each time. Or multiple block data slices and one or more signature data slices are compared in parallel, which is not limited; and the comparison process of the signature data can be performed with reference to the block data described above, and will not be repeated.
  • the second consensus node can obtain multiple block data slices with corresponding relationships.
  • the block data slices with corresponding relationships refer to the block data slice and the first block data slice.
  • the check value of a certain block data slice in the consensus node is the same, and the second consensus node records the position of each block data slice that has a corresponding relationship, and the corresponding block data slice in the first consensus node
  • the second consensus node can also obtain multiple block data slices that do not have a corresponding relationship
  • the second consensus node records the full block data and location of each block data that does not have a corresponding relationship;
  • the second consensus node can also obtain multiple signature data slices with corresponding relationships.
  • the signature data slice with corresponding relationships means that the signature data slice has the same check value as a certain signature data slice in the first consensus node.
  • the second consensus node records the position of each signature data slice that has a corresponding relationship, the check value and position of the signature data slice in the corresponding first consensus node, and the second consensus node can also obtain multiple signature data slices that do not have The corresponding signature data slices, and the second consensus node records the full block data and location of each signature data that does not have a corresponding relationship.
  • the second consensus node is based on the location of each block data slice that has a corresponding relationship, the check value and location of the block data slice in the corresponding first consensus node, and does not have The full block data and location of each block data in the corresponding relationship, the location of each signature data slice with the corresponding relationship, the check value and location of the signature data slice in the corresponding first consensus node, and there is no correspondence
  • the full block data and location of each signature data of the relationship can generate a comparison slicing result of each block by the second consensus node; in this way, the second consensus node treats multiple blocks in the backup block according to the second consensus node
  • the comparison slicing result can generate a comparison slicing result of the block to be backed up by the second consensus node.
  • Table 3 A schematic diagram of comparing the results of slicing
  • the data file of the block to be backed up in the second consensus node includes the data file of block 1 and the data file of block 2.
  • the second consensus node performs data processing on the block data in the data file of block 1. Slicing to obtain 4 block data slices.
  • the first block data slice of block 1 by the second consensus node is the same as the first block data slice of block 1 by the first consensus node.
  • the position of the first block data slice is the check value and position of the first consensus node on the first block data slice of block 1; correspondingly, the second consensus node on the second block of block 1
  • the data slice does not have the same block data slice of the first consensus node, so compare the position of the second block data slice in the slice result to place the full data and position of the second block data slice in the second consensus node, etc. Wait.
  • the block to be backed up is a block that has been successfully agreed by the consensus node in the blockchain system
  • the block data of the block to be backed up in each consensus node is likely to be the same (unless the consensus is The node tampered with the block data of the backup block), and since each consensus node receives a preset number (such as 3/4 of all consensus nodes) of the digital signature of the consensus node, it can determine that the block consensus is successful, Therefore, the signature data of the block to be backed up in each consensus node is very likely to be different.
  • the second consensus node can also only base on the position of each signature data slice that has a corresponding relationship, Corresponding to the verification value and location of the signature data slice in the first consensus node, and the full block data and location of each signature data that does not have a corresponding relationship, generate the comparison slicing result of each block by the second consensus node, Furthermore, according to the comparison slicing result of the multiple blocks in the backup block to be backed up by the second consensus node, the comparison slicing result of the backed up block to the second consensus node can be generated.
  • Table 4 A schematic diagram of comparing the results of slices
  • the data file of the block to be backed up in the second consensus node includes the data file of block 1 and the data file of block 2.
  • the second consensus node performs data processing on the block data in the data file of block 1.
  • the slicing result of the slicing is exactly the same as the slicing result of the first consensus node slicing the block data of block 1
  • the slicing result of the second consensus node slicing the block data in the data file of block 2 is the same as the first consensus.
  • the slicing results of the node slicing the block data of block 2 are exactly the same.
  • the remote server 110 receives the slicing result of the block data of each block by the second consensus node, and finds that the check value of the data file is parsed after the height of block 1, then the second consensus can be determined
  • the slicing result of the block data of each block by the node is the same as the slicing result of the block data of each block by the first consensus node.
  • the slicing result of the block to be backed up by other consensus nodes is actually the comparison slicing result of the block to be backed up by other consensus nodes with respect to the first consensus node, that is, among the slicing results of the backup block to be treated by other consensus nodes Including the slice information of the first consensus node corresponding to the corresponding slice (that is, the check value and position of the slice), and the full amount of data corresponding to the slice without the corresponding relationship (that is, block data or signature data), so far
  • the end server can directly determine the consistency of the block to be backed up in each consensus node based on the slicing result of the block to be backed up by the first consensus node and the comparison slicing result of the block to be backed up by other consensus nodes relative to the first consensus node; That is to say, in this way, other consensus nodes do not need to transmit the full amount of data of the same slice as the first consensus node, thereby reducing the amount of data transmission
  • any other consensus node sends the comparison slicing result of the block to be backed up by the other consensus node to the remote server.
  • Step 306 The remote server determines the number of consensus nodes with the same block data according to the slicing result of the block data by the first consensus node and the comparison slicing result of the block data by other consensus nodes.
  • step 307 the remote server determines whether the number of consensus nodes with the same block data is greater than or equal to a preset threshold, if yes, execute step 308, if not, execute step 309.
  • the remote server can first parse the slicing result of the block to be backed up by the other consensus node to obtain the slicing result of each block in the backup block to be backed up by the other consensus node, and then parse the The slicing result of each block by other consensus nodes obtains the slicing result of the block data of each block and the slicing result of the signature data of each block by the other consensus node.
  • the remote server can first obtain the length of the block data of each block in each consensus node, and select consensus nodes with the same length from each consensus node based on the length of the block data.
  • the number of consensus nodes is less than the preset threshold, indicating that the number of consensus nodes with the same block data is small, and the block to be backed up has been tampered with, so the remote server can directly determine not to back up the block to be backed up. If the number of consensus nodes with the same length is greater than or equal to the preset threshold, the remote server can compare the block data according to the block data of the block to be backed up in the first consensus node and each other consensus node with the same length.
  • the full block data of the block to be backed up in each other consensus node with the same length is restored, and the consensus node with the same block data of the block to be backed up is determined from each consensus node with the same length after restoration.
  • step 308 the remote server backs up the block to be backed up according to the data file of the block to be backed up in the first consensus node and the comparison slicing result of the block to be backed up by other consensus nodes.
  • the remote server determines to back up the block to be backed up, it can select any consensus node from the consensus nodes with the same block data of the block to be backed up, and the data file of the block to be backed up in the consensus node
  • the block data in is used as the target block data, and each consensus node can be calculated based on the full signature data in the data file of the block to be backed up in the first consensus node and the comparison slicing result of the signature data by each other consensus node
  • Step 309 The remote server determines not to back up the block to be backed up.
  • the remote server 110 can generate an alarm message, and can push the alarm message to the operation and maintenance personnel, for example, it can be pushed to the operation and maintenance personnel through Dingding, WeChat, email, etc. Maintenance personnel.
  • the alarm message is used to indicate that the blocks to be backed up in each consensus node of the blockchain system are different.
  • the first consensus node reports the full amount of data of the block to be consensus
  • other consensus nodes report the full amount of data different from the first consensus node, so that the first consensus node and other consensus nodes to be backed up can be realized Blocks are backed up, which can greatly reduce the amount of data transmission.
  • the remote server obtains the full data of each consensus node and compares it, it can also reduce the pressure on the remote server and improve the efficiency of block backup. .
  • FIG. 4 is a schematic diagram of the interaction flow of another data processing method based on a blockchain system provided by an embodiment of the present invention.
  • the method can be executed by a remote server and a consensus node, such as the remote server 110 shown in FIG. 1 And the consensus node 101 to the consensus node 104.
  • the method includes:
  • Step 401 The remote server sends the slicing rule to each consensus node in the blockchain system.
  • the slicing rule may include the block height of each block in the block to be backed up or the identification of the data file of the block to be backed up.
  • the data file of the block to be backed up in each consensus node includes block data and signature data, it also includes any of the length of the block data, the block height, the check value of the data file, and the separator. If one or more than one, the slicing rule may also include the first slice length and the second slice length. Correspondingly, if the data file of the block to be backed up in each consensus node includes the second slice length, for example, the data file is stored according to the first to seventh parts shown in Table 1, because the fifth part is the slice length of the signature data ( That is, the second slice length), so the slicing rule can also include only the first slice length.
  • the second slice length may be an integer multiple of the digital signature length of the consensus node.
  • each consensus node in the blockchain system slices its stored data file of the block to be backed up according to the slicing rule, and obtains the slicing result of the block to be backed up by each consensus node.
  • each consensus node after each consensus node receives the slicing rule sent by the remote server, it can first obtain each block according to the block height of each block in the block to be backed up in the slicing rule or the identification of the data file of the block to be backed up.
  • the data file of the block to be backed up in a consensus node is then sliced using the first slice length in the data file of each block in the block to be backed up to obtain multiple blocks of the block to be backed up by the consensus node Block data slices, and calculate the check value of each block data slice.
  • each consensus node can also use the second slice length to slice the signature data in the data file of each block in the block to be backed up to obtain multiple signature data slices of the block to be backed up by the consensus node, and calculate The check value of each signature data slice.
  • each consensus node is based on the check value of the multiple block data slices of the block to be backed up by the consensus node, the position of the multiple block data slices in the data file, and the multiple blocks of the consensus node to be backed up.
  • the check value of the signature data slice and the positions of multiple signature data slices in the data file can generate the slice result of each consensus node to be backed up.
  • the remote server sends the slicing rule to each consensus node, so that the slicing operation can be executed by each consensus node, thereby reducing the pressure on the remote server and improving the backup efficiency of the remote server.
  • each consensus node sends the slicing result of the block to be backed up by each consensus node to the remote server.
  • step 404 the remote server determines the number of consensus nodes with the same block data according to the result of each consensus node slicing the block data.
  • step 405 the remote server determines whether the number of consensus nodes with the same block data is greater than or equal to a preset threshold, if yes, execute step 406, if not, execute step 409.
  • the remote server After the remote server obtains the slicing results of the blocks to be backed up by each consensus node, it can first obtain the slicing results of the blocks to be backed up by each consensus node in the blocks to be backed up by each consensus node. The slicing result of the block data of each block, and then determine the number of consensus nodes with the same length of the block data in the slicing results of multiple blocks. If the number is less than the preset threshold, the block data is the same The number of consensus nodes is less than the preset threshold, so that step 409 can be performed.
  • the block data slicing results of each block by multiple consensus nodes can be compared to any two consensus nodes. If the slice check value and position of the block data of the block are the same, it can be determined that the block data of the block to be backed up in the two consensus nodes is the same. In this way, by comparing the area of each block by any two consensus nodes The block data slicing result can determine each consensus node with the same block data of the block to be backed up, and count the number of each consensus node with the same block data of the block to be backed up.
  • Step 406 The remote server sends a block data acquisition instruction to any consensus node with the same block data, and sends a signature data acquisition instruction to any consensus node with the same signature data.
  • the remote server can select any consensus node from each consensus node with the same block data of the block to be backed up, and send a block data acquisition instruction to the consensus node.
  • the block data acquisition instruction includes the block height of each block in the block to be backed up or the identification of the data file of the block to be backed up, and the block data acquisition instruction is used by the consensus node in the area to be backed up in the consensus node The block data in the block data file is sent to the remote server.
  • the remote server can compare the slicing results of the signature data by any two consensus nodes, and count the consensus nodes that have the same signature data slice as a consensus node set, and each consensus node set includes at least the public signature data.
  • Two consensus nodes can have the same consensus node.
  • the verification value of signature data slice 1 of consensus node 1 is the same as the verification value of signature data slice 5 of consensus node 3
  • the check value of 3 is the same as the check value of the signature data slice 2 of the consensus node 3.
  • the check value of the signature data slice 1 of the consensus node 2, the check value of the signature data slice 3 of the consensus node 3 and the check value of the consensus node 4 If the verification value of the signature data slice 1 is the same, the consensus node 1 and the consensus node 3 constitute a consensus node set, and the consensus node 2, the consensus node 3, and the consensus node 4 constitute a consensus node set.
  • the remote server can select any consensus node from the consensus node set, and send a signature data acquisition instruction to the consensus node.
  • the signature data acquisition instruction includes the block height of each block in the block to be backed up or the identification of the data file of the block to be backed up, and also includes the signature data of the consensus node that is the same as other consensus nodes in the consensus node set The location of the slice, the signature data acquisition instruction is used by the consensus node to send the public signature data in the consensus node set to which the consensus node belongs to the remote server.
  • Step 407 The consensus node that receives the block data acquisition instruction sends the block data of the block to be backed up in the consensus node to the remote server, and the consensus node that receives the signature data acquisition instruction compares the consensus node with the signature data.
  • the signature data corresponding to the location is sent to the remote server.
  • the consensus node receives a block data acquisition instruction, it can first obtain the block height of each block in the block to be backed up or to be backed up according to the block data acquisition instruction The identification of the data file of the block obtains the data file of the block to be backed up in the consensus node, and then sends the block data in the data file of the block to be backed up in the consensus node to the remote server. Or, if the consensus node receives the signature data acquisition instruction, it can first obtain the data file identification of the block to be backed up in the signature data acquisition instruction according to the block height of each block in the block to be backed up.
  • Step 408 The remote server backs up the block to be backed up according to the received block data and the signature data of each consensus node.
  • the remote server can construct a signature data set according to the received signature data sent by each consensus node, and can back up the block to be backed up according to the received block data of the block to be backed up and the signature data set. .
  • the remote server can obtain the block data and signature data set of each block according to the block data and signature data set of the block to be backed up, and then for any block, from the block data
  • the block header of the block is extracted from the block data, and the data except the block header in the block data of the block and the signature data set of the block can be used as the block body of the block;
  • the block header of the block includes the height of the block, the hash value of the block, the hash value of the parent block, the hash value of the transaction data, the hash value of the transaction receipt, and the hash value of the state data.
  • the block body includes transaction data, transaction receipt, status data, signature data, etc.
  • the remote server can assemble the block header and block body of each block to obtain the block information of each block, and then store the block information of each block in the disk or memory of the remote server To complete the backup of the block to be backed up.
  • Step 409 The remote server determines not to back up the block to be backed up.
  • the remote server first determines whether the block data of each consensus node is consistent according to the result of each consensus node's slicing of the block data. If it is inconsistent, it means that the block to be backed up has been tampered with. In this way, the remote server does not need to Performing the comparison process of the slicing results of the signature data can determine that no backup is required, thereby reducing unnecessary operation steps. Correspondingly, if they are consistent, it means that the block to be backed up can be backed up.
  • the remote server obtains block data from any consensus node that has not been tampered with, and uses the least data transmission method to obtain the full amount of signature data from each consensus node, which can obtain the full amount of block data with the least amount of data transmission.
  • signature data which can effectively reduce the pressure of network communication.
  • the remote server first obtains the slicing results of the blocks to be backed up stored by each consensus node in the blockchain system, and then determines whether to treat the backup block according to the slicing results of each consensus node to be backed up.
  • the backup block is backed up.
  • the slicing result of the block to be backed up by each consensus node is obtained by slicing the data file of the block to be backed up in the consensus node.
  • the data file includes block data and signature data
  • the slicing result includes the check value of multiple slices.
  • the positions of multiple slices in the data file the block data is sliced using the first slice length
  • the signature data is sliced using the second slice length.
  • each consensus node and the remote server realize the backup of the block to be backed up by transmitting the slicing result of the block to be backed up, and the slicing result of the block to be backed up by each consensus node includes the checksum of the slice.
  • the position of the slice in the data file It can be seen that the slice result of the block to be backed up has a smaller amount of data compared to the full amount of data in the block to be backed up. Therefore, this method can greatly reduce the amount of data transmission for network communication. Effectively reduce the cost of network communication, and can improve the efficiency of block backup.
  • an embodiment of the present invention also provides a data processing device based on a blockchain system, and the specific content of the device can be implemented with reference to the foregoing method.
  • Fig. 5 is a schematic structural diagram of a data processing device based on a blockchain system provided by an embodiment of the present invention, including:
  • the obtaining module 501 is configured to obtain the slicing results of the blocks to be backed up stored by each consensus node in the blockchain system, and the slicing results of the blocks to be backed up by each consensus node are for the consensus node
  • the data file of the block to be backed up is obtained by slicing, the data file includes block data and signature data; the slicing result includes the check value of multiple slices and the multiple slices are in the data file
  • the block data is sliced using a first slice length; the signature data is sliced using a second slice length;
  • the backup module 502 is configured to determine whether to back up the block to be backed up according to the slicing result of the block to be backed up by each consensus node.
  • the obtaining module 501 is specifically configured to:
  • the slicing result of the block to be backed up by the first consensus node is sent to other consensus nodes in the blockchain system; the slicing result of the block to be backed up by the first consensus node is used for all
  • the other consensus node determines the slicing result of the block to be backed up by the other consensus node, and the plurality of slices in the slicing result of the block to be backed up by the other consensus node are corresponding to the first consensus node.
  • the slicing result of the block to be backed up by the other consensus node further includes block data or signature data corresponding to the slices that have no corresponding relationship;
  • the obtaining module 501 is specifically configured to:
  • Slice the block data by using the first slice length obtain multiple slices of the block data by the first consensus node, and calculate a check value of each slice;
  • Slice the signature data by using the second slice length obtain multiple slices of the signature data by the first consensus node, and calculate a check value of each slice;
  • the check value of the multiple slices of the block data by the first consensus node According to the check value of the multiple slices of the block data by the first consensus node, the position of the multiple slices of the block data in the data file, and the signature of the first consensus node
  • the check values of the multiple slices of data and the positions of the multiple slices of the signature data in the data file generate a slicing result of the block to be backed up by the first consensus node.
  • the backup module 502 is specifically configured to:
  • each consensus node slicing the block data determine the number of consensus nodes that have the same slicing result of the block data, and if the number is greater than or equal to a preset threshold, according to the consensus node pair
  • the slicing result of the signature data is counted to obtain a signature data set, and the data file of the block is backed up according to the data file of the block to be backed up in the first consensus node and the signature data set; if it is determined If the number is less than the preset threshold, it is determined not to back up the block to be backed up.
  • the obtaining module 501 is specifically configured to:
  • the slicing rule is used by each consensus node to slice the data file of the block to be backed up in each consensus node to obtain the result of each consensus node slicing the block to be backed up,
  • the slicing rule includes a first slice length and a second slice length, and the second slice length is used to identify the length of the digital signature of each consensus node.
  • the backup module 502 is specifically configured to:
  • each consensus node determines the number of consensus nodes that are consistent with the slicing result of the block data, and if the number is greater than or equal to a preset threshold, send the first consensus node to any consensus node A data request; the first data request is used to obtain block data of the consensus node;
  • each consensus node is divided into a plurality of consensus node sets, and a second data request is sent to any consensus node in each consensus node set; each consensus node The consensus nodes in the set have public signature data, and the second data request is used to obtain the public signature data in the consensus node set;
  • the data file of the block is backed up according to the block data of the consensus node and the public signature data in the set of multiple consensus nodes.
  • the remote server first obtains the slicing results of the blocks to be backed up stored by each consensus node in the blockchain system, and then treats the backup block according to each consensus node According to the slice result, determine whether to back up the block to be backed up.
  • the slicing result of the block to be backed up by each consensus node is obtained by slicing the data file of the block to be backed up in the consensus node.
  • the data file includes block data and signature data
  • the slicing result includes the check value of multiple slices.
  • each consensus node and the remote server realize the backup of the block to be backed up by transmitting the slicing result of the block to be backed up, and the slicing result of the block to be backed up by each consensus node includes the checksum of the slice.
  • the position of the slice in the data file It can be seen that the slice result of the block to be backed up has a smaller amount of data compared to the full amount of data in the block to be backed up. Therefore, this method can greatly reduce the amount of data transmission for network communication. Effectively reduce the cost of network communication, and can improve the efficiency of block backup.
  • an embodiment of the present invention provides a computing device. As shown in FIG. 6, it includes at least one processor 601 and a memory 602 connected to the at least one processor.
  • the embodiment of the present invention does not limit the processor 601.
  • the processor 601 and the memory 602 are connected through a bus in FIG. 6 as an example.
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the memory 602 stores instructions that can be executed by at least one processor 601. By executing the instructions stored in the memory 602, the at least one processor 601 can execute the aforementioned data processing method based on the blockchain system. The steps involved.
  • the processor 601 is the control center of the computing device, which can use various interfaces and lines to connect to various parts of the computing device, and realize data by running or executing instructions stored in the memory 602 and calling data stored in the memory 602. deal with.
  • the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor.
  • the application processor mainly processes the operating system, user interface, and application programs.
  • the adjustment processor mainly handles issuing instructions. It can be understood that the foregoing modem processor may not be integrated into the processor 601.
  • the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented on separate chips.
  • the processor 601 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention.
  • the general-purpose processor may be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiment of data processing based on the blockchain system can be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the memory 602 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules.
  • the memory 602 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), magnetic memory, disk , CD, etc.
  • the memory 602 is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
  • the memory 602 in the embodiment of the present invention may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
  • embodiments of the present invention also provide a computer-readable storage medium that stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes The data processing method based on the blockchain system described in any one of FIGS. 2 to 4 above.
  • the embodiments of the present invention can be provided as methods or computer program products. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种基于区块链系统的数据处理方法及装置,用以提高金融科技(Fintech)领域中区块备份的效率。其中方法包括:远端服务器获取各共识节点对各自存储的待备份区块的切片结果,根据该切片结果对待备份区块进行备份,每个共识节点对待备份区块的切片结果包括多个切片的校验值和多个切片在数据文件中的位置。在该方案中,各个共识节点与远端服务器通过传输待备份区块的切片结果实现对待备份区块的备份,而每个共识节点对待备份区块的切片结果包括切片的校验值和切片在数据文件中的位置,因此待备份区块的切片结果相对于待备份区块的全量数据来说数据量较小,从而该种方式可以有效降低网络通信的开销,提高区块备份的效率。

Description

一种基于区块链系统的数据处理方法及装置
相关申请的交叉引用
本申请要求在2019年10月29日提交中国专利局、申请号为201911039082.X、申请名称为“一种基于区块链系统的数据处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及金融科技(Fintech)技术领域,尤其涉及一种基于区块链系统的数据处理方法及装置。
背景技术
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变,区块链技术也不例外,但由于金融行业的安全性、实时性要求,金融科技也对区块链技术提出了更高的要求。区块链系统中的共识节点存在有限的存储空间,导致共识节点在存储大量数据时会存在一定的瓶颈。为解决该问题,当区块链系统上产生海量交易时,常用的技术方案是对共识节点执行海量交易所产生的区块数据进行裁剪,以使共识节点只存储海量交易中较为重要的区块数据。然而,经过裁剪的区块通常是不完整的,因此,为了保证区块链系统中区块的完整性和可信性,区块链系统中的各个共识节点通常还可以将区块备份至远端服务器。如此,即使区块在后续交易时发生了裁剪,共识节点也可以通过访问远端服务器来获取区块的全量数据,以保证区块链系统中数据的完整性和安全性。
在一种现有的实现方式中,远端服务器先从每个共识节点中获取区块的全量数据,然后针对于各个共识节点中区块的各部分全量数据进行对比,进而根据各部分全量数据的对比结果完成对区块的备份。然而,区块的全量数据通常具有较大的数据量,而该种方式需要远端服务器从各个共识节点中拉取区块的全量数据,因此会导致网络通信的开销较大。且,解析区块的全量数据以及对比不同共识节点的区块的各部分全量数据的过程通常较为费时,从而这种方式下区块备份的效率通常较低。
综上,目前亟需一种基于区块链系统的数据处理方法,用以解决现有技术基于共识节点中区块的全量数据进行区块备份所导致的网络通信的开销大、区块备份的效率低的技术问题。
发明内容
本发明提供一种基于区块链系统的数据处理方法及装置,用以解决现有技术基于共识节点中区块的全量数据进行区块备份所导致的网络通信的开销大、区块备份的效率低的技术问题。
第一方面,本发明提供的一种基于区块链系统的数据处理方法,该方法应用于远端服务器,该方法包括:远端服务器获取区块链系统中的各共识节点对各自存储的待备份区块的切片结果,并根据各共识节点对待备份区块的切片结果,确定是否对待备份区块进行备份。其中,每个共识节点对待备份区块的切片结果为对共识节点中待备份区块的数据文件 进行切片得到的,数据文件包括区块数据和签名数据,切片结果包括多个切片的校验值和多个切片在数据文件中的位置,区块数据使用第一切片长度进行切片,签名数据使用第二切片长度进行切片。
在上述设计中,各个共识节点与远端服务器通过传输待备份区块的切片结果来实现对待备份区块的备份,而每个共识节点对待备份区块的切片结果包括切片的校验值和切片在数据文件中的位置,由此可知,待备份区块的切片结果相对于待备份区块的全量数据来说数据量较小,因此该种方式可以极大地减少网络通信的数据传输量,有效降低网络通信的开销,并可以提高区块备份的效率。
可选地,远端服务器获取区块链系统中的各共识节点对各自存储的待备份区块的切片结果,包括:远端服务器先获取第一共识节点对待备份区块的切片结果,并将第一共识节点对待备份区块的切片结果发送给区块链系统中的其它共识节点,再接收其它共识节点发送的其它共识节点对待备份区块的切片结果。其中,第一共识节点对待备份区块的切片结果用于其它共识节点确定其它共识节点对待备份区块的切片结果,其它共识节点对待备份区块的切片结果中的多个切片为对应的第一共识节点对待备份区块的切片结果中的多个切片,其它共识节点对待备份区块的切片结果还包括不存在对应关系的切片对应的区块数据或签名数据。在上述设计中,其它共识节点对待备份区块的切片结果实际为其它共识节点相对于第一共识节点来说对待备份区块的对比切片结果,即其它共识节点对待备份区块的切片结果中包括存在对应关系的切片所对应的第一共识节点的切片信息(即切片的校验值和位置)、不存在对应关系的切片对应的全量数据(即区块数据或签名数据),如此,远端服务器可以直接基于第一共识节点对待备份区块的切片结果和其它共识节点相对于第一共识节点来说对待备份区块的对比切片结果确定出各个共识节点中待备份区块的一致性。采用该种方式,其它共识节点可以无需传输与第一共识节点相同的切片的全量数据,从而可以降低数据的传输量。且,这种方式使远端服务器可以基于该种简洁明确的对应关系快速确定是否对待备份区块进行备份,从而还有助于提高区块备份的效率。
可选地,远端服务器获取第一共识节点对待备份区块的切片结果,包括:远端服务器从第一共识节点获取待备份区块的数据文件,并使用第一切片长度对区块数据进行切片,得到第一共识节点对区块数据的多个切片,进而计算每个切片的校验值,使用第二切片长度对签名数据进行切片,得到第一共识节点对签名数据的多个切片,并计算每个切片的校验值,根据第一共识节点对区块数据的多个切片的校验值、区块数据的多个切片在数据文件中的位置、第一共识节点对签名数据的多个切片的校验值和签名数据的多个切片在数据文件中的位置生成第一共识节点对待备份区块的切片结果。在上述设计中,通过第一共识节点上报待共识区块的全量数据、其它共识节点上报与第一共识节点不同的全量数据,即可实现对第一共识节点和其它共识节点中的待备份区块进行备份,从而可以有效降低数据传输量,相比于远端服务器获取各个共识节点的全量数据并进行对比的方式来说,还可以降低远端服务器的压力,提高区块备份的效率。
可选地,远端服务器根据各共识节点对待备份区块的切片结果,确定是否对待备份区块进行备份,包括:远端服务器根据各共识节点对区块数据的切片结果,确定对区块数据的切片结果一致的共识节点的数量,若数量大于或等于预设阈值,则根据各共识节点对签名数据的切片结果统计得到签名数据集,并根据第一共识节点中待备份区块的数据文件和签名数据集对区块的数据文件进行备份,若确定数量小于预设阈值,则确定不对待备份区 块进行备份。在上述设计中,通过第一共识节点上报全量的签名数据,其它共识节点上报与第一共识节点不同的签名数据,可以在降低数据传输量的同时获取到所有共识节点中的签名数据,从而保证数据备份的准确性。且,通过判断各个共识节点对区块数据的切片结果是否一致,可以直接确定待备份区块是否被篡改,如此,在确定待备份区块被篡改的情况下可以无需执行区块备份,从而可以保证备份结果的可信性和准确性。
可选地,远端服务器获取区块链系统中的各共识节点对各自存储的待备份区块的切片结果,包括:远端服务器向各个共识节点发送切片规则,切片规则用于各个共识节点对各个共识节点中待备份区块的数据文件进行切片得到各个共识节点对待备份区块的切片结果,切片规则包括第一切片长度和第二切片长度,第二切片长度用于标识各共识节点的数字签名的长度。在上述设计中,通过远端服务器向各个共识节点发送切片规则,可以使得切片操作由各个共识节点执行,从而可以降低远端服务器的压力,提高远端服务器的备份效率。且,通过使用各共识节点的数字签名的长度对签名数据进行切片,可以使得签名数据的每个分片对应一个数字签名,如此,可以便于签名数据的切片对比过程,提高对比效率。
可选地,远端服务器根据各共识节点对待备份区块的切片结果,确定是否对待备份区块进行备份,包括:远端服务器根据各共识节点对区块数据的切片结果,确定对区块数据的切片结果一致的共识节点的数量,若数量大于或等于预设阈值,则向任一共识节点发送第一数据请求,第一数据请求用于获取共识节点的区块数据。进一步地,远端服务器根据各共识节点对签名数据的切片结果,将各共识节点划分为多个共识节点集合,并向每个共识节点集合中的任一共识节点发送第二数据请求,每个共识节点集合中的共识节点存在公共签名数据,第二数据请求用于获取共识节点集合中的公共签名数据,如此,远端服务器根据共识节点的区块数据和多个共识节点集合中的公共签名数据对区块的数据文件进行备份。在上述设计中,远端服务器先根据各共识节点对区块数据的切片结果确定各共识节点的区块数据是否一致,若不一致,则说明待备份区块被篡改,如此,远端服务器无需执行签名数据的切片结果的对比过程即可确定不再备份,从而可以降低无必要的操作步骤;相应地,若一致,则说明待备份区块可以被备份。如此,远端服务器通过从任一未被篡改的共识节点获取区块数据,并采用最少的数据传输方式从各个共识节点获取全量的签名数据,可以以最少的数据传输量获取全量的区块数据和签名数据,从而可以有效地降低网络通信的压力。
第二方面,本发明提供一种基于区块链系统的数据处理装置,该装置包括:
获取模块,用于获取区块链系统中的各共识节点对各自存储的待备份区块的切片结果,每个共识节点对待备份区块的切片结果为对共识节点中待备份区块的数据文件进行切片得到的,数据文件包括区块数据和签名数据;切片结果包括多个切片的校验值和多个切片在数据文件中的位置;其中,区块数据使用第一切片长度进行切片;签名数据使用第二切片长度进行切片;
备份模块,用于根据各共识节点对待备份区块的切片结果,确定是否对待备份区块进行备份。
可选地,获取模块具体用于:获取第一共识节点对待备份区块的切片结果,将第一共识节点对待备份区块的切片结果发送给区块链系统中的其它共识节点,接收其它共识节点发送的其它共识节点对待备份区块的切片结果。其中,第一共识节点对待备份区块的切片 结果用于其它共识节点确定其它共识节点对待备份区块的切片结果,其它共识节点对待备份区块的切片结果中的多个切片为对应的第一共识节点对待备份区块的切片结果中的多个切片,其它共识节点对待备份区块的切片结果还包括不存在对应关系的切片对应的区块数据或签名数据。
可选地,获取模块具体用于:从第一共识节点获取待备份区块的数据文件,使用第一切片长度对区块数据进行切片,得到第一共识节点对区块数据的多个切片,并计算每个切片的校验值,使用第二切片长度对签名数据进行切片,得到第一共识节点对签名数据的多个切片,并计算每个切片的校验值,根据第一共识节点对区块数据的多个切片的校验值、区块数据的多个切片在数据文件中的位置、第一共识节点对签名数据的多个切片的校验值和签名数据的多个切片在数据文件中的位置生成第一共识节点对待备份区块的切片结果。
可选地,备份模块具体用于:根据各共识节点对区块数据的切片结果,确定对区块数据的切片结果一致的共识节点的数量,若数量大于或等于预设阈值,则根据各共识节点对签名数据的切片结果统计得到签名数据集,并根据第一共识节点中待备份区块的数据文件和签名数据集对区块的数据文件进行备份,若确定数量小于预设阈值,则确定不对待备份区块进行备份。
可选地,获取模块具体用于:向各个共识节点发送切片规则。其中,该切片规则用于各个共识节点对各个共识节点中待备份区块的数据文件进行切片得到各个共识节点对待备份区块的切片结果,切片规则包括第一切片长度和第二切片长度,第二切片长度用于标识各共识节点的数字签名的长度。
可选地,备份模块具体用于:先根据各共识节点对区块数据的切片结果,确定对区块数据的切片结果一致的共识节点的数量,若数量大于或等于预设阈值,则向任一共识节点发送第一数据请求,第一数据请求用于获取共识节点的区块数据。然后,根据各共识节点对签名数据的切片结果,将各共识节点划分为多个共识节点集合,并向每个共识节点集合中的任一共识节点发送第二数据请求,每个共识节点集合中的共识节点存在公共签名数据,第二数据请求用于获取共识节点集合中的公共签名数据。最后,根据共识节点的区块数据和多个共识节点集合中的公共签名数据对区块的数据文件进行备份。
第三方面,本发明提供一种计算设备,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行上述第一方面任意所述的基于区块链系统的数据处理方法。
第四方面,本发明提供一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述第一方面任意所述的基于区块链系统的数据处理方法。
本发明的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例适用的一种区块链系统的架构示意图;
图2为本发明实施例适用的一种基于区块链系统的数据处理方法的流程示意图;
图3为本发明实施例适用的一种基于区块链系统的数据处理方法的交互流程示意图;
图4为本发明实施例适用的另一种基于区块链系统的数据处理方法的交互流程示意图;
图5为本发明实施例提供的一种基于区块链系统的数据处理装置的结构示意图;
图6为本发明实施例提供的一种计算设备的结构示意图。
具体实施方式
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。
金融科技(Fintech)技术领域通常涉及到多种交易,相应也会产生大量的交易数据。随着区块链技术的逐步发展,金融科技领域也可以使用区块链技术来处理交易。举例来说,银行的交易可以包括售卡交易、存款交易、贷款交易、保险交易和理财交易等,银行每天的交易量可以达到数千笔甚至数万笔,若多家银行之间涉及到相关交易,则可以通过设置联盟链来同步处理相关交易,或者还可以将法院、客户等同时上链,共同维护联盟链的安全和稳定。
区块链系统可以是由多个节点组成的点对点(Peer To Peer,P2P)网络。P2P是一种运行在传输控制协议(transmission control protocol,TCP)协议之上的应用层协议,在区块链系统中的节点可以彼此对等,系统中不存在中心节点,因此每个节点都可以随机地连接其它节点。在区块链系统中,每个节点内部都可以设置有预设数据库,各个节点通过预设数据库共同维护区块链系统中的公共账本,节点内部的预设数据库可以存储区块链系统中的区块数据。其中,区块数据包括区块头和区块体,区块头可以包括上一区块的哈希值、本区块的哈希值、本区块的块高、时间戳、交易的哈希值、回执的哈希值和状态数据的哈希值等信息,区块体可以包括交易数据、回执、状态数据、签名数据等信息。
图1为本发明实施例适用的一种区块链系统的架构示意图,如图1所示,该区块链系统中可以包括一个或多个共识节点,比如共识节点101、共识节点102、共识节点103与共识节点104。区块链系统中的任意两个共识节点可以通过有线方式通信连接,也可以通过无线方式通信连接,具体不作限定。
本发明实施例中,区块链系统中的共识节点可以具有多种功能,比如,路由功能、交易功能、区块链功能和共识功能等。举例来说,任一共识节点还可以把客户端上报的交易发送给其它共识节点,以实现该共识节点与任一其它共识节点之间的通信功能。或者,任一共识节点可以用于记录区块链系统的全部历史交易或全部历史区块。或者,任一共识节点可以与其它共识节点进行共识,从而根据共识成功的交易生成新的区块。
需要说明的是,路由功能是区块链系统中的每个共识节点必须具有的功能,而其它功能可由本领域技术人员根据实际需要进行设置。
本发明实施例中,区块链系统中的共识节点可以是指物理机(服务器),或者也可以是指物理机中运行的一个进程或者一系列进程。比如,共识节点101可以为共识服务器,或者也可以为共识服务器上运行的一个进程,具体不作限定。
如图1所示,该系统架构还可以包括远端服务器110,远端服务器110可以是指客户 端设备,也可以为设置在区块链系统外部的其它设备,比如备份服务器。本发明实施例中,远端服务器110可以通过接入区块链系统的网络而与区块链系统中的任一共识节点进行通信,连接的方式可以为有线连接,或者也可以为无线连接,具体不作限定。
基于图1所示意的区块链系统,图2为本发明实施例提供的一种数据处理方法的流程示意图,该方法适用于远端服务器,例如图1所示意的远端服务器110。如图2所示,该方法包括:
步骤201,远端服务器获取区块链系统中的各共识节点对各自存储的待备份区块的切片结果。
本发明实施例中,针对于任一共识节点,该共识节点对待备份区块的切片结果是指对该共识节点存储的待备份区块的数据文件进行切片得到的,待备份区块的数据文件可以包括区块数据和签名数据,区块数据可以使用第一切片长度进行切片,签名数据可以使用第二切片长度进行切片。因此,共识节点对待备份区块的切片结果可以包括多个切片的校验值和多个切片在数据文件中的位置。
步骤202,远端服务器根据各共识节点对各自存储的待备份区块的切片结果,确定是否对待备份区块进行备份。
具体实施中,远端服务器可以先根据各共识节点对各自存储的待备份区块的切片结果,确定各共识节点中待备份区块的区块数据是否一致,若区块数据一致的共识节点的数量大于或等于预设数量,则说明区块链系统的大部分共识节点中的待备份区块相同,因此远端服务器可以对待备份区块进行备份。若区块数据一致的共识节点的数量小于预设数量,则说明区块链系统的大部分共识节点中的待备份区块不同,大部分共识节点中的待备份区块可能均被篡改,因此远端服务器可以不对待备份区块进行备份。
本发明实施例中,各个共识节点与远端服务器通过传输待备份区块的切片结果来实现对待备份区块的备份,而每个共识节点对待备份区块的切片结果包括切片的校验值和切片在数据文件中的位置。由此可知,待备份区块的切片结果相对于待备份区块的全量数据来说数据量较小,因此该种方式可以极大地减少网络通信的数据传输量,有效降低网络通信的开销,并可以提高区块备份的效率。
本发明实施例中,采用切片方式对待备份区块进行备份的数据处理方法可以有多种实现方式,下面主要描述两种可能的实现方式。
图3为本发明实施例提供的一种基于区块链系统的数据处理方法的交互流程示意图,该方法可以由远端服务器、第一共识节点和第二共识节点来执行,例如图1所示意出的远端服务器110和共识节点101至共识节点104。如图3所示,该方法包括:
步骤301,远端服务器从第一共识节点获取第一共识节点中待备份区块的数据文件。
其中,第一共识节点可以为区块链系统中的任一共识节点,比如共识节点101、共识节点102、共识节点103或共识节点104。
本发明实施例中,待备份区块的数据文件可以包括待备份区块的区块数据和签名数据,待备份区块可以为一个区块,或者也可以为多个区块,因此待备份区块的数据文件可以包括待备份区块中每个区块的区块数据和每个区块的签名数据。其中,每个区块的区块数据可以包括该区块的交易数据、交易回执、状态数据、该区块的哈希值、父区块的哈希值、交易数据的哈希值、交易回执的哈希值、状态数据的哈希值等,每个区块的签名数据可以包括共识节点在共识该区块时所收集到的区块链系统中的其它共识节点的数字签名,或者 也可以包括该共识节点的数字签名,不作限定。
在一种可能的实现方式中,针对于任一区块,第一共识节点在联合区块链系统中的其它共识节点完成对该区块的共识后,若共识成功,则第一共识节点可以将该区块存储至第一共识节点的数据库,且还可以生成该区块的数据文件。其中,区块的数据文件所包括的内容可以由本领域技术人员根据经验进行设置,比如可以仅包括区块数据和签名数据,或者也可以包括区块数据和签名数据,以及区块高度、区块数据的长度、数据文件的校验值、签名数据的切片长度(即第二切片长度)中的任意一项或任意多项,具体不作限定。
在一个示例中,表1为本发明实施例提供的一种数据文件的格式示意表。
表1:一种数据文件的格式示意
区块数据长度 区块高度 区块数据 校验值 签名数据长度 签名数据 分隔符
如表1所示,在该示例中,数据文件中可以存储一个或多个区块的全量数据,每个区块的全量数据可以包括第1至第7部分:第1部分占据8个字节码的存储空间,用于存储该区块的全量数据中区块数据的长度。第2部分占据32个字节码的存储空间,用于存储该区块的区块高度;第3部分用于存储该区块的区块数据。第4部分占据32个字节码的存储空间,用于存储数据文件的校验值,比如数据文件的哈希值。第5部分占据8个字节码的存储空间,用于存储该区块的全量数据中签名数据的长度。第6部分用于存储该区块的签名数据。第7部分占据2个字节码的存储空间,用于存储分隔符,分隔符用于分隔数据文件中的多个区块的全量数据。
其中,分隔符可以由本领域技术人员根据经验进行设置,比如可以为数字、字母和字符中的任意一种或任意组合。
为了便于理解,本发明的下列实施例以数据文件为表1所示的格式进行描述。
具体实施中,远端服务器从第一共识节点获取待备份区块的数据文件的方式可以有多种,下面描述几种可能的获取方式:
获取方式一
远端服务器确定待备份区块后,根据待备份区块的块高或者待备份区块的数据文件的标识生成获取指令,并将获取指令发送给第一共识节点。相应地,第一共识节点接收到远端服务器发送的获取指令后,若获取指令包括待备份区块的块高,则先根据待备份区块的块高确定待备份区块的数据文件的标识,然后再根据待备份区块的数据文件的标识获取待备份区块的数据文件,若获取指令包括待备份区块的数据文件的标识,则直接根据待备份区块的数据文件的标识获取待备份区块的数据文件。如此,第一共识节点根据待备份区块的数据文件生成响应报文,并将响应报文发送给远端服务器。
其中,数据文件的标识可以是指数据文件的文件名,数据文件的文件名为唯一性标识,其可以基于数据文件所存储的区块进行设置,比如可以设置为所存储的区块的块高组合、所存储的区块的哈希值组合等,也可以由数字、字母和字符的任意一种或任意组合构成,不作限定。
本发明实施例中,第一共识节点在设置数据文件的标识后,可以将设置规则同步给区块链系统中的其它共识节点,以使区块链系统中的全部共识节点采用相同的设置规则设置数字文件的标识。或者,第一共识节点也可以将设置规则发送给远端服务器,以使远端服务器建立第一共识节点中区块与数据文件的对应关系。如此,远端服务器确定待备份区块 后,可以直接查询区块与数据文件的对应关系确定第一共识节点中待备份区块的数据文件的标识。
获取方式二
针对于任一区块,若确定该区块共识成功,则第一共识节点可以直接将该区块所在的数据文件上报给远端服务器,以使远端服务器能够实时地对区块链系统中新生成的区块进行备份。或者,第一共识节点可以按照预设周期向远端服务器上报新生成的区块,以使远端服务器能够周期性地对区块链系统中新生成的区块进行备份。
获取方式三
第一共识节点上可以预先部署有数据文件传输服务,并配置有与数据文件传输服务相关的文件协议,比如文件传输协议(File Transfer Protocol,ftp)、安全文件传送协议(SSH File Transfer Protocol,sftp)、(Hyper Text Transfer Protocol,http)、以安全为目标的超文本传输协议(Hyper Text Transfer Protocol over Secure Socket Layer,https)等。其中,远端服务器可以为第一共识节点配置对应的文件地址或http访问地址,并将该文件地址或http访问地址发送给第一共识节点。相应地,若第一共识节点启动文件传输服务以支持该文件地址或http访问地址,则远端服务器可以从该文件地址或http访问地址中下载第一共识节点提供的文件。
具体实施中,当远端服务器确定待备份区块后,可以根据待备份区块的块高或者待备份区块的数据文件的标识(比如数据文件1.binlog)生成数据请求,并将数据请求发送给第一共识节点。相应地,第一共识节点接收到远端服务器发送的数据请求后,可以先根据数据请求中待备份区块的块高或者待备份区块的数据文件的标识获取待备份区块的数据文件,然后基于文件传输服务对待备份区块的数据文件进行压缩和/或加密,进而可以将压缩和/或加密后的待备份区块的数据文件放置在远端服务器为第一共识节点配置的文件地址或http访问地址。如此,远端服务器可以通过其为第一共识节点配置的文件地址或http访问地址获取到压缩和/或加密的待备份区块的数据文件。
进一步地,远端服务器获取压缩或加密的待备份区块的数据文件后,若确定该数据文件为压缩和/或加密的数据文件,则可以使用对应的解压缩和/或解密方法对压缩和/或加密的数据文件进行解压缩和/或解密,得到待备份区块的数据文件。
需要说明的是,上述仅是一种示例性的简单说明,其所列举的并不构成对方案的限定,在具体实施中,第一共识节点也可以将待共识区块的数据文件直接放置在对应的文件地址或http访问地址,而不作压缩和/或加密处理,或者也可以先对待共识区块的数据文件进行其它处理,再放置在对应的文件地址或http访问地址,不作限定。
步骤302,远端服务器对第一共识节点中待备份区块的数据文件进行切片,得到第一共识节点对待备份区块的切片结果。
具体实施中,远端服务器从第一共识节点中获取到待备份区块的数据文件后,可以根据分隔符来解析待备份区块的数据文件,从待备份区块的数据文件中分离出每个区块的数据文件。其中,每个区块的数据文件包括第1至第7部分,第1部分为区块数据的长度,第2部分为区块高度,第3部分为区块数据,第4部分为数据文件的校验值,第5部分为第二切片长度,第6部分为签名数据,第7部分为该区块与下一区块的分隔符。
进一步地,针对于任一区块的数据文件,远端服务器可以使用第一切片长度对该数据文件中的区块数据(即第3部分)进行切片,得到区块数据对应的多个切片,并可以使用 预设校验算法计算得到每个切片的校验值。相应地,远端服务器可以使用第二切片长度对该数据文件中的签名数据(即第6部分)进行切片,得到签名数据对应的多个切片,并可以使用预设校验算法计算得到每个切片的校验值。
其中,预设校验算法可以由本领域技术人员根据经验进行设置,比如可以为哈希算法,或者也可以为其它算法,校验区块数据对应的切片的预设校验算法与校验签名数据对应的切片的预设校验算法可以相同,或者也可以不同,具体不作限定。
在一个示例中,由于签名数据中包括多个共识节点的数字签名,而每个共识节点的数字签名的长度固定为128字节码,因此可以将第二切片长度设置为128字节码的整数倍,从而使得签名数据对应的每个切片均对应一个或多个共识节点的数字签名。相应地,由于不同区块是由不同的交易数据构成的,而不同交易数据的长度大都不同,因此不同区块的区块数据的长度存在不确定性,如此,第一切片长度可以设置为任一固定值。通过分析交易数据的长度发现,当将第一切片长度设置为500字节码至1200字节码之间的固定值时,区块数据的切片结果较好。
举例来说,若某一区块的数字文件中区块数据的长度为22000字节码,签名数据的长度为1280字节码,则当设置第一切片长度为1100字节码,第二切片长度为128字节码时,可以将该区块数据切分为区块数据切片1、区块数据切片2、区块数据切片3、……、区块数据切片20,同时可以将签名数据切分为签名数据切片1、签名数据切片2、签名数据切片3、……、签名数据切片10。再举个例子,当设置第一切片长度为1200字节码时,远端服务器110可以先根据第一切片长度对区块数据进行补齐操作,由于区块数据的长度为22000字节码,第一切片长度为1200字节码,因此可以先在区块数据的后方补上长度为2000字节码的设定字符(比如0),然后再对补0后的24000字节码的区块数据进行切分,得到区块数据切片1、区块数据切片2、区块数据切片3、……、区块数据切片20;或者,也可以直接对22000字节码的区块数据进行切分,得到区块数据切片1、区块数据切片2、区块数据切片3、……、区块数据切片20,其中区块数据切片20的长度为1000字节码。
在上述示例中,通过使用各共识节点的数字签名的长度对签名数据进行切片,可以使得签名数据的每个分片对应一个数字签名,如此,可以便于签名数据的切片对比过程,提高对比效率。
基于此,通过对每个区块的数据文件中的区块数据和签名数据进行切片,远端服务器可以得到第一共识节点对待备份区块的切片结果。
在一个示例中,第一共识节点对待备份区块的切片结果可以如表2所示:
表2:一种切片结果的示意
Figure PCTCN2020114568-appb-000001
Figure PCTCN2020114568-appb-000002
如表2所示,待备份区块的数据文件中包括区块1的数据文件和区块2的数据文件,对区块1的数据文件中的区块数据进行切片,得到4个区块数据切片,对区块1的数据文件中的签名数据进行切片,得到6个签名数据切片。相应地,对区块2的数据文件中的区块数据进行切片,得到8个区块数据切片,对区块2的数据文件中的签名数据进行切片,得到3个签名数据切片。
需要说明的是,步骤301和步骤302仅是一种示例性的说明,本发明实施例中也可以由第一共识节点对待备份区块的数据文件进行切片,得到第一共识节点对待备份区块的切片结果后,由远端服务器从第一共识节点中直接获取第一共识节点对待备份区块的切片结果,具体不作限定。
步骤303,远端服务器将第一共识节点对待备份区块的切片结果发送给区块链系统中的其它共识节点。
本发明实施例中,远端服务器可以采用串行的方式获取其它共识节点对待备份区块的对比切片结果,也可以采用并行的方式获取其它共识节点对待备份区块的对比切片结果。比如远端服务器可以每次仅将第一共识节点对待备份区块的切片结果发送给某一个其它共识节点,并在接收到该其它共识节点发送的该其它共识节点对待备份区块的对比切片结果后,再将第一共识节点对待备份区块的切片结果发送给下一个其它共识节点,直至获取到所有的其它共识节点对待备份区块的对比切片结果后结束获取操作。或者,远端服务器也可以将第一共识节点对待备份区块的切片结果直接发送给所有的其它共识节点,并在接收所有的其它共识节点对待备份区块的对比切片结果后结束获取操作。
步骤304,针对于任一其它共识节点,该其它共识节点根据第一共识节点对待备份区块的切片结果确定该其它共识节点对待备份区块的对比切片结果。
为了便于描述,假设第二共识节点为任一其它共识节点,以第二共识节点为例描述得到第二共识节点对待备份区块的对比切片结果的具体实现过程。
具体实施中,第二共识节点接收到远端服务器发送的第一共识节点对待备份区块的切片结果后,可以先根据该切片结果中数据文件的校验值从第二共识节点中获取第二共识节点中待共识区块的数据文件,再根据每个区块的切片结果中的区块高度从第二共识节点中待共识区块的数据文件中获取对应的每个区块的数据文件。如此,第二共识节点可以获取到第二共识节点中每个区块的数据文件与第一共识节点中每个区块的切片结果的对应关系。
进一步地,针对于第二共识节点对应的每个区块的数据文件,第二共识节点每次可以使用第一切片长度从该区块的数据文件的区块数据中切分出一个区块数据切片(比如区块数据切片A 1),然后计算区块数据切片A 1的校验值,并基于区块数据切片A 1的校验值从第一共识节点对应的该区块的多个区块数据切片中确定是否存在校验值相同的切片,若第一共识节点中的区块数据切片A 2的校验值与第二共识节点中的区块数据切片A 1的校验值相同,则可以记录区块数据切片A 2的位置、区块数据切片A 1的校验值和位置的对应关系;相 应地,若第一共识节点中的多个区块数据切片的校验值均与第二共识节点中的区块数据切片A 1的校验值不同,则可以记录区块数据切片A 2的全量区块数据和区块数据切片A 2的位置。相应地,当区块数据切片A 1对比完成后,第二共识节点可以沿着该区块的区块数据向前滑动第一切片长度的距离,并以此为新的起点,使用第一切片长度从区块数据中切分出另一个区块数据切片,并执行上述对比过程,直至对比至该区块的区块数据的末端。
相应地,第二共识节点对区块数据执行完上述过程后,还可以采用相同的方式对签名数据进行对比,或者也可以对区块数据和签名数据执行并行的对比过程,每次均取出一个或多个区块数据切片和一个或多个签名数据切片进行并行对比,不作限定;且,签名数据的对比过程可以参照上述的区块数据进行执行,不再赘述。
如此,通过执行上述对比过程,针对于任一区块,第二共识节点可以得到多个具有对应关系的区块数据切片,具有对应关系的区块数据切片是指该区块数据切片与第一共识节点中的某一区块数据切片的校验值相同,且第二共识节点记录了具有对应关系的每个区块数据切片的位置、所对应的第一共识节点中的区块数据切片的校验值和位置,第二共识节点还可以得到多个不具有对应关系的区块数据切片,且第二共识节点记录了不具有对应关系的每个区块数据的全量区块数据和位置;相应地,第二共识节点还可以得到多个具有对应关系的签名数据切片,具有对应关系的签名数据切片是指该签名数据切片与第一共识节点中的某一签名数据切片的校验值相同,且第二共识节点记录了具有对应关系的每个签名数据切片的位置、所对应的第一共识节点中的签名数据切片的校验值和位置,第二共识节点还可以得到多个不具有对应关系的签名数据切片,且第二共识节点记录了不具有对应关系的每个签名数据的全量区块数据和位置。
基于此,针对于每个区块,第二共识节点根据具有对应关系的每个区块数据切片的位置、所对应的第一共识节点中的区块数据切片的校验值和位置、不具有对应关系的每个区块数据的全量区块数据和位置、具有对应关系的每个签名数据切片的位置、所对应的第一共识节点中的签名数据切片的校验值和位置、不具有对应关系的每个签名数据的全量区块数据和位置,可以生成第二共识节点对每个区块的对比切片结果;如此,第二共识节点根据第二共识节点对待备份区块中多个区块的对比切片结果可以生成第二共识节点对待备份区块的对比切片结果。
综上,若第二共识节点对待备份区块的切片结果可以如表3所示:
表3:一种对比切片结果的示意
Figure PCTCN2020114568-appb-000003
Figure PCTCN2020114568-appb-000004
如表3所示,第二共识节点中待备份区块的数据文件包括区块1的数据文件和区块2的数据文件,第二共识节点对区块1的数据文件中的区块数据进行切片,得到4个区块数据切片,第二共识节点对区块1的第1个区块数据切片与第一共识节点对区块1的第1个区块数据切片相同,因此对比切片结果中第1个区块数据切片的位置放置第一共识节点对区块1的第1个区块数据切片的校验值和位置;相应地,第二共识节点对区块1的第2个区块数据切片不存在相同的第一共识节点的区块数据切片,因此对比切片结果中第2个区块数据切片的位置放置第二共识节点中第2个区块数据切片的全量数据和位置,等等。
在一个示例中,由于待备份区块为经过区块链系统中的共识节点共识成功的区块,因此各个共识节点中待备份区块的区块数据在很大概率上是相同的(除非共识节点对待备份区块的区块数据进行篡改),且由于每个共识节点在接收到预设数量(比如全部共识节点的3/4)的共识节点的数字签名时即可确定区块共识成功,因此各个共识节点中待备份区块的签名数据在很大概率上是不同的。基于此,若第二共识节点的每个区块数据切片均与第一共识节点的对应区块数据切片相同,则第二共识节点还可以仅根据具有对应关系的每个签名数据切片的位置、所对应的第一共识节点中的签名数据切片的校验值和位置、不具有对应关系的每个签名数据的全量区块数据和位置生成第二共识节点对每个区块的对比切片结果,进而根据第二共识节点对待备份区块中多个区块的对比切片结果可以生成第二共识节点对待备份区块的对比切片结果。
由此可知,在上述示例中,若第二共识节点的每个区块数据切片均与第一共识节点的对应区块数据切片相同,则第二共识节点对待备份区块的切片结果可以如表4所示:
表4:一种对比切片结果的示意
Figure PCTCN2020114568-appb-000005
如表4所示,第二共识节点中待备份区块的数据文件包括区块1的数据文件和区块2的数据文件,第二共识节点对区块1的数据文件中的区块数据进行切片的切片结果与第一共识节点对区块1的区块数据进行切片的切片结果完全相同,第二共识节点对区块2的数据文件中的区块数据进行切片的切片结果与第一共识节点对区块2的区块数据进行切片的切片结果完全相同。如此,当远端服务器110接收到第二共识节点对每个区块的区块数据的切片结果后,发现在区块1的高度之后解析到数据文件的校验值,则可以确定第二共识节点对每个区块的区块数据的切片结果与第一共识节点对每个区块的区块数据的切片结 果相同。
本发明实施例中,其它共识节点对待备份区块的切片结果实际为其它共识节点相对于第一共识节点来说对待备份区块的对比切片结果,即其它共识节点对待备份区块的切片结果中包括存在对应关系的切片所对应的第一共识节点的切片信息(即切片的校验值和位置)、不存在对应关系的切片对应的全量数据(即区块数据或签名数据),如此,远端服务器可以直接基于第一共识节点对待备份区块的切片结果和其它共识节点相对于第一共识节点来说对待备份区块的对比切片结果确定出各个共识节点中待备份区块的一致性;也就是说,采用该种方式,其它共识节点可以无需传输与第一共识节点相同的切片的全量数据,从而可以降低数据的传输量,且远端服务器还可以基于这种简洁明确的对应关系快速地确定是否对待备份区块进行备份,从而可以提高区块备份的效率。
步骤305,任一其它共识节点将该其它共识节点对待备份区块的对比切片结果发送给远端服务器。
步骤306,远端服务器根据第一共识节点对区块数据的切片结果和其它共识节点对区块数据的对比切片结果,确定区块数据相同的共识节点的数量。
步骤307,远端服务器确定区块数据相同的共识节点的数量是否大于或等于预设阈值,若是,执行步骤308,若否,执行步骤309。
具体实施中,针对于任一其它共识节点,远端服务器可以先解析该其它共识节点对待备份区块的切片结果得到该其它共识节点对待备份区块中每个区块的切片结果,然后解析该其它共识节点对每个区块的切片结果得到该其它共识节点对每个区块的区块数据的切片结果和对每个区块的签名数据的切片结果。
在一个示例中,远端服务器可以先获取每个共识节点中每个区块的区块数据的长度,并基于区块数据的长度从各个共识节点中选取长度一致的共识节点,若长度一致的共识节点的数量小于预设阈值,说明区块数据相同的共识节点的数量较少,待备份区块已被篡改,因此远端服务器可以直接确定不对待备份区块进行备份。若长度一致的共识节点的数量大于或等于预设阈值,则远端服务器可以根据第一共识节点中待备份区块的区块数据和长度一致的每个其它共识节点对区块数据的对比切片结果,对长度一致的每个其它共识节点中待备份区块的全量区块数据进行还原,并从还原后的长度一致的各个共识节点中确定出待备份区块的区块数据相同的共识节点,统计待备份区块的区块数据相同的共识节点的数量,若数量大于预设阈值,则可以确定对待备份区块进行备份,若数量小于预设阈值,则可以确定不待备份区块进行备份。
步骤308,远端服务器根据第一共识节点中待备份区块的数据文件和其它共识节点对待备份区块的对比切片结果,对待备份区块进行备份。
具体实施中,若远端服务器确定对待备份区块进行备份,则可以从待备份区块的区块数据相同的共识节点中选取任一共识节点,将该共识节点中待备份区块的数据文件中的区块数据作为目标区块数据,并可以基于第一共识节点中待备份区块的数据文件中的全量签名数据和每个其它共识节点对签名数据的对比切片结果,统计得到各个共识节点中待备份区块的数据文件中的签名数据集。如此,远端服务器可以根据目标区块数据和签名数据集对待备份区块进行备份。
步骤309,远端服务器确定不对待备份区块进行备份。
在一个示例中,远端服务器110若确定不对待备份区块进行备份,则可以生成告警消 息,并可以将告警消息推送给运维人员,比如可以通过钉钉、微信、邮件等方式推送给运维人员。其中,告警消息用于指示区块链系统的各个共识节点中的待备份区块不同。
在上述实现方式中,通过第一共识节点上报待共识区块的全量数据、其它共识节点上报与第一共识节点不同的全量数据,即可实现对第一共识节点和其它共识节点中的待备份区块进行备份,从而可以极大地降低数据传输量,相比于远端服务器获取各个共识节点的全量数据并进行对比的方式来说,还可以降低远端服务器的压力,提高区块备份的效率。
图4为本发明实施例提供的又一种基于区块链系统的数据处理方法的交互流程示意图,该方法可以由远端服务器和共识节点来执行,例如图1所示意出的远端服务器110和共识节点101至共识节点104。如图4所示,该方法包括:
步骤401,远端服务器将切片规则发送给区块链系统中的各个共识节点。
其中,切片规则可以包括待备份区块中每个区块的块高或待备份区块的数据文件的标识。
本发明实施例中,若各个共识节点中待备份区块的数据文件包括区块数据和签名数据,还包括区块数据的长度、区块高度、数据文件的校验值、分隔符中的任意一项或任意多项,则切片规则还可以包括第一切片长度和第二切片长度。相应地,若各个共识节点中待备份区块的数据文件包括第二切片长度,比如数据文件按照表1所示的第1至第7部分进行存储,由于第5部分为签名数据的切片长度(即第二切片长度),因此切片规则还可以仅包括第一切片长度。
在一个示例中,第二切片长度可以为共识节点的数字签名长度的整数倍。
步骤402,区块链系统中的每个共识节点根据切片规则对其存储的待备份区块的数据文件进行切片,得到每个共识节点对待备份区块的切片结果。
具体实施中,每个共识节点在接收到远端服务器发送的切片规则后,可以先根据切片规则中待备份区块中每个区块的块高或待备份区块的数据文件的标识获取每个共识节点中待备份区块的数据文件,然后使用第一切片长度对待备份区块中每个区块的数据文件中的区块数据进行切片,得到该共识节点对待备份区块的多个区块数据切片,并计算每个区块数据切片的校验值。相应地,每个共识节点还可以使用第二切片长度对待备份区块中每个区块的数据文件中的签名数据进行切片,得到该共识节点对待备份区块的多个签名数据切片,并计算每个签名数据切片的校验值。
进一步地,每个共识节点根据该共识节点对待备份区块的多个区块数据切片的校验值、多个区块数据切片在数据文件中的位置、该共识节点对待备份区块的多个签名数据切片的校验值、多个签名数据切片在数据文件中的位置,可以生成每个共识节点对待备份区块的切片结果。
本发明实施例中,通过远端服务器向各个共识节点发送切片规则,可以使得切片操作由各个共识节点执行,从而可以降低远端服务器的压力,提高远端服务器的备份效率。
步骤403,每个共识节点将每个共识节点对待备份区块的切片结果发送给远端服务器。
步骤404,远端服务器根据各共识节点对区块数据的切片结果,确定区块数据相同的共识节点的数量。
步骤405,远端服务器确定区块数据相同的共识节点的数量是否大于或等于预设阈值,若是,执行步骤406,若否,执行步骤409。
在上述步骤404和步骤405中,远端服务器获取各共识节点对待备份区块的切片结果 后,可以先从每个共识节点对待备份区块的切片结果中获取每个共识节点对待备份区块中的每个区块的区块数据的切片结果,然后确定多个区块的切片结果中区块数据的长度均一致的共识节点的数量,若该数量小于预设阈值,则说明区块数据相同的共识节点的数量小于预设阈值,从而可以执行步骤409。相应地,若该数量大于或等于预设阈值,则可以对比多个共识节点对每个区块的区块数据切片结果,针对于任意两个共识节点,若这两个共识节点对每个区块的区块数据的切片校验值和位置均相同,则可以确定这两个共识节点中待备份区块的区块数据相同,如此,通过对比任意两个共识节点对每个区块的区块数据切片结果,可以确定出待备份区块的区块数据相同的各个共识节点,统计待备份区块的区块数据相同的各个共识节点的数量。
步骤406,远端服务器向区块数据相同的任一共识节点发送区块数据获取指令,并向签名数据相同的任一共识节点发送签名数据获取指令。
具体实施中,若待备份区块的区块数据相同的各个共识节点的数量大于或等于预设阈值,则确定区块链系统中大部分共识节点中待备份区块的区块数据一致,如此,远端服务器可以从待备份区块的区块数据相同的各个共识节点中选取任意一个共识节点,向该共识节点发送区块数据获取指令。其中,区块数据获取指令中包括待备份区块中每个区块的块高或待备份区块的数据文件的标识,区块数据获取指令用于该共识节点将该共识节点中待备份区块的数据文件中的区块数据发送给远端服务器。
相应地,远端服务器可以对比任意两个共识节点对签名数据的切片结果,将存在任一相同签名数据切片的共识节点统计为一个共识节点集合,每个共识节点集合包括存在公共签名数据的至少两个共识节点。其中,不同共识节点集合中可以存在相同的共识节点,比如共识节点1的签名数据切片1的校验值与共识节点3的签名数据切片5的校验值相同,且共识节点1的签名数据切片3的校验值与共识节点3的签名数据切片2的校验值相同,共识节点2的签名数据切片1的校验值、共识节点3的签名数据切片3的校验值和共识节点4的签名数据切片1的校验值相同,则共识节点1和共识节点3构成一个共识节点集合,共识节点2、共识节点3和共识节点4构成一个共识节点集合。
进一步地,针对于任一共识节点集合,远端服务器可以从该共识节点集合中选取任意一个共识节点,向该共识节点发送签名数据获取指令。其中,签名数据获取指令中包括待备份区块中每个区块的块高或待备份区块的数据文件的标识,还包括该共识节点在该共识节点集合中与其它共识节点相同的签名数据切片的位置,签名数据获取指令用于该共识节点将该共识节点所属的共识节点集合中的公共签名数据发送给远端服务器。
步骤407,接收到区块数据获取指令的共识节点将该共识节点中待备份区块的区块数据发送给远端服务器,接收到签名数据获取指令的共识节点将该共识节点中与签名数据的位置对应的签名数据发送给远端服务器。
本发明实施例中,针对于任一共识节点,若该共识节点接收到区块数据获取指令,则可以先根据区块数据获取指令中待备份区块中每个区块的块高或待备份区块的数据文件的标识获取该共识节点中待备份区块的数据文件,然后将该共识节点中待备份区块的数据文件中的区块数据发送给远端服务器。或者,若该共识节点接收到签名数据获取指令,则可以先根据签名数据获取指令中待备份区块中每个区块的块高或待备份区块的数据文件的标识获取该共识节点中待备份区块的数据文件,然后根据签名数据获取指令中签名数据切片的位置从该共识节点中待备份区块的数据文件中获取该共识节点所属的共识节点集 合中的公共签名数据,然后将公共签名数据发送给远端服务器。
步骤408,远端服务器根据接收到的区块数据和各个共识节点的签名数据,对待备份区块进行备份。
本发明实施例中,远端服务器可以根据接收到的各个共识节点发送的签名数据构建签名数据集,并可以根据接收到的待备份区块的区块数据和签名数据集对待备份区块进行备份。
在一个示例中,远端服务器可以从根据待备份区块的区块数据和签名数据集得到每个区块的区块数据和签名数据集,然后针对于任一区块,从该区块的区块数据中提取得到该区块的区块头,并可以将该区块的区块数据中除区块头之外的数据和该区块的签名数据集作为该区块的区块体;其中,区块的区块头包括区块高度、区块的哈希值、父区块的哈希值、交易数据的哈希值、交易回执的哈希值和状态数据的哈希值等,区块的区块体包括交易数据、交易回执、状态数据、签名数据等。
进一步地,远端服务器可以组装每个区块的区块头和区块体,得到每个区块的区块信息,然后将每个区块的区块信息存储在远端服务器的磁盘或内存中,以完成对待备份区块的备份。
步骤409,远端服务器确定不对待备份区块进行备份。
在上述实现方式中,远端服务器先根据各共识节点对区块数据的切片结果确定各共识节点的区块数据是否一致,若不一致,则说明待备份区块被篡改,如此,远端服务器无需执行签名数据的切片结果的对比过程即可确定不再备份,从而可以降低无必要的操作步骤。相应地,若一致,则说明待备份区块可以被备份。如此,远端服务器通过从任一未被篡改的共识节点获取区块数据,并采用最少的数据传输方式从各个共识节点获取全量的签名数据,可以以最少的数据传输量获取全量的区块数据和签名数据,从而可以有效地降低网络通信的压力。
本发明的上述实施例中,远端服务器先获取区块链系统中的各共识节点对各自存储的待备份区块的切片结果,再根据各共识节点对待备份区块的切片结果,确定是否对待备份区块进行备份。其中,每个共识节点对待备份区块的切片结果为对共识节点中待备份区块的数据文件进行切片得到的,数据文件包括区块数据和签名数据,切片结果包括多个切片的校验值和多个切片在数据文件中的位置,区块数据使用第一切片长度进行切片,签名数据使用第二切片长度进行切片。本发明实施例中,各个共识节点与远端服务器通过传输待备份区块的切片结果来实现对待备份区块的备份,而每个共识节点对待备份区块的切片结果包括切片的校验值和切片在数据文件中的位置,由此可知,待备份区块的切片结果相对于待备份区块的全量数据来说数据量较小,因此该种方式可以极大地减少网络通信的数据传输量,有效降低网络通信的开销,并可以提高区块备份的效率。
针对上述方法流程,本发明实施例还提供一种基于区块链系统的数据处理装置,该装置的具体内容可以参照上述方法实施。
图5为本发明实施例提供的一种基于区块链系统的数据处理装置的结构示意图,包括:
获取模块501,用于获取所述区块链系统中的各共识节点对各自存储的待备份区块的切片结果,每个共识节点对所述待备份区块的切片结果为对所述共识节点中所述待备份区块的数据文件进行切片得到的,所述数据文件包括区块数据和签名数据;所述切片结果包括多个切片的校验值和所述多个切片在所述数据文件中的位置;其中,所述区块数据使用 第一切片长度进行切片;所述签名数据使用第二切片长度进行切片;
备份模块502,用于根据各共识节点对所述待备份区块的切片结果,确定是否对所述待备份区块进行备份。
可选地,所述获取模块501具体用于:
获取第一共识节点对所述待备份区块的切片结果;
将所述第一共识节点对所述待备份区块的切片结果发送给所述区块链系统中的其它共识节点;所述第一共识节点对所述待备份区块的切片结果用于所述其它共识节点确定所述其它共识节点对所述待备份区块的切片结果,所述其它共识节点对所述待备份区块的切片结果中的多个切片为对应的第一共识节点对所述待备份区块的切片结果中的多个切片,所述其它共识节点对所述待备份区块的切片结果还包括不存在对应关系的切片对应的区块数据或签名数据;
接收所述其它共识节点发送的所述其它共识节点对所述待备份区块的切片结果。
可选地,所述获取模块501具体用于:
从第一共识节点获取所述待备份区块的数据文件;
使用所述第一切片长度对所述区块数据进行切片,得到所述第一共识节点对所述区块数据的多个切片,并计算每个切片的校验值;
使用所述第二切片长度对所述签名数据进行切片,得到所述第一共识节点对所述签名数据的多个切片,并计算每个切片的校验值;
根据所述第一共识节点对所述区块数据的多个切片的校验值、所述区块数据的多个切片在所述数据文件中的位置、所述第一共识节点对所述签名数据的多个切片的校验值和所述签名数据的多个切片在所述数据文件中的位置生成所述第一共识节点对所述待备份区块的切片结果。
可选地,所述备份模块502具体用于:
根据各共识节点对所述区块数据的切片结果,确定对所述区块数据的切片结果一致的共识节点的数量,若所述数量大于或等于预设阈值,则根据所述各共识节点对所述签名数据的切片结果统计得到签名数据集,并根据所述第一共识节点中所述待备份区块的数据文件和所述签名数据集对所述区块的数据文件进行备份;若确定所述数量小于所述预设阈值,则确定不对所述待备份区块进行备份。
可选地,所述获取模块501具体用于:
向各个共识节点发送切片规则;所述切片规则用于各个共识节点对各个共识节点中所述待备份区块的数据文件进行切片得到各个共识节点对所述待备份区块的切片结果,所述切片规则包括第一切片长度和第二切片长度,所述第二切片长度用于标识各共识节点的数字签名的长度。
可选地,所述备份模块502具体用于:
根据各共识节点对所述区块数据的切片结果,确定对所述区块数据的切片结果一致的共识节点的数量,若所述数量大于或等于预设阈值,则向任一共识节点发送第一数据请求;所述第一数据请求用于获取所述共识节点的区块数据;
根据各共识节点对所述签名数据的切片结果,将各共识节点划分为多个共识节点集合,并向每个共识节点集合中的任一共识节点发送第二数据请求;所述每个共识节点集合中的共识节点存在公共签名数据,所述第二数据请求用于获取所述共识节点集合中的公共签名 数据;
根据所述共识节点的区块数据和所述多个共识节点集合中的公共签名数据对所述区块的数据文件进行备份。
从上述内容可以看出:本发明的上述实施例中,远端服务器先获取区块链系统中的各共识节点对各自存储的待备份区块的切片结果,再根据各共识节点对待备份区块的切片结果,确定是否对待备份区块进行备份。其中,每个共识节点对待备份区块的切片结果为对共识节点中待备份区块的数据文件进行切片得到的,数据文件包括区块数据和签名数据,切片结果包括多个切片的校验值和多个切片在数据文件中的位置,区块数据使用第一切片长度进行切片,签名数据使用第二切片长度进行切片。本发明实施例中,各个共识节点与远端服务器通过传输待备份区块的切片结果来实现对待备份区块的备份,而每个共识节点对待备份区块的切片结果包括切片的校验值和切片在数据文件中的位置,由此可知,待备份区块的切片结果相对于待备份区块的全量数据来说数据量较小,因此该种方式可以极大地减少网络通信的数据传输量,有效降低网络通信的开销,并可以提高区块备份的效率。
基于同一发明构思,本发明实施例提供了一种计算设备,如图6所示,包括至少一个处理器601,以及与至少一个处理器连接的存储器602,本发明实施例中不限定处理器601与存储器602之间的具体连接介质,图6中处理器601和存储器602之间通过总线连接为例。总线可以分为地址总线、数据总线、控制总线等。
在本发明实施例中,存储器602存储有可被至少一个处理器601执行的指令,至少一个处理器601通过执行存储器602存储的指令,可以执行前述的基于区块链系统饿的数据处理方法中所包括的步骤。
其中,处理器601是计算设备的控制中心,可以利用各种接口和线路连接计算设备的各个部分,通过运行或执行存储在存储器602内的指令以及调用存储在存储器602内的数据,从而实现数据处理。可选的,处理器601可包括一个或多个处理单元,处理器601可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理下发指令。可以理解的是,上述调制解调处理器也可以不集成到处理器601中。在一些实施例中,处理器601和存储器602可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。
处理器601可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合基于区块链系统的数据处理实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
存储器602作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器602可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等等。存储器602是能够用于携带或存储具有指令 或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器602还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。
基于同一发明构思,本发明实施例还提供了一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述图2至图4任一项所述的基于区块链系统的数据处理方法。
本领域内的技术人员应明白,本发明的实施例可提供为方法、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (14)

  1. 一种基于区块链系统的数据处理方法,其特征在于,所述方法包括:
    远端服务器获取所述区块链系统中的各共识节点对各自存储的待备份区块的切片结果,每个共识节点对所述待备份区块的切片结果为对所述共识节点中所述待备份区块的数据文件进行切片得到的,所述数据文件包括区块数据和签名数据;所述切片结果包括多个切片的校验值和所述多个切片在所述数据文件中的位置;其中,所述区块数据使用第一切片长度进行切片;所述签名数据使用第二切片长度进行切片;
    所述远端服务器根据各共识节点对所述待备份区块的切片结果,确定是否对所述待备份区块进行备份。
  2. 根据权利要求1所述的方法,其特征在于,所述远端服务器获取所述区块链系统中的各共识节点对各自存储的待备份区块的切片结果,包括:
    所述远端服务器获取第一共识节点对所述待备份区块的切片结果;
    所述远端服务器将所述第一共识节点对所述待备份区块的切片结果发送给所述区块链系统中的其它共识节点;所述第一共识节点对所述待备份区块的切片结果用于所述其它共识节点确定所述其它共识节点对所述待备份区块的切片结果,所述其它共识节点对所述待备份区块的切片结果中的多个切片为对应的第一共识节点对所述待备份区块的切片结果中的多个切片,所述其它共识节点对所述待备份区块的切片结果还包括不存在对应关系的切片对应的区块数据或签名数据;
    所述远端服务器接收所述其它共识节点发送的所述其它共识节点对所述待备份区块的切片结果。
  3. 根据权利要求2所述的方法,其特征在于,所述远端服务器获取第一共识节点对待备份区块的切片结果,包括:
    从第一共识节点获取所述待备份区块的数据文件;
    所述远端服务器使用所述第一切片长度对所述区块数据进行切片,得到所述第一共识节点对所述区块数据的多个切片,并计算每个切片的校验值;
    所述远端服务器使用所述第二切片长度对所述签名数据进行切片,得到所述第一共识节点对所述签名数据的多个切片,并计算每个切片的校验值;
    所述远端服务器根据所述第一共识节点对所述区块数据的多个切片的校验值、所述区块数据的多个切片在所述数据文件中的位置、所述第一共识节点对所述签名数据的多个切片的校验值和所述签名数据的多个切片在所述数据文件中的位置生成所述第一共识节点对所述待备份区块的切片结果。
  4. 根据权利要求3所述的方法,其特征在于,所述远端服务器根据各共识节点对所述待备份区块的切片结果,确定是否对所述待备份区块进行备份,包括:
    所述远端服务器根据各共识节点对所述区块数据的切片结果,确定对所述区块数据的切片结果一致的共识节点的数量,若所述数量大于或等于预设阈值,则根据所述各共识节点对所述签名数据的切片结果统计得到签名数据集,并根据所述第一共识节点中所述待备份区块的数据文件和所述签名数据集对所述区块的数据文件进行备份;若确定所述数量小于所述预设阈值,则确定不对所述待备份区块进行备份。
  5. 根据权利要求1所述的方法,其特征在于,所述远端服务器获取所述区块链系统中 的各共识节点对各自存储的待备份区块的切片结果,包括:
    所述远端服务器向各个共识节点发送切片规则;所述切片规则用于各个共识节点对各个共识节点中所述待备份区块的数据文件进行切片得到各个共识节点对所述待备份区块的切片结果,所述切片规则包括第一切片长度和第二切片长度,所述第二切片长度用于标识各共识节点的数字签名的长度。
  6. 根据权利要求5所述的方法,其特征在于,所述远端服务器根据各共识节点对所述待备份区块的切片结果,确定是否对所述待备份区块进行备份,包括:
    所述远端服务器根据各共识节点对所述区块数据的切片结果,确定对所述区块数据的切片结果一致的共识节点的数量,若所述数量大于或等于预设阈值,则向任一共识节点发送第一数据请求;所述第一数据请求用于获取所述共识节点的区块数据;
    所述远端服务器根据各共识节点对所述签名数据的切片结果,将各共识节点划分为多个共识节点集合,并向每个共识节点集合中的任一共识节点发送第二数据请求;所述每个共识节点集合中的共识节点存在公共签名数据,所述第二数据请求用于获取所述共识节点集合中的公共签名数据;
    所述远端服务器根据所述共识节点的区块数据和所述多个共识节点集合中的公共签名数据对所述区块的数据文件进行备份。
  7. 一种基于区块链系统的数据处理装置,其特征在于,所述装置包括:
    获取模块,用于获取所述区块链系统中的各共识节点对各自存储的待备份区块的切片结果,每个共识节点对所述待备份区块的切片结果为对所述共识节点中所述待备份区块的数据文件进行切片得到的,所述数据文件包括区块数据和签名数据;所述切片结果包括多个切片的校验值和所述多个切片在所述数据文件中的位置;其中,所述区块数据使用第一切片长度进行切片;所述签名数据使用第二切片长度进行切片;
    备份模块,用于根据各共识节点对所述待备份区块的切片结果,确定是否对所述待备份区块进行备份。
  8. 根据权利要求7所述的装置,其特征在于,所述获取模块具体用于:
    获取第一共识节点对所述待备份区块的切片结果;
    将所述第一共识节点对所述待备份区块的切片结果发送给所述区块链系统中的其它共识节点;所述第一共识节点对所述待备份区块的切片结果用于所述其它共识节点确定所述其它共识节点对所述待备份区块的切片结果,所述其它共识节点对所述待备份区块的切片结果中的多个切片为对应的第一共识节点对所述待备份区块的切片结果中的多个切片,所述其它共识节点对所述待备份区块的切片结果还包括不存在对应关系的切片对应的区块数据或签名数据;
    接收所述其它共识节点发送的所述其它共识节点对所述待备份区块的切片结果。
  9. 根据权利要求7所述的装置,其特征在于,所述获取模块具体用于:
    从第一共识节点获取所述待备份区块的数据文件;
    使用所述第一切片长度对所述区块数据进行切片,得到所述第一共识节点对所述区块数据的多个切片,并计算每个切片的校验值;
    使用所述第二切片长度对所述签名数据进行切片,得到所述第一共识节点对所述签名数据的多个切片,并计算每个切片的校验值;
    根据所述第一共识节点对所述区块数据的多个切片的校验值、所述区块数据的多个切 片在所述数据文件中的位置、所述第一共识节点对所述签名数据的多个切片的校验值和所述签名数据的多个切片在所述数据文件中的位置生成所述第一共识节点对所述待备份区块的切片结果。
  10. 根据权利要求9所述的装置,其特征在于,所述备份模块具体用于:
    根据各共识节点对所述区块数据的切片结果,确定对所述区块数据的切片结果一致的共识节点的数量,若所述数量大于或等于预设阈值,则根据所述各共识节点对所述签名数据的切片结果统计得到签名数据集,并根据所述第一共识节点中所述待备份区块的数据文件和所述签名数据集对所述区块的数据文件进行备份;若确定所述数量小于所述预设阈值,则确定不对所述待备份区块进行备份。
  11. 根据权利要求7所述的装置,其特征在于,所述获取模块具体用于:
    向各个共识节点发送切片规则;所述切片规则用于各个共识节点对各个共识节点中所述待备份区块的数据文件进行切片得到各个共识节点对所述待备份区块的切片结果,所述切片规则包括第一切片长度和第二切片长度,所述第二切片长度用于标识各共识节点的数字签名的长度。
  12. 根据权利要求11所述的装置,其特征在于,所述备份模块具体用于:
    根据各共识节点对所述区块数据的切片结果,确定对所述区块数据的切片结果一致的共识节点的数量,若所述数量大于或等于预设阈值,则向任一共识节点发送第一数据请求;所述第一数据请求用于获取所述共识节点的区块数据;
    根据各共识节点对所述签名数据的切片结果,将各共识节点划分为多个共识节点集合,并向每个共识节点集合中的任一共识节点发送第二数据请求;所述每个共识节点集合中的共识节点存在公共签名数据,所述第二数据请求用于获取所述共识节点集合中的公共签名数据;
    根据所述共识节点的区块数据和所述多个共识节点集合中的公共签名数据对所述区块的数据文件进行备份。
  13. 一种计算设备,其特征在于,包括至少一个处理器以及至少一个存储器,其中,所述存储器存储有计算机程序,当所述程序被所述处理器执行时,使得所述处理器执行权利要求1~6任一权利要求所述的方法。
  14. 一种计算机可读存储介质,其特征在于,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行权利要求1~6任一权利要求所述的方法。
PCT/CN2020/114568 2019-10-29 2020-09-10 一种基于区块链系统的数据处理方法及装置 WO2021082757A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911039082.XA CN110855761B (zh) 2019-10-29 2019-10-29 一种基于区块链系统的数据处理方法及装置
CN201911039082.X 2019-10-29

Publications (1)

Publication Number Publication Date
WO2021082757A1 true WO2021082757A1 (zh) 2021-05-06

Family

ID=69598378

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/114568 WO2021082757A1 (zh) 2019-10-29 2020-09-10 一种基于区块链系统的数据处理方法及装置

Country Status (2)

Country Link
CN (1) CN110855761B (zh)
WO (1) WO2021082757A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113411191A (zh) * 2021-08-20 2021-09-17 深圳前海微众银行股份有限公司 数据审计方法及装置
CN113628047A (zh) * 2021-07-15 2021-11-09 金陵科技学院 一种交易事件的辅助处理系统
CN114449003A (zh) * 2022-01-28 2022-05-06 浪潮云信息技术股份公司 一种联盟链数据处理方法及联盟链
CN114881760A (zh) * 2022-04-29 2022-08-09 深圳市智策科技有限公司 基于区块链的数据管理方法及系统
CN114884977A (zh) * 2022-05-09 2022-08-09 深圳嘉业产业发展有限公司 一种基于区块链的数据共享方法及系统
CN115544170A (zh) * 2022-11-22 2022-12-30 中国信息通信研究院 基于区块链的数据托管方法和装置、电子设备、介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110855761B (zh) * 2019-10-29 2021-09-21 深圳前海微众银行股份有限公司 一种基于区块链系统的数据处理方法及装置
CN114418574A (zh) * 2020-01-17 2022-04-29 厦门潭宏信息科技有限公司 一种共识和资源传输方法、设备及存储介质
CN111768181B (zh) * 2020-07-01 2024-10-15 李东 一种结合大数据和信用区块链的数据清算系统
CN112596957A (zh) * 2020-12-29 2021-04-02 东软集团股份有限公司 用于区块链的方法、装置、存储介质及电子设备
CN113742296B (zh) * 2021-09-09 2024-04-30 诺优信息技术(上海)有限公司 一种路测数据切片处理的方法、装置及电子设备
CN114385761B (zh) * 2022-03-23 2022-07-12 支付宝(杭州)信息技术有限公司 一种基于共识系统的共识数据存储、获取方法及装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108063774A (zh) * 2018-02-13 2018-05-22 苏州汉辰数字科技有限公司 一种量子流媒体云盘系统及服务架构
CN108647361A (zh) * 2018-05-21 2018-10-12 中国工商银行股份有限公司 一种基于区块链的数据存储方法、装置及系统
WO2019106186A1 (fr) * 2017-11-30 2019-06-06 Worldline Plate-forme de tracabilite securisee de donnees
CN109885256A (zh) * 2019-01-23 2019-06-14 平安科技(深圳)有限公司 一种基于数据分片的数据存储方法、设备及介质
CN110855761A (zh) * 2019-10-29 2020-02-28 深圳前海微众银行股份有限公司 一种基于区块链系统的数据处理方法及装置

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102064906A (zh) * 2009-11-18 2011-05-18 突触计算机系统(上海)有限公司 一种对数据块进行校验的方法和装置
WO2018028777A1 (en) * 2016-08-10 2018-02-15 Rwe International Se Peer-to-peer communication system and peer-to-peer processing apparatus
US10554412B2 (en) * 2018-03-06 2020-02-04 Robust Analytics, Inc. Method and network to implement decentralized validation and authentication mechanisms to prevent ADS-B cyber-attacks
CN109284625A (zh) * 2018-09-03 2019-01-29 佛山科学技术学院 一种基于区块链的数据安全访问方法及装置
CN109271283A (zh) * 2018-09-06 2019-01-25 北京云测信息技术有限公司 一种基于区块链的数据备份方法
CN109271115B (zh) * 2018-10-11 2021-07-30 重庆晨鲸科技有限公司 存储共享方法、装置、区块链分布式网络拓扑
CN109508968B (zh) * 2018-10-25 2020-12-18 常州唯康信息科技有限公司 区块链系统以及其控制方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019106186A1 (fr) * 2017-11-30 2019-06-06 Worldline Plate-forme de tracabilite securisee de donnees
CN108063774A (zh) * 2018-02-13 2018-05-22 苏州汉辰数字科技有限公司 一种量子流媒体云盘系统及服务架构
CN108647361A (zh) * 2018-05-21 2018-10-12 中国工商银行股份有限公司 一种基于区块链的数据存储方法、装置及系统
CN109885256A (zh) * 2019-01-23 2019-06-14 平安科技(深圳)有限公司 一种基于数据分片的数据存储方法、设备及介质
CN110855761A (zh) * 2019-10-29 2020-02-28 深圳前海微众银行股份有限公司 一种基于区块链系统的数据处理方法及装置

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113628047A (zh) * 2021-07-15 2021-11-09 金陵科技学院 一种交易事件的辅助处理系统
CN113628047B (zh) * 2021-07-15 2024-02-02 金陵科技学院 一种交易事件的辅助处理系统
CN113411191A (zh) * 2021-08-20 2021-09-17 深圳前海微众银行股份有限公司 数据审计方法及装置
CN114449003A (zh) * 2022-01-28 2022-05-06 浪潮云信息技术股份公司 一种联盟链数据处理方法及联盟链
CN114881760A (zh) * 2022-04-29 2022-08-09 深圳市智策科技有限公司 基于区块链的数据管理方法及系统
CN114884977A (zh) * 2022-05-09 2022-08-09 深圳嘉业产业发展有限公司 一种基于区块链的数据共享方法及系统
CN115544170A (zh) * 2022-11-22 2022-12-30 中国信息通信研究院 基于区块链的数据托管方法和装置、电子设备、介质
CN115544170B (zh) * 2022-11-22 2023-03-14 中国信息通信研究院 基于区块链的数据托管方法和装置、电子设备、介质

Also Published As

Publication number Publication date
CN110855761A (zh) 2020-02-28
CN110855761B (zh) 2021-09-21

Similar Documents

Publication Publication Date Title
WO2021082757A1 (zh) 一种基于区块链系统的数据处理方法及装置
US10552640B2 (en) In-situ data verification for the cloud
US10346439B2 (en) Entity resolution from documents
CN111090645B (zh) 基于云存储的数据传输方法、装置及计算机设备
WO2020259003A1 (zh) 一种链路追踪方法及装置
US11055291B2 (en) Generating data structures for storing database metadata
CN107194794B (zh) 一种企业纳税申报管理系统及方法
WO2019196304A1 (zh) 电子装置、征信反馈报文的解析方法及存储介质
US11664974B2 (en) Summary chains in distributed systems
CN111641563B (zh) 基于分布式场景的流量自适应方法与系统
CN111580965A (zh) 数据请求的处理方法及系统
WO2021174882A1 (zh) 数据分片校验方法、装置、计算机设备及可读存储介质
WO2020000486A1 (zh) 数据处理方法及装置
CN111898036A (zh) 一种行为数据收集处理系统及方法
WO2021082936A1 (zh) 一种网页访客数量统计方法及装置
CN117708108A (zh) 一种客户多维信息校验方法及装置
WO2019100684A1 (zh) 电子装置、征信数据处理的方法、系统及存储介质
CN113590703A (zh) Es数据导入方法、装置、电子设备及可读存储介质
CN111866106A (zh) 共识方法、装置、电子设备和可读存储介质
WO2023019841A1 (zh) 数据审计方法及装置
CN115834260A (zh) 网络安全防御系统、方法及装置
CN113779075B (zh) 基于差分隐私的数据查询方法、装置、设备及存储介质
CN111158994B (zh) 一种压测性能测试方法及装置
CN115510012A (zh) 业务数据处理方法、装置、计算机设备和存储介质
US20180246666A1 (en) Methods for performing data deduplication on data blocks at granularity level and devices thereof

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: 20880702

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: 20880702

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.09.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20880702

Country of ref document: EP

Kind code of ref document: A1