CN110719322B - Data cross storage method based on block chain cross-chain - Google Patents

Data cross storage method based on block chain cross-chain Download PDF

Info

Publication number
CN110719322B
CN110719322B CN201910908631.6A CN201910908631A CN110719322B CN 110719322 B CN110719322 B CN 110719322B CN 201910908631 A CN201910908631 A CN 201910908631A CN 110719322 B CN110719322 B CN 110719322B
Authority
CN
China
Prior art keywords
block
chain
added
select
chunk
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910908631.6A
Other languages
Chinese (zh)
Other versions
CN110719322A (en
Inventor
信俊昌
姚钟铭
郝琨
王之琼
蒋忠中
范子嘉
罗艺栖
李云飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Northeastern University China
Original Assignee
Northeastern University China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Northeastern University China filed Critical Northeastern University China
Priority to CN201910908631.6A priority Critical patent/CN110719322B/en
Publication of CN110719322A publication Critical patent/CN110719322A/en
Application granted granted Critical
Publication of CN110719322B publication Critical patent/CN110719322B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]

Abstract

The invention relates to the technical field of computer block chains, in particular to a data cross storage method based on block chain cross-chain. Step 1: establishing n block chains, adding blocks into the block chains based on a PBFT consensus mechanism, executing the steps 2 to 5 if the block chains are added to the blocks triggering the transfer block condition, and continuing to add the blocks if the block chains are not added to the blocks triggering the transfer block condition; step 2: selecting a block chain added to a block triggering the transfer block condition as an original chain, and marking the block as a transition block; and step 3: selecting a select chain from a non-original chain set; and 4, step 4: adding a complete transition block in the select chain; and 5: the blockhead is added to blockchains in the original chain and the set of pathway blockchains S. The invention can effectively ensure the safety and the integrity of the block chain and save the memory occupied during the operation.

Description

