Method, device, storage medium and electronic device for blockchain
By introducing node intersection nodes into the blockchain network, sending backup requests to the second blockchain network, and using smart contract devices to process configuration information, the problem of losing consensus credibility in the backup and recovery process of blockchain network is solved. , realizes the correctness and security of ledger data.
Patent Information
- Application Number
- CN202011595394.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-29
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2040-12-29
AI Technical Summary
The blockchain network loses consensus credibility during the backup and recovery process, resulting in security issues. For example, the backup ledger data may be tampered with, which will lead to errors in the restored ledger.
By introducing nodes with node intersections into the blockchain network, a backup request is sent to the second blockchain network, and the block data is backed up to the target storage space after the backup is successful. At the same time, the configuration information backup request is sent through the smart contract device, and the configuration information backup is determined to be successful after the backup is successful.
When the blockchain network is damaged, the block header data and configuration information are obtained through the second blockchain network, thereby ensuring the correctness and security of the ledger data and reducing disputes between nodes.
Smart Images

Figure CN112596957B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of blockchain technology, and in particular, to a method, device, storage medium and electronic device for blockchain. Background Art
[0002] Blockchain is a technology that can collectively maintain a reliable database in a decentralized and trustless manner. It can store transactions that occur over a period of time in blocks, and connect the blocks in chronological order using cryptographic algorithms to form a data structure similar to a chain. Since blockchain technology has the characteristics of distributed ledger, decentralization, and non-tamperability, it has high application prospects in many aspects.
[0003] In related scenarios, the blockchain network will also face the problem of network damage. In this case, the blockchain network can be restored based on the backup file. However, the blockchain network will lose the advantage of blockchain network consensus during the backup and recovery process, which will lead to related security issues. For example, the backup ledger data may be tampered with, which will cause errors in the restored ledger. Summary of the invention
[0004] The purpose of the present disclosure is to provide a method, device, storage medium and electronic device for blockchain to solve the above-mentioned related technical problems.
[0005] In order to achieve the above-mentioned purpose, according to a first aspect of an embodiment of the present disclosure, a method for blockchain is provided, which is applied to a first node, wherein the first node is a node in a node intersection, and the node intersection is an intersection of a node in a first blockchain network and a node in a second blockchain network, and the method includes:
[0006] Sending a backup request to a second node in the second blockchain network, the backup request including block header information corresponding to the first blockchain of the first blockchain network;
[0007] In response to receiving a backup success notification message sent by the second node, determining that the block header information of the first blockchain is successfully backed up, the backup success notification message being generated by the second node after the block header information is successfully saved in the second blockchain network;
[0008] Back up the block data corresponding to the first blockchain to the target storage space.
[0009] Optionally, it also includes:
[0010] Sending a backup and recovery request to a third node in the second blockchain network, wherein the backup and recovery request includes the identity information of the first node;
[0011] Receiving block header information sent by the third node;
[0012] Restoring the first blockchain according to the block header information and the block data corresponding to the target storage space;
[0013] Broadcast the first blockchain to other nodes in the node intersection.
[0014] Optionally, before sending the backup request to the second node in the second blockchain network, the method further includes:
[0015] Initiating a transaction blocking event in the first blockchain network;
[0016] The backup record information is written into the first blockchain.
[0017] Optionally, the first node runs a smart contract device that is isolated from the first node system, and the method includes:
[0018] The first node performs the following operations through the smart contract device:
[0019] Sending a configuration information backup request to a fourth node in the second blockchain network, the configuration information backup request including an encrypted configuration information set and a hash value of the configuration information of a target node, wherein the target node includes each node in the node intersection, and the encrypted configuration information set includes encrypted configuration information obtained by encrypting the configuration information of each of the target nodes;
[0020] In response to receiving a configuration information backup success notification message sent by the fourth node, it is determined that the configuration information backup is successful. The configuration information backup success notification message is generated by the fourth node after the hash value of the encrypted configuration information set and the configuration information of each target node is successfully saved in the second blockchain network.
[0021] Optionally, the operation further includes:
[0022] Obtaining configuration information of each of the target nodes;
[0023] generating an encryption key corresponding to each of the target nodes;
[0024] Encrypting the configuration information of each target node using an encryption key corresponding to the target node to obtain encrypted configuration information of the target node;
[0025] Obfuscating each of the encryption keys to generate an obfuscated key corresponding to each of the target nodes;
[0026] Each obfuscation key is sent to a target node corresponding to the obfuscation key.
[0027] Optionally, the performing key obfuscation on each of the encryption keys to generate an obfuscated key corresponding to each of the target nodes includes:
[0028] Splitting each of the encryption keys into a target number of key segments, where the target number is the number of the target nodes;
[0029] The obfuscation key is generated by the following formula:
[0030] I={(i, 1), (i+1, 2)..., (n, n-i+1),... (ni, n-1), (n-i+1, n)}
[0031] Wherein, I is the obfuscation key of the i-th target node, the obfuscation key I includes n key segments, n is the number of the target nodes, (i, x) is the x-th key segment obtained by dividing the encryption key of the i-th target node, i∈[1,n], x∈[1,n], i and x are positive integers.
[0032] Optionally, the operation further includes:
[0033] Sending a configuration information recovery request to a fifth node in the second blockchain network;
[0034] Receive the encrypted configuration information set and the hash value of each configuration information sent by the fifth node;
[0035] Obtaining an obfuscation key for each of the target nodes, wherein the obfuscation key is generated by obfuscating an encryption key corresponding to each target node, wherein the encryption key is a key used to encrypt configuration information corresponding to the target node;
[0036] Determining an encryption key for each of the target nodes based on each of the obfuscation keys;
[0037] Decrypting the encrypted configuration information set by using each of the encryption keys to obtain configuration information of each of the target nodes;
[0038] Verifying each of the decrypted configuration information using the Hash value;
[0039] When the verification is successful, the node configuration of each of the target nodes is restored based on each of the configuration information.
[0040] According to a second aspect of an embodiment of the present disclosure, a method for blockchain is provided, which is applied to a node in a second blockchain network, and the method includes:
[0041] Receive a backup request sent by a first node, where the first node is a node in a node intersection, where the node intersection is an intersection of nodes in the first blockchain network and nodes in the second blockchain network, and the backup request includes block header information of a first blockchain corresponding to the first blockchain network;
[0042] Verifying the block header information;
[0043] When the verification is successful, the block header information is saved in the second blockchain network;
[0044] Send a backup success notification message to the first node.
[0045] Optionally, it also includes:
[0046] Receiving a backup and recovery request sent by the first node;
[0047] Verifying the identity information of the first node in the backup and recovery request;
[0048] When the verification is successful, the block header information is sent to the first node.
[0049] Optionally, it also includes:
[0050] Receive a configuration information backup request sent by the smart contract device in the first node, the configuration information backup request including an encrypted configuration information set and a hash value of the configuration information of a target node, the encrypted configuration information set including encrypted configuration information obtained by encrypting the configuration information of the target node, the target node including each node in the node intersection, and the smart contract device is system isolated from the first node;
[0051] Saving the encrypted configuration information set and the hash value of the configuration information of the target node in the second blockchain network;
[0052] Send a configuration information backup success notification message to the first node.
[0053] Optionally, it also includes:
[0054] Receiving a configuration information recovery request sent by the smart contract device in the first node;
[0055] Send the encrypted configuration information set and a hash value of the configuration information of the target node to the smart contract device.
[0056] According to a third aspect of an embodiment of the present disclosure, there is provided a device for blockchain, which is applied to a first node, wherein the first node is a node in a node intersection, and the node intersection is an intersection of a node in a first blockchain network and a node in a second blockchain network, and the device includes:
[0057] A first sending module, configured to send a backup request to a second node in the second blockchain network, wherein the backup request includes block header information corresponding to a first blockchain of the first blockchain network;
[0058] A first determination module, configured to determine that the block header information of the first blockchain is successfully backed up in response to receiving a backup success notification message sent by the second node, wherein the backup success notification message is generated by the second node after the block header information is successfully saved in the second blockchain network;
[0059] The execution module is used to back up the block data corresponding to the first blockchain to the target storage space.
[0060] Optionally, the device further comprises:
[0061] A third sending module is used to send a backup and recovery request to a third node in the second blockchain network, wherein the backup and recovery request includes the identity information of the first node;
[0062] A second receiving module, used to receive the block header information sent by the third node;
[0063] A first recovery module, configured to recover the first blockchain according to the block header information and the block data corresponding to the target storage space;
[0064] A broadcast module is used to broadcast the first blockchain to other nodes in the node intersection.
[0065] Optionally, the device further comprises:
[0066] A transaction blocking initiating module, configured to initiate a transaction blocking event in the first blockchain network before the first sending module sends a backup request to the second node in the second blockchain network;
[0067] A writing module is used to write backup record information in the first blockchain.
[0068] Optionally, the device is isolated from the first node system, and the device further includes:
[0069] a fourth sending module, configured to send a configuration information backup request to a fourth node in the second blockchain network, wherein the configuration information backup request includes an encrypted configuration information set and a hash value of the configuration information of a target node, wherein the target node includes each node in the node intersection, and the encrypted configuration information set includes encrypted configuration information obtained by encrypting the configuration information of each of the target nodes;
[0070] The second determination module is used to determine that the configuration information backup is successful in response to receiving a configuration information backup success notification message sent by the fourth node, and the configuration information backup success notification message is generated by the fourth node after the hash value of the encrypted configuration information set and the configuration information of each of the target nodes is successfully saved in the second blockchain network.
[0071] Optionally, the device further comprises:
[0072] A first acquisition module, used to acquire configuration information of each target node;
[0073] A first generating module, used to generate an encryption key corresponding to each of the target nodes;
[0074] A first encryption module, used for encrypting the configuration information of each target node by using an encryption key corresponding to the target node to obtain the encrypted configuration information of the target node;
[0075] A key obfuscation module, used to perform key obfuscation on each of the encryption keys to generate an obfuscated key corresponding to each of the target nodes;
[0076] The fifth sending module is used to send each obfuscation key to a target node corresponding to the obfuscation key.
[0077] Optionally, the key obfuscation module includes:
[0078] A key splitting submodule, used to split each of the encryption keys into a target number of key segments, where the target number is the number of the target nodes;
[0079] The obfuscation key generation submodule is used to generate the obfuscation key using the following formula:
[0080] I={(i, 1), (i+1, 2)..., (n, n-i+1),... (ni, n-1), (n-i+1, n)}
[0081] Wherein, I is the obfuscation key of the i-th target node, the obfuscation key I includes n key segments, n is the number of the target nodes, (i, x) is the x-th key segment obtained by dividing the encryption key of the i-th target node, i∈[1,n], x∈[1,n], i and x are positive integers.
[0082] Optionally, the device further comprises:
[0083] A sixth sending module, configured to send a configuration information recovery request to a fifth node in the second blockchain network;
[0084] A third receiving module, used to receive the encrypted configuration information set and the hash value of each configuration information sent by the fifth node;
[0085] A second acquisition module is used to acquire an obfuscation key of each target node, where the obfuscation key is generated by obfuscating an encryption key corresponding to each target node, where the encryption key is a key used to encrypt configuration information corresponding to the target node;
[0086] A third determination module, configured to determine an encryption key of each of the target nodes based on each of the obfuscation keys;
[0087] A decryption module, used to decrypt the encrypted configuration information set by using each of the encryption keys to obtain the configuration information of each of the target nodes;
[0088] A second verification module, used to verify each of the configuration information obtained by decryption through the Hash value;
[0089] The second recovery module is used to restore the node configuration of each target node based on each configuration information when the verification is successful.
[0090] According to a fourth aspect of an embodiment of the present disclosure, there is provided a device for blockchain, which is applied to a node in a second blockchain network, and the device includes:
[0091] A first receiving module is configured to receive a backup request sent by a first node, where the first node is a node in a node intersection, where the node intersection is an intersection of nodes in the first blockchain network and nodes in the second blockchain network, and the backup request includes block header information of a first blockchain corresponding to the first blockchain network;
[0092] A first verification module, used to verify the block header information;
[0093] A first storage module, configured to store the block header information in the second blockchain network when the first verification module verifies successfully;
[0094] The second sending module is used to send a backup success notification message to the first node.
[0095] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0096] According to a sixth aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method described in any one of the second aspects are implemented.
[0097] According to a seventh aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0098] a memory having a computer program stored thereon;
[0099] A processor is used to execute the computer program in the memory to implement the steps of any one of the methods described in the first aspect above.
[0100] According to an eighth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0101] a memory having a computer program stored thereon;
[0102] A processor is used to execute the computer program in the memory to implement the steps of any method described in the second aspect above.
[0103] In the above technical solution, the first node in the first blockchain network can interact with the second node in the second blockchain network, thereby saving the block header data of the first blockchain in the first blockchain network in the second blockchain network, and backing up the block data of the first blockchain in the target storage space. In this way, even if the first blockchain network is damaged, the block header data of the first blockchain can be obtained through the second blockchain network, so that the account book can be restored based on the block header data and the block data in the target storage space, ensuring the correctness of the account book data. In addition, since the nodes in the node intersection are in both the first blockchain network and the second blockchain network, other nodes in the node intersection can also obtain the block header data of the first blockchain through the second blockchain network, so that in this way, the mutual trust between nodes can be maintained during the data backup and recovery process, thereby reducing node disputes.
[0104] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0105] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings:
[0106] Figure 1 It is a backup schematic diagram of a consortium chain network shown in an exemplary embodiment of the present disclosure.
[0107] Figure 2 It is a flowchart of a method for blockchain shown in an exemplary embodiment of the present disclosure.
[0108] Figure 3 The figure is a flowchart of a blockchain data backup method according to an exemplary embodiment of the present disclosure.
[0109] Figure 4 It is a recovery flowchart of a first blockchain shown in an exemplary embodiment of the present disclosure.
[0110] Figure 5 It is a schematic diagram of backing up configuration information shown in an exemplary embodiment of the present disclosure.
[0111] Figure 6 It is a schematic diagram of encryption of configuration information shown in an exemplary embodiment of the present disclosure.
[0112] Figure 7 It is a schematic diagram of a secret key obfuscation shown in an exemplary embodiment of the present disclosure.
[0113] Figure 8 The figure is a flowchart of restoring configuration information according to an exemplary embodiment of the present disclosure.
[0114] Fig. 9 It is a flowchart of a method for blockchain shown in an exemplary embodiment of the present disclosure.
[0115] Fig.10 It is a block diagram of a device for blockchain shown in an exemplary embodiment of the present disclosure.
[0116] Fig.11 It is a block diagram of a device for blockchain shown in an exemplary embodiment of the present disclosure.
[0117] Fig.12 It is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
[0118] Fig.13 It is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0119] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0120] Before introducing the method, device, storage medium and electronic device for blockchain provided by the present disclosure, the application scenario of the present disclosure is first introduced. The various embodiments provided by the present disclosure can be applied to the blockchain network backup scenario, and the blockchain can be, for example, a consortium chain, a public chain, etc.
[0121] Reference Figure 1 The backup diagram of a consortium chain network is shown. In the relevant scenario, when backing up the consortium chain, the peer node can read the blockchain ledger and the configuration information of its own node and save the data to the storage medium. When restoring, the peer node reads the backup data in the storage medium and rebuilds the blockchain network accordingly, and then other peer nodes can rejoin the consortium chain network to complete the recovery.
[0122] The applicant found that when the alliance chain network is running, the ledger has the characteristic of being tamper-proof. However, after the peer node stores the data in the local storage medium, other nodes cannot verify the data in any form. Therefore, the backup node can tamper with the data at will and upload the tampered ledger when restoring the network, which ultimately threatens the security of the network. In addition, when multiple nodes are backed up separately, if the backup data of multiple nodes are inconsistent, in this case, it is impossible to determine the correct backup data from the multiple backup data, which in turn causes disputes between nodes.
[0123] Furthermore, considering the security of node configuration information, it is difficult for other nodes in the alliance chain to send configuration information to a peer node for backup, which makes it difficult to effectively back up the node configuration information. At the same time, in the case of configuration information loss, the node's permission configuration is described by the peer node that rejoins the network, which has low credibility.
[0124] To this end, the present disclosure provides a method for blockchain, which is applied to a first node, referring to Figure 2 A flowchart of a method for blockchain is shown, the method comprising:
[0125] In step S21, a backup request is sent to a second node in the second blockchain network, where the backup request includes block header information corresponding to the first blockchain of the first blockchain network.
[0126] The first node is a node in the node intersection, and the second node may be a node in the node intersection or may not be a node in the node intersection. The node intersection is the intersection of nodes in the first blockchain network and nodes in the second blockchain network. The node intersection may include all or part of the nodes in the first blockchain network, and the node intersection may also include part or all of the nodes in the second blockchain network.
[0127] The first node may be any node in the node intersection, and may send a backup request to a second node in the second blockchain network, and then save the block header information of the first blockchain in the backup request in the second blockchain network through the second node.
[0128] Of course, in some possible implementations, the steps about the first node in each embodiment provided in this application can also be completed by deploying a smart contract. For example, the nodes in the node intersection can deploy a backup smart contract, and then the first node corresponding to the backup smart contract or the smart contract device in the first node executes the relevant steps in the backup process. Among them, the smart contract device can be, for example, a contract container mounted by the first node.
[0129] Regarding the block header information, depending on different backup application scenarios, the block header information may be, for example, the block header information of each block of the first blockchain, or the block header information of a portion of block segments in the first blockchain.
[0130] In addition, in some embodiments, before sending the backup request to the second node in the second blockchain network, the method further includes:
[0131] Initiate a transaction blocking event in the first blockchain network. For example, the first node may call a delay function in a related smart contract to maintain the state in the first blockchain network in a transaction-in-progress state. In this case, other transactions cannot be submitted and consensus cannot be reached, so that the business in the first blockchain network can be suspended, thereby avoiding the phenomenon that new transaction data is continuously generated and not backed up during the backup process. In addition, the first node may also write backup record information in the first blockchain to facilitate tracing of the backup process.
[0132] Of course, in some embodiments, the backup request and the block header information may also be sent separately. Figure 3 In the flowchart of a backup process of blockchain data shown in the figure, the first node can initiate a transaction block after sending a backup request, and then send the block header data of the first blockchain to the second node (this step is not shown in the figure).
[0133] In step S22, in response to receiving the backup success notification message sent by the second node, it is determined that the block header information of the first blockchain is backed up successfully.
[0134] The backup success notification message is generated by the second node after the block header information is successfully saved in the second blockchain network. Regarding the storage method of the block header information, in some implementation scenarios, the second node can save the block header information in the second blockchain corresponding to the second blockchain network. In other implementation scenarios, the second node can also save the hash value of the block header information in the second blockchain corresponding to the second blockchain network, which is not limited in this disclosure.
[0135] In step S23, the block data corresponding to the first blockchain is backed up to the target storage space. For example, the first node can Figure 1 The method shown backs up the first blockchain data locally or in a related storage space that it can obtain.
[0136] That is to say, the first node in the first blockchain network can interact with the second node in the second blockchain network to save the block header data of the first blockchain in the first blockchain network in the second blockchain network, and back up the block data of the first blockchain in the target storage space.
[0137] In this way, even if the first blockchain network is damaged, the block header data of the first blockchain can be obtained through the second blockchain network, so that the account book can be restored based on the block header data and the block data in the target storage space, ensuring the correctness of the account book data. In addition, since the nodes in the node intersection are in both the first blockchain network and the second blockchain network, other nodes in the node intersection can also obtain the block header data of the first blockchain through the second blockchain network, so that in this way, the mutual trust between nodes can be maintained during the data backup and recovery process, thereby reducing node disputes.
[0138] After the block header information of the first blockchain is saved through the second blockchain network, the first blockchain can be restored according to the saved block header information when the first blockchain network is damaged. In this case, the method further includes:
[0139] Send a backup and recovery request to a third node in the second blockchain network. The third node and the second node may be the same node or different nodes. It should be understood that after the block header information of the first blockchain is written to the second blockchain through the second node, the relevant nodes in the second blockchain network may also save the blocks including the block header information. Therefore, the third node may be another node different from the second node. The backup and recovery request may also include the identity information of the first node, so that the third node can verify the identity of the first node based on the identity information. Of course, refer to Figure 4 In the recovery flowchart of a first blockchain shown, the backup recovery request and the identity information may also be sent separately, which is not limited in the present disclosure.
[0140] After the identity information is verified, the third node may send block header information to the first node. After receiving the block header information, the first node may restore the first blockchain according to the block header information and the block data corresponding to the target storage space.
[0141] For example, the first node may sort the block data in the target storage space in the order of timestamps, and verify the block sorting according to the timestamp, previous block hash, current block hash and other information in the block header information, thereby restoring the first blockchain. Figure 4 As shown, the first node can also write the block data in the target storage space in sequence according to the block header information, thereby restoring the first blockchain.
[0142] Furthermore, the first node may also broadcast the first blockchain to other nodes in the node intersection, so that other nodes in the node intersection can restore the first blockchain. Figure 4 In some implementation scenarios, after restoring the first blockchain data, the first node may also send backup and recovery record information to the third node to facilitate the storage and tracing of the backup and recovery information.
[0143] In this way, when restoring blockchain data, the backup data can be verified according to the block header data obtained from the second blockchain network, thereby ensuring the authenticity of the restored blockchain ledger.
[0144] In a possible implementation, the first node runs a smart contract device that is isolated from the first node system. The smart contract device may be, for example, a contract container mounted on the node or an execution carrier of a related smart contract. The method includes:
[0145] The first node performs the following operations through the smart contract device:
[0146] Send a configuration information backup request to the fourth node in the second blockchain network. The configuration information backup request includes a set of encrypted configuration information and a hash value of the configuration information of the target node. The target node includes each node in the node intersection, and the encrypted configuration information set includes encrypted configuration information encrypted from the configuration information of each target node. The configuration information may include, for example, organizational members, secret keys, certificates, etc. corresponding to the node. The fourth node and the second node may be the same node or different nodes.
[0147] In response to receiving a configuration information backup success notification message sent by the fourth node, it is determined that the configuration information backup is successful. Wherein, the configuration information backup success notification message can be generated by the fourth node after the hash value of the encrypted configuration information set and the configuration information of each of the target nodes is successfully saved in the second blockchain network.
[0148] By adopting the above technical solution, the smart contract device in the first node in the first blockchain network can interact with the fourth node in the second blockchain network, thereby saving the encrypted configuration information set and the hash value of the configuration information of the target node in the second blockchain network. In this way, even if the first blockchain network is damaged, the encrypted configuration information set and the hash value of the configuration information of the target node can be obtained through the second blockchain network, so that the configuration of each node can be restored. In addition, since the smart contract device is isolated from the first node system, it can also avoid the leakage of the configuration information of each node during the backup process, thereby improving security.
[0149] Optionally, the operation further includes:
[0150] Obtain configuration information of each of the target nodes, and generate an encryption key corresponding to each of the target nodes. The encryption key may be randomly generated, for example, referring to Figure 5 A schematic diagram of backup of configuration information is shown (in the figure, a configuration information backup request and an encrypted configuration information set are sent separately). After generating an encryption key corresponding to each target node, the configuration information of each target node can be encrypted by the encryption key corresponding to the target node to obtain the encrypted configuration information of the target node.
[0151] For example, Figure 6This is a schematic diagram of an encryption of configuration information shown in an exemplary embodiment of the present disclosure. Taking the target nodes including nodes a, b, c, and d as an example, the smart contract device can generate secret keys a to d corresponding to the target nodes a, b, c, and d. In this way, the configuration information of nodes a to d can be encrypted by secret keys a to d to obtain encrypted configuration information a to d. In addition, the smart contract device can also combine the encrypted configuration information a to d (for example, arrange them according to the node order) to obtain an encrypted configuration information set.
[0152] In some implementation scenarios, in order to maintain the consistency of each node in the node set, the smart contract device can also send (e.g., broadcast) the encrypted configuration information set to other nodes in the node set, thereby achieving secret sharing of configuration information.
[0153] In this way, after the encryption is completed, the smart contract device can also perform key obfuscation on each of the encryption keys to generate an obfuscated key corresponding to each of the target nodes.
[0154] For example, in some implementations, the obfuscation key may be obtained in the following manner:
[0155] Each of the encryption keys is divided into a target number of key segments, where the target number is the number of target nodes. Figure 7 A schematic diagram of key obfuscation is shown. For keys a to d, each key can be divided into four key segments.
[0156] After obtaining the secret key segment, the obfuscation key can be generated by the following formula:
[0157] I={(i, 1), (i+1, 2)..., (n, n-i+1),... (ni, n-1), (n-i+1, n)}
[0158] Where I is the obfuscation key of the i-th target node, and the obfuscation key I includes n key segments, n is the number of the target nodes, (i, x) is the x-th key segment obtained by dividing the encryption key of the i-th target node, i∈[1, n], x∈[1, n], i and x are positive integers. For example, if target nodes a~d are the 1st to 4th target nodes respectively, the obfuscation key of target node a is:
[0159] I={(1,1), (2,2), (3,3), (4,4)}
[0160] That is, the obfuscation key a' of the target node a is: a1, b2, c3, d4.
[0161] It is worth noting that those skilled in the art should understand that, according to the division and numbering of the key segments, the formula for obtaining the obfuscated key may also have corresponding changes. Within the technical concept of the present disclosure, the formula may have a variety of simple variations, and these simple variations all belong to the protection scope of the present disclosure.
[0162] Furthermore, after obtaining the obfuscation key of each target node, each obfuscation key may be sent to the target node corresponding to the obfuscation key.
[0163] That is to say, after each target node backs up the configuration information through the smart contract device, it can obtain the corresponding obfuscation key. The obfuscation key includes a part of the encryption key of the configuration information of each target node, so each target node cannot decrypt the encrypted configuration information set alone. In this way, the effect of restoring the alliance chain configuration information can be achieved with the consent of all participating members, so that the consensus mechanism can be maintained unchanged and configuration information falsification can be prevented.
[0164] After the encrypted configuration information set and the hash value of each configuration information are saved through the second blockchain network, when the first blockchain network is damaged, the configuration of each target node can be restored according to the saved encrypted configuration information set and the hash value of each configuration information. In this case, the operation also includes:
[0165] Send a configuration information recovery request to the fifth node in the second blockchain network. For example, refer to Figure 8 In the flowchart of restoring configuration information shown, the first node can, for example, rebuild the first blockchain network based on local backup data, build the infrastructure of the first blockchain network and configure the smart contract device so that each target node in the node intersection can join the rebuilt first blockchain network. After the target node joins the rebuilt first blockchain network, the smart contract device can send a configuration information recovery request to the fifth node in the second blockchain network, and receive the encrypted configuration information set and the hash value of each configuration information sent by the fifth node.
[0166] The smart contract device can also obtain the obfuscation key of each target node, and determine the encryption key of each target node based on each obfuscation key. The obfuscation key is generated by obfuscating the encryption key corresponding to each target node, and the encryption key is the key used to encrypt the configuration information corresponding to the target node. Figure 6 and Figure 7For example, after obtaining the obfuscated keys of each target node, the key segments belonging to the same encryption key in each obfuscated key can be combined in the order of segmentation. For example, the key segments a1, a2, a3, and a4 obtained by segmenting the encryption key a (corresponding to the target node a) can be combined to obtain the encryption key a.
[0167] In this way, the encrypted configuration information set can be decrypted by each of the encryption keys to obtain the configuration information of each of the target nodes, and the decrypted configuration information can be verified by the hash value. For example, the hash value of the decrypted configuration information can be calculated by the corresponding hash function, and the hash value can be compared with the hash value of the configuration information of each target node stored in the second blockchain network. If the two are the same, it can be determined that the verification is successful.
[0168] Furthermore, when the verification is successful, the node configuration of each of the target nodes may be restored based on each of the configuration information.
[0169] In this way, configuration information can be backed up and restored, improving the disaster recovery capabilities of the blockchain network.
[0170] In addition, it is worth noting that in the above embodiments, in order to illustrate various embodiments of the method for blockchain, descriptions such as the second node, the third node, the fourth node, and the fifth node are used. However, those skilled in the art should know that in specific implementation, the second node, the third node, the fourth node, and the fifth node can be the same node in the second blockchain network or different nodes in the second blockchain network, and this disclosure does not limit this.
[0171] Fig. 9 is a flowchart of a method for blockchain shown in an exemplary embodiment of the present disclosure. The method can be applied to the nodes in the second blockchain network in the above embodiment, for example. Fig. 9 , the method comprising:
[0172] In step S91, a backup request sent by the first node is received.
[0173] The first node is a node in a node intersection, the node intersection is an intersection of nodes in the first blockchain network and nodes in the second blockchain network, and the backup request includes block header information of a first blockchain corresponding to the first blockchain network.
[0174] In step S92, the block header information is verified.
[0175] In some embodiments, Fig. 9The execution subject of the method steps shown may be, for example, a second node in the second blockchain network, and the second node may be, for example, a node in the node intersection. In this case, the second node may also store relevant data of the first blockchain. Therefore, the second node may compare the block header information with the block header information of the first blockchain stored by itself, thereby completing the verification.
[0176] In some other embodiments, the first node may also provide a relevant data interface so that the second node can obtain the block header information of the first blockchain according to the data interface, and then verify the block header information sent by the first node.
[0177] In step S93, when the verification is successful, the block header information is saved in the second blockchain network. For example, the second node may save the block header information in the second blockchain corresponding to the second blockchain network. The second node may also save the hash value of the block header information in the second blockchain corresponding to the second blockchain network, which is not limited in the present disclosure.
[0178] In step S94, a backup success notification message is sent to the first node.
[0179] That is to say, the first node in the first blockchain network can interact with the second node in the second blockchain network to save the block header data of the first blockchain in the first blockchain network in the second blockchain network, and back up the block data of the first blockchain in the target storage space.
[0180] In this way, even if the first blockchain network is damaged, the block header data of the first blockchain can be obtained through the second blockchain network, so that the account book can be restored based on the block header data and the block data in the target storage space, ensuring the correctness of the account book data. In addition, since the nodes in the node intersection are in both the first blockchain network and the second blockchain network, other nodes in the node intersection can also obtain the block header data of the first blockchain through the second blockchain network, so that in this way, the mutual trust between nodes can be maintained during the data backup and recovery process, thereby reducing node disputes.
[0181] Optionally, refer to Figure 4 , Fig. 9 The execution subject of the method steps shown may also be, for example, the third node in the above embodiment, and the method further includes:
[0182] Receiving a backup and recovery request sent by the first node;
[0183] Verifying the identity information of the first node in the backup and recovery request;
[0184] When the verification is successful, the block header information is sent to the first node.
[0185] In this way, when restoring blockchain data, the backup data can be verified according to the block header data obtained from the second blockchain network, thereby ensuring the authenticity of the restored blockchain ledger.
[0186] In some scenarios, after restoring the first blockchain data, the first node may also send backup recovery record information to the third node. In this case, the third node may also save the backup recovery record information in the second blockchain in response to receiving the backup recovery record information, so as to facilitate the storage and tracing of the backup recovery information.
[0187] Optionally, the method further comprises:
[0188] Receive a configuration information backup request sent by the smart contract device in the first node, wherein the configuration information backup request includes an encrypted configuration information set and a hash value of the configuration information of the target node, the encrypted configuration information set includes encrypted configuration information obtained by encrypting the configuration information of the target node, the target node includes each node in the node intersection, and the smart contract device is system-isolated from the first node.
[0189] Saving the encrypted configuration information set and the hash value of the configuration information of the target node in the second blockchain network;
[0190] Send a configuration information backup success notification message to the first node.
[0191] By adopting the above technical solution, the smart contract device in the first node in the first blockchain network can interact with the fourth node in the second blockchain network, thereby saving the encrypted configuration information set and the hash value of the configuration information of the target node in the second blockchain network. In this way, even if the first blockchain network is damaged, the encrypted configuration information set and the hash value of the configuration information of the target node can be obtained through the second blockchain network, so that the configuration of each node can be restored. In addition, since the smart contract device is isolated from the first node system, it can also avoid the leakage of the configuration information of each node during the backup process, thereby improving security.
[0192] In a possible implementation, the method further includes:
[0193] Receiving a configuration information recovery request sent by the smart contract device in the first node;
[0194] Send the encrypted configuration information set and a hash value of the configuration information of the target node to the smart contract device.
[0195] In this way, configuration information can be backed up and restored, improving the disaster recovery capabilities of the blockchain network.
[0196] Based on the same inventive concept, the present disclosure also provides a device for blockchain, Fig.10 1 is a block diagram of a device for blockchain shown in an exemplary embodiment of the present disclosure. The device can be applied to a first node, the first node is a node in a node intersection, the node intersection is an intersection of a node in a first blockchain network and a node in a second blockchain network, and the device 1000 includes:
[0197] A first sending module 1001 is used to send a backup request to a second node in the second blockchain network, where the backup request includes block header information corresponding to the first blockchain of the first blockchain network;
[0198] A first determination module 1002 is configured to determine that the block header information of the first blockchain is successfully backed up in response to receiving a backup success notification message sent by the second node, wherein the backup success notification message is generated by the second node after the block header information is successfully saved in the second blockchain network;
[0199] The execution module 1003 is used to back up the block data corresponding to the first blockchain to the target storage space.
[0200] In the above technical solution, the first node in the first blockchain network can interact with the second node in the second blockchain network, thereby saving the block header data of the first blockchain in the first blockchain network in the second blockchain network. In this way, even if the first blockchain network is damaged, the block header data of the first blockchain can be obtained through the second blockchain network, so that the account book can be restored based on the block header data, ensuring the correctness of the account book data. In addition, since the nodes in the node intersection are in both the first blockchain network and the second blockchain network, other nodes in the node intersection can also obtain the block header data of the first blockchain through the second blockchain network, so that in this way, the mutual trust between nodes can be maintained during the data backup and recovery process, thereby reducing node disputes.
[0201] Optionally, the device 1000 further includes:
[0202] A third sending module is used to send a backup and recovery request to a third node in the second blockchain network, wherein the backup and recovery request includes the identity information of the first node;
[0203] A second receiving module, used to receive the block header information sent by the third node;
[0204] A first recovery module, configured to recover the first blockchain according to the block header information and the block data corresponding to the target storage space;
[0205] A broadcast module is used to broadcast the first blockchain to other nodes in the node intersection.
[0206] Optionally, the device 1000 further includes:
[0207] A transaction blocking initiating module, configured to initiate a transaction blocking event in the first blockchain network before the first sending module sends a backup request to the second node in the second blockchain network;
[0208] A writing module is used to write backup record information in the first blockchain.
[0209] Optionally, the apparatus 1000 is isolated from the first node system, and the apparatus 1000 further includes:
[0210] a fourth sending module, configured to send a configuration information backup request to a fourth node in the second blockchain network, wherein the configuration information backup request includes an encrypted configuration information set and a hash value of the configuration information of a target node, wherein the target node includes each node in the node intersection, and the encrypted configuration information set includes encrypted configuration information obtained by encrypting the configuration information of each of the target nodes;
[0211] The second determination module is used to determine that the configuration information backup is successful in response to receiving a configuration information backup success notification message sent by the fourth node, and the configuration information backup success notification message is generated by the fourth node after the hash value of the encrypted configuration information set and the configuration information of each of the target nodes is successfully saved in the second blockchain network.
[0212] Optionally, the device 1000 further includes:
[0213] A first acquisition module, used to acquire configuration information of each target node;
[0214] A first generating module, used to generate an encryption key corresponding to each of the target nodes;
[0215] A first encryption module, used for encrypting the configuration information of each target node by using an encryption key corresponding to the target node to obtain the encrypted configuration information of the target node;
[0216] A key obfuscation module, used to perform key obfuscation on each of the encryption keys to generate an obfuscated key corresponding to each of the target nodes;
[0217] The fifth sending module is used to send each obfuscation key to a target node corresponding to the obfuscation key.
[0218] Optionally, the key obfuscation module includes:
[0219] A key splitting submodule, used to split each of the encryption keys into a target number of key segments, where the target number is the number of the target nodes;
[0220] The obfuscation key generation submodule is used to generate the obfuscation key using the following formula:
[0221] I={(i, 1), (i+1, 2)..., (n, n-i+1),... (ni, n-1), (n-i+1, n)}
[0222] Wherein, I is the obfuscation key of the i-th target node, the obfuscation key I includes n key segments, n is the number of the target nodes, (i, x) is the x-th key segment obtained by dividing the encryption key of the i-th target node, i∈[1,n], x∈[1,n], i and x are positive integers.
[0223] Optionally, the device 1000 further includes:
[0224] A sixth sending module, configured to send a configuration information recovery request to a fifth node in the second blockchain network;
[0225] A third receiving module, used to receive the encrypted configuration information set and the hash value of each configuration information sent by the fifth node;
[0226] A second acquisition module is used to acquire an obfuscation key of each target node, where the obfuscation key is generated by obfuscating an encryption key corresponding to each target node, where the encryption key is a key used to encrypt configuration information corresponding to the target node;
[0227] A third determination module, configured to determine an encryption key of each of the target nodes based on each of the obfuscation keys;
[0228] A decryption module, used to decrypt the encrypted configuration information set by using each of the encryption keys to obtain the configuration information of each of the target nodes;
[0229] A second verification module, used to verify each of the configuration information obtained by decryption through the Hash value;
[0230] The second recovery module is used to restore the node configuration of each target node based on each configuration information when the verification is successful.
[0231] The present disclosure also provides a device for blockchain, which is applied to a node in a second blockchain network, referring to Fig.11 A block diagram of a device for blockchain is shown, wherein the device 11 comprises:
[0232] A first receiving module 1101 is configured to receive a backup request sent by a first node, where the first node is a node in a node intersection, where the node intersection is an intersection of nodes in a first blockchain network and nodes in a second blockchain network, and the backup request includes block header information of a first blockchain corresponding to the first blockchain network;
[0233] A first verification module 1102, used to verify the block header information;
[0234] The first storage module 1103 is used to save the block header information in the second blockchain network when the first verification module verifies successfully;
[0235] The second sending module 1104 is used to send a backup success notification message to the first node.
[0236] Optionally, the device 1100 further includes:
[0237] A fourth receiving module, used to receive a backup recovery request sent by the first node;
[0238] A third verification module, used to verify the identity information of the first node in the backup and recovery request;
[0239] The seventh sending module is used to send the block header information to the first node when the third verification module verifies successfully.
[0240] Optionally, the device 1100 further includes:
[0241] a fifth receiving module, configured to receive a configuration information backup request sent by the smart contract device in the first node, wherein the configuration information backup request includes an encrypted configuration information set and a hash value of the configuration information of a target node, wherein the encrypted configuration information set includes encrypted configuration information obtained by encrypting the configuration information of the target node, wherein the target node includes each node in the node intersection, and the smart contract device is system-isolated from the first node;
[0242] A second storage module, used to store the encrypted configuration information set and the hash value of the configuration information of the target node in the second blockchain network;
[0243] An eighth sending module is used to send a configuration information backup success notification message to the first node.
[0244] Optionally, the device 1100 further includes:
[0245] a sixth receiving module, configured to receive a configuration information recovery request sent by the smart contract device in the first node;
[0246] A ninth sending module is used to send the encrypted configuration information set and the hash value of the configuration information of the target node to the smart contract device.
[0247] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0248] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for blockchain for a first node provided by the present disclosure.
[0249] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for blockchain for a node in a second blockchain network provided by the present disclosure.
[0250] The present disclosure also provides an electronic device, comprising:
[0251] a memory having a computer program stored thereon;
[0252] A processor is used to execute the computer program in the memory to implement the steps of the method for blockchain for the first node provided in the present disclosure.
[0253] Fig.12 FIG. 1 is a block diagram of an electronic device 1200 according to an exemplary embodiment. Fig.12 As shown, the electronic device 1200 may include: a processor 1201 and a memory 1202. The electronic device 1200 may also include one or more of a multimedia component 1203, an input / output (I / O) interface 1204, and a communication component 1205.
[0254] The processor 1201 is used to control the overall operation of the electronic device 1200 to complete all or part of the steps in the above-mentioned method for blockchain for the first node. The memory 1202 is used to store various types of data to support the operation of the electronic device 1200, which may include, for example, instructions for any application or method operating on the electronic device 1200, and application-related data, such as sent and received messages, pictures, audio, video, block data, certificates, etc. The memory 1202 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 1203 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 1202 or sent via the communication component 1205. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 1204 provides an interface between the processor 1201 and other interface modules, and the above-mentioned other interface modules can be a keyboard, a mouse, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 1205 is used for wired or wireless communication between the electronic device 1200 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 1205 may include: Wi-Fi module, Bluetooth module, NFC module, etc.
[0255] In an exemplary embodiment, the electronic device 1200 may be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned method for blockchain for the first node.
[0256] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by the processor, the steps of the method for blockchain for the first node are implemented. For example, the computer-readable storage medium can be the memory 1202 including the program instructions, and the program instructions can be executed by the processor 1201 of the electronic device 1200 to complete the method for blockchain for the first node.
[0257] The present disclosure also provides an electronic device, comprising:
[0258] a memory having a computer program stored thereon;
[0259] A processor is used to execute the computer program in the memory to implement the steps of the method for blockchain for a node in a second blockchain network provided by the present disclosure.
[0260] Fig.13 FIG. 1 is a block diagram of an electronic device 1300 according to an exemplary embodiment. Fig.13 As shown, the electronic device 1300 may include: a processor 1301 and a memory 1302. The electronic device 1300 may also include one or more of a multimedia component 1303, an input / output (I / O) interface 1304, and a communication component 1305.
[0261] The processor 1301 is used to control the overall operation of the electronic device 1300 to complete all or part of the steps in the above-mentioned method for blockchain for a node in the second blockchain network. The memory 1302 is used to store various types of data to support the operation of the electronic device 1300, which may include, for example, instructions for any application or method operating on the electronic device 1300, and application-related data, such as sent and received messages, pictures, audio, video, block data, certificates, etc. The memory 1302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. The multimedia component 1303 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may be further stored in the memory 1302 or sent via the communication component 1305. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 1304 provides an interface between the processor 1301 and other interface modules, and the above-mentioned other interface modules can be a keyboard, a mouse, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 1305 is used for wired or wireless communication between the electronic device 1300 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 1305 may include: Wi-Fi module, Bluetooth module, NFC module, etc.
[0262] In an exemplary embodiment, the electronic device 1300 may be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned method for blockchain for nodes in the second blockchain network.
[0263] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by the processor, the steps of the method for blockchain for the node in the second blockchain network are implemented. For example, the computer-readable storage medium can be the memory 1302 including the program instructions, and the program instructions can be executed by the processor 1301 of the electronic device 1300 to complete the method for blockchain for the node in the second blockchain network.
[0264] In another exemplary embodiment, a computer program product is also provided, which includes a computer program that can be executed by a programmable device, and the computer program has a code portion for executing the above-mentioned method for blockchain for a first node when executed by the programmable device.
[0265] In another exemplary embodiment, a computer program product is also provided, which includes a computer program that can be executed by a programmable device, and the computer program has a code portion for executing the above-mentioned method for blockchain for a node in a second blockchain network when executed by the programmable device.
[0266] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0267] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.
[0268] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.
Claims
1. A method for blockchain, characterized in that Applied to a first node, the first node is a node in a node intersection, the node intersection is an intersection of a node in a first blockchain network and a node in a second blockchain network, the method comprising: Sending a backup request to a second node in the second blockchain network, the backup request including block header information corresponding to the first blockchain of the first blockchain network; In response to receiving a backup success notification message sent by the second node, determining that the block header information of the first blockchain is successfully backed up, the backup success notification message being generated by the second node after the block header information is successfully saved in the second blockchain network; Backing up the block data corresponding to the first blockchain to the target storage space; Sending a backup and recovery request to a third node in the second blockchain network, wherein the backup and recovery request includes the identity information of the first node; Receiving block header information sent by the third node; Restoring the first blockchain according to the block header information and the block data corresponding to the target storage space; Broadcast the first blockchain to other nodes in the node intersection.
2. The method according to claim 1, characterized in that Before sending the backup request to the second node in the second blockchain network, the method further includes: Initiating a transaction blocking event in the first blockchain network; The backup record information is written into the first blockchain.
3. The method according to claim 1 or 2, characterized in that: The first node runs a smart contract device that is isolated from the first node system, and the method includes: The first node performs the following operations through the smart contract device: Sending a configuration information backup request to a fourth node in the second blockchain network, the configuration information backup request including an encrypted configuration information set and a hash value of the configuration information of a target node, wherein the target node includes each node in the node intersection, and the encrypted configuration information set includes encrypted configuration information obtained by encrypting the configuration information of each of the target nodes; In response to receiving a configuration information backup success notification message sent by the fourth node, it is determined that the configuration information is backed up successfully. The backup success notification message is generated by the fourth node after the hash value of the encrypted configuration information set and the configuration information of each target node is successfully saved in the second blockchain network.
4. The method according to claim 3, characterized in that The operations also include: Obtaining configuration information of each of the target nodes; generating an encryption key corresponding to each of the target nodes; Encrypting the configuration information of each target node using an encryption key corresponding to the target node to obtain encrypted configuration information of the target node; Obfuscating each of the encryption keys to generate an obfuscated key corresponding to each of the target nodes; Each obfuscation key is sent to a target node corresponding to the obfuscation key.
5. The method according to claim 4, characterized in that The step of performing key obfuscation on each of the encryption keys to generate an obfuscated key corresponding to each of the target nodes includes: Splitting each of the encryption keys into a target number of key segments, where the target number is the number of the target nodes; The obfuscation key is generated by the following formula: Wherein, I is the obfuscation key of the i-th target node, and the obfuscation key I includes n key segments, and n is the number of the target nodes. is the xth key segment obtained by splitting the encryption key of the i-th target node, i∈[1,n], x∈[1,n], i and x are positive integers.
6. The method according to claim 3, characterized in that: The operations also include: Sending a configuration information recovery request to a fifth node in the second blockchain network; Receive the encrypted configuration information set and the hash value of each configuration information sent by the fifth node; Obtaining an obfuscation key for each of the target nodes, wherein the obfuscation key is generated by obfuscating an encryption key corresponding to each target node, wherein the encryption key is a key used to encrypt configuration information corresponding to the target node; Determining an encryption key for each of the target nodes based on each of the obfuscation keys; Decrypting the encrypted configuration information set by using each of the encryption keys to obtain configuration information of each of the target nodes; Verifying each of the decrypted configuration information using the Hash value; When the verification is successful, the node configuration of each of the target nodes is restored based on each of the configuration information.
7. A method for blockchain, characterized in that: Applied to a node in a second blockchain network, the method comprises: Receive a backup request sent by a first node, where the first node is a node in a node intersection, where the node intersection is an intersection of nodes in the first blockchain network and nodes in the second blockchain network, and the backup request includes block header information of a first blockchain corresponding to the first blockchain network; Verifying the block header information; When the verification is successful, the block header information is saved in the second blockchain network; Sending a backup success notification message to the first node; Receiving a backup and recovery request sent by the first node; Verifying the identity information of the first node in the backup and recovery request; When the verification is successful, the block header information is sent to the first node.
8. The method according to claim 7, characterized in that Also includes: Receive a configuration information backup request sent by the smart contract device in the first node, the configuration information backup request including an encrypted configuration information set and a hash value of the configuration information of a target node, the encrypted configuration information set including encrypted configuration information obtained by encrypting the configuration information of the target node, the target node including each node in the node intersection, and the smart contract device is system-isolated from the first node; Saving the encrypted configuration information set and the hash value of the configuration information of the target node in the second blockchain network; Send a configuration information backup success notification message to the first node.
9. The method according to claim 8, characterized in that Also includes: Receiving a configuration information recovery request sent by the smart contract device in the first node; Send the encrypted configuration information set and a hash value of the configuration information of the target node to the smart contract device.
10. A device for blockchain, characterized in that: Applied to a first node, the first node is a node in a node intersection, the node intersection is an intersection of a node in a first blockchain network and a node in a second blockchain network, the device comprises: A first sending module, configured to send a backup request to a second node in the second blockchain network, wherein the backup request includes block header information corresponding to a first blockchain of the first blockchain network; A first determination module, configured to determine that the block header information of the first blockchain is successfully backed up in response to receiving a backup success notification message sent by the second node, wherein the backup success notification message is generated by the second node after the block header information is successfully saved in the second blockchain network; An execution module, configured to back up the block data corresponding to the first blockchain to a target storage space; A third sending module is used to send a backup and recovery request to a third node in the second blockchain network, wherein the backup and recovery request includes the identity information of the first node; A second receiving module, used to receive the block header information sent by the third node; A first recovery module, configured to recover the first blockchain according to the block header information and the block data corresponding to the target storage space; A broadcast module is used to broadcast the first blockchain to other nodes in the node intersection.
11. A device for blockchain, characterized in that: Applied to a node in a second blockchain network, the device comprises: A first receiving module is configured to receive a backup request sent by a first node, where the first node is a node in a node intersection, where the node intersection is an intersection of nodes in the first blockchain network and nodes in the second blockchain network, and the backup request includes block header information of a first blockchain corresponding to the first blockchain network; A first verification module, used to verify the block header information; A first storage module, configured to store the block header information in the second blockchain network when the first verification module verifies successfully; A second sending module, used to send a backup success notification message to the first node; A fourth receiving module, used to receive a backup recovery request sent by the first node; A third verification module, used to verify the identity information of the first node in the backup and recovery request; The seventh sending module is used to send the block header information to the first node when the third verification module verifies successfully.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 1 to 6 are implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method described in any one of claims 7 to 9 are implemented.
14. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 6.
15. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 7 to 9.
Citation Information
Patent Citations
Supervisory blockchain system and method
CN107483198A
Block chain data lifecycle management method
CN109274728A