CN106686087A - Blockchain truncation method and distributed node - Google Patents

Blockchain truncation method and distributed node Download PDF

Info

Publication number
CN106686087A
CN106686087A CN201611257553.0A CN201611257553A CN106686087A CN 106686087 A CN106686087 A CN 106686087A CN 201611257553 A CN201611257553 A CN 201611257553A CN 106686087 A CN106686087 A CN 106686087A
Authority
CN
China
Prior art keywords
block chain
block
chain
blocking
distributed node
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.)
Pending
Application number
CN201611257553.0A
Other languages
Chinese (zh)
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.)
Quality chain network technology Chengdu Co., Ltd.
Original Assignee
Pioneer Payments Ltd
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 Pioneer Payments Ltd filed Critical Pioneer Payments Ltd
Priority to CN201611257553.0A priority Critical patent/CN106686087A/en
Publication of CN106686087A publication Critical patent/CN106686087A/en
Pending legal-status Critical Current

Links

Classifications

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

Abstract

The invention provides a blockchain truncation method and a distributed node. The blockchain truncation method is applied to the distributed node and includes: according to an own stored blockchain, judging whether to truncate the blcokchain or not periodically; if yes, jointing all distributed nodes to judge whether truncation of the blockchain is allowed or not; if yes, jointing all of the distributed nodes to select a blockchain truncation position; truncating the blockchain at the blockchain truncation position; storing the blockchain, obtained after blockchain truncation, earlier in generation time and related information of the blockchain earlier in generation time into a set memory. By adoption of the technical scheme, blockchain length is effectively controlled while data integrity is guaranteed, voting availability of all distributed nodes is guaranteed, and a decentration characteristic of the blockchain is protected.

Description