Data cross storage method based on block chain cross-chain
Technical Field
The invention relates to the technical field of computer block chains, in particular to a data cross storage method based on block chain cross-chain.
Background
The block chain technology is a distributed classified book which is maintained in the same global state by multiple parties which are not mutually trusted, has the advantages of decentralization, redundant storage, tamper resistance, traceability and the like, and mainly relates to related algorithms such as a chain structure, a consensus mechanism, asymmetric encryption and the like. People who are not mutually trusted can share data through the blockchain technology without the intervention of a third party. Therefore, the blockchain has important applications in finance, economy and science and technology.
The blockchain is a chain structure with a block as a unit, and in general, the data structure of the blockchain is as shown in fig. 1. Each block consists of a block head and a block body, wherein the block head stores fields such as Version, Target _ bits, Nonce, TimeStamp, PrevBlockHash and Merkle Root, and the block body stores Data stored by the block. Version refers to Version number and is used for marking transaction Version; target _ bits refers to a difficulty Target, which is a difficulty value for generating the block; nonce is a random number, which is a value for making the hash of the block head smaller than the difficulty target; TimeStamp refers to a TimeStamp and records the approximate time that the block was generated. PrevBlockHash refers to the hash of a previous block, the hash of the previous block is stored, and all blocks are connected together through the hash of the previous block according to a generation sequence, so that the change of the hash of all the following blocks can be influenced when any block in a block chain is modified, and the safety of the block chain can be ensured. The Merkle Root is a Merkle tree Root, the Merkle tree is a binary Ha coefficient, the leaf nodes are stored data, all child node values are connected and then subjected to Hash operation to obtain a parent node, and finally the Root node can be calculated. Any data in the block is changed, the root of the Merkle tree is changed, and the integrity of the data in the block can be ensured.
The consensus mechanism is also an important element in blockchain technology. The public chain applies the POW mechanism and the private and federation chains apply the PBFT algorithm. PBFT can tolerate malicious nodes not exceeding 1/3 for the full network node number. The method for adding information in the block chain by the PBFT algorithm is as follows:
(1) selecting a main node responsible for generating a new block from all nodes;
(2) all nodes broadcast information to be added, and the main nodes pack the information into blocks after collection and then broadcast the information in the whole network;
(3) after each node receives the block, calculating the Hash value of the new block, and then broadcasting the Hash value to the whole network;
(4) if one node receives the 2c (c is the tolerable malicious node number) strip and the same abstract as the node, broadcasting a commit message to the whole network;
(5) if a node receives 2c +1 commit messages, a new block can be added to the blockchain.
In the existing data storage method based on the block chain, data storage is based on a single block chain, and when a malicious node wants to tamper with data of the block chain, the safety and integrity of the block chain are difficult to guarantee by the existing method.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a data cross storage method based on block chain cross-chain, which can effectively ensure the safety and the integrity of the block chain and save the occupied memory during the operation.
The technical scheme of the invention is as follows:
a data cross storage method based on block chain cross-linking is characterized by comprising the following steps:
step 1: establishing n block chains, adding blocks into the block chains based on a PBFT consensus mechanism, and if any block chain is added to the block triggering the transfer block condition, executing the steps 2 to 5; if no block chain is added to the block triggering the transfer block condition, continuing to add the block to the block chain based on the PBFT consensus mechanism;
step 2: selecting a block chain added to a block triggering transfer block condition as an original chain, marking the block triggering the transfer block condition to which the original chain is added as a transition block, and forming a non-original chain set by n-1 block chains except the original chain;
and step 3: selecting a block chain for an origi chain transfer transition block from a non-origi chain set to be marked as a select chain;
step 3.1: initializing K to be 1, wherein the path block chain set S is an empty set, and K is the total number of block chains in the unorginal chain set;
step 3.2: randomly selecting a block chain which does not belong to the path block chain set S from the unorganic chain set by using a random function and marking the block chain as SkConnecting the block chain skAdding into the route blockchain set S;
step 3.3: if block chain skIf the block is added to the block triggering the transfer block condition, step 3.4 is performed; if block chain skNot added to the block triggering the transfer block condition, the chain of blocks s is then formedkAs select chain, block chain skRemoving from the path block chain set S, and entering step 4;
step 3.4: if K is equal to K, the block chain s is divided into two blockskAs select chain, block chain skRemoving from the path block chain set S; if k is<K, making K equal to K +1, and returning to the step 3.2;
and 4, step 4: adding a complete transition block in the select chain;
step 4.1: adding a transition block in a select chain, and recording the hash of the transition block in the previous block of the select chain by using a PrevBlockHash field in the block header of the transition block added by the select chain;
step 4.2: additionally adding a ConnectBlockHash field in a transition block added by a select chain, and recording the hash of the transition block in the prior block of the original chain by using the ConnectBlockHash field;
and 5: adding a block header to the block chains in the original chain and the path block chain set S; the block header comprises a PrevBlockHash field, a NextBlockHash field, a Translocation field and a Merkle Root field;
the PrevBlockHash field of the block header added in the block chain is used for recording the block hash of the block header before the block chain; the Merkle Root field is used for recording a Merkle tree Root of the transition block, and the Merkle tree Root is a data summary of the transition block;
if the path block chain set is an empty set, a NextBlockHash field of a block header added by an original chain is used for recording the Hash of a transition block added by a select chain at a previous block of the select chain, and a Translocation field of the block header added by the original chain is used for recording the position information < ChainID, Height > of the transition block added by the select chain; wherein, ChainID is ID of select chain, and Height is position of transition block added by select chain on select chain;
if the set of path blockchains is not empty, the set of path blockchains S ═ S is recorded1,...,sr,...,sR},srFor the R-th blockchain in the set S of path blockchains, R belongs to { 1., R }, R is the total number of blockchains in the set S of path blockchains, and S is the blockchainrLocation information of added block headerInformation is<ChainIDr,Heightr>,ChainIDrFor a chain of blocks srID, Height ofrFor a chain of blocks srAdded chunk headers in a chunk chain srIn the above-mentioned position(s),
the NextBlockHash field of the headblock for original chain addition is used to record the blockchain s1Added chunk headers in a chunk chain s1The chunk-before-hash of (1), the Translocation field of the chunk header added by original chain, is used to record the chunk chain s1Location information of added block header<ChainID1,Height1>,
If R is 1, blockchain s1The NextBlockHash field of the added chunk header is used for recording the hash of the transition chunk added by the select chain on the previous chunk of the select chain, chunk chain s1The Translocation field of the added block header is used for recording the position information of the transition block added by the select chain<ChainID,Height>,
If R is>1, block chain siThe NextBlockHash field of the chunk header added by i ∈ { 1., R-1} is used to record the chunk chain si+1Added chunk headers in a chunk chain si+1Previous block hash, blockchain siThe Translocation field of the added chunk header is used to record the chunk chain si+1Location information of added block header<ChainIDi+1,Heighti+1>Block chains sRThe NextBlockHash field of the added chunk header is used for recording the hash of the transition chunk added by the select chain on the previous chunk of the select chain, chunk chain sRThe Translocation field of the added block header is used for recording the position information of the transition block added by the select chain<ChainID,Height>。
In the step 1, the transfer block condition is a fixed step length condition or an indefinite step length condition; when the transfer block condition is a fixed step condition, if a block chain is added to the 2 m-th block (m is 1,2,3, … …), then the 2 m-th block triggers the transfer block condition; if the blockchain is added to the 2 nd block when the transfer block condition is an indeterminate step conditionmBlock (m is 1,2,3, … …), then the 2 nd blockmThe block triggers the transfer block condition.
After the select chain is selected in step 3, if there is a new block to be added in the select chain, it is necessary to wait for the transition block to be added in the select chain in step 4, and then continue to add the new block.
The invention has the beneficial effects that:
(1) the invention uses a plurality of block chains to store data in a cross-chain manner, randomly links the blocks triggering the transfer block condition in the block chains to other block chains, and records the information of the involved chains in the passing chains, if a malicious node wants to tamper the data of any one block chain, the content of a plurality of block chains mutually associated with the malicious node needs to be changed, which has huge workload for the malicious node and can effectively ensure the safety and the integrity of the block chains.
(2) The invention uses the block head to replace the complete block, can save the occupied memory during the operation and can prevent the block chain from being too large as a whole.
Drawings
FIG. 1 is a diagram illustrating a data structure of a general blockchain;
FIG. 2 is a flow chart of a block chain-based inter-chain data interleaving method according to the present invention;
fig. 3 is a schematic process diagram of performing data interleaving storage by using the block chain cross-chain based data interleaving storage method according to the first embodiment of the present invention;
fig. 4 is a schematic process diagram of performing data interleaving storage by using the block chain cross-chain based data interleaving storage method according to the second embodiment of the present invention;
fig. 5 is a schematic process diagram of performing data interleaving storage by using the block chain-crossing-based data interleaving storage method according to the third embodiment of the present invention.
Detailed Description
The invention will be further described with reference to the accompanying drawings and specific embodiments.
Example one
As shown in fig. 2, the data interleaving storage method based on block chain cross-chain of the present invention includes the following steps:
step 1: establishing n block chains, adding blocks into the block chains based on a PBFT consensus mechanism, and if any block chain is added to the block triggering the transfer block condition, executing the steps 2 to 5; if no blockchain is added to the block triggering the transfer blockchain condition, the block is continuously added to the blockchain based on the PBFT consensus mechanism.
Wherein, the transfer block condition is a fixed step length condition or an indefinite step length condition; when the transfer block condition is a fixed step condition, if a block chain is added to the 2 m-th block (m is 1,2,3, … …), then the 2 m-th block triggers the transfer block condition; if the blockchain is added to the 2 nd block when the transfer block condition is an indeterminate step conditionmBlock (m is 1,2,3, … …), then the 2 nd blockmThe block triggers the transfer block condition. Two different step sizes have different characteristics: the fixed step length is adopted, the crossing of each chain is gradually increased along with the increase of the blocks, the crossing frequency is kept unchanged, and the crossing of a plurality of block chains ensures the increase of a stable state; with variable step size, the crossing of chains increases as the block grows, but the crossing frequency changes, for example, when 2 nd is usedmWhen a block (m is 1,2,3, … …) is transferred, the crossing frequency decreases as the number of blocks increases, but the query time for querying the block chain is saved. Therefore, the master node can adjust the crossing frequency by setting different trigger conditions according to the actual situation of the own chain, and the balance is between the safety of the block chain and the query speed. Different chains may select different trigger conditions.
In the first embodiment, as shown in fig. 3, 10 block chains are established, which are numbered { a, B, C, D, E, F, G, H, I, J }, and blocks are added to the block chains based on the PBFT consensus mechanism. The transfer block condition of all block chains adopts an indefinite step size condition, namely when the block chain is added to the 2 nd block chainmBlock (m is 1,2,3, … …), the 2 nd blockmThe block triggers the transfer block condition, and the block triggering the transfer block condition needs to be transferred.
Step 2: selecting a block chain added to the block triggering the transfer block condition as an original chain, marking the block triggering the transfer block condition to which the original chain is added as a transition block, and forming a non-original chain set by n-1 block chains except the original chain.
In the first embodiment, the blockchain a is added to the 2 nd block, the 2 nd block triggers the transfer block condition, the blockchain a is referred to as an original chain, the 2 nd block is referred to as a transition block, and 9 blockchains except the blockchain a constitute the unorganic chain set.
And step 3: selecting a block chain for an origi chain transfer transition block from a non-origi chain set to be marked as a select chain;
step 3.1: initializing K to be 1, wherein the path block chain set S is an empty set, and K is the total number of block chains in the unorginal chain set;
step 3.2: randomly selecting a block chain which does not belong to the path block chain set S from the unorganic chain set by using a random function and marking the block chain as SkConnecting the block chain skAdding into the route blockchain set S;
step 3.3: if block chain skIf the block is added to the block triggering the transfer block condition, step 3.4 is performed; if block chain skNot added to the block triggering the transfer block condition, the chain of blocks s is then formedkAs select chain, block chain skRemoving from the path block chain set S, and entering step 4;
step 3.4: if K is equal to K, the block chain s is divided into two blockskAs select chain, block chain skRemoving from the path block chain set S; if k is<K, let K be K +1, return to step 3.2.
In the first embodiment, a random function srand () is used to randomly select a block chain B, the block chain B is added to the 5 th block, and the block chain B is not added to the block triggering the transfer block condition, and the transfer block may be connected to the block chain B, so that the block chain B is used as a select chain, and the obtained path block chain set S is an empty set.
And 4, step 4: adding a complete transition block in the select chain;
step 4.1: adding a transition block in a select chain, and recording the hash of the transition block in the previous block of the select chain by using a PrevBlockHash field in the block header of the transition block added by the select chain;
step 4.2: additionally adding a ConnectBlockHash field in the transition block added by the select chain, and recording the hash of the transition block in the prior block of the original chain by using the ConnectBlockHash field.
After the select chain is selected in step 3, if there is a new block to be added in the select chain, the new block needs to be added after the transition block is added in the select chain in step 4.
As shown in fig. 3, the transition block includes a connectitblockhash field in addition to fields in the general block data structure. In calculating the select chain Hash, the ConnectBlockHash field is included in addition to PrevBlockHash, Merkle Tree root, etc.
And 5: adding a block header to the block chains in the original chain and the path block chain set S; the block header comprises a PrevBlockHash field, a NextBlockHash field, a Translocation field and a Merkle Root field;
the PrevBlockHash field of the block header added in the block chain is used for recording the block hash of the block header before the block chain; the Merkle Root field is used for recording a Merkle tree Root of the transition block, and the Merkle tree Root is a data summary of the transition block;
if the path block chain set is an empty set, a NextBlockHash field of a block header added by an original chain is used for recording the Hash of a transition block added by a select chain at a previous block of the select chain, and a Translocation field of the block header added by the original chain is used for recording the position information < ChainID, Height > of the transition block added by the select chain; wherein, ChainID is ID of select chain, and Height is position of transition block added by select chain on select chain;
if the set of path blockchains is not empty, the set of path blockchains S ═ S is recorded1,...,sr,...,sR},srFor the R-th blockchain in the set S of path blockchains, R belongs to { 1., R }, R is the total number of blockchains in the set S of path blockchains, and S is the blockchainrThe added location information of the block header is<ChainIDr,Heightr>,ChainIDrFor a chain of blocks srID, Height ofrFor a chain of blocks srAdded chunk headers in a chunk chain srIn the above-mentioned position(s),
the NextBlockHash field of the headblock for original chain addition is used to record the blockchain s1Added chunk headers in a chunk chain s1The chunk-before-hash of (1), the Translocation field of the chunk header added by original chain, is used to record the chunk chain s1Location information of added block header<ChainID1,Height1>,
If R is 1, blockchain s1The NextBlockHash field of the added chunk header is used for recording the hash of the transition chunk added by the select chain on the previous chunk of the select chain, chunk chain s1The Translocation field of the added block header is used for recording the position information of the transition block added by the select chain<ChainID,Height>,
If R is>1, block chain siThe NextBlockHash field of the chunk header added by i ∈ { 1., R-1} is used to record the chunk chain si+1Added chunk headers in a chunk chain si+1Previous block hash, blockchain siThe Translocation field of the added chunk header is used to record the chunk chain si+1Location information of added block header<ChainIDi+1,Heighti+1>Block chains sRThe NextBlockHash field of the added chunk header is used for recording the hash of the transition chunk added by the select chain on the previous chunk of the select chain, chunk chain sRThe Translocation field of the added block header is used for recording the position information of the transition block added by the select chain<ChainID,Height>。
In the first embodiment, the set of path blockchains is an empty set, a complete transition block is added to the blockchain B, and a blockhead is added to the blockchain a. The method comprises the steps of recording the hash of a transition block in the previous block of the blockchain B by using a PrevBlockHash field in the block header of the transition block added by the blockchain B, additionally adding a ConnectBlockHash field in the transition block added by the blockchain B, and recording the hash of the transition block in the previous block of the blockchain A by using the ConnectBlockHash field. The NextBlockHash field of the block header added by the block chain a is used for recording the hash of the transition block added by the block chain B on the previous block of the block chain B, the TransLocation field of the block header added by the block chain a is used for recording the position information < ChainID, Height > of the transition block added by the block chain B, the ChainID is the ID of the block chain B, and the Height is the position of the transition block added by the block chain B on the block chain B.
From the above, the present invention uses multiple block chains to store data across chains, randomly links the block triggering the transfer block condition in the block chain to other block chains, and records the information of the participating chains in the passing chain. The main node performs operations related to transferring blocks. When the original chain data is modified, the Hash values of original, select chain and block chain of the intermediate path are changed; modifying the contents of select chains also results in changes to the Hash values of these chains. Because n chains are shared, if a malicious node wants to tamper with data of any one blockchain, the content of several blockchains associated with the malicious node needs to be changed, which is a huge workload for the malicious node, and therefore, the security and integrity of the n blockchains can be effectively guaranteed.
Example two
The second embodiment is different from the first embodiment in that:
as shown in fig. 4, the block chain a is added to the 4 th block, and the 4 th block triggers a transfer block condition, which is denoted as a transfer block. Randomly selected to blockchain C, blockchain C added to blockchain 2, when a transition block of blockchain a is connected to blockchain C, this block is also a transition block for blockchain C. At this time, for the block chain C, an appropriate block chain is also selected to migrate the block, and the block chain D is selected by random selection. And inquiring a block chain D, wherein the block chain D is connected to the 5 th block, the block chain D is not added to the block triggering the transfer block condition, the transfer block of the block chain A can be connected to the block chain D through the block chain C, so that the block chain D is used as a select chain, and the obtained path block chain set S is { C }.
At this time, a complete transition block is added to the blockchain D, and a blockhead is added to both the blockchain a and the blockchain C.
The method comprises the steps of recording the hash of a transition block in the previous block of a blockchain D by using a PrevBlockHash field in the block header of the transition block added by the blockchain D, additionally adding a ConnectBlockHash field in the transition block added by the blockchain D, and recording the hash of the transition block in the previous block of the blockchain A by using the ConnectBlockHash field.
The NextBlockHash field of the block head added by the block chain A is used for recording the block head added by the block chain C in the previous block Hash of the block chain C, and the Translocation field of the block head added by the block chain A is used for recording the position information of the block head added by the block chain C<ChainID1,Height1>,ChainID1Is ID, Height, of blockchain C1The position on blockchain C of the added blockhead for blockchain C.
The NextBlockHash field of the block header added by the block chain C is used for recording the hash of the transition block added by the block chain D on the previous block of the block chain D, the TransLocation field of the block header added by the block chain C is used for recording the position information < ChainID, Height > of the transition block added by the block chain D, the ChainID is the ID of the block chain D, and the Height is the position of the transition block added by the block chain D on the block chain D.
EXAMPLE III
The third embodiment is different from the second embodiment in that:
as shown in fig. 5, the block chain a is added to the 8 th block, and the 8 th block triggers a transfer block condition, which is denoted as a transfer block. Randomly selected to blockchain E, added to 2 ndmAnd block, and continuously selecting a block chain. After randomly selecting all block chains (in the order of E->F->D->B->I->G->C->J->H) All blockchains are found to be just connected to 2 ndmThe block blocks and the transition blocks of the block chain A can be connected to the block chain H selected at last through 8 block chains of the path, so that the block chain H is used as a select chain to obtain a path block chain set S ═ E, F, D, B, I, G, C and J }.
At this point, a complete transition block is added to blockchain H, and a blockhead is added to both blockchain a and blockchain E, F, D, B, I, G, C, J.
The method comprises the steps of recording the hash of a transition block in the previous block of a blockchain H by using a PrevBlockHash field in the block header of the transition block added by the blockchain H, additionally adding a ConnectBlockHash field in the transition block added by the blockchain H, and recording the hash of the transition block in the previous block of the blockchain A by using the ConnectBlockHash field.
The NextBlockHash field of the block header added by the block chain A is used for recording the block hash of the block header added by the block chain E before the block chain E, and the Translocation field of the block header added by the block chain A is used for recording the position information of the block header added by the block chain E<ChainID1,Height1>,ChainID1Is ID, Height of blockchain E1The location of the added chunk header for chunk chain E on chunk chain E.
The NextBlockHash field of the block header added by the block chain E is used for recording the block hash of the block header added by the block chain F at the front block of the block chain F, and the Translocation field of the block header added by the block chain E is used for recording the position information of the block header added by the block chain F<ChainID2,Height2>,ChainID2Is ID, Height, of blockchain F2The position on the blockchain F of the added blockhead for the blockchain F. The block head added to the block chain F records the position information of the block head added to the block chain D, the block head added to the block chain D records the position information of the block head added to the block chain B, and so on, and the block head added to the block chain C records the position information of the block head added to the block chain J.
The NextBlockHash field of the block header added by the block chain J is used for recording the hash of the transition block added by the block chain H on the previous block of the block chain H, the TransLocation field of the block header added by the block chain J is used for recording the position information < ChainID, Height > of the transition block added by the block chain H, the ChainID is the ID of the block chain H, and the Height is the position of the transition block added by the block chain H on the block chain H.
It is to be understood that the above-described embodiments are only a few embodiments of the present invention, and not all embodiments. The above examples are only for explaining the present invention and do not constitute a limitation to the scope of protection of the present invention. All other embodiments, which can be derived by those skilled in the art from the above-described embodiments without any creative effort, namely all modifications, equivalents, improvements and the like made within the spirit and principle of the present application, fall within the protection scope of the present invention claimed.

