Block data processing method and device, equipment and storage medium
By encrypting the block data with a threshold public key and storing it to the data storage node, the problem of insufficient storage space and security of the blockchain node is solved, and a safe and efficient data storage solution is realized.
Patent Information
- Application Number
- CN202310803804.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-12-31
AI Technical Summary
Blockchain nodes face problems such as space limitations and insufficient security when storing block data, and it is difficult to improve data security while saving storage space.
By encrypting the block data with a threshold public key, it is stored in the data storage node, and deleting the original data from the blockchain after the storage is successful, saving storage space and improving data security.
It realizes the effect of improving block data security while saving the storage space of blockchain nodes, and ensures data security and high applicability through encrypted storage.
Smart Images

Figure CN119227092A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a block data processing method, device, equipment and storage medium. Background Art
[0002] As privacy protection becomes more important and data volume expands, the storage restrictions on blockchain are increasing. In order to save the storage space of blockchain nodes, it is often necessary to store the block data in the same data storage center, but the security of the block data cannot be guaranteed.
[0003] Therefore, how to save the storage space of blockchain nodes while improving the security of block data has become an urgent problem to be solved. Summary of the invention
[0004] The embodiments of the present application provide a block data processing method, apparatus, device and storage medium, which are highly applicable.
[0005] On the one hand, an embodiment of the present application provides a block data processing method, which is applied to a blockchain node, and the method includes:
[0006] Obtaining first block data to be archived from the blockchain, and encrypting the first block data based on the threshold public key to obtain first encrypted block data;
[0007] Sending the first encrypted block data to a data storage node so that the data storage node archives and stores the first encrypted block data;
[0008] In response to the first encrypted block data being successfully stored, the first block data is deleted from the blockchain.
[0009] On the one hand, an embodiment of the present application provides a block data processing method, which is applied to a data storage node, and the method includes:
[0010] Obtaining first encrypted block data, and archiving and storing the first encrypted block data, wherein the first encrypted block data is obtained by encrypting the first block data in the blockchain by the blockchain node based on the threshold public key;
[0011] In response to the successful storage of the first encrypted block data, first indication information for indicating the successful storage of the first encrypted block data is sent to the blockchain node, so that the blockchain node deletes the first block data from the blockchain.
[0012] On the other hand, an embodiment of the present application provides a block data processing device, the device comprising:
[0013] A data encryption module, used to obtain first block data to be archived from the blockchain, and encrypt the first block data based on a threshold public key to obtain first encrypted block data;
[0014] A first transceiver module is used to send the first encrypted block data to a data storage node, so that the data storage node archives and stores the first encrypted block data;
[0015] The data processing module is used to delete the first block data from the blockchain in response to the first encrypted block data being successfully stored.
[0016] On the other hand, an embodiment of the present application provides a block data processing device, the device comprising:
[0017] A data storage module, used to obtain first encrypted block data and archive and store the first encrypted block data, wherein the first encrypted block data is obtained by encrypting the first block data in the blockchain by the blockchain node based on the threshold public key;
[0018] The second transceiver module is used to send first indication information indicating that the first encrypted block data is successfully stored to the blockchain node in response to the first encrypted block data being successfully stored, so that the blockchain node deletes the first block data from the blockchain.
[0019] On the other hand, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the processor and the memory are connected to each other;
[0020] The memory is used to store computer programs;
[0021] The above-mentioned processor is used to execute the block data processing method provided in the embodiment of the present application when calling the above-mentioned computer program.
[0022] On the other hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the block data processing method provided in the embodiment of the present application.
[0023] On the other hand, an embodiment of the present application provides a computer program product, which includes a computer program. When the above computer program is executed by a processor, the block data processing method provided by the embodiment of the present application is implemented.
[0024] In the embodiment of the present application, the blockchain node can encrypt the block data sampling threshold public key to be archived and store it in the data storage node. Since the encrypted encrypted block data needs to be decrypted by the blockchain node's own threshold private key to obtain the plaintext data, the data storage security of the data storage node can be improved. And after the blockchain node stores the block data in the data storage node, it can delete the corresponding block data from the blockchain, thereby saving the storage space of the blockchain node itself, and the applicability is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 It is a schematic diagram of the network structure of the blockchain data processing method provided in the embodiment of the present application;
[0027] Figure 2 It is a timing diagram of a block data processing method provided by an embodiment of the present application;
[0028] Figure 3 is another timing diagram of the block data processing method provided by an embodiment of the present application;
[0029] Figure 4 This is a schematic diagram of the key generation process provided by an embodiment of the present application;
[0030] Figure 5 It is a schematic diagram of the process framework of the data archiving method provided in the embodiment of the present application;
[0031] Figure 6 It is a schematic diagram of the process framework of the data recovery method provided in the embodiment of the present application;
[0032] Figure 7 It is a schematic diagram of the process framework of the data query method provided in the embodiment of the present application;
[0033] Figure 8 It is a schematic diagram of the structure of the blockchain node provided in the embodiment of the present application;
[0034] Fig. 9 It is a structural diagram of a data storage node provided in an embodiment of the present application;
[0035] Fig.10 is a structural schematic diagram of a block data processing device provided in an embodiment of the present application;
[0036] Fig.11is another structural schematic diagram of the block data processing device provided in an embodiment of the present application;
[0037] Fig.12 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0039] The block data storage method provided in the embodiment of the present application can be applied to the blockchain field and used to archive and store block data in the blockchain, which is beneficial to saving storage space of blockchain nodes.
[0040] See also Figure 1 , Figure 1 Schematic diagram of the network structure of the blockchain data processing method provided by the embodiment of the present application. Figure 1 As shown, the blockchain network 10 includes multiple blockchain nodes, such as node 10a, node 10b, node 10c, node 10d, and so on.
[0041] Each node in the blockchain network 10 stores the same blockchain 20, which includes multiple blocks. The blockchain 20 is a new application model of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. The blockchain 20 is essentially a decentralized database, a string of blocks generated by cryptographic methods, each of which contains a batch of transaction information for verifying the validity of its information (anti-counterfeiting) and generating the next block. The blockchain can include the blockchain underlying platform, the platform product service layer, and the application service layer.
[0042] Among them, blockchain nodes (such as node 10a, node 10b, node 10c and node 10d, etc.) usually refer to network devices in the blockchain network 10, that is, any network device connected to the blockchain network 10 can be called a blockchain node.
[0043] Among them, blockchain nodes can be terminal devices such as personal computers, laptops, smart phones, tablets, smart watches, smart voice interaction devices, smart home appliances, car terminals and smart wearable devices, or independent physical servers, cloud servers, etc., which can be determined based on the actual application scenario requirements and are not limited here. Cloud servers refer to servers that can provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. Cloud servers are simple, efficient, safe and reliable computing services with elastically scalable processing capabilities. Its management method is simpler and more efficient than that of physical servers. Cloud servers can quickly create or release any number of cloud servers, which is conducive to quickly building more stable and secure applications, reducing the difficulty of development and operation and overall IT costs.
[0044] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0045] The underlying blockchain platform can include processing modules such as object management, basic services, smart contracts, and data processing. Among them, the object management module is responsible for the identity information management of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the correspondence between real identities and blockchain addresses (authority management), etc., and, under authorization, verifies the transaction status of certain real identities and provides risk control rule configuration (risk control audit); the basic service module is deployed on all blockchain node devices to verify the validity of business requests, and records valid requests after consensus is reached. For a new business request, the basic service first adapts the interface for parsing and authentication processing (interface adaptation), and then encrypts the business information through the consensus algorithm (consensus management), and transmits it to the shared ledger in a complete and consistent manner after encryption (network communication), and records and stores it; the smart contract module is responsible for the registration and issuance of contracts, as well as contract triggering and contract execution. Developers can define contract logic in a programming language and publish it to the blockchain (contract registration). According to the logic of the contract terms, call keys or other events to trigger execution to complete the contract logic. At the same time, it also provides the function of contract upgrade and cancellation; the data processing module is mainly responsible for the deployment, configuration modification, contract setting, cloud adaptation and visual output of real-time status of product operation during product release.
[0046] exist Figure 1 In the example, the blockchain node (such as blockchain node 10a) in the blockchain network 10 can obtain the first block data to be archived from the blockchain 20, such as the block data with a block height of 5 (i.e., the fifth block in the blockchain 20), and encrypt the first block data based on the threshold public key to obtain the first encrypted block data. Further, the blockchain node 10a can send the first encrypted block data to the data storage node 30 so that the data storage node 30 archives and stores the first encrypted block, and after the data storage node 30 successfully stores the first encrypted block data, delete the first block data from the blockchain 20.
[0047] in, Figure 1 The data storage node in the data archiving service can be a device that interacts with the blockchain node in the data archiving service provided by a third party. It can be a designated storage space, such as a server cluster, a large database, a cloud storage space, or a blockchain specifically used for data archiving, etc. The specific requirements can be determined based on the actual application scenario and are not limited here.
[0048] The database can be simply regarded as an electronic file cabinet - a place to store electronic files. It can be a relational database (SQL database) or a non-relational database (NoSQL database), and there is no restriction here. Cloud storage is a new concept that extends and develops from the concept of cloud computing. It refers to the use of cluster applications, grid technology, and distributed storage file systems to bring together a large number of different types of storage devices (storage devices are also called storage nodes) in the network through application software or application interfaces to work together to achieve data storage.
[0049] See also Figure 2 , Figure 2 FIG. 1 is a timing diagram of a block data processing method provided by an embodiment of the present application. Figure 2 As shown, the block data processing method provided in the embodiment of the present application can be jointly executed by the blockchain node and the data storage node, and may specifically include the following steps:
[0050] Step S21: Obtain first block data to be archived from the blockchain, and encrypt the first block data based on a threshold public key to obtain first encrypted block data.
[0051] In the embodiment of the present application, the blockchain node used to process block data can be any node in the blockchain network, or it can be a management node with relevant permissions to process block data stored on the chain, etc. The specific details can be determined based on the actual application scenario requirements and are not limited here.
[0052] In some feasible implementations, when a blockchain node needs to archive block data of a block in the blockchain, it can directly obtain the block data of the block from the blockchain (hereinafter referred to as the first block data for the convenience of description), and encrypt the first block data based on the threshold public key to obtain the first encrypted block data.
[0053] In some feasible implementations, when the first object needs to archive the first block data in the blockchain, the blockchain node may receive the first data archiving request initiated by the first object, and determine whether the first object has the data archiving permission based on the first data archiving request. Further, when the blockchain node determines that the first object has the data archiving permission, it obtains the first block data from the blockchain, and encrypts the first block data based on the threshold public key to obtain the first encrypted block data.
[0054] In some feasible implementations, when the first object needs to archive the first block data in the blockchain, the blockchain node can receive the first signature information sent by the first object.
[0055] The first signature information is obtained after the first object signs the first data archiving request based on the private key of the first object (hereinafter referred to as the first private key for the convenience of description).
[0056] The first data archiving request is initiated by the first object and is used to request archiving and storing the first block data.
[0057] Further, the blockchain node may decrypt the first signature information based on the public key of the first object (hereinafter referred to as the first public key for convenience of description) to obtain the first data archiving request. When the blockchain node successfully decrypts the first signature information to obtain the first data archiving request, it may be determined that the first signature information passes the signature verification.
[0058] Based on this, the blockchain node can determine whether the first object has data archiving permission based on the first data archiving request, and if the first object has data archiving permission, obtain the first block data from the blockchain, and encrypt the first block data based on the threshold public key to obtain the first encrypted block data.
[0059] In some feasible implementations, when the first object needs to archive the first block data in the blockchain, the blockchain node can receive the first signature information sent by the first object.
[0060] The first signature information is obtained after the first object signs the first data archiving request based on the first private key of the first object.
[0061] The first data archiving request is initiated by the first object and is used to request archiving and storing the first block data.
[0062] Further, the blockchain node may decrypt the first signature information based on the first public key of the first object to obtain the first data archiving request. When the blockchain node successfully decrypts the first signature information to obtain the first data archiving request, it may be determined that the first signature information passes the signature verification.
[0063] When the first signature information passes the signature verification and it is determined that the first object has data archiving authority, the blockchain node can add the first data archiving request as a pending transaction to the transaction pool, and the transaction pool will package the pending transactions including the first data archiving request and execute them out of blocks.
[0064] During the block generation process, the verification node in the blockchain can perform signature verification on the first data archiving request, that is, confirm whether the first data archiving request can be generated and executed. For any verification node, if the node signs the first data archiving request based on the private key of the node, the node confirms that the first data archiving request can be generated and executed, that is, confirms the validity of the first object request for data archiving.
[0065] Based on this, if signature information of at least a preset number of verification nodes for the first data archiving request is received, and the corresponding signature information is successfully decrypted based on the public key of each verification node, the first data archiving request is confirmed as a valid transaction, that is, the first data archiving request is confirmed as a valid request. At this time, while the first data archiving request is blocked as a transaction to be executed, the blockchain node can obtain the first block data from the blockchain, and encrypt the first block data based on the threshold public key to obtain the first encrypted block data.
[0066] In some feasible implementations, when a blockchain node needs to archive block data of a block in the blockchain, the blockchain node can determine a second data archiving request and add the second data archiving request as a pending transaction to the transaction pool, and the transaction pool will package the pending transactions including the second data archiving request and execute them out of the block.
[0067] During the block generation process, the verification node in the blockchain can perform signature verification on the second data archiving request, that is, confirm whether the second data archiving request can be generated and executed. For any verification node, if the node signs the second data archiving request based on the node's private key, the node confirms that the second data archiving request can be generated and executed, that is, confirms the validity of the blockchain node's request for data archiving.
[0068] Based on this, if signature information of at least a preset number of verification nodes for the second data archiving request is received, and the corresponding signature information is successfully decrypted based on the public key of each verification node, the second data archiving request is confirmed as a valid transaction, that is, the second data archiving request is confirmed as a valid request. At this time, while the second data archiving request is blocked as a transaction to be executed, the blockchain node can obtain the first block data from the blockchain, and encrypt the first block data based on the threshold public key to obtain the first encrypted block data.
[0069] It should be noted that the aforementioned second data archiving request can be initiated by the blockchain node based on the first data archiving request (such as the first data archiving request and the second data archiving request are the same request), or it can be initiated directly by the block node, and there is no limitation here.
[0070] Step S22: Send the first encrypted block data to a data storage node.
[0071] In some feasible implementations, the blockchain node may sign the second data archiving request based on the private key of the blockchain node (hereinafter referred to as the second private key for the convenience of description) to obtain the second signature information.
[0072] Furthermore, the blockchain node may send the second signature information to the data storage node, so that the data storage node decrypts the second signature information based on the public key of the blockchain node (hereinafter referred to as the second public key for the convenience of description) to obtain a second data archiving request.
[0073] In which, when the data storage node successfully decrypts the second signature information to obtain the second data archiving request, it can be determined that the second signature information passes the signature verification.
[0074] When the second signature information passes the signature verification, the data storage node can determine whether the blockchain node has the data archiving permission based on the second data archiving request, and when the blockchain node has the data archiving permission, the blockchain node can send the first encrypted block data to the data storage node so that the data storage node can obtain the first encrypted block data.
[0075] Optionally, when determining the second data archiving request, the blockchain node may add the first encrypted block data to the second data archiving request, and sign the second data archiving request based on the second private key of the blockchain node to obtain second signature information.
[0076] Furthermore, the blockchain node may send the second signature information to the data storage node, so that the data storage node decrypts the second signature information based on the second public key of the blockchain node to obtain a second data archiving request.
[0077] In which, when the data storage node successfully decrypts the second signature information to obtain the second data archiving request, it can be determined that the second signature information passes the signature verification.
[0078] When the second signature information passes the signature verification, the data storage node can determine whether the blockchain node has the data archiving permission based on the second data archiving request, and when the blockchain node has the data archiving permission, the data storage node can directly obtain the first encrypted block data in the second data archiving request.
[0079] Step S23: Acquire the first encrypted block data, and archive and store the first encrypted block data.
[0080] In the embodiment of the present application, the manner in which the data storage node obtains the first encrypted block data can be referred to step S23, which will not be described in detail herein.
[0081] Furthermore, the data storage node may write the first encrypted block data into a corresponding file system, and compress the first encrypted block data after writing is completed, so as to reduce the amount of data storage.
[0082] Step S24: In response to the first encrypted block data being successfully stored, sending first indication information indicating that the first encrypted block data is successfully stored.
[0083] In some feasible implementations, after successfully storing the first encrypted block data, the data storage node sends first indication information to the blockchain node, where the first indication information is used to indicate that the first encrypted block data has been successfully stored. After failing to store the first encrypted block data, the data storage node sends second indication information to the blockchain node, where the second indication information is used to indicate that the first encrypted block data has failed.
[0084] When the blockchain node requests the data storage node to archive and store the first encrypted block data based on the second data archiving request, before the data storage node stores the first encrypted block data, the second data archiving request is marked as an uncompleted state. After receiving the first indication information, the blockchain node may mark the second data archiving request as a completed state.
[0085] Step S25: In response to the first encrypted block data being successfully stored, the first block data is deleted from the blockchain.
[0086] In some feasible implementations, after the data storage node successfully stores the first encrypted block data, that is, after receiving the first indication information sent by the data storage node, the blockchain node can determine that the first encrypted block data is successfully stored, and then delete the first block data from the blockchain to save the storage space of the blockchain node itself.
[0087] In the embodiment of the present application, for the first signature information, the first signature information may also be obtained by encrypting the first summary information based on the second public key of the blockchain node after the first object performs a hash calculation on the first data archiving request. When receiving the first signature information, the blockchain node also receives the first data archiving request initiated by the first object.
[0088] Based on this, when the blockchain node verifies the first signature information, it can decrypt the first signature information based on the second private key of the blockchain node to obtain the decrypted summary information, and at the same time perform a hash calculation on the first data archiving request to obtain the first summary information, thereby comparing the decrypted summary information with the first summary information. If the two are consistent, it means that the first data archiving request has not been tampered with, that is, the first data archiving request is a valid request.
[0089] Similarly, for the second signature information, the second signature information can also be obtained by the blockchain node performing a hash calculation on the second data archiving request to obtain the second summary information, and then encrypting the second summary information based on the third public key of the data storage node. When the data storage node receives the second signature information, it also receives the second data archiving request initiated by the first object.
[0090] Based on this, when the data storage node verifies the signature of the second signature information, it can decrypt the second signature information based on the third private key of the data storage node to obtain the decrypted summary information, and at the same time perform hash calculation on the second data archiving request to obtain the second summary information, thereby comparing the decrypted summary information with the second summary information. If the two are consistent, it means that the second data archiving request has not been tampered with, that is, the second data archiving request is a valid request.
[0091] The block data processing method provided in the embodiment of the present application is Figure 2 In addition to the block data archiving method shown in FIG, there is also a block data recovery method. Figure 3 As shown, Figure 3 FIG. 1 is another timing diagram of the block data processing method provided in the embodiment of the present application. Figure 3 As shown, the block data processing method provided in the embodiment of the present application may also include the following steps:
[0092] Step S31: Obtain first encrypted block data from a data storage node.
[0093] In some feasible implementations, when a blockchain node needs to recover block data of a block in the blockchain, it can directly obtain the block data of the block from the data storage node (hereinafter referred to as the first block data for the convenience of description), that is, the data storage node directly sends the first encrypted block data to the blockchain node.
[0094] In some feasible implementations, when the first object needs to restore the first block data in the blockchain, the blockchain node may receive the first data recovery request initiated by the first object, and determine whether the first object has data archiving authority based on the first data recovery request. Further, when the blockchain node determines that the first object has data archiving authority, it obtains the first block data from the blockchain, and encrypts the first block data based on the threshold public key to obtain the first encrypted block data.
[0095] In some feasible implementations, when the first object needs to recover the first block data in the blockchain, the blockchain node can receive the third signature information sent by the first object.
[0096] The third signature information is obtained after the first object signs the first data recovery request based on the first private key of the first object.
[0097] The first data recovery request is initiated by the first object and is used to request recovery of the first block data.
[0098] Further, the blockchain node may decrypt the third signature information based on the first public key of the first object to obtain the first data recovery request. When the blockchain node successfully decrypts the third signature information to obtain the first data recovery request, it may be determined that the third signature information passes the signature verification.
[0099] Based on this, the blockchain node can determine whether the first object has data recovery authority based on the first data recovery request, and obtain the first encrypted block data from the data storage node if the first object has data recovery authority.
[0100] In some feasible implementations, when the first object needs to recover the first block data in the blockchain, the blockchain node can receive the third signature information sent by the first object.
[0101] The third signature information is obtained after the first object signs the first data recovery request based on the first private key of the first object.
[0102] The first data recovery request is initiated by the first object and is used to request data recovery of the first block data.
[0103] Further, the blockchain node may decrypt the third signature information based on the first public key of the first object to obtain the first data recovery request. When the blockchain node successfully decrypts the third signature information to obtain the first data recovery request, it may be determined that the third signature information passes the signature verification.
[0104] When the third signature information passes the signature verification and it is determined that the first object has data recovery authority, the blockchain node can add the first data recovery request as a pending transaction to the transaction pool, and the transaction pool will package the pending transactions including the first data recovery request and execute them out of blocks.
[0105] During the block generation process, the verification node in the blockchain can perform signature verification on the first data recovery request, that is, confirm whether the first data recovery request can be generated and executed. For any verification node, if the node signs the first data recovery request based on the node's private key, the node confirms that the first data recovery request can be generated and executed, that is, confirms the validity of the first object request for data archiving.
[0106] Based on this, if signature information of at least a preset number of verification nodes for the first data recovery request is received, and the corresponding signature information is successfully decrypted based on the public key of each verification node, the first data recovery request is confirmed as a valid transaction, that is, the first data recovery request is confirmed as a valid request. At this time, while the first data recovery request is blocked as a transaction to be executed, the blockchain node can obtain the first encrypted block data from the data storage node.
[0107] In some feasible implementations, when a blockchain node needs to recover the first block data in the blockchain, the blockchain node may determine a second data recovery request, and add the second data recovery request as a pending transaction to the transaction pool, and the transaction pool may package the pending transactions including the second data recovery request and execute them out of the block.
[0108] During the block generation process, the verification node in the blockchain can perform signature verification on the second data recovery request, that is, confirm whether the second data recovery request can be generated and executed. For any verification node, if the node signs the second data recovery request based on the node's private key, the node confirms that the second data recovery request can be generated and executed, that is, confirms the validity of the blockchain node's request for data archiving.
[0109] Based on this, if signature information of at least a preset number of verification nodes for the second data recovery request is received, and the corresponding signature information is successfully decrypted based on the public key of each verification node, the second data recovery request is confirmed as a valid transaction, that is, the second data recovery request is confirmed as a valid request. At this time, while the second data recovery request is blocked as a transaction to be executed, the blockchain node can obtain the first encrypted block data from the data storage node.
[0110] It should be noted that the aforementioned second data recovery request can be initiated by the blockchain node based on the first data recovery request (such as the first data recovery request and the second data recovery request are the same request), or it can be initiated directly by the block node, and there is no restriction here.
[0111] In some feasible implementations, the blockchain node may sign the second data recovery request based on the second private key of the blockchain node to obtain fourth signature information.
[0112] Furthermore, the blockchain node may send the fourth signature information to the data storage node, so that the data storage node decrypts the fourth signature information based on the second public key of the blockchain node to obtain a second data recovery request.
[0113] In which, when the data storage node successfully decrypts the fourth signature information to obtain the second data recovery request, it can be determined that the fourth signature information passes the signature verification.
[0114] When the fourth signature information passes the signature verification, the data storage node may determine whether the blockchain node has data recovery authority based on the second data recovery request, and when the blockchain node has data recovery authority, the data storage node may send the first encrypted block data to the blockchain node.
[0115] In the embodiment of the present application, for the third signature information, the third signature information may also be obtained by encrypting the third summary information based on the second public key of the blockchain node after the first object performs a hash calculation on the first data recovery request. When receiving the third signature information, the blockchain node also receives the first data recovery request initiated by the first object.
[0116] Based on this, when the blockchain node verifies the third signature information, it can decrypt the third signature information based on the second private key of the blockchain node to obtain the decrypted summary information, and at the same time perform hash calculation on the first data recovery request to obtain the third summary information, thereby comparing the decrypted summary information and the third summary information. If the two are consistent, it means that the first data recovery request has not been tampered with, that is, the first data recovery request is a valid request.
[0117] Similarly, for the fourth signature information, the fourth signature information can also be obtained by encrypting the fourth summary information based on the third public key of the data storage node after the blockchain node performs hash calculation on the second data recovery request. When the data storage node receives the fourth signature information, it also receives the second data recovery request initiated by the first object.
[0118] Based on this, when the data storage node verifies the signature of the fourth signature information, it can decrypt the fourth signature information based on the third private key of the data storage node to obtain the decrypted summary information, and at the same time perform a hash calculation on the second data recovery request to obtain the fourth summary information, thereby comparing the decrypted summary information and the fourth summary information. If the two are consistent, it means that the second data recovery request has not been tampered with, that is, the second data recovery request is a valid request.
[0119] In an embodiment of the present application, when the blockchain node recovers the first block data based on the second data recovery request, it can also pre-determine whether the data storage node stores the first encrypted block data corresponding to the first block data.
[0120] Specifically, after the data storage node successfully stores the first encrypted block data, the blockchain node may store the data indication information of the first block data. After receiving the first data recovery request, it may determine whether the data storage node stores the first encrypted block data of the first block data requested to be recovered by the first data recovery request based on the data indication information.
[0121] Among them, the data indication information of the first block data includes but is not limited to the transaction identifier of all transaction data in the first block data, the transaction hash, the block hash corresponding to the first block data, and the block height corresponding to the first block data, etc., which can be determined based on the actual application scenario requirements and are not limited here.
[0122] It should be particularly noted that the first block data in the embodiment of the present application may be block data of at least one block in the blockchain, and its corresponding block height is the block height interval of all blocks corresponding to the first block data.
[0123] As an example, when the first data recovery request includes the transaction hash of all transaction data in the first block data, the blockchain node can determine whether the data storage node stores the transaction data corresponding to the transaction hash. If it is determined that the transaction data corresponding to the transaction hash is stored, it is determined that the data storage node stores the first encrypted block data corresponding to the first block data.
[0124] As an example, when the first data recovery request includes a block hash corresponding to the first block data, the blockchain node may determine whether the data storage node stores the block data corresponding to the block hash. If it is determined that the block data corresponding to the block hash is stored, it is determined that the data storage node stores the first encrypted block data corresponding to the first block data.
[0125] As an example, when the first data recovery request includes a block height corresponding to the first block data, the blockchain node may determine whether the data storage node stores encrypted block data associated with the block height.
[0126] In an embodiment of the present application, before sending the first encrypted block data to the blockchain node, the data storage node may also pre-determine whether the data storage node stores the first encrypted block data corresponding to the first block data.
[0127] Specifically, after successfully storing the first encrypted block data, the data storage node may store the data indication information of the first block data. After receiving the second data recovery request, it may determine whether the data storage node stores the first encrypted block data of the first block data requested to be recovered by the second data recovery request based on the data indication information.
[0128] Among them, the data indication information of the first block data includes but is not limited to the transaction identifier of all transaction data in the first block data, the transaction hash, the block hash corresponding to the first block data, and the block height corresponding to the first block data, etc., which can be determined based on the actual application scenario requirements and are not limited here.
[0129] It should be particularly noted that the first block data in the embodiment of the present application may be block data of at least one block in the blockchain, and its corresponding block height is the block height interval of all blocks corresponding to the first block data.
[0130] As an example, when the second data recovery request includes the transaction hash of all transaction data in the first block data, the data storage node may determine whether the transaction data corresponding to the transaction hash is stored. If it is determined that the transaction data corresponding to the transaction hash is stored, it is determined that the first encrypted block data corresponding to the first block data is stored.
[0131] As an example, when the second data recovery request includes a block hash corresponding to the first block data, the data storage node may determine whether the block data corresponding to the block hash is stored. If it is determined that the block data corresponding to the block hash is stored, it is determined that the first encrypted block data corresponding to the first block data is stored.
[0132] As an example, when the second data recovery request includes the block height corresponding to the first block data, the data storage node may determine whether encrypted block data associated with the block height is stored.
[0133] Based on this, after determining that the first encrypted block data is stored, the data storage node provides the first encrypted block data to the blockchain node.
[0134] Among them, the process in which the blockchain node or the data storage node determines whether to store the first encrypted block data based on the transaction hash and the block hash can be implemented based on the Bloom filter.
[0135] S32: decrypting the first encrypted block data based on the threshold private key of the blockchain node to obtain the first block data, and restoring the first block data in the blockchain.
[0136] In an embodiment of the present application, after obtaining the first encrypted block data, the blockchain node can decrypt the first encrypted block data based on the threshold private key of the blockchain node to obtain the first block data, thereby restoring the first block data to the blockchain.
[0137] Optionally, if the first encrypted block data obtained by the blockchain node is compressed data, the first encrypted block data needs to be decompressed, and then the decompressed block data is decrypted based on the threshold private key to obtain the first block data.
[0138] In the embodiment of the present application, the encryption and decryption process of the first block data is implemented based on threshold encryption technology. Threshold encryption technology is often embodied as a type of distributed encryption and decryption protocol, which can achieve the following functions: any node can use the threshold public key to encrypt data. The ownership of the private key is jointly controlled by multiple designated holders, and each holder has a different threshold private key. Only when the holders who meet the number of shards decrypt the encrypted data based on their respective threshold private keys, and then aggregate the decrypted shards to achieve final decryption.
[0139] Among them, the number of shards in the embodiment of the present application is 1, that is, any blockchain node with a threshold private key can independently complete the decryption of the encrypted block data.
[0140] In the embodiment of the present application, the threshold public key and the threshold private key can be generated during the blockchain creation process. Figure 4 , Figure 4 Schematic diagram of the key generation process provided by the embodiment of the present application. Figure 4 As shown, when creating a blockchain, the threshold public key can be initialized first, and the threshold private key can be created for some blockchain nodes. The blockchain nodes can maintain their own threshold private keys, write the threshold public key into the blockchain creation configuration, and write the threshold public key into the database when creating the blockchain according to the creation configuration. Based on this, when the genesis block is created according to the creation configuration, the genesis block can store the threshold public key. Furthermore, if the genesis block passes the consensus verification, such as block consistency verification, legality verification, etc., it can be determined that the blockchain is created successfully, otherwise the blockchain creation fails.
[0141] For blockchain nodes in the blockchain, the blockchain nodes save their own threshold private keys and can obtain threshold public keys through the database or the genesis block.
[0142] Combine the following Figure 5 The data archiving method provided in the embodiment of the present application is further explained. Figure 5 Schematic diagram of the process framework of the data archiving method provided in the embodiment of the present application. Figure 5 As shown, when the first object needs to archive the first block data in the blockchain, the first object can initiate a first data archiving request to the blockchain node, and sign the first data archiving request based on the first private key of the first object to obtain first signature information.
[0143] After receiving the first signature information sent by the first object, the blockchain node may perform signature verification on the first signature information, that is, decrypt the first signature information based on the first public key of the first object, and if the first data archiving request is obtained through decryption, it is determined that the first signature information passes the signature verification, otherwise, relevant error information is returned to the first object.
[0144] After the first signature information passes the signature verification of the blockchain node, the blockchain node can determine whether the first object has the data archiving authority, and if the first object has the data archiving authority, obtain the first block data from the blockchain. If the first object does not have the data archiving authority, relevant error information can be returned to the first object.
[0145] When the first signature information passes the signature verification and it is determined that the first object has the data archiving permission, the blockchain node may add the first data archiving request as a pending transaction to the transaction pool, and the transaction pool may package the pending transactions including the first data archiving request.
[0146] Before the packaged transaction is generated, the verification node in the blockchain can perform signature verification on the first data archiving request, that is, confirm whether the first data archiving request can be generated and executed. For any verification node, if the node signs the first data archiving request based on the private key of the node, the node confirms that the first data archiving request can be generated and executed, that is, confirms the validity of the first object request for data archiving.
[0147] Based on this, if signature information of at least a preset number of verification nodes for the first data archiving request is received, and the corresponding signature information is successfully decrypted based on the public key of each verification node, the first data archiving request is confirmed as a valid transaction, that is, the first data archiving request is confirmed as a valid request. At this time, the first data archiving request can be blocked as a transaction to be executed, and a mapping relationship between the transaction hash of all transaction data in the first block data, the block hash of the block corresponding to the first block data and the corresponding block is established.
[0148] The blockchain node may further encrypt the first block data based on the threshold public key to obtain first encrypted block data, and determine a second data archiving request, which may include the above-mentioned mapping relationship and the first encrypted block.
[0149] The blockchain node can encrypt the second data archiving request based on the second private key of the blockchain node to obtain second signature information, and send the second signature information to the data storage node.
[0150] The data storage node performs signature verification on the second signature information, that is, decrypts the second signature information based on the second public key of the blockchain data storage node, and if a second data archiving request is obtained, it is determined that the second signature information passes the signature verification. If the second signature information fails the signature verification, relevant error information is returned to the blockchain node.
[0151] After the second signature information passes the signature verification, the data storage node can directly obtain the first encrypted block data from the blockchain node, or obtain the first encrypted block data from the second data archiving request, and store the first encrypted block data to write it into the relevant file system. In order to reduce the amount of data storage, the data storage node can compress the first encrypted block data after storing it.
[0152] After successfully storing the first encrypted block data, the data storage node may send a successful storage indication message to the data storage node, so that the blockchain node may delete the first block data from the blockchain. If the data storage node fails to successfully store the first encrypted block data, it returns relevant error information to the blockchain node.
[0153] Among them, before the first encrypted block data is successfully stored, the blockchain node may mark the second data archiving request and the first data archiving request as unfinished status, and after the first encrypted block data is successfully stored, the blockchain node marks the second data archiving request and the first data archiving request as completed status.
[0154] Among them, after the first encrypted block data is successfully stored, the blockchain node can update the corresponding archiving height, and the archiving height is used to indicate the block height of the block corresponding to the block data that has been archived and stored in the blockchain network.
[0155] Combine the following Figure 6 The data recovery method provided in the embodiment of the present application is further explained. Figure 6 Schematic diagram of the process framework of the data recovery method provided in the embodiment of the present application. Figure 6 As shown, when the first object needs to recover the first block data in the blockchain, the first object can determine the first data recovery request and encrypt the first data recovery request based on the first private key of the first object to obtain the third signature information.
[0156] The blockchain node may receive the third signature information sent by the first object, and perform signature verification on the third signature information. That is, the blockchain node decrypts the third signature information based on the first public key of the first object to obtain the first data recovery request. If the blockchain node successfully decrypts the third signature information to obtain the first data recovery request, it may determine that the third signature information passes the signature verification; otherwise, it may determine that the third signature information fails the signature verification, and return relevant error information to the first object.
[0157] Furthermore, if the third signature information passes the signature verification, the blockchain node can determine whether the first object has data recovery authority based on the first data recovery request. If the first object does not have data recovery authority, relevant error information is returned to the first counterpart, and if the first object has data recovery authority, a second data recovery request (such as obtained by repackaging the first data recovery request) is determined.
[0158] Furthermore, the blockchain node encrypts the second data recovery request based on the second private key of the blockchain node to obtain fourth signature information, and sends the fourth signature information to the data storage node.
[0159] Among them, after the blockchain node successfully stores the first encrypted block data, if it updates the corresponding filing height, that is, stores the block height of the block corresponding to the archived stored block data, the blockchain node can preliminarily determine whether the data storage node stores the encrypted block data of the block height of the block corresponding to the first block data based on the filing height before sending the fourth signature information. In the case of determining that the encrypted block data of the block height of the block corresponding to the first block data is stored, the fourth signature information is sent to the data storage node.
[0160] The data storage node can perform signature verification on the fourth signature information, that is, decrypt the fourth signature information through the second public key of the blockchain node. If the second data archiving request obtained by decryption, it is determined that the fourth signature information passes the signature verification; otherwise, it is determined that the fourth signature information does not pass the signature verification, and returns relevant error information to the blockchain node.
[0161] When the fourth signature information passes the signature verification, the data storage node can determine whether the blockchain node has data recovery authority. If the blockchain node does not have data recovery authority, it returns relevant error information to the blockchain node. If the blockchain node has data recovery authority, it can query whether the first encrypted block data corresponding to the first block data requested to be recovered by the first object is stored.
[0162] When the second data recovery request includes the transaction hash of all transaction data in the first block data, the data storage node can determine whether the transaction data corresponding to the transaction hash is stored based on the corresponding mapping relationship. If it is determined that the transaction data corresponding to the transaction hash is stored, it is determined that the first encrypted block data corresponding to the first block data is stored.
[0163] When the second data recovery request includes a block hash corresponding to the first block data, the data storage node can determine whether the block data corresponding to the block hash is stored based on the corresponding mapping relationship. If it is determined that the block data corresponding to the block hash is stored, it is determined that the first encrypted block data corresponding to the first block data is stored.
[0164] When the second data recovery request includes the block height corresponding to the first block data, the data storage node may determine whether encrypted block data associated with the block height is stored based on the corresponding mapping relationship.
[0165] Furthermore, if the data storage node compresses the first encrypted block data, the data storage node may decompress the compressed first encrypted block data to obtain the first encrypted block data, and send the first encrypted block data to the blockchain node. Alternatively, the data storage node may send the compressed first encrypted block data to the blockchain node, and the blockchain node decompresses it to obtain the first encrypted block data.
[0166] Furthermore, after obtaining the first encrypted block data, the blockchain node can decrypt the first encrypted block data based on the threshold private key of the blockchain node to obtain the first block data, and then verify the integrity of the first block data.
[0167] After the first block data passes the integrity check, the first block data can be restored from the blockchain.
[0168] In the embodiment of the present application, in addition to completing the archiving storage and recovery process of block data, the blockchain node can also complete the query process of the first object for the target block data. Figure 7 The data query method provided in the embodiment of the present application is further explained.
[0169] Figure 7 Schematic diagram of the process framework of the data query method provided in the embodiment of the present application. Figure 7 As shown, when the first object needs to query the target block data, it can directly send a first data query request for querying the target block data to the blockchain node, or it can encrypt the first data query request based on the first private key to obtain corresponding signature information. The blockchain node determines that the signature information passes the signature verification and the first object has data query authority, and then obtains the first data query request.
[0170] After receiving the first data query request, the blockchain node can determine whether the target block data queried by the first data query request exists, such as determining whether the blockchain has stored the target block data, or determining whether the latest block height is not lower than the block height of the block corresponding to the target block data.
[0171] When the blockchain node determines that the target block data does not exist, it can return corresponding error information to the first object. When it is determined that the target block data exists, it can further determine whether the data storage node stores the target block data. For example, the blockchain node can determine whether the data storage node stores the target block data based on the archiving height.
[0172] When it is determined that the data storage node does not store the target block data, it is determined that the blockchain stores the target block data. At this time, the blockchain node can obtain the target block data from the blockchain and return it to the first object.
[0173] When it is determined that the data storage node stores the target block data, the blockchain node can determine the second data query request and encrypt the second data query request based on the second private key of the blockchain node to obtain the fifth signature information.
[0174] The data storage node can perform signature verification on the fifth signature information, that is, decrypt the fifth signature information through the second public key of the blockchain node. If the second data query request obtained by decryption is passed, it is determined that the fifth signature information passes the signature verification; otherwise, it is determined that the fifth signature information does not pass the signature verification, and relevant error information is returned to the blockchain node.
[0175] When the fifth signature information passes the signature verification, the data storage node can determine whether the blockchain node has data query authority. If the blockchain node does not have data query authority, it returns relevant error information to the blockchain node. If the blockchain node has data query authority, it can query whether the encrypted block data corresponding to the target block data requested to be restored by the first object is stored.
[0176] The data storage node can determine whether the encrypted block data corresponding to the target block data is stored according to the mapping relationship between the transaction hash of all transaction data in the target block data, the corresponding block hash and the block height. The transaction hash or block hash can also be processed through a Bloom filter to determine whether the encrypted block data corresponding to the target block data is stored.
[0177] After determining that the target block data is not stored (that is, the corresponding encrypted block data is not stored), the corresponding error information can be returned to the blockchain node. If it is determined that the target block data is stored, the corresponding encrypted block data can be returned to the blockchain node.
[0178] Furthermore, if the data storage node compresses the encrypted block data, the data storage node may decompress the compressed encrypted block data to obtain the target encrypted block data, and send the encrypted block data to the blockchain node. Alternatively, the data storage node may send the compressed encrypted block data to the blockchain node, and the blockchain node decompresses it to obtain the target encrypted block data.
[0179] Furthermore, after obtaining the encrypted block data, the blockchain node can decrypt the encrypted block data based on the threshold private key of the blockchain node to obtain the target block data, and then verify the integrity of the target block data.
[0180] After the target block data passes the integrity check, the target block data can be stored in the node cache of the blockchain for easy query and use by the first object.
[0181] Combine the following Figure 8 The structure of a blockchain node is described. Figure 8 It is a schematic diagram of the structure of the blockchain node provided in the embodiment of the present application.
[0182] Figure 8 The blockchain nodes shown are nodes for data archiving, querying, and recovery in the blockchain.
[0183] The blockchain node includes a network module for communicating with other blockchain nodes (such as verification nodes), the first object, and data storage nodes, etc.
[0184] The blockchain node includes an authentication module for authority verification and storing node certificates.
[0185] Among them, the authentication module includes a node certificate submodule, which is used to store the certificates of each node of the blockchain; the authentication module also includes an authentication algorithm submodule, which is used to verify the legitimacy of the node certificate and the verification algorithm for running related permissions.
[0186] The blockchain node includes an API interface module, which is used to provide an interface to the first object, the blockchain, and the data storage node for calling.
[0187] Among them, the API interface module includes a block archiving submodule, which is used to transfer the block data stored in the blockchain node to the data storage node; the API interface module also includes a block recovery submodule, which is used to restore the block data stored in the data storage node to the blockchain node; the API interface module also includes a block deletion submodule, which is used to delete the block data in the blockchain maintained by the blockchain node.
[0188] The blockchain node includes a privacy protection module for protecting data privacy when interacting with the data storage node.
[0189] Among them, the privacy protection module includes a threshold public key sub-module for encrypting block data; the privacy protection module also includes a threshold private key sub-module for decrypting encrypted block data; the privacy protection module also includes a block data encryption sub-module for encrypting block data using the threshold public key; the privacy protection module also includes a block data decryption sub-module for decrypting encrypted block data using the threshold private key.
[0190] Combine the following Fig. 9 The structure of the data storage node is described. Fig. 9 It is a structural diagram of a data storage node provided in an embodiment of the present application.
[0191] Fig. 9 The data storage node shown is used to archive block data, achieve data privacy through threshold encryption, and ensure efficient data archiving services through a series of storage measures.
[0192] The data storage node includes a network module for communicating with the blockchain node.
[0193] The data storage node includes an authentication module, which is used to perform permission verification and save certificates, etc.
[0194] Among them, the authentication module includes a blockchain certificate sub-module, which is used to store the certificates of each node in the blockchain; the authentication module includes an authentication algorithm sub-module, which is used to verify the legitimacy of the certificate and the relevant algorithms for running authority verification.
[0195] The data storage node includes an API interface module, which is used to provide an interface for the first object and the block link node to call.
[0196] Among them, the API interface module includes a block query submodule for querying and returning encrypted block data; the API interface module also includes a block storage submodule for storing encrypted block data.
[0197] The data storage node includes a storage module module, which is used to store all block data.
[0198] Among them, the storage module also includes a Bloom filter, which is used to check whether the block data to be queried does not exist; the storage module also includes a block data storage index submodule, which is used to store the mapping relationship between block height and transaction hash, block hash and other information; the storage module also includes a compressed data storage submodule, which is used to store all compressed encrypted block data; the storage module also includes a file writing submodule, which is used to write files to various directories.
[0199] In the embodiment of the present application, the blockchain node can encrypt the block data sampling threshold public key to be archived and store it in the data storage node. Since the encrypted encrypted block data needs to be decrypted by the blockchain node's own threshold private key to obtain the plaintext data, the data storage security of the data storage node can be improved. And after the blockchain node stores the block data in the data storage node, it can delete the corresponding block data from the blockchain, thereby saving the storage space of the blockchain node itself, and the applicability is high.
[0200] In addition, blockchain nodes can also implement operations such as block data recovery and query of corresponding objects, thereby achieving flexible processing of block data in the blockchain and block data in data storage nodes.
[0201] See also Fig.10 , Fig.10 1 is a schematic diagram of a block data processing device provided in an embodiment of the present application. The block data processing device provided in an embodiment of the present application includes:
[0202] The data encryption module 101 is used to obtain the first block data to be archived from the blockchain, and encrypt the first block data based on the threshold public key to obtain the first encrypted block data;
[0203] The first transceiver module 102 is used to send the first encrypted block data to the data storage node, so that the data storage node archives and stores the first encrypted block data;
[0204] The data processing module 103 is used to delete the first block data from the blockchain in response to the first encrypted block data being successfully stored.
[0205] In some feasible implementations, the data encryption module 101 is used to:
[0206] Obtaining first signature information, where the first signature information is obtained by the first object signing a first data archiving request based on the first private key of the first object, where the first data archiving request is initiated by the first object and is used to request archiving and storing the first block data in the blockchain;
[0207] In response to decrypting the first signature information based on the first public key of the first object to obtain the first data archiving request, and determining that the first object has data archiving authority, the first block data is obtained from the blockchain based on the first data archiving request.
[0208] In some feasible implementations, the first transceiver module 102 is configured to:
[0209] Determine a second data archiving request, where the second data archiving request is used to request archiving and storing the first block data;
[0210] Signing the second data archiving request based on the second private key of the blockchain node to obtain second signature information;
[0211] The second signature information is sent to the data storage node, so that the data storage node decrypts the second signature information based on the second public key of the blockchain node to obtain the second data archiving request, and when it is determined that the blockchain node has the data archiving authority, the first encrypted block data is sent to the data storage node, so that the data storage node archives and stores the first encrypted block data.
[0212] In some feasible implementations, the data processing module 103 is used to:
[0213] Acquire the first encrypted block data from the data storage node;
[0214] The first encrypted block data is decrypted based on the threshold private key of the blockchain node to obtain the first block data, and the first block data is restored in the blockchain.
[0215] In some feasible implementations, the data processing module 103 is used to:
[0216] Obtaining third signature information, where the third signature information is obtained by the first object signing a first data recovery request based on the first private key of the first object, where the first data recovery request is initiated by the first object and is used to request recovery of the first block data;
[0217] In response to decrypting the third signature information based on the first public key of the first object to obtain a first data recovery request and determining that the first object has data recovery authority, the first encrypted block data is obtained from the data storage node based on the first data recovery request.
[0218] In some feasible implementations, the data processing module 103 is used to:
[0219] Determine a second data recovery request based on the first data recovery request, where the second data recovery request is used to request recovery of the first block data;
[0220] Signing the second data recovery request based on the second private key of the blockchain node to obtain fourth signature information;
[0221] Sending the fourth signature information to the data storage node;
[0222] In response to the data storage node decrypting the fourth signature information based on the second public key of the blockchain node to obtain the second data recovery request, and determining that the blockchain node has data recovery authority, the first encrypted block data is obtained from the data storage node.
[0223] In a specific implementation, the block data processing device can execute the above-mentioned Figure 2 and / or Figure 3 The implementation methods provided by the various steps executed by the blockchain node can be specifically referred to the implementation methods provided by the above steps, which will not be repeated here.
[0224] See also Fig.11 , Fig.11 1 is another structural diagram of a block data processing device provided in an embodiment of the present application. The block data processing device provided in an embodiment of the present application includes:
[0225] The data storage module 111 is used to obtain the first encrypted block data and archive and store the first encrypted block data, wherein the first encrypted block data is obtained by encrypting the first block data in the blockchain by the blockchain node based on the threshold public key;
[0226] The second transceiver module 112 is used for sending first indication information indicating successful storage of the first encrypted block data to the blockchain node in response to successful storage of the first encrypted block data, so that the blockchain node deletes the first block data from the blockchain.
[0227] In some feasible implementations, the data storage module 111 is used to:
[0228] Obtaining second signature information, where the second signature information is obtained by the blockchain node signing a second data archiving request based on the second private key of the blockchain node, and the second data archiving request is initiated by the blockchain node and is used to request archiving and storing the first block data;
[0229] In response to decrypting the second signature information based on the second public key of the blockchain node to obtain the second data archiving request and determining that the blockchain node has data archiving authority, the first encrypted block data is obtained and the first encrypted block data is archived and stored.
[0230] In some feasible implementations, the second transceiver module 112 is used to:
[0231] The first encrypted block data is sent to the blockchain node, so that the blockchain node decrypts the first encrypted block data based on the threshold private key of the blockchain node to obtain the first block data, and restores the first block data in the blockchain.
[0232] In some feasible implementations, the second transceiver module 112 is used to:
[0233] Obtain fourth signature information, where the fourth signature information is obtained by the blockchain node signing the second data recovery request based on the second private key of the blockchain node, and the second data recovery request is initiated by the blockchain node;
[0234] In response to decrypting the fourth signature information based on the second public key of the blockchain node to obtain the second data recovery request and determining that the blockchain node has data recovery authority, determining whether the first encrypted block data is stored based on the second data recovery request;
[0235] In response to storing the first encrypted block data, the first encrypted block data is sent to the blockchain node.
[0236] In some feasible implementations, the second transceiver module 112 is used to:
[0237] In response to the second data recovery request including a transaction hash of all transaction data in the first block data, determining whether the first encrypted block data is stored based on the transaction hash;
[0238] In response to the second data recovery request including a block hash corresponding to the first block data, determining whether the first encrypted block data is stored based on the block hash;
[0239] In response to the second data recovery request including the block height corresponding to the first block data, determining whether the first encrypted block data is stored based on the block height.
[0240] In a specific implementation, the block data processing device can execute the above-mentioned Figure 2 and / or Figure 3 For the implementation methods provided by the various steps executed by the data storage node, please refer to the implementation methods provided by the above steps for details, which will not be repeated here.
[0241] See also Fig.12 , Fig.12 Schematic diagram of the structure of the electronic device provided in the embodiment of the present application. Fig.12As shown, the electronic device 1200 in this embodiment may include: a processor 1201, a network interface 1204 and a memory 1205. In addition, the above-mentioned electronic device 1200 may also include: an object interface 1203, and at least one communication bus 1202. Among them, the communication bus 1202 is used to realize the connection and communication between these components. Among them, the object interface 1203 may include a display screen (Display), a keyboard (Keyboard), and the object interface 1203 may optionally include a standard wired interface and a wireless interface. The network interface 1204 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1205 may be a high-speed RAM memory, or it may be a non-volatile memory (NVM), such as at least one disk storage. The memory 1205 may optionally also be at least one storage device located away from the aforementioned processor 1201. As Fig.12 As shown, the memory 1205 as a computer-readable storage medium may include an operating system, a network communication module, an object interface module, and a device control application program.
[0242] exist Fig.12 In the electronic device 1200 shown, the network interface 1204 can provide a network communication function; the object interface 1203 is mainly used to provide an input interface for the object; and the processor 1201 can be used to call the device control application stored in the memory 1205 to implement Figure 2 and / or Figure 3 The steps performed by the blockchain nodes and data storage nodes.
[0243] It should be understood that in some feasible implementations, the processor 1201 may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the type of device.
[0244] In a specific implementation, the electronic device 1200 can execute the above-mentioned functions through its built-in functional modules. Figure 2 and / or Figure 3 For the implementation methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.
[0245] The present application also provides a computer-readable storage medium, which stores a computer program and is executed by a processor to implement Figure 2 and / or Figure 3 For the methods provided in each step, please refer to the implementation methods provided in the above steps for details, which will not be repeated here.
[0246] The computer-readable storage medium may be an internal storage unit of the block data processing device or electronic device provided in any of the aforementioned embodiments, such as a hard disk or memory of an electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. The computer-readable storage medium may also include a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. Further, the computer-readable storage medium may also include both an internal storage unit of the electronic device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
[0247] An embodiment of the present application provides a computer program product, which includes a computer program. The computer program is executed by a processor to provide a method provided by each step in AA.
[0248] The terms "first", "second", etc. in the claims, specification and drawings of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or electronic device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or electronic devices. Mentioning "embodiment" in this article means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. Displaying the phrase at various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. The term "and / or" used in the present application specification and the attached claims refers to any combination of one or more of the items listed in association and all possible combinations, and includes these combinations.
[0249] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0250] The above disclosure is only the preferred embodiment of the present application, which cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A block data processing method, characterized in that: Applied to a blockchain node, the method comprises: Acquire first block data to be archived from the blockchain, and encrypt the first block data based on a threshold public key to obtain first encrypted block data; Sending the first encrypted block data to a data storage node so that the data storage node archives and stores the first encrypted block data; In response to the first encrypted block data being successfully stored, deleting the first block data from the blockchain.
2. The method according to claim 1, characterized in that The obtaining the first block data to be archived from the blockchain includes: Obtaining first signature information, where the first signature information is obtained by a first object signing a first data archiving request based on a first private key of the first object, where the first data archiving request is initiated by the first object and is used to request archiving and storing first block data in the blockchain; In response to decrypting the first signature information based on the first public key of the first object to obtain the first data archiving request, and determining that the first object has data archiving authority, the first block data is obtained from the blockchain based on the first data archiving request.
3. The method according to claim 1, characterized in that The sending the first encrypted block data to a data storage node so that the data storage node archives and stores the first encrypted block data includes: Determine a second data archiving request, where the second data archiving request is used to request archiving and storing the first block data; Signing the second data archiving request based on the second private key of the blockchain node to obtain second signature information; The second signature information is sent to the data storage node, so that the data storage node decrypts the second signature information based on the second public key of the blockchain node to obtain the second data archiving request, and when it is determined that the blockchain node has data archiving authority, the first encrypted block data is sent to the data storage node, so that the data storage node archives and stores the first encrypted block data.
4. The method according to claim 1, characterized in that The method further comprises: Acquire the first encrypted block data from the data storage node; The first encrypted block data is decrypted based on the threshold private key of the blockchain node to obtain the first block data, and the first block data is restored in the blockchain.
5. The method according to claim 4, characterized in that The acquiring the first encrypted block data from the data storage node comprises: Obtaining third signature information, where the third signature information is obtained after the first object signs a first data recovery request based on the first private key of the first object, where the first data recovery request is initiated by the first object and is used to request recovery of the first block data; In response to decrypting the third signature information based on the first public key of the first object to obtain a first data recovery request and determining that the first object has data recovery authority, the first encrypted block data is obtained from the data storage node based on the first data recovery request.
6. The method according to claim 5, characterized in that The acquiring the first encrypted block data from the data storage node based on the first data recovery request includes: Determine a second data recovery request based on the first data recovery request, where the second data recovery request is used to request recovery of the first block data; Signing the second data recovery request based on the second private key of the blockchain node to obtain fourth signature information; Sending the fourth signature information to the data storage node; In response to the data storage node decrypting the fourth signature information based on the second public key of the blockchain node to obtain the second data recovery request, and determining that the blockchain node has data recovery authority, the first encrypted block data is obtained from the data storage node.
7. A block data processing method, characterized in that: Applied to a data storage node, the method comprises: Obtaining first encrypted block data, and archiving and storing the first encrypted block data, wherein the first encrypted block data is obtained by encrypting the first block data in the blockchain by the blockchain node based on the threshold public key; In response to the first encrypted block data being successfully stored, first indication information for indicating that the first encrypted block data is successfully stored is sent to the blockchain node, so that the blockchain node deletes the first block data from the blockchain.
8. The method according to claim 7, characterized in that The obtaining of the first encrypted block data and archiving and storing the first encrypted block data comprises: Obtaining second signature information, where the second signature information is obtained by the blockchain node signing a second data archiving request based on a second private key of the blockchain node, where the second data archiving request is initiated by the blockchain node and is used to request archiving and storing the first block data; In response to decrypting the second signature information based on the second public key of the blockchain node to obtain the second data archiving request, and determining that the blockchain node has data archiving authority, obtaining the first encrypted block data, and archiving and storing the first encrypted block data.
9. The method according to claim 7, characterized in that: The method further comprises: The first encrypted block data is sent to the blockchain node, so that the blockchain node decrypts the first encrypted block data based on the threshold private key of the blockchain node to obtain the first block data, and restores the first block data in the blockchain.
10. The method according to claim 9, characterized in that The sending the first encrypted block data to the blockchain node includes: Obtain fourth signature information, where the fourth signature information is obtained by the blockchain node signing a second data recovery request based on a second private key of the blockchain node, where the second data recovery request is initiated by the blockchain node; In response to decrypting the fourth signature information based on the second public key of the blockchain node to obtain the second data recovery request and determining that the blockchain node has data recovery authority, determining whether the first encrypted block data is stored based on the second data recovery request; In response to storing the first encrypted block data, sending the first encrypted block data to the blockchain node.
11. The method according to claim 10, characterized in that Determining whether the first encrypted block data is stored based on the second data recovery request includes at least one of the following: In response to the second data recovery request including a transaction hash of all transaction data in the first block data, determining whether the first encrypted block data is stored based on the transaction hash; In response to the second data recovery request including a block hash corresponding to the first block data, determining whether the first encrypted block data is stored based on the block hash; In response to the second data recovery request including the block height corresponding to the first block data, determining whether the first encrypted block data is stored based on the block height.
12. A block data processing device, characterized in that: The device comprises: A data encryption module, used to obtain first block data to be archived from the blockchain, and encrypt the first block data based on a threshold public key to obtain first encrypted block data; A first transceiver module, used for sending the first encrypted block data to a data storage node, so that the data storage node archives and stores the first encrypted block data; The data processing module is configured to delete the first block data from the blockchain in response to the first encrypted block data being successfully stored.
13. A block data processing device, characterized in that: The device comprises: A data storage module, used to obtain first encrypted block data and archive and store the first encrypted block data, wherein the first encrypted block data is obtained by encrypting the first block data in the blockchain by the blockchain node based on the threshold public key; The second transceiver module is used to send first indication information indicating that the first encrypted block data is successfully stored to the blockchain node in response to the first encrypted block data being successfully stored, so that the blockchain node deletes the first block data from the blockchain.
14. An electronic device, characterized in that: comprising a processor and a memory, wherein the processor and the memory are connected to each other; The memory is used to store computer programs; The processor is configured to execute the method according to any one of claims 1 to 6 or 7 to 11 when calling the computer program.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is executed by a processor to implement the method according to any one of claims 1 to 6 or 7 to 11.