A kind of block chain method for cutting and distributed node
Technical field
The present invention relates to block chain maintenance technology field, more particularly to a kind of block chain method for cutting and distributed node.
Background technology
Block chain technology is one of basic core technology of financial exchange technology of future generation, will adjust and provide in Accounting system Gold plays an important role in terms of carrying down.Block chain has the characteristic of decentralization, i.e., the data in whole block chain are by owning Distributed node safeguards that the data in all distributed nodes in block chain are identical, and all distributed nodes jointly Rights and duties be all impartial, hardware or management organization in the absence of centralization.The decentralization characteristic of block chain is caused Data in block chain can not be distorted unilaterally, improve Information Security.
In block chain technology, each distributed node will be waited with ballot ability after a new block is generated Distributed node to generate new block vote, after this new block is approved, then carry out next new block Generation.As new block is continuously generated, block chain can be more and more long.When a lack of memory capacity for distributed node is holding Receive whole block chain when, this distributed node cannot vote newly-generated block.It is continuous with block chain Growth, has increasing distributed node and loses ballot ability due to that can not accommodate whole block chain, can vote Distributed node can concentrate on the sufficiently large distributed node of a small number of capacity, so as to destroy the decentralization characteristic of block chain, Further influence Information Security.
The content of the invention
Defect and deficiency based on above-mentioned prior art, the present invention propose a kind of block chain method for cutting and distributed section Point, can block the block chain in distributed node, and the block chain that will be cut down is stored, what is guaranteed data integrity The length of block chain is effectively controlled simultaneously, it is ensured that all distributed nodes have ballot ability, protect going for block chain Centralization characteristic.
A kind of block chain method for cutting, is applied to distributed node, and the method includes:
Periodically according to the block chain that itself is stored, judge whether to need to block on the block chain;
When judging to need to block on the block chain, combine all distributed nodes and determine whether the block Chain is blocked;
When judging to allow to block on the block chain, combine all distributed node selections and block the block chain Position;
From at the position for blocking the block chain, the block chain is blocked;
To block what is obtained after the block chain, generation time block chain earlier, and the generation time is more early Block chain relevant information storage to setting memory.
Preferably, the position of the block chain is blocked in the joint all distributed node selections, including:
According to the block chain that itself is stored, the position for blocking the block chain is calculated;
Obtain the position for blocking the block chain that all other distributed node is calculated;
Judge that what is itself be calculated blocks the position of the block chain respectively, and all other distributed node is calculated To the position for blocking the block chain, if can be used;
Obtain all other distributed node position of the block chain that judges that what is itself be calculated block, and it is all its What its distributed node was calculated blocks the position of the block chain, if can be with adopted judged result;
According to itself judged result and the judged result of all other distributed node, institute is blocked from what is itself be calculated State the position of block chain, and in the position for blocking the block chain that is calculated of all other distributed node, select one Position is used as the position for blocking the block chain.
Preferably, it is described to block the block chain from the position for blocking the block chain, including:
At the position for blocking the block chain, pseudo- wound generation block is set;
From between the pseudo- wound generation block and previous block, the block chain is blocked.
Preferably, it is described at the position for blocking the block chain, pseudo- wound generation block is set, including:
At the position for blocking the block chain, a new block is set, as puppet wound generation block;Or, by institute The next block at the position for blocking the block chain is stated, is arranged to pseudo- wound generation block.
Preferably, it is described to block what is obtained after the block chain, generation time block chain earlier, and the life Into the time earlier block chain relevant information storage to setting memory, including:
To block what is obtained after the block chain, the Hash of generation time last block of block chain earlier Value, in storage to data storage block;
By first block of generation time block chain earlier, and the data storage block, storage to number According in memory block chain;
Block what is obtained after the block chain by described, generation time block chain earlier, and the data storage Block chain, memory of the storage to setting.
Preferably, first block by generation time block chain earlier, and the data storage area Block, in storage to data storage block chain, including:
By first block of generation time block chain earlier, and the data storage block, one is generated New block;
By in new block insertion data storage block chain.
A kind of distributed node, including:
First judging unit, for the block chain for periodically being stored according to itself, judges whether to need the block Chain is blocked;
Second judging unit, for when first judging unit judge need the block chain is blocked when, joint institute The formula node of being distributed determines whether to block on the block chain;
Select unit, for when second judging unit judges to allow to block on the block chain, combining the institute It is distributed the position that the block chain is blocked in the selection of formula node;
Processing unit, for from the position for blocking the block chain, the block chain being blocked;
Memory cell, for will block what is obtained after the block chain, generation time block chain earlier, and it is described The generation time earlier block chain relevant information storage to setting memory.
Preferably, the select unit, including:
Computing unit, for according to the block chain for itself storing, being calculated the position for blocking the block chain;
First acquisition unit, for obtaining the position for blocking the block chain that all other distributed node is calculated Put;
3rd judging unit, for the position of the block chain that judges that what is itself be calculated block respectively, and it is all its What its distributed node was calculated blocks the position of the block chain, if can be used;
Second acquisition unit, judges that what is itself be calculated blocks the block for obtaining all other distributed node The position of chain, and the position for blocking the block chain that all other distributed node is calculated, if can be with adopted Judged result;
Decision package, for the judged result according to itself judged result and all other distributed node, from itself meter What is obtained blocks the position of the block chain, and the position for blocking the block chain that all other distributed node is calculated In putting, one position of selection is used as the position for blocking the block chain.
Preferably, the processing unit, including:
Pretreatment unit, at the position for blocking the block chain, setting pseudo- wound generation block;
Cutter chain implementation unit, between the pseudo- wound generation block and previous block, the block chain being blocked.
Preferably, the pretreatment unit when setting pseudo- wound generation block, has at the position for blocking the block chain Body is used for:
At the position for blocking the block chain, a new block is set, as puppet wound generation block;Or, by institute The next block at the position for blocking the block chain is stated, is arranged to pseudo- wound generation block.
Preferably, the memory cell, including:
First memory cell, for will block what is obtained after the block chain, the generation time, block chain was most earlier The latter cryptographic Hash of block, in storage to data storage block;
Second memory cell, for by first block of generation time block chain earlier, and the data Memory block, in storage to data storage block chain;
3rd memory cell, for blocking what is obtained after the block chain by described, generation time block chain earlier, And the data storage block chain, memory of the storage to setting.
Preferably, second memory cell is by first block of generation time block chain earlier, Yi Jisuo Data storage block is stated, when in storage to data storage block chain, specifically for:
By first block of generation time block chain earlier, and the data storage block, one is generated New block;
By in new block insertion data storage block chain.
Block chain method for cutting proposed by the present invention, is applied to distributed node, and distributed node is periodically according to certainly The block chain of body storage, judges whether to need to block on the block chain;When judging to need to block on the block chain, joint All distributed nodes determine whether to block on the block chain;When all distributed nodes judge to allow the block When chain is blocked, combine the position that the block chain is blocked in all distributed node selections;Distributed node is blocked from described At the position of the block chain, the block chain is blocked, and will block what is obtained after the block chain, the generation time is more early Block chain, and the generation time earlier block chain relevant information storage to setting memory.Using above-mentioned skill Art scheme, all distributed nodes in the same manner block block chain, and the block chain that will be cut down is stored, and are protecting The length of block chain is effectively controlled while integrity of verified data, it is ensured that all distributed nodes have ballot ability, protected The decentralization characteristic of block chain is protected.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this Inventive embodiment, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is a kind of schematic flow sheet of block chain method for cutting provided in an embodiment of the present invention;
Fig. 2 is the schematic flow sheet of another block chain method for cutting provided in an embodiment of the present invention;
Fig. 3 is the schematic flow sheet of another block chain method for cutting provided in an embodiment of the present invention;
Fig. 4 is the schematic flow sheet of another block chain method for cutting provided in an embodiment of the present invention;
Fig. 5 is the schematic flow sheet of another block chain method for cutting provided in an embodiment of the present invention;
Fig. 6 is the data mode schematic diagram before distributed node cutter chain provided in an embodiment of the present invention;
Fig. 7 is the data mode schematic diagram after distributed node cutter chain provided in an embodiment of the present invention;
Fig. 8 is a kind of structural representation of distributed node provided in an embodiment of the present invention;
Fig. 9 is the structural representation of another distributed node provided in an embodiment of the present invention;
Figure 10 is the structural representation of another distributed node provided in an embodiment of the present invention;
Figure 11 is the structural representation of another distributed node provided in an embodiment of the present invention.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
The embodiment of the invention discloses a kind of block chain method for cutting, distributed node is applied to, it is shown in Figure 1, should Method includes:
S101, periodically according to itself store block chain, judge whether need the block chain is blocked;
Specifically, in distributed node, being stored with for judging whether to need consolidating for the block chain for blocking itself storage Determine algorithm routine, the algorithm routine can each time reach the judgement cycle when, according to itself store block chain length or The block that itself judges whether to need to store itself for the computing capability of block chain that stores or the parameter such as disposal ability Chain is blocked.
For example, it is assumed that the fixed algorithm routine in distributed node judges whether according to the length of the block chain for itself storing The block chain for storing itself is needed to block, when the block chain length of distributed node itself storage reaches the length of setting, then The fixed algorithm routine judges that the block chain that should be stored itself be blocked, further, distributed node confirm to need by The block chain of itself storage is blocked.
It should be noted that when distributed node is generated, be have cured in distributed node is for calculation block chain The no algorithm routine that should be truncated, the algorithm routine can judge whether block chain needs to be cut according to the parameter of setting It is disconnected.Algorithm in all distributed nodes can be the same or different, but it must be ensured that the algorithm journey in distributed node Sequence is constant all the time.
When judging to need to block on the block chain, perform step S102, all distributed nodes of joint and judge whether Allow to block on the block chain;
Specifically, due to being deposited in all distributed nodes in the decentralization characteristic requirements block chain network of block chain network The block chain of storage must be identical.Therefore, in order to ensure the decentralization characteristic of block chain network, although in step S101 In, distributed node judges to need to block on block chain, but the block chain that itself will unilaterally can not be stored without authorization cuts It is disconnected, but after having to pass through all distributed nodes agreements, the block chain that all distributed nodes all store itself is blocked, with Ensure the data uniformity of all distributed nodes.
The distributed node combines the specific mistake that all distributed nodes determine whether to block on the block chain Cheng Wei:Distributed node is sent to all other distributed node and blocks the request of block chain, and all other distributed node is received After request, pause generation new block.All other distributed node analyzes itself block chain, judges that whether itself block chain should It is truncated, when judging that itself block chain should be truncated, transmission allows to block the response of block chain;When judging itself block chain not When should be truncated, send refusal and block the response of block chain.Distributed node receives the response letter of all other distributed node Breath, and response message is analyzed, when receiving when allowing the response message for blocking block chain to reach setting ratio, it is distributed Formula node confirms that all distributed nodes have agreed to block on block chain.
When judging to allow to block on the block chain, perform step S103, combine all distributed node selections Block the position of the block chain;
Specifically, due to the decentralization characteristic of block chain network, it is desirable in block chain network in all distributed nodes If block chain identical.In order to ensure the decentralization characteristic of block chain network, distributed node can be to area in confirmation When block chain is implemented to block, all distributed nodes need to be combined and determine to block the position of block chain jointly.All distributed nodes are all Block chain is blocked from the same position for blocking block chain so that the block chain in all distributed nodes is still identical , it is ensured that the decentralization characteristic of block chain network.
S104, from the position for blocking the block chain, the block chain is blocked;
Specifically, in step s 103, the position for blocking the block chain has been had been acknowledged, in step S104, directly Block chain is blocked from the position for blocking the block chain.
S105, will block what is obtained after the block chain, generation time block chain earlier, and the generation time The memory of setting is arrived in the relevant information storage of block chain earlier.
Specifically, after a complete block chain is blocked, obtaining two block chains.In two block chains, its In one be the generation time earlier block composition, another be the generation time it is later block composition.During for generation Between block earlier, the situation that distributed node is used seldom, therefore, distributed node by this generation time earlier Block chain is kept separately and generation time later block chain continues to be used when giving over to generation new block.
It should be noted that distributed node is by the generation time, and block chain is stored during in memory earlier, can With in storing own hardware memory, it is also possible in storage to the independent memory outside own hardware, distributed node Can freely be chosen on the premise of its own processing capabilities are not influenceed according to self-ability.All distributed nodes are all independently deposited The generation time block chain earlier of storage itself interception, has uniformity, whole area with the data for ensureing all distributed nodes Block chain network possesses decentralization characteristic.
Block chain method for cutting proposed by the present invention, is applied to distributed node, and distributed node is periodically according to certainly The block chain of body storage, judges whether to need to block on the block chain;When judging to need to block on the block chain, joint All distributed nodes determine whether to block on the block chain;When all distributed nodes judge to allow the block When chain is blocked, combine the position that the block chain is blocked in all distributed node selections;Distributed node is blocked from described At the position of the block chain, the block chain is blocked, and will block what is obtained after the block chain, the generation time is more early Block chain, and the generation time earlier block chain relevant information storage to setting memory.Using above-mentioned skill Art scheme, all distributed nodes in the same manner block block chain, and the block chain that will be cut down is stored, and are protecting The length of block chain is effectively controlled while integrity of verified data, it is ensured that all distributed nodes have ballot ability, protected The decentralization characteristic of block chain is protected.
Optionally, in another embodiment of the present invention, it is shown in Figure 2, joint all distributed sections Point selection blocks the position of the block chain, including:
S203, the block chain according to itself storage, are calculated the position for blocking the block chain;
Specifically, the algorithm routine in distributed node, can be after judging to need to block on block chain, additionally it is possible to root According to itself computing capability or disposal ability, or the parameter, the position that block chain is blocked in calculating such as block chain length.
It should be noted that each distributed node can be with for calculating the algorithm routine of the position for blocking the block chain It is identical, it is also possible to different, and algorithm routine in each distributed node must be constant all the time.
The position for blocking the block chain that S204, all other distributed node of acquisition are calculated;
Specifically, the block in the decentralization characteristic requirements block chain network of block chain network in all distributed nodes Chain is identical.In order to ensure the decentralization characteristic of block chain network, distributed node is when block chain is blocked, it shall be guaranteed that institute It is distributed formula node and blocks block chain from the uniform location of block chain, so that block chain after each distributed node is blocked still phase Together.
Because the memory space and operational capability of each distributed node are different, it is used to calculate blocking district in each distributed node The algorithm routine of the position of block chain is also differed, and the position for blocking block chain for causing each distributed node to be calculated is different. If block chain is blocked in the position that what each distributed node was calculated according to itself block block chain, it will cause each distribution Block chain after node is blocked is differed, and is further resulted in whole block chain network and is lost decentralization characteristic.Therefore, dividing After cloth node is calculated the position for blocking block chain according to itself block chain, all other distributed node meter is obtained first What is obtained blocks the position of block chain network, so that each distributed node is from all positions for blocking block chain network, choosing Select same position and carry out block chain and block.
S205, judge that what is itself be calculated blocks the position of the block chain, and all other distributed node respectively What is be calculated blocks the position of the block chain, if can be used;
Specifically, distributed node calculated for itself block position, and all other distributed node is calculated What is obtained blocks position, judges whether it can be as the position of blocking district block chain, if can be as blocking district block chain respectively Position, then marking this to block the position of block chain can be used, and otherwise mark it to be used.
Using embodiment of the present invention technical scheme, all distributed nodes are distinguished for all of position for blocking block chain One judged result of generation.
S206, all other distributed node of acquisition judge that what is itself be calculated blocks the position of the block chain, and What all other distributed node was calculated blocks the position of the block chain, if can be with adopted judged result;
Specifically, distributed node obtains all other distributed node judges that what is itself be calculated blocks the block The position of chain, and the position for blocking the block chain that all other distributed node is calculated, if can be with adopted Judged result, further, distributed node can therefrom confirm which blocks position and can be received by most distributed nodes, It is smaller which blocks the received ratio in position.
S207, according to itself judged result and the judged result of all other distributed node, be calculated from itself Block the position of the block chain, and in the position for blocking the block chain that is calculated of all other distributed node, choosing A position is selected as the position for blocking the block chain.
Specifically, all distributed nodes block position for each, all judge whether it can be used, therefore, Distributed node obtains all other distributed node and judges that what is itself be calculated blocks the position of the block chain, and all What other distributed nodes were calculated blocks the position of the block chain, if after can be with adopted judged result, can Therefrom analysis obtain that each position for blocking block chain is judged as can be with adopted ratio.Distributed node is by right Than, will be judged as that position can be blocked with adopted ratio highest, it is set as blocking the position of block chain.
The step of step S201, S202, S208, S209 in the present embodiment distinguish the embodiment of the method shown in corresponding diagram 1 S101, S102, S104, S105, its particular content refer to the content of the embodiment of the method shown in corresponding diagram 1, no longer go to live in the household of one's in-laws on getting married herein State.
Optionally, in another embodiment of the present invention, it is shown in Figure 3, it is described to block the block chain from described Position at, the block chain is blocked, including:
S304, at the position for blocking the block chain, pseudo- wound generation block is set;
Specifically, according to the feature of block chain, the beginning of each block chain must possess a wound generation block.In area When block chain comes out, founder sets a wound generation block, and the new block for generating afterwards is sequentially inserted into the area headed by creating generation block In block chain.In embodiments of the present invention, after original block chain is blocked, two block chains are generated, it is more early for the generation time Block chain, headed by creating generation block, meet block chain feature request;And the block chain later for the generation time, due to not having Invasive generation block, does not meet block chain feature, therefore can not turn into block chain truly.In order to solve the above problems, The embodiment of the present invention was blocking one wound generation block of setting at position, in order to be set with founder first before block chain is blocked The wound generation block truly put is distinguished, and the wound generation block of setting is referred to as pseudo- wound generation block by the embodiment of the present invention.Puppet wound Generation block be used for block after, generation time later block chain collectively forms the block chain for meeting block chain feature.
S305, between the pseudo- wound generation block and previous block, the block chain is blocked.
Specifically, after pseudo- wound generation block is set in step s 304, in order to ensure to block the life obtained after block chain Meet block chain feature into time later block chain, in step S305, created between generation block and previous block from puppet, will Block chain is blocked, it is ensured that it is complete block chain to block the generation time for obtaining afterwards later block chain.
Step in the embodiment of the method shown in step S301~S303, S306 difference corresponding diagram 1 in the present embodiment S101~S103, S105, its particular content refer to the content of the embodiment of the method shown in corresponding diagram 1, and here is omitted.
Optionally, in another embodiment of the present invention, it is described at the position for blocking the block chain, set Puppet wound generation block, including:
At the position for blocking the block chain, a new block is set, as puppet wound generation block;Or, by institute The next block at the position for blocking the block chain is stated, is arranged to pseudo- wound generation block.
Specifically, the concrete mode for setting pseudo- wound generation block, can generate at the position for blocking the block chain One new block, and the new district block's attribute is configured, it is set to pseudo- wound generation block.Can also be to blocking block chain Position at next block be configured, make it have wound generation patch characteristics, further, as Wei Chuanshi areas Block.
In fact, any one can make to block the generation time obtained after block chain later block chain possesses one The pseudo- wound generation block method of setting of puppet wound generation block, can be used by the embodiment of the present invention, and the embodiment of the present invention is not to setting The method of puppet wound generation block carries out considered critical.
Optionally, in another embodiment of the present invention, it is shown in Figure 4, it is described to block after the block chain Obtain, generation time block chain earlier, and generation time block chain earlier relevant information storage to setting Memory, including:
S406, will block what is obtained after the block chain, generation time last block of block chain earlier Cryptographic Hash, in storage to data storage block;
Specifically, block chain is substantially a front and rear block information be mutually related Data-Link, between front and rear block Corresponding relation needs to be pointed to by the cryptographic Hash on block, i.e., have the cryptographic Hash for pointing to previous block in latter block. After block chain is blocked, the generation time, block chain will be stored separately earlier, in order that distributed node is not lost to area Block chain successional judgement, will block the generation time obtained after block chain last block of block chain earlier Cryptographic Hash is stored, when distributed node needs to use the generation time information of block chain earlier so that generation First block of time later block chain can point at generation time block earlier, distributed node is still sentenced The continuity of disconnected whole block chain.
On the other hand, the sensing of block, can protect the number in block sequence block before and after block chain is completed using cryptographic Hash According to being not tampered with.When the data in block chain are tampered, when cryptographic Hash changes, distributed node can discover block chain number According to being tampered, and data to distorting are recovered.Therefore, by the Kazakhstan of the time of generation last block of block chain earlier Uncommon value is stored, and ensure that distributed node after block chain is blocked, and can still be detected according to the cryptographic Hash of storage Whether the data in block chain, the data for especially blocking block chain are tampered, and when data are tampered, carry out data extensive It is multiple.
It should be noted that the embodiment of the present invention is by the cryptographic Hash of the time of generation last block of block chain earlier In storing data storage block.In fact, the storage location of the cryptographic Hash is not limited only to store in data storage block, In can also be as a Transaction Information storage to distributed node, any side that can be used for storing the cryptographic Hash Formula, can be used, and the embodiment of the present invention does not do considered critical.
S407, first block by generation time block chain earlier, and the data storage block, storage To in data storage block chain;
Specifically, for blocking the generation time obtained after block chain block chain earlier, distributed node by its One block, and the data storage block of the cryptographic Hash of its last block is preserved, it is saved in a data storage area In block chain.Distributed node often performs the operation for once blocking block chain, will all block the generation time obtained after block chain First block and data storage block of block chain are saved in data storage block chain earlier, and distributed node is all the time not The information of any one block chain for being cut down can be lost, it is ensured that all information of whole block chain will not be tampered, and protect Having demonstrate,proved whole block chain network has decentralization characteristic.
S408, block what is obtained after the block chain by described, generation time block chain earlier, and the data Memory block chain, memory of the storage to setting.
Specifically, generation time for will being obtained after cutter chain of distributed node block chain earlier, and for storing State the data storage block chain of the generation time relevant information of block chain earlier, memory of the storage to setting.Distribution section Point selects the memory of the setting according to its own processing capabilities, can store in itself memory space, it is also possible to storage with In other storage devices of itself connection.It is any to ensure that distributed node independently possesses all data of block chain, and not shadow The storage mode that distributed node possesses ballot disposal ability is rung, can be used by the embodiment of the present invention.
Step S301 in the embodiment of the method shown in step S401~S405 corresponding diagrams 3 in the present embodiment~ S305, its particular content refers to the content of the embodiment of the method shown in corresponding diagram 3, and here is omitted.
Optionally, in another embodiment of the present invention, it is shown in Figure 5, it is described by the generation time earlier First block of block chain, and the data storage block, in storage to data storage block chain, including:
S507, first block by generation time block chain earlier, and the data storage block, generation One new block;
Specifically, data storage block chain is substantially a block chain, connected and composed by block.In the embodiment of the present invention By first block of generation time block chain earlier, and the data storage block, a new block is generated, deposited In storing up block chain network.According to the technical scheme of the embodiment of the present invention, the next block chain of every section of distributed node, all by it Need the relevant information of storage to generate a block to store in data storage block chain.
S508, by the new block insert data storage block chain in.
Specifically, the storing process of the embodiment of the present invention is as shown in Figure 6 and Figure 7.Assuming that in figure 6, distributed node is accurate Block chain is blocked between standby block n+1 and the pseudo- wound generation block M+1 of transaction block chain from block chain." the block being truncated 3 block chains that distributed node cuts down have been preserved in chain " region, corresponding, are stored with 3 in data storage block chain The individual block for storing the relevant information of the block chain for cutting down.After distributed node is implemented to block block chain, such as Fig. 7 institutes Show, in " the block chain being truncated " region, increased 1 block chain for cutting down, meanwhile, increase in data storage block chain 1 new block of the relevant information of the block chain for just having cut down that is stored with, now the block chain in distributed node is from transaction The block chain that the pseudo- wound generation block M+1 of block chain starts.
It should be noted that the embodiment of the present invention only illustrates distribution in the way of storing to data storage block chain The relevant information of the block chain how node will cut down is stored.In fact, distributed node can using any one With the relevant information of block chain that will cut down of storage mode stored, for example, distributed node can be according to data genaration Precedence relationship, the relevant information of the block chain that will be cut down is stored successively in the way of data message.The embodiment of the present invention is not Mode to distributed node data storage carries out considered critical.
Step in the embodiment of the method shown in step S501~S506, S509 difference corresponding diagram 4 in the present embodiment S401~S406, S408, its particular content refer to the content of the embodiment of the method shown in corresponding diagram 4, and here is omitted.
Another embodiment of the present invention also discloses a kind of distributed node, shown in Figure 8, including:
First judging unit 801, for the block chain for periodically being stored according to itself, judges whether to need the area Block chain is blocked;
Second judging unit 802, for when first judging unit judges to need to block on the block chain, combining All distributed nodes determine whether to block on the block chain;
Select unit 803, for when second judging unit judges to allow to block on the block chain, joint to be described The position of the block chain is blocked in all distributed node selections;
Processing unit 804, for from the position for blocking the block chain, the block chain being blocked;
Memory cell 805, for will block what is obtained after the block chain, generation time block chain earlier, and The generation time earlier block chain relevant information storage to setting memory.
Specifically, the specific works content of unit refers to the content of corresponding embodiment of the method in the present embodiment, Here is omitted.
Distributed node proposed by the present invention, the first judging unit 801 periodically according to the block chain that itself is stored, is sentenced It is disconnected whether to need to block on the block chain;When judging to need to block on the block chain, the joint institute of the second judging unit 802 The formula node of being distributed determines whether to block on the block chain;When all distributed nodes judge to allow the block chain When blocking, select unit 803 combines the position that the block chain is blocked in all distributed node selections;Processing unit 804 From at the position for blocking the block chain, the block chain is blocked, memory cell 805 will be blocked after the block chain Obtain, generation time block chain earlier, and generation time block chain earlier relevant information storage to setting Memory.Using above-mentioned technical proposal, all distributed nodes in the same manner block block chain, and will cut down Block chain is stored, and the length of block chain is effectively controlled while guaranteeing data integrity, it is ensured that all distributions Node has ballot ability, protects the decentralization characteristic of block chain.
Optionally, in another embodiment of the present invention, it is shown in Figure 9, select unit 803, including:
Computing unit 8031, for according to the block chain for itself storing, being calculated the position for blocking the block chain;
First acquisition unit 8032, for the block chain that blocks for obtaining that all other distributed node is calculated Position;
3rd judging unit 8033, for judging that what is itself be calculated blocks the position of the block chain, and institute respectively There is the position for blocking the block chain that other distributed nodes are calculated, if can be used;
Second acquisition unit 8034, judges that what is itself be calculated blocks described for obtaining all other distributed node The position of block chain, and the position for blocking the block chain that all other distributed node is calculated, if can be adopted Judged result;
Decision package 8035, for the judged result according to itself judged result and all other distributed node, from certainly What body was calculated the block position of the block chain, and all other distributed node be calculated block the block chain Position in, selection one position as the position for blocking the block chain.
Specifically, the specific works content of unit refers to the content of corresponding embodiment of the method in the present embodiment, Here is omitted.
Optionally, in another embodiment of the present invention, it is shown in Figure 10, processing unit 804, including:
Pretreatment unit 8041, at the position for blocking the block chain, setting pseudo- wound generation block;
Cutter chain implementation unit 8042, between the pseudo- wound generation block and previous block, the block chain being cut It is disconnected.
Specifically, the specific works content of unit refers to the content of corresponding embodiment of the method in the present embodiment, Here is omitted.
Optionally, in another embodiment of the present invention, the pretreatment unit 8041 blocks the block described At the position of chain, when pseudo- wound generation block is set, specifically for:
At the position for blocking the block chain, a new block is set, as puppet wound generation block;Or, by institute The next block at the position for blocking the block chain is stated, is arranged to pseudo- wound generation block.
Specifically, the specific works content of pretreatment unit 8041 refers to corresponding embodiment of the method in the present embodiment Content, here is omitted.
Optionally, in another embodiment of the present invention, it is shown in Figure 11, memory cell 805, including:
First memory cell 8051, for will block what is obtained after the block chain, generation time block chain earlier Last block cryptographic Hash, storage is in data storage block;
Second memory cell 8052, for by first block of generation time block chain earlier and described Data storage block, in storage to data storage block chain;
3rd memory cell 8053, for blocking what is obtained after the block chain by described, the generation time area earlier Block chain, and the data storage block chain, memory of the storage to setting.
Specifically, the specific works content of unit refers to the content of corresponding embodiment of the method in the present embodiment, Here is omitted.
Optionally, in another embodiment of the present invention, second memory cell 8052 by the generation time compared with First block of early block chain, and the data storage block, it is specific to use when in storage to data storage block chain In:
By first block of generation time block chain earlier, and the data storage block, one is generated New block;
By in new block insertion data storage block chain.
Specifically, the specific works content of the second memory cell 8052 refers to corresponding embodiment of the method in the present embodiment Content, here is omitted.
The foregoing description of the disclosed embodiments, enables professional and technical personnel in the field to realize or uses the present invention. Various modifications to these embodiments will be apparent for those skilled in the art, as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, the present invention The embodiments shown herein is not intended to be limited to, and is to fit to and principles disclosed herein and features of novelty phase one The scope most wide for causing.