Claims (3)

1. A data cross storage method based on block chain cross-linking is characterized by comprising the following steps:
step 1: establishing n block chains, adding blocks into the block chains based on a PBFT consensus mechanism, and if any block chain is added to the block triggering the transfer block condition, executing the steps 2 to 5; if no block chain is added to the block triggering the transfer block condition, continuing to add the block to the block chain based on the PBFT consensus mechanism;
step 2: selecting a block chain added to a block triggering transfer block condition as an original chain, marking the block triggering the transfer block condition to which the original chain is added as a transition block, and forming a non-original chain set by n-1 block chains except the original chain;
and step 3: selecting a block chain for an origi chain transfer transition block from a non-origi chain set to be marked as a select chain;
step 3.1: initializing K to be 1, wherein the path block chain set S is an empty set, and K is the total number of block chains in the unorginal chain set;
step 3.2: randomly selecting a block chain which does not belong to the path block chain set S from the unorganic chain set by using a random function and marking the block chain as SkConnecting the block chain skAdding into the route blockchain set S;
step 3.3: if block chain skIf the block is added to the block triggering the transfer block condition, step 3.4 is performed; if block chain skNot added to the block triggering the transfer block condition, the chain of blocks s is then formedkAs select chain, block chain skRemoving from the path block chain set S, and entering step 4;
step 3.4: if K is equal to K, the block chain s is divided into two blockskAs select chain, block chain skRemoving from the path block chain set S; if k is<K, making K equal to K +1, and returning to the step 3.2;
and 4, step 4: adding a complete transition block in the select chain;
step 4.1: adding a transition block in a select chain, and recording the hash of the transition block in the previous block of the select chain by using a PrevBlockHash field in the block header of the transition block added by the select chain;
step 4.2: additionally adding a ConnectBlockHash field in a transition block added by a select chain, and recording the hash of the transition block in the prior block of the original chain by using the ConnectBlockHash field;
and 5: adding a block header to the block chains in the original chain and the path block chain set S; the block header comprises a PrevBlockHash field, a NextBlockHash field, a Translocation field and a Merkle Root field;
the PrevBlockHash field of the block header added in the block chain is used for recording the block hash of the block header before the block chain; the Merkle Root field is used for recording a Merkle tree Root of the transition block, and the Merkle tree Root is a data summary of the transition block;
if the path block chain set is an empty set, a NextBlockHash field of a block header added by an original chain is used for recording the Hash of a transition block added by a select chain at a previous block of the select chain, and a Translocation field of the block header added by the original chain is used for recording the position information < ChainID, Height > of the transition block added by the select chain; wherein, ChainID is ID of select chain, and Height is position of transition block added by select chain on select chain;
if the set of path blockchains is not empty, the set of path blockchains S ═ S is recorded1,...,sr,...,sR},srFor the R-th blockchain in the set S of path blockchains, R belongs to { 1., R }, R is the total number of blockchains in the set S of path blockchains, and S is the blockchainrThe added location information of the block header is<ChainIDr,Heightr>,ChainIDrFor a chain of blocks srID, Height ofrFor a chain of blocks srAdded chunk headers in a chunk chain srIn the above-mentioned position(s),
the NextBlockHash field of the headblock for original chain addition is used to record the blockchain s1Added chunk headers in a chunk chain s1The chunk-before-hash of (1), the Translocation field of the chunk header added by original chain, is used to record the chunk chain s1Location information of added block header<ChainID1,Height1>,
If R is 1, blockchain s1The NextBlockHash field of the added chunk header is used for recording the hash of the transition chunk added by the select chain on the previous chunk of the select chain, chunk chain s1The Translocation field of the added block header is used for recording the position information of the transition block added by the select chain<ChainID,Height>,
If R is>1, block chain siThe NextBlockHash field of the chunk header added by i ∈ { 1., R-1} is used to record the chunk chain si+1Added chunk headers in a chunk chain si+1Previous block hash, blockchain siThe Translocation field of the added chunk header is used to record the chunk chain si+1Location information of added block header<ChainIDi+1,Heighti+1>Block chains sRThe NextBlockHash field of the added chunk header is used for recording the hash of the transition chunk added by the select chain on the previous chunk of the select chain, chunk chain sRThe Translocation field of the added block header is used for recording the position information of the transition block added by the select chain<ChainID,Height>。
2. The method according to claim 1, wherein in step 1, the transfer block condition is a fixed step condition or an indefinite step condition; when the transfer block condition is a fixed step condition, if a block chain is added to the 2 m-th block (m is 1,2,3, … …), then the 2 m-th block triggers the transfer block condition; if the blockchain is added to the 2 nd block when the transfer block condition is an indeterminate step conditionmBlock (m is 1,2,3, … …), then the 2 nd blockmThe block triggers the transfer block condition.
3. The method as claimed in claim 1, wherein after the select chain is selected in step 3, if a new block is ready to be added to the select chain, the method waits for the transition block to be added to the select chain in step 4 before continuing to add the new block.
CN201910908631.6A 2019-09-25 2019-09-25 Data cross storage method based on block chain cross-chain Active CN110719322B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910908631.6A CN110719322B (en) 2019-09-25 2019-09-25 Data cross storage method based on block chain cross-chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910908631.6A CN110719322B (en) 2019-09-25 2019-09-25 Data cross storage method based on block chain cross-chain

