Specific embodiment
Retouching in detail to one or more embodiment of the invention is hereafter provided together with the attached drawing of the diagram principle of the invention
It states.The present invention is described in conjunction with such embodiment, but the present invention is not limited to any embodiments.The scope of the present invention is only by right
Claim limits, and the present invention covers many substitutions, modification and equivalent.Illustrate in the following description many details with
Just it provides a thorough understanding of the present invention.These details are provided for exemplary purposes, and without in these details
Some or all details can also realize the present invention according to claims.
An aspect of of the present present invention provides a kind of block chain structure storage controlling method.Fig. 1 is to implement according to the present invention
The block chain structure storage controlling method flow chart of example.
The present invention constructs multi-level alliance's block chain, and participant is multiple alliances, and alliance has unique identity,
Each alliance is made of multiple certification nodes, the internal identity authentication content of the block chain storage virtual token of each alliance;It is empty
Quasi- token is globally unique, can be transmitted in any alliance;Request certification both sides can initiate certification request by different alliances, and can
Virtual token is transmitted in any alliance.Block chain inside each alliance's maintenance, all collectives, alliance safeguard global alliance chain;
The authorization node collection of each alliance verifies the uniqueness of virtual token, guarantees that virtual token is all satisfied uniquely in different alliances
Property.By constructing dynamic authorization node collection for each alliance, subregion verifies virtual token uniqueness, improves throughput of system;
Authorization node collection dynamic change at any time prevents alliance from acting in collusion altered data.
Global alliance's chain is stored with reliable token hashes index, the block chain storage internal authentication node of each alliance
Authentication data.The inside block chain of alliance votes in a certification node, the referred to as agency of the alliance, and agency is responsible for and other
The agent communication of alliance;Ballot generates the authorization node collection of current alliance from the certification node of other alliances of the whole network.
The authorization node collection of all alliances randomly chooses a group node as the node collection that keeps accounts from the whole network node;Alliance
Initial authorization node collection is voted from the whole network node generation by the agency of alliance, keep accounts node collection by all alliances start node
Collection is voted from the whole network node and is generated.Build file data is broadcast to the authorization node collection of alliance by the agency of alliance;Alliance
Authorization node collection verifies whether authentication meets uniqueness;
The hash index for meeting the authentication of uniqueness is sent to the node collection that keeps accounts by the confirmation node of alliance;Keep accounts section
Point set updates global alliance block.
The virtual token VC passes through VC_ID the whole network unique identification.The certification request be described as TR=(src, des,
VC_ID, key, TR_ID), src indicates virtual token sender;Des indicates virtual token recipient;Key indicates request certification
Both sides' private key;TR_ID indicates that certification request ID, certification request ID the whole network are unique.There are three types of authentication result tools state S (TR)=
{ not determining, Pending The Entry Into Force comes into force }.Meet uniqueness by verifying authentication content, the state of identity is switched to give birth to by not determination
Effect;It is unsatisfactory for uniqueness by verifying authentication content, the state of identity switchs to Pending The Entry Into Force by not determination.The certification TR to come into force
Meet the authentication of uniqueness.The alliance Ai∈{P1..., PN, N indicates the quantity of alliance in block chain network.
Alliance AiIt indicates that participant different in block chain network is identified using public key address, and saves other alliances
Identity.Each alliance includes multiple certification node ANij, j≤ni, ANijIndicate alliance AiJ-th of certification node, ni
Indicate alliance AiCertification number of nodes.It is communicated between certification node by asynchronous message mechanism.According to different needs
Wallet is arranged different roles, comprising: the node UN that keeps accounts, confirmation node VN, Generic Authentication node ON.The node that keeps accounts is responsible for dimension
Protect global alliance chain;Confirmation node is responsible for verifying whether authentication meets uniqueness;The node that keeps accounts is safeguarded with confirmation node
Whether internal block chain and verification authentication meets the uniformity in tissue.Generic Authentication node, which only initiates certification, asks
Whether block chain and verification authentication inside asking, safeguarding meet the uniformity in tissue.Authenticate node by public key
Location is identified.
Alliance AiAll certification node ANijStorage alliance AiPrivate key, utilize alliance AiPrivate key and authenticate node private
Key signs to block.Alliance AiAuthorization node collection VNGiIt is made of confirmation node, verifies alliance AiCertification whether meet
Uniqueness;Alliance AiAuthorization node collection dynamic change, current grant node collection randomly choose one from the whole network node at any time
Group node is as alliance AiNext validity period confirm node collection.Keep accounts node collection UNGiBy keeping accounts, node is formed, and currently keep accounts section
Point set randomly chooses a group node by the host node of the authorization node collection of each unit validity period all alliances from the whole network and forms,
And dynamic change at any time.
For example, it is assumed that the whole network is by alliance A1, A2, A3Three alliance's compositions, each alliance separately include 7 certification sections
Point.By voting in certification node A11, A21, A31It is acted on behalf of accordingly as each alliance.Then A11It is responsible for from other alliances A2,
A3Certification node in ballot generate alliance A1Authorization node collection VNG1, it is assumed that initial VNG1Node integrates as A22, A35。A21It is responsible for
From alliance A1, A3Certification node in ballot generate alliance A2Authorization node collection VNG2, it is assumed that initial VNG2Node integrates as A12,
A34。A31It is responsible for from alliance A1, A2Certification node in ballot generate alliance A3Authorization node collection VNG3, it is assumed that initial VNG3Section
Point set is A15, A24.All above-mentioned authorization node collection A22, A35, A12, A34, A15, A24One group of section is randomly choosed from the whole network node
Point is as the node collection that keeps accounts, it is assumed that is A23, A37, A15.That is node A22, A35It is applied not only to determine the node collection that keeps accounts, also monitoring connection
Alliance A1Certification whether meet uniqueness, and be to come into force by the status modifier for verifying the certification request ID passed through, be then forwarded to
Keep accounts node collection A23, A37, A15.Similarly, node A12, A34Monitor alliance A2Certification whether meet uniqueness, node A15, A24Prison
Control alliance A3Certification whether meet uniqueness, will verify the status modifier of certification request ID passed through is to come into force, and is then sent
To the node collection A that keeps accounts23, A37, A15.The node collection that keeps accounts is for constructing global alliance's block.
Based on block chain structure of the invention, it is assumed that a certain alliance A3Attempt to tamper with itself authentication data and correlation zone
Block, for the block to come into force, the block in global alliance's block chain after need to distorting is sent to all certification nodes (i.e.
A31,..., A37) verified;And the alliance need to change together all global alliances chain blocks after change block;It needs simultaneously
Change every other alliance (A1And A2Totally 14 nodes) certification block chain, such high cost data for making malicious modification
It is almost difficult to come into force.
Block chain is formed by alliance's sub-district block chaining inside alliance, authentication data and build inside the storage of alliance's block
File;Build file stores the TR_ID of all certifications in this block, authenticating party list, VC_ID;Global alliance's block then will not
It is chained up with alliance's block chain, constitutes global alliance chain.Global alliance's block only stores the certification that comes into force for meeting uniqueness, lattice
Formula is as follows: GB=<exp_ID, PB_ID, NB_ID, and TRset>, wherein PB_ID indicates the mark of block chain inside alliance, NB_ID
Indicate the hash index value of alliance's block on PB_ID, TRset indicates the TR_ID set of authentic authentication, including corresponding virtual
Token VC_ID, exp_ID indicate current affiliated time limit serial number, when new alliance is added, are worked as according to exp_ID quick obtaining
Preceding and new authorization node collection, keep accounts node collection.
Authorization node collection is directed to each alliance AiBuilding, authorization node collection, which verifies authentication using build file data, is
No to meet uniqueness, certification node belonging to alliance passes through the block chain inside common recognition algorithm maintenance, alliance AiAuthorization node
There will be no the TR_ID of the certification of the Uniqueness to be sent to the node collection that keeps accounts for collection;The TR_ID only authenticated is kept accounts node collection
It is written in global alliance's chain, which is just identified as authentic authentication.
Preferably, there are a validity periods for authorization node collection.In authorization node collection generating process, current grant node collection
It is alliance A before validity period reachesiConstruct the authorization node collection of next validity period.It specifically, is guarantee alliance AiInitially award
It weighs node and concentrates the safe node that at least there is more than half, alliance AiAgency select M confirmation node at random from the whole network
As alliance AiInitial authorization node collection, M > 3N/4.Select a confirmation node as alliance A in each allianceiAuthorization section
The both candidate nodes of point set;Selection result is sent to other M-1 confirmation node and alliance AiAgency;Frequency of occurrence is most
M confirmation node as alliance AiAuthorization node collection VNGi;Statistical result is broadcast to recognizing for inside by the agency of each alliance
Demonstrate,prove node, VNGiIn each confirmation node be in communication with each other, thereby confirm that and establish connection between node.
By Byzantine theorem it is found that at least there is the trusted node of 3N/4 or more in the whole network, it can thus be appreciated that N number of node
Chain at most there are N/4 incredible main bodys, therefore block chain more new node be concentrated to it is few comprising (N+1)/2 safety certification
Node, so block chain more new node collection is believable.
Preferably, before the end of the validity period, current grant node collection VNGiM alliance is randomly choosed, in each alliance
Select a node for meeting the following conditions as alliance AiNext validity period authorization node collection VNGi, i.e., any node is not
Can be continuously as the confirmation node of any alliance, and M > 3N/4;The voting results of this node are sent to other M-1 confirmation section
Point and alliance AiAgency;M most node of statistics frequency of occurrence is as new VNG againi, and by final result, that is, next
The candidate authorization node collection of validity period is sent to the node collection that keeps accounts.Next validity period candidate node set is gone out occurrence by the node collection that keeps accounts
The most confirmation node of number is as alliance AiNext validity period authorization node collection VNGi.When the node collection that keeps accounts calculate it is all
When the new authorization node collection of alliance, by the node listing of new authorization node collection be sent to the current confirmation node of each alliance with
And new confirmation node.Node UN keep accounts for the VNG of each allianceiNode listing is broadcast to the agency of 1/4 alliance, Mei Gelian
The node collection message of next validity period is sent to internal certification node by the agency of alliance.Based on the above mechanism, guarantee is next to be had
Effect phase confirmation node receives the node listing information of correct authorization node collection.
Within each validity period, alliance AiAuthorization node collection verify alliance AiCertification whether meet uniqueness.It is preferred that
Ground, alliance AiAgency internal build file data is broadcast to alliance AiAuthorization node collection VNGi;VNGiIt will meet unique
The TR_ID of the authentication of property is broadcasted to the node collection that keeps accounts.The authorization node collection of all alliances selects one group from the whole network node
Keep accounts node collection UNG of the node as next validity period.
Based on previous example, authorization node collection A is being determined22, A35, A12, A34, A15, A24Later, if it exceeds one
It presets validity period, such as 10 minutes, then authorization node collection A22, A35, A12, A34, A15, A24Authorization node role will fail.Therefore
Within ten minutes, for alliance A1, A2, A3, A is acted on behalf of accordingly11, A21, A31Organize present node collection A22, A35, A12, A34,
A15, A24It votes, reselects next round authorization node collection, it is assumed that the new authorization node collection selected according to votes
For A25, A32, A16, A37, A11, A23, voting results are broadcasted in each alliance, then by new authorization node collection from the whole network node
In select the node collection that keeps accounts of next validity period, may be, for example, A13, A36, A14.The node collection that keeps accounts is for constructing global area, alliance
Block.
In the authorization node collection by after being sent to and keep accounts node collection of the authentication for meeting uniqueness, keep accounts node collection
Construct global alliance block;And alliance AiAfter build file data is sent to authorization node collection, without waiting for authorization node collection
Verification, continue construct alliance AiGlobal alliance's block.
If each authentication is broadcast to all nodes of the whole network by alliance, TOCOM total communication cost is N2;If alliance will have
The authentication content of body is sent to the internal authentication node of other alliances, Yi Yinfa leakage of private information problem.If alliance will
Block content is broadcasted to the whole network, and authenticating the uniqueness verification time can be elongated, increases the storage of block chain and maintenance cost.To reduce net
Network communication cost simultaneously improves throughput of system, and the preferential embodiment of the present invention carries out core using uniqueness of the following procedure to certification
Real confirmation:
Alliance AiAgency build file data is broadcast to internal all confirmation nodes;Confirm node according to head information
Sequentially, verified according to the uniqueness that following rule carries out alliance's block: the same virtual token of synchronization can only authenticate once,
I.e. same VC_ID does not allow to appear in the build file data of other alliances.Build file includes following information: internal block
The TR_ID list of all certifications, relevant authenticating party list, alliance's private key, creation time, the cryptographic Hash of previous block, VC_ID
List, the ID of current overall situation alliance block.Alliance AiAuthorization node collection will present node collection verify after have recognizing for uniqueness
Card TR_ID is sent to the node collection that keeps accounts in form of a message, and message format MSG is as follows: Msg=< PB_ID, NB_ID, TR_ID,
VC_ID, BlockID, Key >, BlockID is the private key of current global alliance block number, Key expression node;Keep accounts node collection root
Can only occur primary rule in same block according to same VC_ID and guarantee that authentication content meets uniqueness.In the currently active phase
At the end of, it is current to confirm that node VN terminates all build file data verification process, and delete untreated build file data.
Alliance AiBuild file data is broadcast to authorization node collection VNGi, within certain time interval, if alliance AiDo not receive
Verification result then sends the build file data again.Using the above mechanism, for being aborted the build file data of verification,
Delay is maximum to be no more than the time interval.
As it can be seen that global alliance's block is broadcast to the agency of all alliances by the node collection that keeps accounts, by act on behalf of again by message or
Block is broadcast to the certification node of affiliated alliance;Since general networking is in order between internal certification node;Therefore based on this
The mechanism of invention can help to eliminate the network blockage by being broadcast directly to the initiation of the whole network node, alleviate message time-out or area
It is too long that block updates delay.
When selection it is new keep accounts node collection when, vote information is sent to the section that currently keeps accounts by the authorization node collection of all alliances
Point set is counted votes highest M nodes by the node collection that currently keeps accounts, and as the section that keeps accounts of next validity period
Point set, while the node collection information that keeps accounts of next validity period is sent to all alliances by each confirmation node by the way of multicast
Agency and next validity period keep accounts node collection, i.e., each keep accounts node by message be broadcast to the agency of 1/4 alliance of the whole network with
Next validity period keeps accounts node.
Face similarly keep accounts task when, due to hardware processing capability difference between different nodes, it is possible that high calculate
Power node is idle, and low calculation power node is then constantly in busy state, influences whole efficiency.Therefore of the invention further
In embodiment, the calculation power of certification node is comprehensively considered when ballot selection keeps accounts node.The node calculates power
Memory capacity, nucleus number, dominant frequency, bus I/O rate and network bandwidth, and the mode of weighted sum calculates the calculation power of certification node.
Node force parameter is calculated first to calculate using normalization:
Wherein, UijRepresent alliance AiJ-th certification node normalized calculation force parameter, UjIndicate alliance AiJ-th
Initial parameter before authenticating node normalization, Umin iRepresent alliance AiIn each node same parameters minimum value,Represent alliance Ai
In respectively calculate the average value of force parameter.niIndicate alliance AiCertification number of nodes.
According to parameter normalization as a result, can calculate power to node hardware carries out accurate description, and calculate the weighting of each component
Average value U 'ij。
U’ij=k1×Uij(1)+k2×Uij(2)+…+kx×Uij(x)
Wherein, Uij(1)、Uij(2)…Uij(x) node to be obtained according to parameter normalization calculates x component of force parameter,
Such as memory capacity, core frequency, bandwidth etc., k1, k2... kxRepresent corresponding weight, i.e. shadow of the performance quantities to node calculation power
The degree of sound.
Preferably, node is kept accounts after the interactive process every time with authorization node, table of the authorization node to the node that keeps accounts
It now scores, with SCijRepresentative keeps accounts after node j provides interaction for authorization node i, and authorization node i is to keeping accounts what node j gave
Score.
Therefore, whenever new authorization node collection selected from the whole network node it is new keep accounts node collection when, by U 'ij×SCijMake
For the reference weight of the whole network ballot.
In global alliance's block building process, if all nodes both participate in competition and generate global alliance block, it can make
It is high at delay, calculate power waste.Therefore global alliance's block generting machanism is improved in the preferred embodiment of the invention to improve system
Handling capacity.Specifically, when constructing block, block body is constructed by the way of individual branches, independently updated each branch avoids
Limitation to throughput of system.Each unit validity period ballot selects multiple host nodes to construct global alliance's block simultaneously, according to
Time sequencing verifies global alliance's block of each primary node constructs, and the node collection that keeps accounts will verify the global area, alliance passed through at first
Block is broadcasted to the agency of all alliances, while deleting global alliance's block of other primary node constructs.It is effective by each unit
The multiple host nodes of phase ballot construct block simultaneously, postpone the problem of increasing to reduce malicious node as host node bring.
The node that each keeps accounts is known together the global alliance's block passed through at first based on timestamp judgement, and by this area, global alliance
Block is broadcast to the agency of Z alliance, N/4 < Z < 3N/4;Since each node receives repeatedly global alliance block, therefore can guarantee
Node receives correctly global alliance block.
In conclusion the invention proposes a kind of block chain structure storage controlling method, by constructing multi-level block
It is expansible that chain structure realizes block capacity, and alleviates and postpone increase problem caused by authentication procedures, ensure that every time
Uniqueness of the authentication in entire block catenary system.
Obviously, it should be appreciated by those skilled in the art, each module of the above invention or each steps can be with general
Computing system realize that they can be concentrated in single computing system, or be distributed in multiple computing systems and formed
Network on, optionally, they can be realized with the program code that computing system can be performed, it is thus possible to they are stored
It is executed within the storage system by computing system.In this way, the present invention is not limited to any specific hardware and softwares to combine.
It should be understood that above-mentioned specific embodiment of the invention is used only for exemplary illustration or explains of the invention
Principle, but not to limit the present invention.Therefore, that is done without departing from the spirit and scope of the present invention is any
Modification, equivalent replacement, improvement etc., should all be included in the protection scope of the present invention.In addition, appended claims purport of the present invention
Covering the whole variations fallen into attached claim scope and boundary or this range and the equivalent form on boundary and is repairing
Change example.