Claims (12)

1. a kind of block chain method for cutting, it is characterised in that be applied to distributed node, the method includes:
Periodically according to the block chain that itself is stored, judge whether to need to block on the block chain;
When judging to need to block on the block chain, combine all distributed nodes and determine whether to cut on the block chain It is disconnected;
When judging to allow to block on the block chain, combine the position that the block chain is blocked in all distributed node selections Put;
From at the position for blocking the block chain, the block chain is blocked;
To block what is obtained after the block chain, generation time block chain earlier, and generation time area earlier Memory of the relevant information storage of block chain to setting.
2. method according to claim 1, it is characterised in that institute is blocked in joint all distributed nodes selections The position of block chain is stated, including:
According to the block chain that itself is stored, the position for blocking the block chain is calculated;
Obtain the position for blocking the block chain that all other distributed node is calculated;
The position of the block chain that judges that what is itself be calculated block respectively, and all other distributed node is calculated Block the position of the block chain, if can be used;
Obtain all other distributed node and judge that what is itself be calculated blocks the position of the block chain, and all other point What cloth node was calculated blocks the position of the block chain, if can be with adopted judged result;
According to itself judged result and the judged result of all other distributed node, the area is blocked from what is itself be calculated In the position of block chain, and the position for blocking the block chain that is calculated of all other distributed node, a position is selected As the position for blocking the block chain.
3. method according to claim 1, it is characterised in that described from the position for blocking the block chain, will The block chain is blocked, including:
At the position for blocking the block chain, pseudo- wound generation block is set;
From between the pseudo- wound generation block and previous block, the block chain is blocked.
4. method according to claim 3, it is characterised in that described at the position for blocking the block chain, if Pseudo- wound generation block is put, including:
At the position for blocking the block chain, a new block is set, as puppet wound generation block;Or, described will cut Next block at the position of the disconnected block chain, is arranged to pseudo- wound generation block.
5. method according to claim 3, it is characterised in that described to block what is obtained after the block chain, generation Time block chain earlier, and the generation time earlier block chain relevant information storage to setting memory, bag Include:
To block what is obtained after the block chain, the cryptographic Hash of generation time last block of block chain earlier is deposited In storing up data storage block;
First block of generation time block chain earlier, and the data storage block, storage are deposited to data In storage area block chain;
Block what is obtained after the block chain by described, generation time block chain earlier, and the data storage block Chain, memory of the storage to setting.
6. method according to claim 5, it is characterised in that it is described by the generation time earlier block chain first Individual block, and the data storage block, in storage to data storage block chain, including:
By first block of generation time block chain earlier, and the data storage block, a new district is generated Block;
By in new block insertion data storage block chain.
7. a kind of distributed node, it is characterised in that including:
First judging unit, for the block chain for periodically being stored according to itself, judges whether to need to cut on the block chain It is disconnected;
Second judging unit, for when first judging unit judges to need to block on the block chain, combining all points Cloth node determines whether to block on the block chain;
Select unit, for when second judging unit judges to allow to block on the block chain, combining described all points The position of the block chain is blocked in the selection of cloth node;
Processing unit, for from the position for blocking the block chain, the block chain being blocked;
Memory cell, for will block what is obtained after the block chain, generation time block chain earlier, and the generation Time earlier block chain relevant information storage to setting memory.
8. distributed node according to claim 7, it is characterised in that the select unit, including:
Computing unit, for according to the block chain for itself storing, being calculated the position for blocking the block chain;
First acquisition unit, for obtaining the position for blocking the block chain that all other distributed node is calculated;
3rd judging unit, for judging that what is itself be calculated blocks the position of the block chain, and all other point respectively What cloth node was calculated blocks the position of the block chain, if can be used;
Second acquisition unit, for the block chain that blocks for obtaining that all other distributed node judges itself to be calculated Position, and the position for blocking the block chain that all other distributed node is calculated, if can be with adopted judgement As a result;
Decision package, for the judged result according to itself judged result and all other distributed node, calculates from itself To the position for blocking the block chain, and the position for blocking the block chain that all other distributed node is calculated In, one position of selection is used as the position for blocking the block chain.
9. distributed node according to claim 7, it is characterised in that the processing unit, including:
Pretreatment unit, at the position for blocking the block chain, setting pseudo- wound generation block;
Cutter chain implementation unit, between the pseudo- wound generation block and previous block, the block chain being blocked.
10. distributed node according to claim 9, it is characterised in that the pretreatment unit blocks described described At the position of block chain, when pseudo- wound generation block is set, specifically for:
At the position for blocking the block chain, a new block is set, as puppet wound generation block;Or, described will cut Next block at the position of the disconnected block chain, is arranged to pseudo- wound generation block.
11. distributed nodes according to claim 9, it is characterised in that the memory cell, including:
First memory cell, for will block what is obtained after the block chain, generation time block chain earlier last The cryptographic Hash of individual block, in storage to data storage block;
Second memory cell, for by first block of generation time block chain earlier, and the data storage Block, in storage to data storage block chain;
3rd memory cell, for blocking what is obtained after the block chain by described, generation time block chain earlier, and The data storage block chain, memory of the storage to setting.
12. distributed nodes according to claim 11, it is characterised in that when second memory cell is by the generation Between block chain earlier first block, and the data storage block, when in storage to data storage block chain, specifically For:
By first block of generation time block chain earlier, and the data storage block, a new district is generated Block;
By in new block insertion data storage block chain.
CN201611257553.0A 2016-12-30 2016-12-30 Blockchain truncation method and distributed node Pending CN106686087A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611257553.0A CN106686087A (en) 2016-12-30 2016-12-30 Blockchain truncation method and distributed node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611257553.0A CN106686087A (en) 2016-12-30 2016-12-30 Blockchain truncation method and distributed node

Publications (1)

Publication Number Publication Date
CN106686087A true CN106686087A (en) 2017-05-17

Family

ID=58873301

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611257553.0A Pending CN106686087A (en) 2016-12-30 2016-12-30 Blockchain truncation method and distributed node

Country Status (1)

Country Link
CN (1) CN106686087A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107239953A (en) * 2017-06-20 2017-10-10 无锡井通网络科技有限公司 Fast data store method and system based on block chain
CN107240017A (en) * 2017-07-20 2017-10-10 捷德(中国)信息科技有限公司 Block chain trade managing system and method
CN108494706A (en) * 2018-02-09 2018-09-04 北京欧链科技有限公司 Data processing method and device in block chain
CN109274728A (en) * 2018-09-03 2019-01-25 北京飞纳泰科信息技术有限公司 Block chain Data lifecycle management method
CN109509287A (en) * 2017-09-15 2019-03-22 松下电器(美国)知识产权公司 Electronic voting system and control method
CN109543455A (en) * 2018-11-06 2019-03-29 联动优势科技有限公司 A kind of data archiving method and device of block chain
CN110378694A (en) * 2018-05-21 2019-10-25 腾讯科技(深圳)有限公司 Block chain data processing method, device, computer equipment and storage medium
WO2019223681A1 (en) * 2018-05-22 2019-11-28 Digital Transaction Limited Blockchain-based transaction platform with enhanced scalability, testability and usability
CN110727391A (en) * 2018-07-16 2020-01-24 北京京东尚科信息技术有限公司 Transaction data storage method and device, block chain system, medium and electronic equipment
CN111382119A (en) * 2018-12-29 2020-07-07 华为技术有限公司 Block data archiving method and related equipment
WO2020151635A1 (en) * 2019-01-23 2020-07-30 腾讯科技(深圳)有限公司 Data processing method and apparatus, computer device, and storage medium
US10747780B2 (en) 2017-02-17 2020-08-18 Alibaba Group Holding Limited Blockchain-based data processing method and device
CN112445792A (en) * 2019-09-04 2021-03-05 中移物联网有限公司 Block chain block data storage method and device, electronic equipment and storage medium
US11558179B2 (en) 2018-08-09 2023-01-17 Nokia Technologies Oy Distributed data storage

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259762A (en) * 2012-02-16 2013-08-21 中兴通讯股份有限公司 File encryption and decryption method and system based on cloud storage
CN103257958A (en) * 2012-02-16 2013-08-21 中兴通讯股份有限公司 Cloud storage based translating method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103259762A (en) * 2012-02-16 2013-08-21 中兴通讯股份有限公司 File encryption and decryption method and system based on cloud storage
CN103257958A (en) * 2012-02-16 2013-08-21 中兴通讯股份有限公司 Cloud storage based translating method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
聂舒: "从SDDS看区块链技术的应用", 《中国金融》 *

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11392612B2 (en) 2017-02-17 2022-07-19 Advanced New Technologies Co., Ltd. Data processing method and device
US10747780B2 (en) 2017-02-17 2020-08-18 Alibaba Group Holding Limited Blockchain-based data processing method and device
CN107239953A (en) * 2017-06-20 2017-10-10 无锡井通网络科技有限公司 Fast data store method and system based on block chain
CN107239953B (en) * 2017-06-20 2021-10-29 无锡井通网络科技有限公司 Block chain-based rapid data storage method and system
CN107240017A (en) * 2017-07-20 2017-10-10 捷德(中国)信息科技有限公司 Block chain trade managing system and method
CN109509287A (en) * 2017-09-15 2019-03-22 松下电器(美国)知识产权公司 Electronic voting system and control method
CN108494706A (en) * 2018-02-09 2018-09-04 北京欧链科技有限公司 Data processing method and device in block chain
CN110378694B (en) * 2018-05-21 2021-01-12 腾讯科技(深圳)有限公司 Block chain data processing method and device, computer equipment and storage medium
CN110378694A (en) * 2018-05-21 2019-10-25 腾讯科技(深圳)有限公司 Block chain data processing method, device, computer equipment and storage medium
WO2019223681A1 (en) * 2018-05-22 2019-11-28 Digital Transaction Limited Blockchain-based transaction platform with enhanced scalability, testability and usability
US11409730B2 (en) 2018-05-22 2022-08-09 Eternal Paradise Limited Blockchain-based transaction platform with enhanced scalability, testability and usability
CN110727391A (en) * 2018-07-16 2020-01-24 北京京东尚科信息技术有限公司 Transaction data storage method and device, block chain system, medium and electronic equipment
US11558179B2 (en) 2018-08-09 2023-01-17 Nokia Technologies Oy Distributed data storage
CN109274728A (en) * 2018-09-03 2019-01-25 北京飞纳泰科信息技术有限公司 Block chain Data lifecycle management method
CN109543455A (en) * 2018-11-06 2019-03-29 联动优势科技有限公司 A kind of data archiving method and device of block chain
CN111382119A (en) * 2018-12-29 2020-07-07 华为技术有限公司 Block data archiving method and related equipment
CN111382119B (en) * 2018-12-29 2023-08-22 华为技术有限公司 Block data archiving method and related equipment
KR20210034072A (en) * 2019-01-23 2021-03-29 텐센트 테크놀로지(센젠) 컴퍼니 리미티드 Data processing method and apparatus, computer device, and storage medium
WO2020151635A1 (en) * 2019-01-23 2020-07-30 腾讯科技(深圳)有限公司 Data processing method and apparatus, computer device, and storage medium
KR102455884B1 (en) * 2019-01-23 2022-10-19 텐센트 테크놀로지(센젠) 컴퍼니 리미티드 Data processing method and apparatus, computer device, and storage medium
US11574290B2 (en) 2019-01-23 2023-02-07 Tencent Technology (Shenzhen) Company Limited Data processing method and apparatus, computer device, and storage medium
US11935015B2 (en) 2019-01-23 2024-03-19 Tencent Technology (Shenzhen) Company Limited Data processing method and apparatus, computer device, and storage medium
CN112445792A (en) * 2019-09-04 2021-03-05 中移物联网有限公司 Block chain block data storage method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN106686087A (en) Blockchain truncation method and distributed node
CN111309711A (en) Cross-block-chain data migration method, device, equipment and storage medium
CN107172586A (en) Mobile terminal network localization method based on block chain
CN105099995B (en) SDN network system, controller and control method
CN108270836A (en) Data processing method, equipment and system based on block chain
CN110569246B (en) Block chain node information synchronization method and device, computer equipment and storage medium
CN109040305B (en) Block chain recording method based on hierarchical heterogeneous dynamic topological fragments
CN102045344B (en) Cross-domain affiliation method and system based on path information elastic sharding
CN108040008A (en) The cross-domain dispositions method of online service function chain
CN108847926A (en) A kind of client secure detection method, device and client device
EP4134893A1 (en) Method and device for preventing forking of blockchain
CN111431695A (en) Software defined tactical network node credit management method based on block chain
CN111726368B (en) SRv 6-based inter-domain source address verification method
CN109033143A (en) Distribution based on block chain divides domain Electric Grid Data Processing System and its method
CN110138660A (en) A kind of multiple exit route selection method
CN110581839A (en) Content protection method and device
CN109583899A (en) Data storage and management method and system based on cloud storage service device
CN110086780A (en) The processing method for being tampered transaction, device and storage medium based on ether mill
CN108563718A (en) A kind of method and system preventing log flood
CN104717645A (en) Method and system for ensuring data transmission of wireless sensor network
CN107608821A (en) A kind of method for reading data based on correcting and eleting codes, device, equipment
CN112463881B (en) Efficient block chain system and processing method for cloud edge aggregation computing environment
CN109191143A (en) food information processing method, device and system
CN109978556A (en) A kind of agricultural product retroactive method, device, electronic equipment and storage medium
Inderfurth et al. Note on “Myopic heuristics for the random yield problem”

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
TA01 Transfer of patent application right

Effective date of registration: 20180126

Address after: 610093 No. 205, No. 996, No. 996, north section of Tianfu Avenue, Wuhou District, Sichuan

Applicant after: Quality chain network technology Chengdu Co., Ltd.

Address before: 116001 Zhongshan Road 136, Zhongshan District, Dalian, Liaoning province (25 layer 01-05 unit of hope mansion)

Applicant before: Pioneer payments Ltd

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20170517

RJ01 Rejection of invention patent application after publication