Publications (2)

Publication Number Publication Date
CN110719322A CN110719322A (en) 2020-01-21
CN110719322B true CN110719322B (en) 2021-06-22

Family

ID=69210817

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910908631.6A Active CN110719322B (en) 2019-09-25 2019-09-25 Data cross storage method based on block chain cross-chain

Country Status (1)

Country Link
CN (1) CN110719322B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111416808B (en) * 2020-03-13 2021-04-13 财付通支付科技有限公司 Cross-block-chain data mutual storage method, device, equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203344A (en) * 2017-05-31 2017-09-26 郑州云海信息技术有限公司 A kind of date storage method and data-storage system
CN110199307A (en) * 2018-11-16 2019-09-03 阿里巴巴集团控股有限公司 The domain name scheme across chain interaction is carried out in block catenary system
CN110264204A (en) * 2019-06-06 2019-09-20 杭州趣链科技有限公司 A kind of across chain method of commerce of block chain based on intelligent contract sequencing

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190147065A1 (en) * 2017-11-16 2019-05-16 International Business Machines Corporation Method and system for verification of deleted data for blockchains

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203344A (en) * 2017-05-31 2017-09-26 郑州云海信息技术有限公司 A kind of date storage method and data-storage system
CN110199307A (en) * 2018-11-16 2019-09-03 阿里巴巴集团控股有限公司 The domain name scheme across chain interaction is carried out in block catenary system
CN110264204A (en) * 2019-06-06 2019-09-20 杭州趣链科技有限公司 A kind of across chain method of commerce of block chain based on intelligent contract sequencing

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Blockchain-Based Outsourced Storage Schema;KUN HAO,JUNCHANG,ZHIQIONG WANG,KEYAN CAO,G;《IEEE Access》;20190830;全文 *

Also Published As

Publication number Publication date
CN110719322A (en) 2020-01-21

Similar Documents

Publication Publication Date Title
TWI737157B (en) Block chain-based hierarchical storage method and device, and electronic equipment
CN110457319B (en) Block chain state data storage method and device and electronic equipment
TWI732463B (en) Block chain state data recovery method and device, and electronic equipment
TWI740392B (en) Computer-implemented method, non-transitory computer-readable medium and computer-implemented system for synchronizing blockchain state data
WO2021027529A1 (en) Block processing method and device, block consensus method and device and block synchronization method and device
CN109871366B (en) Block chain fragment storage and query method based on erasure codes
CN110647503A (en) Distributed storage method and device
CN110750382B (en) Minimum storage regeneration code coding method and system for improving data repair performance
US20200145222A1 (en) Optimal data storage configuration in a blockchain
CN107844976A (en) A kind of card of depositing based on block chain applies transaction system and method
Dryja Utreexo: A dynamic hash-based accumulator optimized for the Bitcoin UTXO set
CN111090645B (en) Cloud storage-based data transmission method and device and computer equipment
TW202101437A (en) Hierarchical storage method and device based on block chain and electronic equipment
TW202101248A (en) Hierarchical storage method and device based on block chain and electronic equipment
CN112131227A (en) Data query method and device based on alliance chain
WO2020220251A1 (en) Data processing method for blockchain system and block generating method
CN111095210A (en) Storing shared blockchain data based on error correction coding
CN104184812A (en) Multi-point data transmission method based on private cloud
CN110673966B (en) Data interaction method based on block chain up-link down cooperation
CN110691078B (en) Block chain-based data dynamic reliability verification method
CN110719322B (en) Data cross storage method based on block chain cross-chain
CN111935211A (en) Method, equipment and medium for improving main chain performance by adopting side chain based on block chain
CN116628083A (en) Block chain transaction data capacity expansion storage method and system
WO2021144747A1 (en) Transaction verification system and method of operation thereof
CN111258508B (en) Metadata management method in distributed object storage

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