CN112631836B - Method, device, storage medium and electronic equipment for blockchain - Google Patents
Method, device, storage medium and electronic equipment for blockchain Download PDFInfo
- Publication number
- CN112631836B CN112631836B CN202011595380.XA CN202011595380A CN112631836B CN 112631836 B CN112631836 B CN 112631836B CN 202011595380 A CN202011595380 A CN 202011595380A CN 112631836 B CN112631836 B CN 112631836B
- Authority
- CN
- China
- Prior art keywords
- node
- configuration information
- target
- blockchain network
- backup
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 89
- 230000004044 response Effects 0.000 claims abstract description 12
- 238000011084 recovery Methods 0.000 claims description 45
- 238000004590 computer program Methods 0.000 claims description 26
- 238000012795 verification Methods 0.000 claims description 13
- 230000000903 blocking effect Effects 0.000 claims description 5
- 230000000977 initiatory effect Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 19
- 238000004891 communication Methods 0.000 description 17
- 230000008569 process Effects 0.000 description 8
- 230000005236 sound signal Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 4
- 230000003068 static effect Effects 0.000 description 4
- 238000003491 array Methods 0.000 description 2
- 201000001098 delayed sleep phase syndrome Diseases 0.000 description 2
- 208000033921 delayed sleep phase type circadian rhythm sleep disease Diseases 0.000 description 2
- 235000019800 disodium phosphate Nutrition 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000004549 pulsed laser deposition Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1464—Management of the backup or restore process for networked environments
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/62—Protecting access to data via a platform, e.g. using keys or access control rules
- G06F21/6218—Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/02—Network architectures or network communication protocols for network security for separating internal from external traffic, e.g. firewalls
- H04L63/0209—Architectural arrangements, e.g. perimeter networks or demilitarized zones
- H04L63/0218—Distributed architectures, e.g. distributed firewalls
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Health & Medical Sciences (AREA)
- Software Systems (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Quality & Reliability (AREA)
- Computing Systems (AREA)
- Databases & Information Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The present disclosure relates to a method, an apparatus, a storage medium, and an electronic device for a blockchain, the method being applied to a first node in a node intersection, the node intersection being an intersection of a node in a first blockchain network and a node in a second blockchain network, the first node performing the following operations by an intelligent contract apparatus that is systematically isolated from the first node: and sending a configuration information backup request to a second node in the second blockchain network, wherein the configuration information backup request comprises an encryption configuration information set and hash values of configuration information of target nodes, the target nodes comprise each node in a node intersection, the configuration information backup success is determined in response to receiving a configuration information backup success notification message sent by the second node, and the backup success notification message is generated after the second node successfully stores the hash values of the configuration information of the encryption configuration information set and the configuration information of each target node in the second blockchain network.
Description
Technical Field
The present disclosure relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a storage medium, and an electronic device for blockchain.
Background
Blockchains are a technique that enables collective maintenance of a reliable database by means of decentralization and de-trust. The method can store the transactions occurring in a period of time in blocks as units, and connect the blocks in time sequence by a cryptography algorithm to form a data structure similar to a chain. The blockchain technology has the characteristics of distributed account book, decentralization, non-falsification and the like, and has a high application prospect in various aspects.
In the related scenario, the blockchain network also faces the problem of network damage, but because the privacy of the configuration information of the nodes in the blockchain network is higher, particularly for the alliance chain, in order to prevent data leakage, the configuration information of the nodes is not backed up, so that when the blockchain network is damaged, the configuration of the nodes cannot be restored based on the backed up configuration information, and in the prior art, the partial configuration of the nodes cannot be restored, and all the configurations of the nodes cannot be restored safely and reliably.
Disclosure of Invention
An object of the present disclosure is to provide a method, apparatus, storage medium and electronic device for blockchain to solve the above related technical problems.
To achieve the above object, according to a first aspect of embodiments of the present disclosure, there is provided a method for blockchain applied to a first node, the first node being a node in a node intersection, the node intersection being an intersection of a node in a first blockchain network and a node in a second blockchain network, the first node running a smart contract device isolated from the first node system, the method comprising:
the first node performs the following operations by the smart contract device:
Transmitting a configuration information backup request to a second node in the second blockchain network, wherein the configuration information backup request comprises an encryption configuration information set and hash values of configuration information of target nodes, the target nodes comprise each node in the node intersection, and the encryption configuration information set comprises encryption configuration information obtained by encrypting the configuration information of each target node;
And in response to receiving a configuration information backup success notification message sent by the second node, determining that the configuration information backup is successful, wherein the backup success notification message is generated after the second node successfully saves the hash value of the configuration information of the encrypted configuration information set and the configuration information of each target node in the second blockchain network.
Optionally, the operations further comprise:
Acquiring configuration information of each target node;
Generating an encryption key corresponding to each of the target nodes;
encrypting the configuration information of each target node through an encryption key corresponding to the target node to obtain the encryption configuration information of the target node;
Performing key confusion on each encryption key to generate a confusion key corresponding to each target node;
And sending each confusion key to a target node corresponding to the confusion key.
Optionally, the performing key confusion on each encryption key to generate a confusion key corresponding to each target node includes:
dividing each encryption key into a target number of key segments, wherein the target number is the number of target nodes;
The obfuscation key is generated by the following formula:
I={(i,1),(i+1,2)…,(n,n-i+1),…(n-i,n-1),(n-i+1,n)}
Wherein I is a confusion key of the ith target node, the confusion key I includes n key segments, n is the number of the target nodes, (I, x) is an xth key segment obtained by dividing an encryption key of the ith target node, I e [1, n ], x e [1, n ], I and x are positive integers.
Optionally, the operations further comprise:
transmitting a configuration information recovery request to a third node in the second blockchain network;
receiving the encryption configuration information set and hash values of the configuration information sent by the third node;
Obtaining a confusion secret key of each target node, wherein the confusion secret key is generated by carrying out secret key confusion on an encryption secret key corresponding to each target node, and the encryption secret key is a secret key used for encrypting configuration information corresponding to the target node;
Determining an encryption key for each of the target nodes based on each of the confusion keys;
Decrypting the encrypted configuration information set through each encryption key to obtain configuration information of each target node;
verifying each piece of configuration information obtained through decryption through the hash value;
And recovering the node configuration of each target node based on each configuration information when the verification is successful.
Optionally, the method further comprises:
determining that the first node is a full node in the first blockchain network, the full node being a node in the first blockchain network that stores full amount of blockchain data;
Sending a block header backup request to a fourth node in the second blockchain network, wherein the block header backup request comprises block header information of a first blockchain stored by the first node;
Determining that the block header information of the first block chain is successfully backed up in response to receiving a backup success notification message sent by the fourth node, wherein the backup success notification message is generated by the fourth node after the block header information is successfully stored in the second block chain network;
and backing up the block data corresponding to the first block chain to a target storage space.
Optionally, the method further comprises:
Sending a backup recovery request to a fifth node in a second blockchain network, wherein the backup recovery request comprises the identity information of the first node;
receiving block header information sent by the fifth node;
restoring the first blockchain according to the blockhead information and the blockdata corresponding to the target storage space;
The first blockchain is broadcast to other nodes in the node intersection.
Optionally, before the sending the block header backup request to the fourth node in the second blockchain network, the method further includes:
Initiating a transaction blocking event in the first blockchain network;
And writing backup record information in the first blockchain.
According to a second aspect of embodiments of the present disclosure, there is provided a method for a blockchain, for use with a node in a second blockchain network, the method comprising:
Receiving a configuration information backup request sent by an intelligent contract device in a first node, wherein 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 configuration information backup request comprises an encryption configuration information set and a hash value of configuration information of a target node, the encryption configuration information set comprises encryption configuration information obtained by encrypting the configuration information of the target node, the target node comprises each node in the node intersection, and the intelligent contract device is systematically isolated from the first node;
storing the hash value of the encrypted configuration information set and the configuration information of the target node in the second blockchain network;
and sending a configuration information backup success notification message to the first node.
Optionally, the method further comprises:
receiving a configuration information recovery request sent by an intelligent contract device in the first node;
and sending the hash value of the encryption configuration information set and the configuration information of the target node to the intelligent contract device.
Optionally, the method further comprises:
Receiving a block header backup request sent by the first node, wherein the block header backup request comprises block header information of a first block chain corresponding to the first block chain network;
checking the block header information;
when the verification is successful, the block header information is stored in the second block chain network;
and sending a backup success notification message to the first node.
Optionally, the method further comprises:
Receiving a backup recovery request sent by the first node;
verifying the identity information of the first node in the backup recovery request;
and when the verification is successful, the block header information is sent to the first node.
According to a third aspect of embodiments of the present disclosure, there is provided an apparatus for blockchain applied to a first node, the first node being a node in an intersection of a node in a first blockchain network and a node in a second blockchain network, the apparatus being systematically isolated from the first node, the apparatus comprising:
a first sending module, configured to send a configuration information backup request to a second node in the second blockchain network, where the configuration information backup request includes an encrypted configuration information set and a hash value of configuration information of a target node, where 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 target node;
And the first determining module is used for determining that the configuration information backup is successful in response to receiving a configuration information backup success notification message sent by the second node, wherein the configuration information backup success notification message is generated after the second node successfully saves the hash values of the configuration information of the encrypted configuration information set and the configuration information of each target node in the second blockchain network.
According to a fourth aspect of embodiments of the present disclosure, there is provided an apparatus for a blockchain, for use with a node in a second blockchain network, the apparatus comprising:
The first receiving module is used for receiving a configuration information backup request sent by an intelligent contract device in a first node, wherein the first node is a node in 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 configuration information backup request comprises an encryption configuration information set and a hash value of configuration information of a target node, the encryption configuration information set comprises encryption configuration information obtained by encrypting the configuration information of the target node, the target node comprises each node in the node intersection, and the intelligent contract device is systematically isolated from the first node;
The first storage module is used for storing the encryption configuration information set and the hash value of the configuration information of the target node in the second blockchain network;
And the second sending module is used for sending a configuration information backup success notification message to the first node.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the first aspects described above.
According to a sixth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the second aspects described above.
According to a seventh aspect of embodiments of the present disclosure, there is provided an electronic device, comprising:
a memory having a computer program stored thereon;
A processor for executing the computer program in the memory to implement the steps of the method of any of the above first aspects.
According to an eighth aspect of embodiments of the present disclosure, there is provided an electronic device, comprising:
a memory having a computer program stored thereon;
A processor for executing the computer program in the memory to implement the steps of the method of any of the second aspects above.
In the above technical solution, the smart contract device in the first node in the first blockchain network may interact with the second node in the second blockchain network, so as to store the hash value of the configuration information of the target node and the encrypted configuration information set in the second blockchain network. In this way, even if the first blockchain network is damaged, the hash value of the encrypted configuration information set and 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, because the intelligent contract device is isolated from the first node system, the configuration information of each node in the backup process can be prevented from being leaked, and the credibility and the safety of the configuration information of each node are improved.
Additional features and advantages of the present disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate the disclosure and together with the description serve to explain, but do not limit the disclosure. In the drawings:
FIG. 1 is a schematic diagram of a backup of a federated chain network as illustrated in an exemplary embodiment of the present disclosure.
FIG. 2 is a flowchart illustrating a method for blockchain in accordance with an exemplary embodiment of the present disclosure.
Fig. 3 is a schematic diagram of a backup of configuration information according to an exemplary embodiment of the present disclosure.
Fig. 4 is an encryption schematic of configuration information according to an exemplary embodiment of the present disclosure.
Fig. 5 is a diagram illustrating a key confusion diagram in accordance with an exemplary embodiment of the present disclosure.
Fig. 6 is a flow chart illustrating recovery of configuration information according to an exemplary embodiment of the present disclosure.
FIG. 7 is a flowchart illustrating another method for blockchain in accordance with an exemplary embodiment of the present disclosure.
FIG. 8 is a backup flow diagram of blockchain data illustrating an exemplary embodiment of the present disclosure.
FIG. 9 is a flowchart illustrating a first blockchain recovery procedure in accordance with an exemplary embodiment of the present disclosure.
FIG. 10 is a flowchart illustrating yet another method for blockchain in accordance with an exemplary embodiment of the present disclosure.
FIG. 11 is a flowchart illustrating yet another method for blockchain in accordance with an exemplary embodiment of the present disclosure.
FIG. 12 is a block diagram of an apparatus for blockchain shown in an exemplary embodiment of the present disclosure.
FIG. 13 is a block diagram of an apparatus for blockchain shown in an exemplary embodiment of the present disclosure.
Fig. 14 is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
Fig. 15 is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
Detailed Description
Specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the disclosure, are not intended to limit the disclosure.
Before introducing the method, the device, the storage medium and the electronic equipment for blockchain provided by the disclosure, an application scenario of the disclosure is first described. Embodiments provided by the present disclosure may be applied to a blockchain network backup scenario, which may be, for example, a federated chain, a public chain, and so forth.
Referring to a backup schematic diagram of a federated chain network shown in fig. 1, in a related scenario, a peer node may read configuration information of a blockchain ledger and its own node during a federated chain backup, and store the data in a storage medium. During recovery, the peer node reads the backup data in the storage medium, and rebuilds the blockchain network according to the backup data, so that other peer nodes can be added into the alliance chain network again to finish recovery.
The applicant finds that when the alliance chain network runs, other nodes in the alliance chain are difficult to send configuration information to a peer node for backup in consideration of the security of the node configuration information, so that the node configuration information is difficult to be effectively backed up. Meanwhile, under the condition that the configuration information is lost, the authority configuration of the node is automatically described by the peer node which rejoins the network, and the reliability is low.
And, the ledger data stored in the blockchain has a non-tamperable characteristic. However, after the peer node stores the data in the local storage medium, other nodes cannot verify the data in any form, so that the node performing backup can tamper the data at will, upload the tampered account book when the network is restored, and finally threaten the security of the network. In addition, when the plurality of nodes are backed up separately, if the backup data of the plurality of nodes are inconsistent, in this case, the correct backup data cannot be determined from the plurality of backup data, which causes disputes between the nodes.
To this end, the present disclosure provides a method for a blockchain, applied to a first node running a smart contract device isolated from the first node system, which may be, for example, a node-mounted contract container or an execution carrier of a related smart contract, with reference to a flowchart of a method for a blockchain shown in fig. 2, by which the first node may perform the following method steps:
In step S21, a configuration information backup request is sent to a second node in the second blockchain network, the configuration information backup request including a hash value of the configuration information of the target node and the encrypted configuration information set.
The first node is a node in the node intersection, and the second node may or may not be a node in the 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 node intersection may include all or a portion of the nodes in the first blockchain network, and the node intersection may also include a portion or all of the nodes in the second blockchain network.
The target node includes each node in the node intersection, and the set of encryption configuration information includes encryption configuration information encrypted from configuration information of each node in the node intersection. The configuration information may include, for example, organization members, keys, certificates, etc., to which the node corresponds.
In step S22, in response to receiving the configuration information backup success notification message sent by the second node, it is determined that the configuration information backup is successful.
The configuration information backup success notification message may be generated by the second node after the encrypted configuration information set and hash values of the configuration information of each target node are successfully stored in the second blockchain network.
That is, any node in the node intersection may further store the encrypted configuration information of each node and the hash value of the configuration information of each node in the node intersection in the second blockchain network for recovery of the node configuration information by sending a configuration information backup request to the second node in the second blockchain network.
By adopting the technical scheme, the intelligent contract device in the first node in the first blockchain network can interact with the second node in the second blockchain network, so that the hash value of the configuration information of the target node and the encryption configuration information set is stored in the second blockchain network. In this way, even if the first blockchain network is damaged, the hash value of the encrypted configuration information set and 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, as the intelligent contract device is isolated from the first node system, configuration information of each node in the backup process can be prevented from being leaked, and safety is improved.
Alternatively, the encryption configuration information of the target node may be obtained as follows:
Configuration information of each target node is obtained, and an encryption key corresponding to each target node is generated. The encryption key may be generated randomly, for example, referring to a backup schematic diagram of one configuration information shown in fig. 3 (in the figure, the backup schematic diagram is shown by sending a configuration information backup request and an encryption configuration information set respectively), after generating the encryption key corresponding to each target node, the encryption key corresponding to the target node may be used to encrypt the configuration information of each target node, so as to obtain the encryption configuration information of the target node.
For example, fig. 4 is an encryption diagram of configuration information according to an exemplary embodiment of the present disclosure, where the target node includes node a, b, c, d, the smart contract device may generate keys a-d corresponding to the target node a, b, c, d. Thus, the configuration information of the nodes a to d can be encrypted by the keys a to d to obtain the encrypted configuration information a to d. The smart contract device may combine the encryption configuration information a to d (for example, arrange the encryption configuration information a to d according to the order of nodes) to obtain an encryption configuration information set.
In some implementations, to maintain consistency of each node in the set of nodes, the smart contract device may also send (e.g., broadcast) the set of encrypted configuration information to other nodes in the set of nodes, thereby enabling secret sharing of configuration information.
Thus, after encryption is completed, the smart contract device may also perform key confusion for each encryption key, generating a confusion key corresponding to each target node.
For example, in some embodiments, the obfuscation key may be obtained by:
Each encryption key is partitioned into a target number of key segments, the target number being the number of target nodes. Along the line of a key confusion diagram shown with the above example and with reference to fig. 5, each key may be partitioned into 4 key segments for keys a-d.
After the key segment is obtained, the obfuscated key may be generated by the following formula:
I={(i,1),(i+1,2)…,(n,n-i+1),…(n-i,n-1),(n-i+1,n)}
Wherein I is a confusion key of the ith target node, the confusion key I includes n key segments, n is the number of the target nodes, (I, x) is an xth key segment obtained by dividing an encryption key of the ith target node, I e [1, n ], x e [1, n ], I and x are positive integers. Taking the 1 st to 4 th target nodes as examples, the confusion secret key of the target node a is:
I={(1,1),(2,2),(3,3),(4,4)}
that is, the confusion key a' of the target node a is: a1, b2, c3, d4.
It should be noted that, as will be understood by those skilled in the art, the formula for obtaining the confusion key may also be changed correspondingly according to the division and the number of the key segments. Within the scope of the technical idea of the present disclosure, there may be a number of simple variants of the formula, all of which fall within the scope of protection of the present disclosure.
Further, after obtaining the confusion key of each target node, each confusion key may be sent to the target node corresponding to the confusion key.
That is, each target node may obtain a corresponding confusion key after performing configuration information backup by the smart contract device. The obfuscation key includes a portion of the encryption key of the configuration information of each target node, so each target node cannot individually decrypt the set of encrypted configuration information. By adopting the mode, the effect of recovering the configuration information of the alliance chain under the condition that all participating members agree can be realized, so that the consensus mechanism can be maintained unchanged, and the configuration information is prevented from being counterfeited.
After the hash value of the encryption configuration information set and each configuration information is stored through the second blockchain network, when the first blockchain network is damaged, the configuration of each target node can be recovered according to the stored hash value of the encryption configuration information set and each configuration information. In this case, the method further comprises:
And sending a configuration information recovery request to a third node in the second blockchain network. For example, referring to a recovery flow chart of configuration information shown in fig. 6, the first node may reconstruct the first blockchain network from the local backup data, build an infrastructure of the first blockchain network, and configure the smart contract device to enable each target node in the node intersection to join the reconstructed first blockchain network. After the target node joins the rebuilt first blockchain network, the smart contract device may send a configuration information recovery request to a third node in the second blockchain network, and receive the encrypted configuration information set and hash values of the configuration information sent by the third node.
The smart contract device may also obtain a confusion key for each target node and determine an encryption key for each target node based on each confusion key. The confusion secret key is generated by carrying out secret key confusion on the encryption secret key corresponding to each target node, wherein the encryption secret key is the secret key used for encrypting the configuration information corresponding to the target node. With the examples of fig. 4 and 5, after obtaining the confusion key of each target node, each key segment belonging to the same encryption key in each confusion key may be combined in the division order, for example, the key segments a1, a2, a3, a4 obtained by dividing the encryption key a (corresponding to the target node a) may be combined, thereby obtaining the encryption key a.
In this way, the encrypted configuration information set can be decrypted through each encryption key to obtain the configuration information of each target node, and each configuration information obtained through decryption is checked through the hash value. For example, the hash value of the configuration information may be obtained by calculating and decrypting the corresponding hash function, and the hash value may 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, then a successful verification can be determined.
Further, when the verification is successful, the node configuration of each target node can be recovered based on each configuration information.
By the mode, backup and recovery of configuration information can be completed, and disaster recovery capacity of the blockchain network is improved.
The embodiment of the disclosure also provides another method for blockchain, which is applied to a first node, wherein the first node is a node in a node intersection set, the node intersection set is an intersection set of a node in a first blockchain network and a node in a second blockchain network, the node intersection set can comprise all or part of the nodes in the first blockchain network, and the node intersection set can also comprise part or all of the nodes in the second blockchain network. As shown in fig. 7, the method includes:
In step S71, the first node is determined to be a full node in the first blockchain network.
Wherein the full node is a node in the first blockchain network that stores the full amount of blockchain data.
In step S72, a block header backup request is sent to a fourth node in the second blockchain network, the block header backup request including block header information corresponding to the first blockchain of the first blockchain network.
The fourth node may or may not be a node in the node intersection.
In some possible implementations, the steps regarding the first node in the embodiments provided by the present application may be accomplished by deploying a smart contract. For example, the nodes in the node intersection may deploy the backup smart contract, and then the first node corresponding to the backup smart contract or the smart contract device in the first node performs relevant steps in the backup process. The smart contract device may be, for example, a contract container mounted by the first node.
For the block header information, 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 part of the block segments in the first blockchain according to the different backup application scenarios.
Furthermore, in some embodiments, before the sending the blockhead backup request to the fourth node in the second blockchain network, the method further includes:
A transaction blocking event is initiated in the first blockchain network. For example, the first node may invoke a delay function in the associated smart contract to maintain a state in the first blockchain network in a transaction ongoing state. In this case, other transactions cannot be submitted and agreed, so that the service in the first blockchain network can be suspended, and the phenomenon that new transaction data are not backed up continuously in the backup process is avoided. In addition, the first node can write backup record information in the first blockchain so as to trace back the backup process.
Of course, in some embodiments, the block header backup request may also be sent separately from the block header information. Referring to a block chain data backup flow diagram shown in fig. 8, the first node may initiate a transaction block after sending a block head backup request, and then send the block head data of the first block chain to the fourth node (this step is not shown).
In step S73, in response to receiving the backup success notification message sent by the fourth node, it is determined that the backup of the block header information of the first blockchain is successful.
The backup success notification message is generated by the fourth node after the block header information is successfully stored in the second blockchain network. For the manner of storing the block header information, in some implementations, the fourth node may store the block header information in a second blockchain corresponding to the second blockchain network. In other embodiments, the fourth node may also store the hash value of the blockhead information in a second blockchain corresponding to the second blockchain network, which is not limited in this disclosure.
In step S74, the block data corresponding to the first blockchain is backed up to the target storage space. For example, the first node may backup the first blockchain data locally or in the relevant storage space that the first node can obtain through the backup process shown in fig. 1.
That is, a first node in the first blockchain network may store blockhead data of a first blockchain in the first blockchain network in the second blockchain network by interacting with a fourth node in the second blockchain network and backing up the blockhead data of the first blockchain in the target storage space.
Therefore, even if the first blockchain network is damaged, the second blockchain network can acquire the block header data of the first blockchain, so that account book recovery can be performed based on the block header data and the block data in the target storage space, and the accuracy of the account book data is ensured. And because the nodes in the node intersection are simultaneously positioned in the first block chain network and the second block chain network, other nodes in the node intersection can acquire the block head data of the first block chain through the second block chain network, so that the common communication among the nodes can be maintained in the data backup and recovery process in the mode, and the node disputes are reduced.
After the block header information of the first block chain is saved through the second block chain network, the first block chain can be restored according to the saved block header information when the first block chain network is damaged. In this case, the method further comprises:
And sending a backup recovery request to a fifth node in the second blockchain network. The fifth node and the fourth node may be the same node or different nodes. It should be appreciated that after the block header information of the first blockchain is written into the second blockchain by the fourth node, the associated node in the second blockchain network may also save the block that includes the block header information. Thus, the fifth node may be another node than the fourth node. The backup restoration request may further include identity information of the first node, where the fifth node is configured to verify the identity of the first node according to the identity information. Of course, referring to a first blockchain restore flowchart shown in fig. 9, the backup restore request and the identity information may also be sent separately, which is not limited by the present disclosure.
The fifth node may send block header information to the first node after the authentication of the identity information is passed. 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.
For example, the first node may sort the block data in the target storage space according to the sequence of the time stamps, and verify the block sorting according to the time stamp, the last block hash, the present block hash, and other information in the block header information, so as to restore the first block chain. Or as shown in fig. 9, the first node may also write the block data in the target storage space in sequence according to the block header information, so as to restore the first blockchain.
Further, the first node may also broadcast the first blockchain to other nodes in the node intersection to facilitate the other nodes in the node intersection to recover the first blockchain. Referring to fig. 9, in some implementations, after recovering the first blockchain data, the first node may further send backup recovery record information to the fifth node, so as to document and trace the backup recovery information.
In this way, when the blockchain data is restored, the backup data can be verified according to the blockhead data acquired from the second blockchain network, so that the authenticity of the restored blockchain ledger is ensured.
It should be noted that, in the above embodiments, in order to describe each embodiment of the method for blockchain, descriptions of the second node, the third node, the fourth node, the fifth node, and the like are used. However, it should be understood by those skilled in the art that in the implementation, the second node, the third node, the fourth node, and the fifth node may be the same node in the second blockchain network or different nodes in the second blockchain network, which is not limited in this disclosure.
Fig. 10 is a flowchart illustrating a method for a blockchain, which may be applied to, for example, a node in a second blockchain network in the above-described embodiments, according to an exemplary embodiment of the present disclosure, and with reference to fig. 10, the method includes:
In step S101, a configuration information backup request sent by the smart contract device in the first node is received, where the configuration information backup request includes a hash value of the configuration information of the target node and a set of encrypted configuration information.
The encryption configuration information set comprises encryption configuration information obtained by encrypting the configuration information of the target node, the target node comprises each node in a node intersection set, the intelligent contract device is isolated from the first node in a system, and the node intersection set is an intersection set of a node in a first blockchain network and a node in a second blockchain network.
In step S102, the hash values of the encrypted configuration information set and the configuration information of the target node are stored in the second blockchain network.
In step S103, a configuration information backup success notification message is sent to the first node.
By adopting the technical scheme, the intelligent contract device in the first node in the first blockchain network can interact with the second node in the second blockchain network, so that the hash value of the configuration information of the target node and the encryption configuration information set is stored in the second blockchain network. In this way, even if the first blockchain network is damaged, the hash value of the encrypted configuration information set and 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, as the intelligent contract device is isolated from the first node system, configuration information of each node in the backup process can be prevented from being leaked, and safety is improved.
In one possible embodiment, the method further comprises:
receiving a configuration information recovery request sent by an intelligent contract device in the first node;
And sending the hash value of the encryption configuration information set and the configuration information of the target node to the intelligent contract device.
By the mode, backup and recovery of configuration information can be completed, and disaster recovery capacity of the blockchain network is improved.
Fig. 11 is a flowchart illustrating a method for a blockchain, which may be applied to, for example, a node in a second blockchain network in the above-described embodiments, according to an exemplary embodiment of the present disclosure, and with reference to fig. 11, the method includes:
In step S111, a block header backup request sent by the first node is received.
The first node is a node in a node intersection set, the node intersection set is an intersection set of a node in a first blockchain network and a node in a second blockchain network, and the blockhead backup request includes blockhead information of a first blockchain corresponding to the first blockchain network.
In step S112, the block header information is checked.
In some embodiments, the execution body of the method steps shown in fig. 9 may be, for example, the fourth node in the foregoing embodiment, where the fourth node may be, for example, a node in the node intersection, and in this case, the fourth node may also store the related data of the first blockchain. Thus, the fourth node can compare the block header information with the block header information of the first blockchain stored by itself, thereby completing the verification.
In other embodiments, the first node may also provide a related data interface, so that the fourth node may obtain the block header information of the first blockchain according to the data interface, and further verify the block header information sent by the first node.
In step S113, the block header information is stored in the second blockchain network when the verification is successful.
For example, the fourth node may store the blockhead information in a second blockchain corresponding to the second blockchain network. The fourth node may also store the hash value of the block header information in a second blockchain corresponding to the second blockchain network, which is not limited in the present disclosure.
In step S114, a backup success notification message is sent to the first node.
That is, a first node in the first blockchain network may store blockhead data of a first blockchain in the first blockchain network in the second blockchain network by interacting with a fourth node in the second blockchain network and backing up the blockhead data of the first blockchain in the target storage space.
Therefore, even if the first blockchain network is damaged, the second blockchain network can acquire the block header data of the first blockchain, so that account book recovery can be performed based on the block header data and the block data in the target storage space, and the accuracy of the account book data is ensured. And because the nodes in the node intersection are simultaneously positioned in the first block chain network and the second block chain network, other nodes in the node intersection can acquire the block head data of the first block chain through the second block chain network, so that the common communication among the nodes can be maintained in the data backup and recovery process in the mode, and the node disputes are reduced.
Alternatively, the execution body of the method steps shown in fig. 11 may be, for example, the fifth node in the above embodiment (the fifth node shown in fig. 9), and the method further includes:
Receiving a backup recovery request sent by the first node;
verifying the identity information of the first node in the backup recovery request;
and when the verification is successful, the block header information is sent to the first node.
In this way, when the blockchain data is restored, the backup data can be verified according to the blockhead data acquired from the second blockchain network, so that the authenticity of the restored blockchain ledger is ensured.
In some scenarios, the first node may also send backup recovery record information to the fifth node after recovering the first blockchain data. In this case, the fifth node may further store the backup restoration record information in the second blockchain in response to receiving the backup restoration record information, so as to document and trace the backup restoration information.
Based on the same inventive concept, the present disclosure further provides an apparatus 1200 for a blockchain, and fig. 12 is a block diagram of an apparatus for a blockchain shown in an exemplary embodiment of the present disclosure, the apparatus being applicable to a first node, the first node being a node in a node intersection, the node intersection being an intersection of a node in a first blockchain network and a node in a second blockchain network, the apparatus 1200 being isolated from the first node system, the apparatus 1200 comprising:
A first sending module 1201, configured to send a configuration information backup request to a second node in the second blockchain network, where the configuration information backup request includes an encrypted configuration information set and a hash value of configuration information of a target node, where 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 target node;
The first determining module 1202 is configured to determine that the configuration information backup is successful in response to receiving a configuration information backup success notification message sent by the second node, where the configuration information backup success notification message is generated by the second node after the hash values of the encrypted configuration information set and the configuration information of each target node are successfully stored in the second blockchain network.
Optionally, the apparatus 1200 further includes:
The first acquisition module is used for acquiring configuration information of each target node;
A first generation module for generating an encryption key corresponding to each of the target nodes;
The first encryption module is used for encrypting the configuration information of each target node through an encryption key corresponding to the target node to obtain the encryption configuration information of the target node;
The key confusion module is used for carrying out key confusion on each encryption key and generating a confusion key corresponding to each target node;
And the third sending module is used for sending each confusion key to the target node corresponding to the confusion key.
Optionally, the key confusion module includes:
A key dividing sub-module, configured to divide each encryption key into a target number of key segments, where the target number is the number of the target nodes;
A confusion key generation sub-module for generating the confusion key by the following formula:
I={(i,1),(i+1,2)…,(n,n-i+1),…(n-i,n-1),(n-i+1,n)}
Wherein I is a confusion key of the ith target node, the confusion key I includes n key segments, n is the number of the target nodes, (I, x) is an xth key segment obtained by dividing an encryption key of the ith target node, I e [1, n ], x e [1, n ], I and x are positive integers.
Optionally, the apparatus 1200 further includes:
a fourth sending module, configured to send a configuration information recovery request to a third node in the second blockchain network;
The second receiving module is used for receiving the encryption configuration information set and hash values of the configuration information sent by the third node;
the second obtaining module is used for obtaining a confusion secret key of each target node, wherein the confusion secret key is generated by carrying out secret key confusion on an encryption secret key corresponding to each target node, and the encryption secret key is a secret key used for encrypting configuration information corresponding to the target node;
A second determining module, configured to determine an encryption key of each of the target nodes based on each of the confusion keys;
the decryption module is used for decrypting the encryption configuration information set through each encryption key to obtain the configuration information of each target node;
The first verification module is used for verifying each piece of configuration information obtained through decryption through the hash value;
And the first recovery module is used for recovering the node configuration of each target node based on each configuration information when the verification is successful.
With the apparatus 1200, a first node in a first blockchain network may store a hash value of the encrypted configuration information set and the configuration information of the target node in a second blockchain network by interacting with a second node in the second blockchain network through the apparatus 1200. In this way, even if the first blockchain network is damaged, the hash value of the encrypted configuration information set and 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, because the intelligent contract device is isolated from the first node system, the configuration information of each node in the backup process can be prevented from being leaked, and the credibility and the safety of the configuration information of each node are improved.
Optionally, the apparatus 1200 further includes:
A third determining module, configured to determine that the first node is a full node in the first blockchain network, where the full node is a node storing a full amount of blockchain data in the first blockchain network;
a fifth sending module, configured to send a block header backup request to a fourth node in the second blockchain network, where the block header backup request includes block header information of the first blockchain stored by the first node;
a fourth determining 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 fourth node, where the backup success notification message is generated by the fourth node after the block header information is successfully stored in the second blockchain network;
And the execution module is used for backing up the block data corresponding to the first block chain into the target storage space.
Optionally, the apparatus 1200 further includes:
a sixth sending module, configured to send a backup recovery request to a fifth node in the second blockchain network, where the backup recovery request includes identity information of the first node;
the third receiving module is used for receiving the block header information sent by the fifth node;
A second recovery module, configured to recover the first blockchain according to the blockhead information and the blockdata corresponding to the target storage space;
and the broadcasting module is used for broadcasting the first block chain to other nodes in the node intersection.
Optionally, the apparatus 1200 further includes:
A transaction blocking initiating module, configured to initiate a transaction blocking event in the first blockchain network before the first sending module sends a blockhead backup request to a fourth node in the second blockchain network;
And the writing module is used for writing backup record information in the first blockchain.
By adopting the device 1200, even if the first blockchain network is damaged, the block header data of the first blockchain can be acquired through the second blockchain network, so that account book recovery can be performed based on the block header data and the block data in the target storage space, and the accuracy of the account book data is ensured. And because the nodes in the node intersection are simultaneously positioned in the first block chain network and the second block chain network, other nodes in the node intersection can acquire the block head data of the first block chain through the second block chain network, so that the common communication among the nodes can be maintained in the data backup and recovery process in the mode, and the node disputes are reduced.
The present disclosure also provides an apparatus 1300 for a blockchain, for use with a node in a second blockchain network, with reference to a block diagram of an apparatus 1300 for a blockchain shown in fig. 13, the apparatus 1300 comprising:
a first receiving module 1301, configured to receive a configuration information backup request sent by an intelligent contract device in a first node, where the first node is a node in a node intersection, where the node intersection is an intersection between a node in a first blockchain network and a node in a second blockchain network, the configuration information backup request includes a hash value of configuration information of a target node and an encrypted configuration information set, 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 intelligent contract device is systematically isolated from the first node;
A first storage module 1302, configured to store the encrypted configuration information set and the hash value of the configuration information of the target node in the second blockchain network;
the second sending module 1303 is configured to send a configuration information backup success notification message to the first node.
Optionally, the apparatus 1300 further includes:
A fourth receiving module, configured to receive a configuration information recovery request sent by an intelligent contract device in the first node;
and a seventh sending module, configured to send the encrypted configuration information set and the hash value of the configuration information of the target node to the smart contract device.
Optionally, the apparatus 1300 further includes:
A fifth receiving module, configured to receive a block header backup request sent by the first node, where the block header backup request includes block header information corresponding to a first block chain of the first block chain network;
The second checking module is used for checking the block header information;
the second storage module is used for storing the block header information in the second block chain network when the second checking module is successful in checking;
And an eighth sending module, configured to send a backup success notification message to the first node.
Optionally, the apparatus 1300 further includes:
A fourth receiving module, configured to receive a backup recovery request sent by the first node;
the third checking module is used for checking the identity information of the first node in the backup recovery request;
And a ninth sending module, configured to send the block header information to the first node when the third checking module checks successfully.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
The present disclosure also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the method for blockchain for a first node provided by the present disclosure.
The present disclosure also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the method for blockchain for nodes in a second blockchain network provided by the present disclosure.
The present disclosure also provides an electronic device, including:
a memory having a computer program stored thereon;
A processor for executing the computer program in the memory to implement the steps of the method for blockchain for the first node provided by the present disclosure.
Fig. 14 is a block diagram of an electronic device 1400, shown in accordance with an exemplary embodiment. As shown in fig. 14, the electronic device 1400 may include: processor 1401, memory 1402. The electronic device 1400 may also include one or more of a multimedia component 1403, an input/output (I/O) interface 1404, and a communication component 1405.
Wherein the processor 1401 is configured to control the overall operation of the electronic device 1400 to perform all or part of the steps of the method for blockchain for the first node described above. Memory 1402 is used to store various types of data to support operations at the electronic device 1400, which may include, for example, instructions for any application or method operating on the electronic device 1400, as well as application-related data, such as messages, pictures, audio, video, block data, certificates, and the like. The Memory 1402 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as static random access Memory (Static Random Access Memory, SRAM for short), electrically erasable programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM for short), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM for short), programmable Read-Only Memory (Programmable Read-Only Memory, PROM for short), read-Only Memory (ROM for short), magnetic Memory, flash Memory, magnetic disk, or optical disk. Multimedia component 1403 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen, the audio component being for outputting and/or inputting 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 memory 1402 or transmitted through communication component 1405. The audio assembly further comprises at least one speaker for outputting audio signals. The I/O interface 1404 provides an interface between the processor 1401 and other interface modules, which may be a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 1405 is used for wired or wireless communication between the electronic device 1400 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, near Field Communication (NFC) for short, 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or one or a combination of more of them, is not limited herein. The corresponding communication component 1405 may thus comprise: wi-Fi module, bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic device 1400 may be implemented by one or more Application-specific integrated circuits (ASICs), digital signal processors (DIGITAL SIGNAL processors, DSPs), digital signal processing devices (DIGITAL SIGNAL Processing Device, DSPDs), programmable logic devices (Programmable Logic Device, PLDs), field programmable gate arrays (Field Programmable GATE ARRAY, FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the method for blockchain for the first node described above.
In another exemplary embodiment, a computer readable storage medium is also provided comprising program instructions which, when executed by a processor, implement the steps of the method for blockchain for a first node described above. For example, the computer readable storage medium may be the memory 1402 including program instructions described above that are executable by the processor 1401 of the electronic device 1400 to perform the method for blockchain for the first node described above.
The present disclosure also provides an electronic device, including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method for blockchain for nodes in the second blockchain network provided by the present disclosure.
Fig. 15 is a block diagram of an electronic device 1500, according to an example embodiment. As shown in fig. 15, the electronic device 1500 may include: a processor 1501, a memory 1502. The electronic device 1500 may also include one or more of a multimedia component 1503, an input/output (I/O) interface 1504, and a communication component 1505.
Wherein the processor 1501 is configured to control the overall operation of the electronic device 1500 to perform all or part of the steps in the method for blockchains described above for nodes in the second blockchain network. The memory 1502 is used to store various types of data to support operation at the electronic device 1500, which may include, for example, instructions for any application or method operating on the electronic device 1500, as well as application-related data, such as messages, pictures, audio, video, block data, certificates, and the like. The Memory 1502 may be implemented by any type or combination of volatile or non-volatile Memory devices, such as static random access Memory (Static Random Access Memory, SRAM for short), electrically erasable programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM for short), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM for short), programmable Read-Only Memory (Programmable Read-Only Memory, PROM for short), read-Only Memory (ROM for short), magnetic Memory, flash Memory, magnetic disk, or optical disk. The multimedia component 1503 may include a screen and an audio component. Wherein the screen may be, for example, a touch screen, the audio component being for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signals may be further stored in the memory 1502 or transmitted through the communication component 1505. The audio assembly further comprises at least one speaker for outputting audio signals. The I/O interface 1504 provides an interface between the processor 1501 and other interface modules, which may be a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 1505 is used for wired or wireless communication between the electronic device 1500 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, near Field Communication (NFC) for short, 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or one or a combination of more of them, is not limited herein. The corresponding communication component 1505 may thus comprise: wi-Fi module, bluetooth module, NFC module, etc.
In an exemplary embodiment, the electronic device 1500 may be implemented by one or more Application-specific integrated circuits (ASICs), digital signal processors (DIGITAL SIGNAL processors, DSPs), digital signal processing devices (DIGITAL SIGNAL Processing Device, DSPDs), programmable logic devices (Programmable Logic Device, PLDs), field programmable gate arrays (Field Programmable GATE ARRAY, FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the above-described methods for blockchains for nodes in a second blockchain network.
In another exemplary embodiment, a computer readable storage medium is also provided comprising program instructions which, when executed by a processor, implement the steps of the method for blockchains for a node in a second blockchain network as described above. For example, the computer readable storage medium may be the memory 1502 including program instructions described above that are executable by the processor 1501 of the electronic device 1500 to perform the method for blockchain for nodes in the second blockchain network described above.
In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-described method for a first node for a blockchain when executed by the programmable apparatus.
In another exemplary embodiment, a computer program product is also provided, the computer program product comprising a computer program executable by a programmable apparatus, the computer program having code portions for performing the above-described method for blockchain for a node in a second blockchain network when executed by the programmable apparatus.
The preferred embodiments of the present disclosure have been described in detail above with reference to the accompanying drawings, but the present disclosure is not limited to the specific details of the embodiments described above, and various simple modifications may be made to the technical solutions of the present disclosure within the scope of the technical concept of the present disclosure, and all the simple modifications belong to the protection scope of the present disclosure.
In addition, the specific features described in the foregoing embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, the present disclosure does not further describe various possible combinations.
Moreover, any combination between the various embodiments of the present disclosure is possible as long as it does not depart from the spirit of the present disclosure, which should also be construed as the disclosure of the present disclosure.
Claims (17)
1. A method for blockchain, characterized by being applied to a first node that is a node in a node intersection of a node in a first blockchain network and a node in a second blockchain network, the first node running a smart contract device that is systematically isolated from the first node, the method comprising:
the first node performs the following operations by the smart contract device:
Transmitting a configuration information backup request to a second node in the second blockchain network, wherein the configuration information backup request comprises an encryption configuration information set and hash values of configuration information of target nodes, the target nodes comprise each node in the node intersection, and the encryption configuration information set comprises encryption configuration information obtained by encrypting the configuration information of each target node;
And in response to receiving a configuration information backup success notification message sent by the second node, determining that the configuration information backup is successful, wherein the backup success notification message is generated after the second node successfully saves the hash value of the configuration information of the encrypted configuration information set and the configuration information of each target node in the second blockchain network.
2. The method of claim 1, wherein the operations further comprise:
Acquiring configuration information of each target node;
Generating an encryption key corresponding to each of the target nodes;
encrypting the configuration information of each target node through an encryption key corresponding to the target node to obtain the encryption configuration information of the target node;
Performing key confusion on each encryption key to generate a confusion key corresponding to each target node;
And sending each confusion key to a target node corresponding to the confusion key.
3. The method of claim 2, wherein said performing key obfuscation on each of said encryption keys to generate an obfuscated key corresponding to each of said target nodes comprises:
dividing each encryption key into a target number of key segments, wherein the target number is the number of target nodes;
The obfuscation key is generated by the following formula:
I={(i,1),(i+1,2),…,(n,n-i+1),…(n-i,n-1),(n-i+1,n)}
Wherein I is a confusion key of the ith target node, the confusion key I includes n key segments, n is the number of the target nodes, (I, x) is an xth key segment obtained by dividing an encryption key of the ith target node, I e [1, n ], x e [1, n ], I and x are positive integers.
4. The method of claim 1, wherein the operations further comprise:
transmitting a configuration information recovery request to a third node in the second blockchain network;
receiving the encryption configuration information set and hash values of the configuration information sent by the third node;
Obtaining a confusion secret key of each target node, wherein the confusion secret key is generated by carrying out secret key confusion on an encryption secret key corresponding to each target node, and the encryption secret key is a secret key used for encrypting configuration information corresponding to the target node;
Determining an encryption key for each of the target nodes based on each of the confusion keys;
Decrypting the encrypted configuration information set through each encryption key to obtain configuration information of each target node;
verifying each piece of configuration information obtained through decryption through the hash value;
And recovering the node configuration of each target node based on each configuration information when the verification is successful.
5. The method according to any one of claims 1-4, further comprising:
determining that the first node is a full node in the first blockchain network, the full node being a node in the first blockchain network that stores full amount of blockchain data;
Sending a block header backup request to a fourth node in the second blockchain network, wherein the block header backup request comprises block header information of a first blockchain stored by the first node;
Determining that the block header information of the first block chain is successfully backed up in response to receiving a backup success notification message sent by the fourth node, wherein the backup success notification message is generated by the fourth node after the block header information is successfully stored in the second block chain network;
and backing up the block data corresponding to the first block chain to a target storage space.
6. The method as recited in claim 5, further comprising:
Sending a backup recovery request to a fifth node in a second blockchain network, wherein the backup recovery request comprises the identity information of the first node;
receiving block header information sent by the fifth node;
restoring the first blockchain according to the blockhead information and the blockdata corresponding to the target storage space;
The first blockchain is broadcast to other nodes in the node intersection.
7. The method of claim 5, wherein prior to sending the blockhead backup request to a fourth node in the second blockchain network, the method further comprises:
Initiating a transaction blocking event in the first blockchain network;
And writing backup record information in the first blockchain.
8. A method for a blockchain, for application to a node in a second blockchain network, the method comprising:
Receiving a configuration information backup request sent by an intelligent contract device in a first node, wherein 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 configuration information backup request comprises an encryption configuration information set and a hash value of configuration information of a target node, the encryption configuration information set comprises encryption configuration information obtained by encrypting the configuration information of the target node, the target node comprises each node in the node intersection, and the intelligent contract device is systematically isolated from the first node;
storing the hash value of the encrypted configuration information set and the configuration information of the target node in the second blockchain network;
and sending a configuration information backup success notification message to the first node.
9. The method as recited in claim 8, further comprising:
receiving a configuration information recovery request sent by an intelligent contract device in the first node;
and sending the hash value of the encryption configuration information set and the configuration information of the target node to the intelligent contract device.
10. The method according to claim 8 or 9, characterized in that the method further comprises:
Receiving a block header backup request sent by the first node, wherein the block header backup request comprises block header information of a first block chain corresponding to the first block chain network;
checking the block header information;
when the verification is successful, the block header information is stored in the second block chain network;
and sending a backup success notification message to the first node.
11. The method as recited in claim 10, further comprising:
Receiving a backup recovery request sent by the first node;
verifying the identity information of the first node in the backup recovery request;
and when the verification is successful, the block header information is sent to the first node.
12. An apparatus for a blockchain, characterized by being applied to a first node that is a node in an intersection of nodes in a first blockchain network and nodes in a second blockchain network, the apparatus being systematically isolated from the first node, the apparatus comprising:
a first sending module, configured to send a configuration information backup request to a second node in the second blockchain network, where the configuration information backup request includes an encrypted configuration information set and a hash value of configuration information of a target node, where 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 target node;
And the first determining module is used for determining that the configuration information backup is successful in response to receiving a configuration information backup success notification message sent by the second node, wherein the configuration information backup success notification message is generated after the second node successfully saves the hash values of the configuration information of the encrypted configuration information set and the configuration information of each target node in the second blockchain network.
13. An apparatus for a blockchain, for use with a node in a second blockchain network, the apparatus comprising:
The first receiving module is used for receiving a configuration information backup request sent by an intelligent contract device in a first node, wherein the first node is a node in 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 configuration information backup request comprises an encryption configuration information set and a hash value of configuration information of a target node, the encryption configuration information set comprises encryption configuration information obtained by encrypting the configuration information of the target node, the target node comprises each node in the node intersection, and the intelligent contract device is systematically isolated from the first node;
The first storage module is used for storing the encryption configuration information set and the hash value of the configuration information of the target node in the second blockchain network;
And the second sending module is used for sending a configuration information backup success notification message to the first node.
14. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any one of claims 1-7.
15. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the steps of the method according to any of claims 8-11.
16. An electronic device, comprising:
a memory having a computer program stored thereon;
A processor for executing the computer program in the memory to implement the steps of the method of any one of claims 1-7.
17. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 8-11.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011595380.XA CN112631836B (en) | 2020-12-29 | 2020-12-29 | Method, device, storage medium and electronic equipment for blockchain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011595380.XA CN112631836B (en) | 2020-12-29 | 2020-12-29 | Method, device, storage medium and electronic equipment for blockchain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112631836A CN112631836A (en) | 2021-04-09 |
CN112631836B true CN112631836B (en) | 2024-10-25 |
Family
ID=75286136
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011595380.XA Active CN112631836B (en) | 2020-12-29 | 2020-12-29 | Method, device, storage medium and electronic equipment for blockchain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112631836B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113438205B (en) * | 2021-05-31 | 2022-12-20 | 东软集团股份有限公司 | Block chain data access control method, node and system |
GB2622523A (en) * | 2021-06-10 | 2024-03-20 | Amaroo Com Holdings Pty Ltd | System and method for decentralised, scalable, and secure consensus between cooperating blockchain systems |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112596957A (en) * | 2020-12-29 | 2021-04-02 | 东软集团股份有限公司 | Method and device for block chain, storage medium and electronic equipment |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107819749A (en) * | 2017-10-26 | 2018-03-20 | 平安科技(深圳)有限公司 | Block catenary system and transaction data processing method based on ether mill |
KR102149747B1 (en) * | 2018-02-22 | 2020-08-31 | 김우섭 | Block chain based social network service system and method |
US10992458B2 (en) * | 2019-01-16 | 2021-04-27 | EMC IP Holding Company LLC | Blockchain technology for data integrity regulation and proof of existence in data protection systems |
CN109995850B (en) * | 2019-03-05 | 2022-04-26 | 深圳前海微众银行股份有限公司 | Block chain system and transaction processing method thereof |
US11422981B2 (en) * | 2019-04-09 | 2022-08-23 | International Business Machines Corporation | Information management and access control in a database |
CN110351133B (en) * | 2019-06-28 | 2021-09-17 | 创新先进技术有限公司 | Method and device for main node switching processing in block chain system |
CN112100144A (en) * | 2020-08-20 | 2020-12-18 | 东软集团股份有限公司 | Block chain file sharing method and device, storage medium and electronic equipment |
-
2020
- 2020-12-29 CN CN202011595380.XA patent/CN112631836B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112596957A (en) * | 2020-12-29 | 2021-04-02 | 东软集团股份有限公司 | Method and device for block chain, storage medium and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN112631836A (en) | 2021-04-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109194466B (en) | A blockchain-based cloud data integrity detection method and system | |
TWI698767B (en) | Blockchain-based transaction consensus processing method and device, and electronic equipment | |
CN110169015B (en) | Reach consensus among network nodes in a distributed system | |
CN111159306B (en) | Information publishing method and device based on block chain and computer equipment | |
CN110784463B (en) | A blockchain-based file storage and access method | |
US20210028931A1 (en) | Secure distributed key management system | |
CN108768647B (en) | Random number generation method for block chain | |
CN114499866B (en) | Key hierarchical management method and device for federal learning and privacy calculation | |
CN112631836B (en) | Method, device, storage medium and electronic equipment for blockchain | |
CN114499875A (en) | Service data processing method and device, computer equipment and storage medium | |
CN114503506A (en) | A blockchain system that supports changes to plaintext data contained in transactions | |
CN112685786A (en) | Financial data encryption and decryption method, system, equipment and storage medium | |
CN112907375A (en) | Data processing method, data processing device, computer equipment and storage medium | |
CN110912892B (en) | Certificate management method and device, electronic equipment and storage medium | |
CN111628863A (en) | Data signature method and device, electronic equipment and storage medium | |
CN112596957B (en) | Method, device, storage medium and electronic device for blockchain | |
CN111080300A (en) | Asset transfer method and device based on block chain and hardware equipment | |
US20240097905A1 (en) | Values exclusions | |
CN117294484A (en) | Method, apparatus, device, medium and product for data interaction | |
CN110852887A (en) | Method and device for acquiring transaction processing state in decentralized application cluster | |
CN116032499A (en) | Distributed cloud file storage method and system, user terminal and cloud device thereof | |
JP7535823B1 (en) | Biometric secret sharing system | |
CN115297125B (en) | Business data processing method, device, computer equipment and readable storage medium | |
CN118741518B (en) | Intelligent vehicle data information trusted verification method and device based on trusted computing | |
CN101470643B (en) | Fixed hardware security unit backup and recovery method and system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |