CN109587238A - The data processing of block chain and synchronous method, device, equipment and storage medium - Google Patents
The data processing of block chain and synchronous method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN109587238A CN109587238A CN201811465309.2A CN201811465309A CN109587238A CN 109587238 A CN109587238 A CN 109587238A CN 201811465309 A CN201811465309 A CN 201811465309A CN 109587238 A CN109587238 A CN 109587238A
- Authority
- CN
- China
- Prior art keywords
- block
- data
- block chain
- point identification
- synchronization
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0876—Network architectures or network communication protocols for network security for authentication of entities based on the identity of the terminal or configuration, e.g. MAC address, hardware or software configuration or device fingerprint
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1095—Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/06—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
- H04L9/0643—Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/32—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
- H04L9/3247—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving digital signatures
Abstract
The embodiment of the invention discloses a kind of data processing of block chain and synchronous method, device, equipment and storage mediums.The data processing method of block chain is applied to block chain node, this method comprises: determining at least one synchronization block of checkpoint to be created when determining satisfaction setting trigger condition;The inspection point identification of checkpoint is calculated according to the data of the synchronization block in block chain;It will check that point identification transmits in block chain network, to request other block chain link points to be verified, and feed back approval signature;If the approval signature received meets effective term, is locally corresponding to synchronous block record check point identification and approving signature.It, can be as unit of checkpoint if other nodes need to carry out block synchronization using the technical solution of the embodiment of the present invention, block is synchronized according to checking that point identification obtains, it is directly that the data delivery node of synchronous block is local, it does not need to repeat verification, therefore it is synchronous to can speed up data.
Description
Technical field
The present embodiments relate to the data processing of block chain technology more particularly to a kind of block chain and synchronous method, dress
It sets, equipment and storage medium.
Background technique
Block chain is the novel of the computer technologies such as Distributed Storage, point-to-point transmission, common recognition mechanism, Encryption Algorithm
Application model.
Under normal conditions, each node in block chain network can safeguard the block data of full dose, and block chain network
New block can be ceaselessly generated, over time, each node needs the data volume safeguarded will be increasing.And block chain category
In linked data structure, each block is directed toward a upper block, and therefore, the validity of verify data just needs to open from wound generation block
Begin, sequence verifies each block.
And for the node that block chain network is added new for one, need first to synchronize all history block datas and
Validity check one by one is carried out, could start to synchronize newest block.And history block data is often very big, therefore, this is same
Step process need to expend for a long time.
Summary of the invention
The embodiment of the present invention provides data processing and synchronous method, device, equipment and the storage medium of a kind of block chain, with
Accelerate the synchronization of block data.
In a first aspect, it is applied to block chain node the embodiment of the invention provides a kind of data processing method of block chain,
This method comprises:
When determining satisfaction setting trigger condition, at least one synchronization block of checkpoint to be created is determined;
The inspection point identification of the checkpoint is calculated according to the data of the synchronization block in block chain;
The inspection point identification is transmitted in block chain network, to request other block chain link points to be verified, and it is anti-
Signature is approved in feedback;
If the approval signature received meets effective term, the checkpoint is recorded locally corresponding to synchronous block
Mark and approval signature.
Second aspect, the embodiment of the invention also provides a kind of method of data synchronization of block chain, are applied to block chain link
Point, this method comprises:
Block synchronization request is initiated to inspection node, and checks the data of the synchronization block of node feeding back and checks
Point identification and approval signature, wherein the checkpoint, which is identified as, checks that node calculates determination according to the data of synchronous block, described
Approval signature carries out verifying to inspection point identification for other nodes and feeds back to the inspection node;
The authenticity of point identification is checked according to the approval signature verification;
If the inspection point identification is true, the data of synchronous block according to the checkpoint identity verification are true
Property;
The data validity of the synchronous block is verified, then stores the data of the synchronous block.
The third aspect, the embodiment of the invention also provides a kind of data processing equipments of block chain, are configured at block chain link
In point, which includes:
Block determining module is checked, for determining checkpoint to be created at least when determining satisfaction setting trigger condition
One synchronous block;
Computing module is identified, the checkpoint for calculating the checkpoint according to the data of the synchronization block in block chain is marked
Know;
Identification transmission module, for transmitting the inspection point identification in block chain network, to request other block chains
Node is verified, and feeds back approval signature;
Logging modle is locally corresponding to synchronous block if the approval signature for receiving meets effective term
It records the inspection point identification and approves signature.
Fourth aspect, the embodiment of the invention also provides a kind of data synchronization units of block chain, are configured at block chain link
In point, which includes:
Communication module for initiating block synchronization request to inspection node, and checks the synchronization block of node feeding back
Data and check point identification and approve signature, wherein the checkpoint, which is identified as, checks node according to the data of synchronous block
Calculating determines that the approval signature carries out verifying to inspection point identification for other nodes and feeds back to the inspection node;
Identity verification module, for checking the authenticity of point identification according to the approval signature verification;
Data Verification module, if true for the inspection point identification, according to the checkpoint identity verification
The data validity of synchronous block;
Data memory module, the data validity for the synchronous block are verified, then store the inspection block
Data.
5th aspect, the embodiment of the invention also provides a kind of equipment, which includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processing
Device realizes the data processing method of any block chain in first aspect, or realizes any area in second aspect
The method of data synchronization of block chain.
6th aspect, the embodiment of the invention also provides a kind of storage mediums, are stored thereon with computer program, the program
The data processing method of any block chain in first aspect is realized when being executed by processor, or is realized in second aspect
The method of data synchronization of any block chain.
The data processing of block chain provided in an embodiment of the present invention and synchronous method, device, equipment and storage medium, the machine
Node is determining that the creation for then executing checkpoint operates when meeting setting trigger condition, determines at least the one of checkpoint to be created
A synchronous block, the data based on synchronous block calculate the inspection point identification of checkpoint and request other block chain nodes to inspection
Mark is made an inventory of to be verified and feed back approval signature, then in the case where the approval signature received meets effective term,
Synchronous block is locally recorded, check point identification and approves the incidence relation between signature three, and then completes this checkpoint
Creation.If such as new node that block chain network is added of a certain block chain node need to carry out block and synchronize, can be with checkpoint
Unit synchronizes block according to checking that point identification obtains, directly that the data delivery node of synchronous block is local, does not need to repeat
Verification is executed, therefore it is synchronous to can speed up data.
Detailed description of the invention
Fig. 1 is a kind of flow chart of the data processing method of the block chain provided in the embodiment of the present invention one;
Fig. 2 is a kind of flow chart of the data processing method of the block chain provided in the embodiment of the present invention two;
Fig. 3 is a kind of flow chart of the data processing method of the block chain provided in the embodiment of the present invention three;
Fig. 4 is a kind of flow chart of the method for data synchronization of the block chain provided in the embodiment of the present invention four;
Fig. 5 is a kind of flow chart of the method for data synchronization of the block chain provided in the embodiment of the present invention five;
Fig. 6 is a kind of structural schematic diagram of the data processing equipment of the block chain provided in the embodiment of the present invention six;
Fig. 7 is a kind of structural schematic diagram of the data synchronization unit of the block chain provided in the embodiment of the present invention seven;
Fig. 8 is a kind of structural schematic diagram of the equipment provided in the embodiment of the present invention eight.
Specific embodiment
The present invention is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched
The specific embodiment stated is used only for explaining the present invention rather than limiting the invention.It also should be noted that in order to just
Only the parts related to the present invention are shown in description, attached drawing rather than entire infrastructure.
Embodiment one
Fig. 1 is a kind of flow chart of the data processing method for block chain that the embodiment of the present invention one provides, and the present embodiment can
It is the processing condition data of synchronous block creation checkpoint suitable for block chain network, the checkpoint of creation is for example applicable to
In block chain network, such as new node that block chain network is added of some node need to carry out the synchronous scene of block.The area being applicable in
Block chain can be publicly-owned chain, privately owned chain or alliance's chain.The scheme of the embodiment of the present invention is applied to block chain node, and this method can
It is executed with the data processing equipment by block chain, the mode which can be used software and/or hardware is realized, and can be integrated in
In the calculating equipment for carrying block chain link point.Referring to Fig. 1, this method is specifically included:
S110 determines at least one synchronization block of checkpoint to be created when determining satisfaction setting trigger condition.
In the present embodiment, setting trigger condition refers to that the node in preset block chain network creates checkpoint when institute
The rule to be met;The setting trigger condition can make an appointment in block chain creation, be stored in block chain wound generation block,
I.e. in the 0th block of block chain, or independently of block chain be stored in node local;Can also during block chain creation base
In ballot selection mechanism, it is added in some block of block chain, it such as can be in the form of intelligent contract or other block link networks
The form that network is approved is submitted in block chain network, and be stored in some block the inside etc..Illustratively, setting trigger condition can
To be configured in block chain wound generation block or update in the deployment data of configuration block.Wherein, deployment data refer to participation block
The node of chain network, what is disposed needed for local includes the operating mechanisms such as checkpoint creation condition, which can be with intelligence
The form of contract is submitted in block chain network, and is stored in inside some block.
Optionally, meet setting trigger condition can be local block chain current state meet block chain wound generation block in or
The regulation for creating checkpoint in the deployment data of configuration block is updated, local block chain current block height is such as can be and meets in advance
If block vertical separation, current block height refers to the current block number such as 100 of block chain.It is logical to be also possible to other triggerings
Know mechanism, for notifying localized nodes creation checkpoint etc., is not limited this in the present embodiment.
So-called checkpoint, which can also become, achieves point, is used to indicate to the block in such as default block vertical separation in a certain section
Archive processing is carried out, and the block for being included in default block vertical separation is synchronous block.And checkpoint can generally refer to
The end position of synchronous block, and the initial position for synchronizing block is defaulted as the position of the last checkpoint created of localized nodes
It sets, in addition, the initial position of synchronous block can also be configured according to actual needs.In the present embodiment, checkpoint to be created
As this checkpoint to be created of localized nodes.
Illustratively, determine checkpoint to be created at least one synchronize block may include: local will be deposited it is newest
Block height subtracts setting offset block amount, and subtracts setting detection range block amount, and difference serial number block obtained is made
For the starting point block of synchronous block, terminal block of the starting point block plus setting detection range block amount as synchronous block.
In the present embodiment, newest block height refers to the number of the local currently stored block of block chain;Setting offset area
Block amount refers to bifurcated in order to prevent, the maximum block number such as 6 of preset permissible bifurcated;Set detection range block amount
Refer to the interval number of blocks between adjacent checkpoint that localized nodes are created.For example, the local newest block height deposited
Be 106, setting offset block amount is 6, set detection range block amount as 50, then difference serial number block is the 51st piece, as
Point block, difference serial number block are equivalent to next block serial number after digital difference.The serial number of starting point block is plus setting inspection
Surveying range block amount is 100, then the 100th piece is terminal block, therefore, the synchronization block of identified checkpoint to be created are as follows:
51st block of local block chain is to the 100th block.If newest block height is 156, starting point block is the 101st piece,
Terminal block is the 150th piece.
Specifically, localized nodes detect the state that local block chain is presently in meet block chain wound generation block in or
The regulation for creating checkpoint in the deployment data of configuration block is updated, then executes the creation operation of checkpoint, determines inspection to be created
At least one made an inventory of synchronizes block.
It should be noted that, by controlling the condition that checkpoint creates, can avoid in block chain in the present embodiment
Node the phenomenon that arbitrarily initiating to create, leading to block chain network fluctuation of service, further ensure that block data in block chain
Has high security.
S120 calculates the inspection point identification of checkpoint according to the data of the synchronization block in block chain.
In the present embodiment, it may include being stored in that the data of synchronous block, which refer to all data corresponding to synchronous block,
Block data in block, and it is stored in independently of block chain the data etc. of node local.Check that point identification refers to for only
The mark of the one a certain checkpoint of identification, can be used for representing the information etc. of synchronization block corresponding to checkpoint.Optionally, it checks
The calculation of point identification can store in block chain wound generation block or in the deployment data for updating configuration block, localized nodes
It need to be created according to block chain in generation block or update mode specified in the deployment data of configuration block and calculate inspection point identification;This
Outside, localized nodes can also be using the calculation such as public key of itself, private key or the signature algorithm such as SHA256 locally set
It calculates and checks point identification.
Specifically, localized nodes can breathe out the data of block synchronous in block chain using hash algorithm such as SHA256
Uncommon operation, and then obtain the inspection point identification of checkpoint.Can also block head data to each synchronous block or it is block-identified into
Row Hash operation obtains the inspection point identification of checkpoint.Different calculations determines the verifying of the data to synchronous block
Degree, subsequent embodiment introduce the determining scheme for checking point identification of different calculations for detailed.
S130 will check that point identification transmits in block chain network, to request other block chain link points to be verified, and it is anti-
Signature is approved in feedback.
In the present embodiment, approve that signature is that other block chain nodes verify to inspection point identification and use key such as private
Key feeds back to localized nodes after signing to the inspection point identification.Optionally, approve that in signature may include via other
Block chain node key, such as the key such as public key and node identification for checking point identification, other block chain nodes of private key signature
Deng.Wherein, node identification refers to the mark for a certain block chain node identities of unique identification, can be node ID or network IP
Address etc..
Specifically, localized nodes are marked in the checkpoint that checkpoint is calculated according to the data of the synchronization block in block chain
After knowledge, which can be transmitted in block chain network, to request other block chain nodes to the inspection point identification
It is verified and feeds back approval signature.After other block chain nodes receive the inspection point identification of localized nodes transmission, it can adopt
With calculation identical with localized nodes calculate checkpoint inspection point identification, and by the inspection point identification being calculated with connect
The inspection point identification of receipts is compared, if inconsistent, can send checkpoint identity verification failure information to block chain network
Or it does nothing;If consistent, signed using key such as private key to inspection point identification, it then will be via private key
The inspection point identification of signature and node public key etc. feed back to localized nodes together as signature is approved;Localized nodes receive it
The approval of his block chain node feeding back is signed.
S140 is locally corresponding to synchronous block record check if the approval signature received meets effective term
Point identification and approval signature.
In the present embodiment, effective term refers to that recognizing signable feedback meets preset requirement, i.e., other nodes are to this
The approval of checkpoint meets preset requirement.Specifically, can be it is preset recognize reach opposite needed for signable quantity
Ratio or absolute quantity etc. such as recognize the half that signable quantity is greater than block chain network total node number amount.In order to further right
The permission of checkpoint creation is managed, and optionally, effective term, which can also be configured in block chain wound generation block or update, matches
It sets in the deployment data of block, to guarantee that the effective term is difficult to be tampered and open and clear property.
Specifically, if localized nodes receive other block chain node feeding backs approval signature after, can be into ca authentication
The heart sends the effective number of nodes of query communication certificate, to obtain the number of nodes for participating in block chain network, or from local maintenance
Node identities mark table in inquiry obtain participate in block chain network number of nodes;Then obtained from block chain wound generation block
Effective term is taken, or is traversed forward from current block to obtain effective term, the effective term is based on, determines the approval received
Whether signature meets effective term;If approve signature meet effective term, be locally created synchronous block, check point identification and
Approve the incidence relation between signature three, and is stored in local pre-stored checkpoint concordance list or is stored in current block
It is medium, and then complete the creation operation of this checkpoint;If approve wrong tally signature close effective term, illustrate check point identification without
Effect, localized nodes can abandon the creation of this checkpoint.
Technical solution provided in an embodiment of the present invention, localized nodes then execute inspection when determining satisfaction setting trigger condition
The creation operation made an inventory of determines that at least one synchronization block of checkpoint to be created, the data based on synchronous block are calculated and checked
Point inspection point identification and request other block chain nodes to check point identification verified and feed back approval signature, then exist
In the case that the approval signature received meets effective term, synchronous block is being locally recorded, check point identification and is approving signature
Incidence relation between three, and then complete the creation of this checkpoint.If such as new section that block chain network is added of other nodes
Point need to carry out block and synchronize, then can be as unit of checkpoint, according to the synchronous block of point identification acquisition is checked, directly by synchronization zone
The data delivery node of block is local, does not need to repeat verification, therefore can speed up data and synchronize, and is that the data of block chain are same
Step provides a kind of new approaches.
Embodiment two
Fig. 2 is a kind of flow chart of the data processing method of block chain provided by Embodiment 2 of the present invention, and the present embodiment exists
On the basis of above-described embodiment, the inspection point identification of checkpoint is further calculated according to the data of the synchronization block in block chain
It is explained.Referring to fig. 2, this method specifically includes:
S210 determines at least one synchronization block of checkpoint to be created when determining satisfaction setting trigger condition.
S220 exports the block data of the synchronization block in block chain and this surface data, forms synchronization zone block file.
In the present embodiment, block data refers to the data being stored in block, this surface data refers to independently of block chain
It is stored in the data of node local.Illustratively, block data may include block body and block head, before block head is for storing
The Mei Keer that Transaction Information in one block-identified, block creation timestamp, random number, target Hash and the block is established
Tree root etc.;Block body is used for store transaction data itself.Due to operation function, implementing result and the transactions history of intelligent contract
The data volumes such as data are relatively huge, and do not spend transaction output data data volume relatively small.It is therefore preferable that in the present embodiment
In, block body does not spend transaction output data for storing;This surface data is used to store the operation function of intelligent contract and holds
Row is as a result, and for store transaction historical data etc..
Wherein, transaction output data i.e. UTXO (Unspent Transaction Output) data are not spent, are numbers
The basic unit of moneytary operations is the data structure comprising transaction data and execution code, it may also be said to be that certain address is such as
The encryption digital cash still not yet spent away that account B has been received.Based on UTXO data, by the input of transaction and defeated
Out, fund can be changing into one section of numeric structure (being referred to as Transaction or trade order).It is corresponding, it hands over
The digital cash that easy historical data is as spent away.Operation function refers to the mistake for running code segment corresponding to intelligent contract
Function involved in journey, specifically include function that the intelligence contract itself is written and there are dynamic binding relationship, in operation
The function etc. of calling.Implementing result is the result of output after running the corresponding code segment of intelligent contract.
Specifically, localized nodes are after at least one for determining checkpoint to be created synchronizes block, it can will be in block chain
The block data and this surface data of synchronous block export, and carry out serializing processing, form synchronization zone block file.Synchronous block
File is used to represent the data information of synchronization block corresponding to checkpoint, optionally, synchronization zone block file can for one or
It is multiple.
Illustratively, the block data of the synchronization block in block chain and this surface data are exported, forms synchronous block
File may include: that the block data of the synchronization block in block chain and the export of this surface data are formed a synchronous block
File;Or it by the block data of the synchronization block in block chain and this surface data, is exported respectively according to data type table, shape
At multiple synchronization zone block files.
In the present embodiment, data type refers to type involved in the data of synchronous block;It may include UTXO data, intelligence
It can contract data (data corresponding to the operation function and implementing result of intelligent contract) and three type of transaction history data
Type.For the ease of management, classification storage can be carried out according to data type, same type of data are stored in same tables of data
In, that is to say, that a kind of data are stored in a data type list, the number of data type table represents the species number of data.Cause
This, localized nodes can directly export the block data of block synchronous in block chain and this surface data, raw after being handled
At a synchronization zone block file;The data in one data type list can also be exported to form one according to data type table
Synchronization zone block file, and then form multiple synchronization zone block files.
Optionally, the data of the synchronization block in the present embodiment can be based on the database purchase number of Level DB form
According to.Therefore, if localized nodes are by the block data of the synchronization block in block chain and this surface data, according to data type table point
It does not export, forms multiple synchronization zone block files, then can be determined according to Level DB table name, block chain title and data type etc.
The title of each synchronization zone block file.For example, synchronization zone block file title are as follows: block chain title+data type (UTXO data/intelligence
Energy contract data/transaction history data)+Level DB table name.If localized nodes are by the block counts of the synchronization block in block chain
It is exported according to this surface data, forms a synchronization zone block file, the title of the synchronization zone block file then can be with direct basis area
Block chain title and Level DB table name determine.
In conclusion being not limited on only block chain originally in the embodiment of the present invention for calculating the data for checking point identification
Body storage data, can also include and associated surface data of block chain.The storage classification of this surface data is also not necessarily limited to
Above-mentioned three classes can be each storage table for needing and determining based on storage architecture.
S230 calculates the inspection point identification of checkpoint according to the data in the block file of synchronization zone.
It is provided in the deployment data for configuring block specifically, localized nodes can be created in generation block or be updated according to block chain
Mode or the calculation etc. that locally sets of localized nodes, calculate checkpoint mark according to the data in the block file of synchronization zone
Know.For example, Hash operation can be carried out to the data in the block file of synchronization zone using hash algorithm, cryptographic Hash is obtained, by the Kazakhstan
Inspection point identification of the uncommon value as checkpoint.
In the present embodiment, the quantity of synchronization zone block file is different, and the side for checking point identification is determined based on synchronization zone block file
Formula is different.Illustratively, according to the data in the block file of synchronization zone, the inspection point identification for calculating checkpoint may include: basis
Data in the block file of synchronization zone calculate cryptographic Hash, as inspection point identification.Specifically, localized nodes can use hash algorithm
Cryptographic Hash is calculated to the data in the block file of synchronization zone, using the cryptographic Hash as inspection point identification.
It may also is that each synchronization zone block file is calculated separately file cryptographic Hash, established according to each file cryptographic Hash
Mei Keer tree, using the root of Mei Keer tree as inspection point identification.In the present embodiment, file cryptographic Hash is based on a synchronous block
Data in file calculate what cryptographic Hash obtained.Specifically, localized nodes can use hash algorithm literary to each synchronous block
Part calculates separately file cryptographic Hash, then according to each file cryptographic Hash, Mei Keer tree is generated using Mei Keer tree algorithm, by plum
The root of Ke Er tree is as inspection point identification.
Further, it is also possible to cryptographic Hash be calculated according to the block head data of synchronous block, as inspection point identification.Specifically,
Localized nodes can obtain the block-identified of the synchronization block from the block head of each synchronous block, then by each synchronization zone
The block-identified number order according to each synchronous block of block is connected together as an entirety mark, and integrally marks to this
Know and calculate cryptographic Hash, obtains checking point identification;Can also block head data to each synchronous block calculate cryptographic Hash, then according to
According to each cryptographic Hash, Mei Keer tree is generated using Mei Keer tree algorithm, using the root of Mei Keer tree as inspection point identification.The present embodiment
In, the block head data based on synchronous block calculate the mode for checking point identification, are more suitable for the local not memory block chain of node
Lightweight node carry out subsequent synchronisation block data verification.
S240 will check that point identification transmits in block chain network, to request other block chain link points to be verified, and it is anti-
Signature is approved in feedback.
S250 is locally corresponding to synchronous block record check if the approval signature received meets effective term
Point identification and approval signature.
It should be noted that exported in the present embodiment by the block data and this surface data that will synchronize block, as
One entirety, that is, synchronization zone block file, so that the subsequent new node that block chain network is added can be straight when progress block chain is synchronous
It connects and imports synchronization zone block file locally, and then ensure that the block data not being only stored in block is able to carry out synchronization, and
It relies on block chain but the data for being stored in node local independently of block chain can also synchronize together, that is, ensure that synchronous area
While block chain is complete, synchronizing speed is accelerated.
Technical solution provided in an embodiment of the present invention, localized nodes are at least one synchronization zone for determining checkpoint to be created
After block, the block data of block synchronous in block chain and this surface data can be exported, and carry out serializing processing, be formed same
Walk block file;And the inspection point identification of checkpoint is calculated based on the data of synchronization zone block file and requests other block chain links
Point verifies inspection point identification and feeds back approval signature, then the case where the approval signature received meets effective term
Under, synchronous block is being locally recorded, check point identification and is approving the incidence relation between signature three, and then is completing this inspection
The creation of point.It can be single with checkpoint if such as new node that block chain network is added of other nodes need to carry out block and synchronize
Position synchronizes block according to checking that point identification obtains, directly that the data delivery node of synchronous block is local, does not need to repeat
Verification, therefore it is synchronous to can speed up data.
Embodiment three
Fig. 3 is a kind of flow chart of the data processing method for block chain that the embodiment of the present invention three provides, and the present embodiment exists
It is same locally corresponding to if the approval signature further received meets effective term on the basis of above-described embodiment
Step block records the inspection point identification and approves that signature is explained.Referring to Fig. 3, this method is specifically included:
S310 determines at least one synchronization block of checkpoint to be created when determining satisfaction setting trigger condition.
S320 calculates the inspection point identification of checkpoint according to the data of the synchronization block in block chain.
S330 will check that point identification transmits in block chain network, to request other block chain link points to be verified, and it is anti-
Signature is approved in feedback.
Optionally, approve in signature to may include marking via the checkpoint of other block chain node key such as private key signatures
Knowledge, the key such as public key and node identification of other block chain nodes etc..
S340 obtains the inspection point identification through other block chain node private key signatures from the approval signature received, with
And obtain the public key of other block chain nodes.
Specifically, sign after the approval signature for receiving other block chain node feeding backs for each approval, the machine section
Point can obtain the inspection point identification and the block chain link via a certain block chain node private key signature from approval signature
The public key of point is then carried out using the public key of the block chain node to using the inspection point identification of the block chain node private key signature
Identification obtains checking point identification;Obtained inspection point identification is compared with the inspection point identification of local computing, if unanimously,
Then illustrate that checkpoint mark is effective;If inconsistent, illustrate to check that point identification is invalid.
S350, if identified by the checkpoint that public key verifications are signed effective, it is determined that approve that signature is effective.
Specifically, for each inspection point identification via block chain node private key signature, if localized nodes pass through it is a certain
The public key verifications of block chain node identify effective via the checkpoint of the block chain node private key signature, it is determined that the block chain link
The fed back approval signature of point is effective;Otherwise, it determines the approval signature that the block chain node is fed back is invalid.
S360 is locally corresponding to synchronous block record if effectively recognizing signable quantity meets effective term
It checks point identification and approves signature.
Specifically, localized nodes can first determine the number of nodes for participating in block chain network, then from the area block Lian Chuanshi
Effective term is obtained in block, or is traversed forward from current block to obtain effective term, the effective term is based on, and is determined effective
Recognize whether signable quantity meets relative scale or absolute quantity specified in effective term;If meeting, it is being locally created
Synchronous block checks point identification and approves the incidence relation between signature three, and is stored in the local checkpoint constructed in advance
Concordance list or to be stored in current block medium;If not meeting, illustrate to check that point identification is invalid, localized nodes can abandon this inspection
The creation made an inventory of.
Technical solution provided in an embodiment of the present invention, localized nodes execute inspection when determining satisfaction setting trigger condition
The creation operation of point determines that at least one synchronization block of checkpoint to be created, the data based on synchronous block calculate checkpoint
Inspection point identification and request other block chain nodes to check point identification verified and feed back approval signature;Then dock
The signable validity of recognizing received is determined, and in the case where effective approval signature meets effective term, in local
Recording synchronism block checks point identification and approves the incidence relation between signature three, further to the permission of checkpoint creation
It is managed, it is ensured that block data has high security in block chain.If such as new node that block chain network is added of other nodes
It is synchronous need to carry out block, then can synchronize block according to checking that point identification obtains as unit of checkpoint, it directly will synchronous block
Data delivery nodes it is local, do not need to repeat verification, therefore can speed up that data are synchronous, be the data synchronization of block chain
Provide a kind of new approaches.
Example IV
Fig. 4 is a kind of flow chart of the method for data synchronization for block chain that the embodiment of the present invention four provides, and the present embodiment can
Node suitable for block chain network carries out the synchronous situation of block, is particularly suitable in block chain network, block is newly added
The node of chain network carries out the synchronous scene of block based on checkpoint.Checkpoint in the present embodiment can use above-described embodiment
In scheme created.The scheme of the embodiment of the present invention is applied to block chain node, and this method can be by the data of block chain
Synchronizing device executes, and the mode which can be used software and/or hardware is realized, and can be integrated in carrying block chain link point
It calculates in equipment.Referring to fig. 4, this method specifically includes:
S410 initiates block synchronization request to inspection node, and checks the data of the synchronization block of node feeding back, inspection
It makes an inventory of mark and approves signature.
In the present embodiment, check that node refers to that block chain network interior joint has locally constructed or stored the block chain of checkpoint
Node, corresponding inspection node identification are block chain node identification;Block synchronization request refers to the node in block chain network
It needs to carry out generated request when block chain synchronizes, may include node identification in block synchronization request, can also include institute
The mark etc. of the synchronization block and each synchronous block that need to synchronize.Optionally, if generating block synchronization request may include: area
Block chain node be the new node that block chain is added or block chain node due to communication quality or by malicious attack etc. other because
It is local to need synchronous downloading block chain whens element leads to block chain lack part or whole block of block chain node etc., then it generates
Block synchronization request.Optionally, block synchronization request can be initiated from block chain node itself to inspection node;It can also be and work as
When preceding block generation node or other permission nodal tests need to carry out the synchronization of block chain to other block chain nodes, saved to checking
The initiated request etc. of point.In the present embodiment, preferably block chain node itself initiates block synchronization request to inspection node.
Checkpoint, which is identified as, checks that node calculates determination according to the data of synchronous block, approves that signature is other nodes to inspection
It makes an inventory of mark and verify and feed back to inspection node.The data of synchronous block refer to all data corresponding to synchronous block,
It may include the block data being stored in block, and be stored in the data etc. of node local independently of block chain.It is exemplary
, the data of synchronous block may include: one as derived from the block data and this surface data of the synchronization block in block chain
A synchronization zone block file;Or block data and this surface data by the synchronization block in block chain, according to data type table point
Not derived multiple synchronization zone block files.Block data includes block body and block head, and block body does not spend transaction for storing
Output data;This surface data is used to store the operation function and implementing result of intelligent contract, and is used for store transaction history
Data.
Specifically, block chain node can be sent out when needing to carry out the synchronization of block chain to the inspection node in block chain network
Play block synchronization request;It checks that node receives the block synchronization request that block chain node is initiated, can synchronize and ask according to block
The mark of synchronous block needed for asking is searched in the checkpoint concordance list being locally stored, the inspection met the requirements if it exists
It makes an inventory of, then to the data of block chain node feedback synchronization block, inspection point identification and approval signature;If checking, node is not deposited locally
In the checkpoint met the requirements, then a checkpoint for meeting block chain node demand can be temporarily created, and to block chain node
The data of feedback synchronization block check point identification and approve signature.Wherein, storage checks point identification, same in the concordance list of checkpoint
It walks block, approve the incidence relation between signature three.
It should be noted that the corresponding one group of synchronous block in a checkpoint, inspection point identification and approval signature, block chain link
The received synchronous block of point institute checks point identification and approves that signature can be multiple groups.For example, the area of synchronization needed for localized nodes
Block is data of the 0th block to the 200th block, and checks that synchronization block corresponding to checkpoint A constructed by node is
0th block is to the 100th block;Synchronization block corresponding to the B of checkpoint is the 101st block to the 200th block, this
When, localized nodes will receive two groups of synchronous blocks, and check point identification and approve signature.Optionally, the synchronous block of multiple groups, inspection
Point identification and approval signature can derive from same inspection node, can also derive from multiple inspection nodes.
It illustratively, can also include: before that block chain node determines block to checking that node initiates block synchronization request
Block chain node (checking node) mark of checkpoint has been constructed in chain network.Specifically, block chain node can be to block chain
Checkpoint acquisition request is sent in network, then the feedback according to other block chain nodes, will construct the block chain of checkpoint
Node initiates block synchronization request to corresponding inspection node as node is checked, according to inspection node identification.
S420, according to the authenticity for approving that signature verification checks point identification.
In the present embodiment, due to checking node when creating checkpoint, it need to will check that point identification passes in block chain network
It is defeated, to request other block chain nodes to verify the inspection point identification, and feed back approval signature.Therefore, block chain node
It can be according to the authenticity recognized signable quantity and carry out validation check point identification for checking that node is fed back.Specifically, block chain
What the determining inspection node of node was fed back recognizes signable quantity, and participates in the number of nodes of block chain network;Then foundation
Approve the number of nodes of signed data and block chain network, determines and recognize signable quantity and participation block chain network number of nodes
Between ratio whether be greater than setting ratio value, or recognize signable quantity and participate in block chain network number of nodes it
Between absolute difference whether be greater than setting quantity;If meeting any of the above-described kind of situation, it is determined that check that point identification is true;If
It is unsatisfactory for any of the above-described kind of situation, it is determined that the inspection point identification for checking that node is fed back is not true in vain.
S430, if checking that point identification is true, according to the data validity of the synchronous block of checkpoint identity verification.
Specifically, block chain node in the case where determining the inspection true situation of point identification, can be fed back according to inspection node
Synchronization block data, using with check that the identical calculation of node calculates and check point identification, and the inspection that will be calculated
It makes an inventory of mark and is compared with the inspection point identification for checking node feeding back, if unanimously, illustrating that the data of synchronous block are true
, that is to say, that check that the data etc. of synchronous block are not played tricks or distorted to node;If inconsistent, can be sent out to block chain network
The checking request of the data including synchronous block is sent, is checked with requesting other block chain nodes to calculate according to the data of synchronous block
Point identification is simultaneously fed back, and the result confirmation according to feedback is that block chain node calculates incorrect or checks the synchronization that node is fed back
The data of block are wrong etc..
Illustratively, it may is that according to the data validity of the synchronous block of checkpoint identity verification according to synchronous block text
Data in part calculate cryptographic Hash, as point identification is checked, are compared with the inspection point identification received, true with verify data
Reality;Each synchronization zone block file is either calculated separately into file cryptographic Hash, Mei Keer is established according to each file cryptographic Hash
Tree is compared using the root of Mei Keer tree as point identification is checked with the inspection point identification received, true with verify data
Property.If localized nodes are lightweight node, it can also be and calculate cryptographic Hash according to the block head data of synchronous block, as inspection
Point identification is compared, with data authenticity validating etc. with the inspection point identification received.
The data validity of S440, synchronous block are verified, then store the data of synchronous block.
Specifically, if block chain node according to the data of the synchronous block of checkpoint identity verification be it is true, can be straight
It connects the data delivery node of the associated synchronous block of the inspection point identification is local.In addition, if block synchronization request is to work as proparea
Block generates what node was initiated, then current block generates node after the data validity of synchronization block is verified, and can incite somebody to action
The data of synchronous block are fed directly to need the node of synchronous block chain, so that the data of synchronous block are imported section by the node
Point is local, and it is synchronous to carry out completion block chain.
It should be noted that if block chain node also is stored in some blocks not after the data for storing synchronous block
Synchronous, block chain node then needs to synchronize remaining block one by one, until reaching newest block at this time.
Technical solution provided in an embodiment of the present invention, block chain node, can be to inspections when needing to carry out the synchronization of block chain
It looks into node and initiates block synchronization request, requesting the data for checking the synchronous block of node feeding back, checking point identification and approving signature;
Then according to the authenticity for approving inspection point identification received by signature verification for checking node feeding back, checking that point identification is true
In the case where reality, again according to the data validity of the synchronous block of checkpoint identity verification;It is finally true in the data of synchronous block
When reality is verified, the data of synchronous block are stored.This programme, if such as new node that block chain network is added of other nodes needs
It is synchronous to carry out block, then the data for checking the associated synchronous block of point identification can be introduced directly into section as unit of checkpoint
Point is local, does not need to repeat verification, while guaranteeing that synchronous block chain is complete, accelerates synchronizing speed, is block
The data of chain have simultaneously provided a kind of new approaches.
Embodiment five
Fig. 5 is a kind of flow chart of the method for data synchronization for block chain that the embodiment of the present invention five provides, and the present invention is implemented
Example on the basis of the above embodiments, further checks that the authenticity of point identification explains to according to approval signature verification
It is bright.Referring to Fig. 5, this method is specifically included:
S510 initiates block synchronization request to inspection node, and checks the data of the synchronization block of node feeding back, inspection
It makes an inventory of mark and approves signature.
Wherein, checkpoint, which is identified as, checks that node calculates determination according to the data of synchronous block, approves signature for other sections
Point carries out verifying to inspection point identification and feeds back to inspection node.Optionally, approve that in signature may include via other blocks
The inspection point identification of chain node key such as private key signature, the key such as public key and node identification of other block chain nodes etc..One
A inspection point identification is associated, and to recognize signable number be multiple.
S520 obtains each public key for approving other corresponding nodes of signing from inspection node.
Specifically, each public affairs for approving other nodes corresponding to acquisition in signature that block chain node is fed back from inspection node
Key is then identified to using the inspection point identification of other node private key signatures using the public key of other nodes, is checked
Point identification;Obtained inspection point identification is compared with the inspection point identification for checking node feeding back, if unanimously, illustrating to check
Point identification is effective;If inconsistent, illustrate to check that point identification is invalid.
S530, if effective using the checkpoint mark of other node private key signatures by public key verifications, it is determined that approve
Signature is effective.
Specifically, if block chain node is by the public key verifications of a certain block chain node via the block chain node private key label
The checkpoint mark of name is effective, it is determined that the corresponding approval signature of the block chain node is effective;Otherwise, it determines the block chain node
Corresponding approval signature is invalid.
S540, if effectively recognizing signable quantity meets effective term, it is determined that check the authenticity of point identification.
In the present embodiment, effective term refers to that recognizing signable feedback meets preset requirement, i.e., other nodes are to this
The approval of checkpoint meets preset requirement.Specifically, can be it is preset recognize reach opposite needed for signable quantity
Ratio or absolute quantity etc. such as recognize the half that signable quantity is greater than block chain network total node number amount.In order to further right
The permission of checkpoint creation is managed, and optionally, effective term, which can also be configured in block chain wound generation block or update, matches
It sets in the deployment data of block, to guarantee that the effective term is difficult to be tampered and open and clear property.
Specifically, block chain node can first determine the number of nodes for participating in block chain network, generation then is created from block chain
Effective term is obtained in block, or is traversed forward from current block to obtain effective term, the effective term is based on, and is determined effective
Recognize whether signable quantity meets relative scale or absolute quantity specified in effective term;If meeting, it is determined that check
The inspection point identification that node is fed back is true;If not meeting, illustrate to check that point identification is invalid, block chain node can be abandoned
The data of the synchronization block fed back according to the inspection node carry out the synchronous operation of block chain.
S550, if checking that point identification is true, according to the data validity of the synchronous block of checkpoint identity verification.
The data validity of S560, synchronous block are verified, then store the data of synchronous block.
Technical solution provided in an embodiment of the present invention, block chain node, can be to inspections when needing to carry out the synchronization of block chain
It looks into node and initiates block synchronization request, requesting the data for checking the synchronous block of node feeding back, checking point identification and approving signature;
Then according to the authenticity for approving inspection point identification received by signature verification for checking node feeding back, checking that point identification is true
In the case where reality, again according to the data validity of the synchronous block of checkpoint identity verification;It is finally true in the data of synchronous block
When reality is verified, the data of synchronous block are stored.This programme, if such as new node that block chain network is added of other nodes needs
It is synchronous to carry out block, then the data for checking the associated synchronous block of point identification can be introduced directly into section as unit of checkpoint
Point is local, does not need to repeat verification, while guaranteeing that synchronous block chain is complete, accelerates synchronizing speed, is block
The data of chain have simultaneously provided a kind of new approaches.
Embodiment six
Fig. 6 is a kind of structural schematic diagram of the data processing equipment for block chain that the embodiment of the present invention six provides, the device
It is configured in block chain node, the data processing method of block chain provided by the embodiment of the present invention one, two and three can be performed,
Have the corresponding functional module of execution method and beneficial effect.As shown in fig. 6, the device includes:
Block determining module 610 is checked, for determining checkpoint to be created extremely when determining satisfaction setting trigger condition
A few synchronous block;
Computing module 620 is identified, the checkpoint for calculating checkpoint according to the data of the synchronization block in block chain is marked
Know;
Identification transmission module 630, for that will check that point identification transmits in block chain network, to request other block chain links
Point is verified, and feeds back approval signature;
Logging modle 640 is locally corresponding to synchronization zone if the approval signature for receiving meets effective term
Block record check point identification and approval signature.
Technical solution provided in an embodiment of the present invention, localized nodes then execute inspection when determining satisfaction setting trigger condition
The creation operation made an inventory of determines that at least one synchronization block of checkpoint to be created, the data based on synchronous block are calculated and checked
Point inspection point identification and request other block chain nodes to check point identification verified and feed back approval signature, then exist
In the case that the approval signature received meets effective term, synchronous block is being locally recorded, check point identification and is approving signature
Incidence relation between three, and then complete the creation of this checkpoint.If such as new section that block chain network is added of other nodes
Point need to carry out block and synchronize, then can be as unit of checkpoint, according to the synchronous block of point identification acquisition is checked, directly by synchronization zone
The data delivery node of block is local, does not need to repeat verification, therefore can speed up data and synchronize, and is that the data of block chain are same
Step provides a kind of new approaches.
Illustratively, logging modle 640 specifically can be used for:
The inspection point identification through other block chain node private key signatures is obtained from the approval signature received, and is obtained
The public key of other block chain nodes;
If identified by the checkpoint that public key verifications are signed effective, it is determined that approve that signature is effective;
If effectively recognizing signable quantity meets effective term, locally corresponding to synchronous block record check point
Mark and approval signature.
Illustratively, mark computing module 620 may include:
File forms unit, for exporting the block data of the synchronization block in block chain and this surface data, is formed
Synchronization zone block file;
Computing unit is identified, for calculating the inspection point identification of checkpoint according to the data in the block file of synchronization zone.
Illustratively, file forms unit and specifically can be used for:
The block data of synchronization block in block chain and this surface data are exported, a synchronization zone block file is formed;
Or
By the block data of the synchronization block in block chain and this surface data, exported respectively according to data type table, shape
At multiple synchronization zone block files.
Illustratively, block data includes block body and block head, and block body does not spend transaction output data for storing;
This surface data is used to store the operation function and implementing result of intelligent contract, and is used for store transaction historical data.
Illustratively, mark computing unit specifically can be used for:
Cryptographic Hash is calculated according to the data in the block file of synchronization zone, as inspection point identification;Or
Each synchronization zone block file is calculated separately into file cryptographic Hash, Mei Keer tree is established according to each file cryptographic Hash,
Using the root of Mei Keer tree as inspection point identification.
Illustratively, trigger condition and effective term are set, configuration block is configured in block chain wound generation block or updates
Deployment data in.
Illustratively, check that block determining module 610 specifically can be used for:
By the local newest block height deposited, setting offset block amount is subtracted, and subtracts setting detection range block
Amount, starting point block of the difference serial number block obtained as synchronous block, starting point block is plus setting detection range block amount
Terminal block as synchronous block.
Embodiment seven
Fig. 7 is a kind of structural schematic diagram of the data synchronization unit for block chain that the embodiment of the present invention seven provides, the device
It is configured in block chain node, the method for data synchronization of block chain provided by the embodiment of the present invention four and five, tool can be performed
The standby corresponding functional module of execution method and beneficial effect.As shown in fig. 7, the device includes:
Communication module 710 for initiating block synchronization request to inspection node, and checks the synchronization zone of node feeding back
The data and inspection point identification and approval signature of block, wherein checkpoint, which is identified as, checks node according to the data meter of synchronous block
Calculation determines that approval signature carries out verifying to inspection point identification for other nodes and feeds back to inspection node;
Identity verification module 720, for according to the authenticity for approving that signature verification checks point identification;
Data Verification module 730, if for checking that point identification is true, according to the synchronous block of checkpoint identity verification
Data validity;
Data memory module 740, the data validity for synchronizing block are verified, then store the number of synchronous block
According to.
Technical solution provided in an embodiment of the present invention, block chain node, can be to inspections when needing to carry out the synchronization of block chain
It looks into node and initiates block synchronization request, requesting the data for checking the synchronous block of node feeding back, checking point identification and approving signature;
Then according to the authenticity for approving inspection point identification received by signature verification for checking node feeding back, checking that point identification is true
In the case where reality, again according to the data validity of the synchronous block of checkpoint identity verification;It is finally true in the data of synchronous block
When reality is verified, the data of synchronous block are stored.This programme, if such as new node that block chain network is added of other nodes needs
It is synchronous to carry out block, then the data for checking the associated synchronous block of point identification can be introduced directly into section as unit of checkpoint
Point is local, does not need to repeat verification, while guaranteeing that synchronous block chain is complete, accelerates synchronizing speed, is block
The data of chain have simultaneously provided a kind of new approaches.
Illustratively, identity verification module 720 is specifically used for:
Each public key for approving other corresponding nodes of signing is obtained from inspection node;
If effective using the checkpoint mark of other node private key signatures by public key verifications, it is determined that approve that signature has
Effect;
If effectively recognizing signable quantity meets effective term, it is determined that check the authenticity of point identification.
Illustratively, the data of synchronous block may include:
A synchronization zone block file as derived from the block data and this surface data of the synchronization block in block chain;Or
It is derived more respectively according to data type table by the block data and this surface data of the synchronization block in block chain
A synchronization zone block file.
Illustratively, block data includes block body and block head, and block body does not spend transaction output data for storing;
This surface data is used to store the operation function and implementing result of intelligent contract, and is used for store transaction historical data.
Illustratively, Data Verification module 730 specifically can be used for:
Cryptographic Hash is calculated according to the data in the block file of synchronization zone, as point identification is checked, is marked with the checkpoint received
Knowledge is compared, with data authenticity validating;Or
Each synchronization zone block file is calculated separately into file cryptographic Hash, Mei Keer tree is established according to each file cryptographic Hash,
Using the root of Mei Keer tree as point identification is checked, it is compared with the inspection point identification received, with data authenticity validating.
Embodiment eight
Fig. 8 is a kind of structural schematic diagram for equipment that the embodiment of the present invention eight provides.Fig. 8, which is shown, to be suitable for being used to realizing this
The block diagram of the example devices 12 of invention embodiment.The equipment 12 that Fig. 8 is shown is only an example, should not be to of the invention real
The function and use scope for applying example bring any restrictions.The calculating that equipment 12 typically undertakes block chain network nodal function is set
It is standby.
As shown in figure 8, equipment 12 is showed in the form of universal computing device.If 12 component can include but is not limited to:
One or more processor or processing unit 16, system storage 28 connect different system components (including system storage
28 and processing unit 16) bus 18.
Bus 18 indicates one of a few class bus structures or a variety of, including memory bus or Memory Controller,
Peripheral bus, graphics acceleration port, processor or the local bus using any bus structures in a variety of bus structures.It lifts
For example, these architectures include but is not limited to industry standard architecture (ISA) bus, microchannel architecture (MAC)
Bus, enhanced isa bus, Video Electronics Standards Association (VESA) local bus and peripheral component interconnection (PCI) bus.
Equipment 12 typically comprises a variety of computer system readable media.These media can be it is any can be by equipment 12
The usable medium of access, including volatile and non-volatile media, moveable and immovable medium.
System storage 28 may include the computer system readable media of form of volatile memory, such as arbitrary access
Memory (RAM) 30 and/or cache memory 32.Equipment 12 may further include it is other it is removable/nonremovable,
Volatile/non-volatile computer system storage medium.Only as an example, storage system 34 can be used for reading and writing irremovable
, non-volatile magnetic media (Fig. 8 do not show, commonly referred to as " hard disk drive ").Although being not shown in Fig. 8, use can be provided
In the disc driver read and write to removable non-volatile magnetic disk (such as " floppy disk "), and to removable anonvolatile optical disk
The CD drive of (such as CD-ROM, DVD-ROM or other optical mediums) read-write.In these cases, each driver can
To be connected by one or more data media interfaces with bus 18.System storage 28 may include that at least one program produces
Product, the program product have one group of (for example, at least one) program module, these program modules are configured to perform of the invention each
The function of embodiment.
Program/utility 40 with one group of (at least one) program module 42 can store and store in such as system
In device 28, such program module 42 includes but is not limited to operating system, one or more application program, other program modules
And program data, it may include the realization of network environment in each of these examples or certain combination.Program module 42
Usually execute the function and/or method in embodiment described in the invention.
Equipment 12 can also be communicated with one or more external equipments 14 (such as keyboard, sensing equipment, display 24 etc.),
Can also be enabled a user to one or more equipment interacted with the equipment 12 communication, and/or with enable the equipment 12 with
One or more of the other any equipment (such as network interface card, modem etc.) communication for calculating equipment and being communicated.It is this logical
Letter can be carried out by input/output (I/O) interface 22.Also, equipment 12 can also by network adapter 20 and one or
The multiple networks of person (such as local area network (LAN), wide area network (WAN) and/or public network, such as internet) communication.As shown,
Network adapter 20 is communicated by bus 18 with other modules of equipment 12.It should be understood that although not shown in the drawings, can combine
Equipment 12 use other hardware and/or software module, including but not limited to: microcode, device driver, redundant processing unit,
External disk drive array, RAID system, tape drive and data backup storage system etc..
Processing unit 16 by the program that is stored in system storage 28 of operation, thereby executing various function application and
Data processing, such as realize the data processing of block chain and/or the data side of synchronization of block chain provided by the embodiment of the present invention
Method.
Embodiment nine
The embodiment of the present invention nine additionally provides a kind of computer readable storage medium, is stored thereon with computer program, should
Program can realize that the data of the data processing of block chain and/or block chain described in above-described embodiment are same when being executed by processor
Step.The computer readable storage medium can be configured on block chain node.
The computer storage medium of the embodiment of the present invention, can be using any of one or more computer-readable media
Combination.Computer-readable medium can be computer-readable signal media or computer readable storage medium.It is computer-readable
Storage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device or
Device, or any above combination.The more specific example (non exhaustive list) of computer readable storage medium includes: tool
There are electrical connection, the portable computer diskette, hard disk, random access memory (RAM), read-only memory of one or more conducting wires
(ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-
ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer-readable storage
Medium can be any tangible medium for including or store program, which can be commanded execution system, device or device
Using or it is in connection.
Computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited
In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can
Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for
By the use of instruction execution system, device or device or program in connection.
The program code for including on computer-readable medium can transmit with any suitable medium, including --- but it is unlimited
In wireless, electric wire, optical cable, RF etc. or above-mentioned any appropriate combination.
The computer for executing operation of the present invention can be write with one or more programming languages or combinations thereof
Program code, described program design language include object oriented program language-such as Java, Smalltalk, C++,
Further include conventional procedural programming language-such as " C " language or similar programming language.Program code can be with
It fully executes, partly execute on the user computer on the user computer, being executed as an independent software package, portion
Divide and partially executes or executed on a remote computer or server completely on the remote computer on the user computer.?
Be related in the situation of remote computer, remote computer can pass through the network of any kind --- including local area network (LAN) or
Wide area network (WAN)-be connected to subscriber computer, or, it may be connected to outer computer (such as mentioned using Internet service
It is connected for quotient by internet).
Note that the above is only a better embodiment of the present invention and the applied technical principle.It will be appreciated by those skilled in the art that
The invention is not limited to the specific embodiments described herein, be able to carry out for a person skilled in the art it is various it is apparent variation,
It readjusts and substitutes without departing from protection scope of the present invention.Therefore, although being carried out by above embodiments to the present invention
It is described in further detail, but the present invention is not limited to the above embodiments only, without departing from the inventive concept, also
It may include more other equivalent embodiments, and the scope of the invention is determined by the scope of the appended claims.
Claims (17)
1. a kind of data processing method of block chain, which is characterized in that be applied to block chain node, which comprises
When determining satisfaction setting trigger condition, at least one synchronization block of checkpoint to be created is determined;
The inspection point identification of the checkpoint is calculated according to the data of the synchronization block in block chain;
The inspection point identification is transmitted in block chain network, to request other block chain link points to be verified, and feeds back and recognizes
It can sign;
If the approval signature received meets effective term, the inspection point identification is recorded locally corresponding to synchronous block
It signs with approving.
2. the method according to claim 1, wherein if receive approval signature meet effective term,
The inspection point identification and approval signature are recorded locally corresponding to synchronous block, includes:
The inspection point identification through other block chain node private key signatures is obtained from the approval signature received, and obtains other
The public key of block chain node;
If identified by the checkpoint of signature described in the public key verifications effective, it is determined that the approval signature is effective;
If effectively recognizing signable quantity meets effective term, the checkpoint is recorded locally corresponding to synchronous block
Mark and approval signature.
3. the method according to claim 1, wherein according to the calculating of the data of the synchronization block in block chain
The inspection point identification of checkpoint includes:
The block data of synchronization block in the block chain and this surface data are exported, synchronization zone block file is formed;
According to the data in the synchronization zone block file, the inspection point identification of the checkpoint is calculated.
4. according to the method described in claim 3, it is characterized in that, by the block data of the synchronization block in the block chain and
The export of this surface data, forms synchronization zone block file, comprising:
The block data of synchronization block in the block chain and this surface data are exported, a synchronization zone block file is formed;
Or
By the block data of the synchronization block in the block chain and this surface data, exported respectively according to data type table, shape
At multiple synchronization zone block files.
5. according to the method described in claim 3, it is characterized by:
The block data includes block body and block head, and the block body does not spend transaction output data for storing;
Described surface data is used to store the operation function and implementing result of intelligent contract, and is used for store transaction history number
According to.
6. according to the method described in claim 4, it is characterized in that, calculating institute according to the data in the synchronization zone block file
The inspection point identification for stating checkpoint includes:
Cryptographic Hash is calculated according to the data in the synchronization zone block file, as the inspection point identification;Or
Each synchronization zone block file is calculated separately into file cryptographic Hash, Mei Keer tree is established according to each file cryptographic Hash, by plum
The root of Ke Er tree is as the inspection point identification.
7. according to the method described in claim 1, it is characterized by:
The setting trigger condition and effective term are configured in block chain wound generation block or update the deployment data of configuration block
In.
8. the method according to claim 1, wherein determine that at least one of checkpoint to be created synchronizes block,
Include:
By the local newest block height deposited, setting offset block amount is subtracted, and subtracts setting detection range block amount, institute
Starting point block of the difference serial number block of acquisition as synchronous block, starting point block is plus setting detection range block amount as same
Walk the terminal block of block.
9. a kind of method of data synchronization of block chain, which is characterized in that be applied to block chain node, comprising:
Block synchronization request is initiated to inspection node, and checks the data of the synchronization block of node feeding back, check point identification
It signs with approving, wherein the checkpoint, which is identified as, checks that node is determined according to the data calculating of synchronous block, the approval label
Other entitled nodes carry out verifying to inspection point identification and feed back to the inspection node;
The authenticity of point identification is checked according to the approval signature verification;
If the inspection point identification is true, the data validity of synchronous block according to the checkpoint identity verification;
The data validity of the synchronous block is verified, then stores the data of the synchronous block.
10. according to the method described in claim 9, it is characterized in that, checking point identification according to the approval signature verification
Authenticity, comprising:
Each public key for approving other corresponding nodes of signing is obtained from the inspection node;
If identified effectively by the public key verifications using the checkpoint of other node private key signatures, it is determined that the approval label
Name is effectively;
If effectively recognizing signable quantity meets effective term, it is determined that the authenticity for checking point identification.
11. according to the method described in claim 9, it is characterized in that, the data of the synchronous block include:
A synchronization zone block file as derived from the block data and this surface data of the synchronization block in the block chain;Or
It is derived more respectively according to data type table by the block data and this surface data of the synchronization block in the block chain
A synchronization zone block file.
12. according to the method for claim 11, it is characterised in that:
The block data includes block body and block head, and the block body does not spend transaction output data for storing;
Described surface data is used to store the operation function and implementing result of intelligent contract, and is used for store transaction history number
According to.
13. according to the method for claim 11, which is characterized in that the synchronous block according to the checkpoint identity verification
Data validity, comprising:
Cryptographic Hash is calculated according to the data in the synchronization zone block file, as point identification is checked, is marked with the checkpoint received
Knowledge is compared, with data authenticity validating;Or
Each synchronization zone block file is calculated separately into file cryptographic Hash, Mei Keer tree is established according to each file cryptographic Hash, by plum
The root of Ke Er tree is compared, with data authenticity validating as point identification is checked with the inspection point identification received.
14. a kind of data processing equipment of block chain, which is characterized in that be configured in block chain node, described device includes:
Block determining module is checked, for determining at least one of checkpoint to be created when determining satisfaction setting trigger condition
Synchronous block;
Computing module is identified, for calculating the inspection point identification of the checkpoint according to the data of the synchronization block in block chain;
Identification transmission module, for transmitting the inspection point identification in block chain network, to request other block chain nodes
It is verified, and feeds back approval signature;
Logging modle is locally corresponding to synchronous block record if the approval signature for receiving meets effective term
The inspection point identification and approval signature.
15. a kind of data synchronization unit of block chain, which is characterized in that be configured in block chain node, described device includes:
Communication module for initiating block synchronization request to inspection node, and checks the number of the synchronization block of node feeding back
It signs according to inspection point identification and approval, wherein the checkpoint is identified as the data calculating for checking node according to synchronous block
It determines, the approval signature carries out verifying to inspection point identification for other nodes and feeds back to the inspection node;
Identity verification module, for checking the authenticity of point identification according to the approval signature verification;
Data Verification module, it is synchronous according to the checkpoint identity verification if true for the inspection point identification
The data validity of block;
Data memory module, the data validity for the synchronous block are verified, then store the number of the synchronous block
According to.
16. a kind of equipment, which is characterized in that the equipment includes:
One or more processors;
Storage device, for storing one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
Now as any in the data processing method of block chain described in any one of claims 1-8, or realization such as claim 9-13
The method of data synchronization of the block chain.
17. a kind of storage medium, is stored thereon with computer program, which is characterized in that the realization when program is executed by processor
Such as data processing method of block chain described in any one of claims 1-8, or realize such as institute any in claim 9-13
The method of data synchronization for the block chain stated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811465309.2A CN109587238B (en) | 2018-12-03 | 2018-12-03 | Data processing and synchronizing method, device, equipment and storage medium of block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811465309.2A CN109587238B (en) | 2018-12-03 | 2018-12-03 | Data processing and synchronizing method, device, equipment and storage medium of block chain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109587238A true CN109587238A (en) | 2019-04-05 |
CN109587238B CN109587238B (en) | 2021-08-03 |
Family
ID=65926821
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811465309.2A Active CN109587238B (en) | 2018-12-03 | 2018-12-03 | Data processing and synchronizing method, device, equipment and storage medium of block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109587238B (en) |
Cited By (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110187831A (en) * | 2019-05-13 | 2019-08-30 | 华宇金信(北京)软件有限公司 | The block data storage system and method for block chain alliance chain |
CN110601816A (en) * | 2019-09-18 | 2019-12-20 | 腾讯科技(深圳)有限公司 | Lightweight node control method and device in block chain system |
CN110727644A (en) * | 2019-09-29 | 2020-01-24 | 南京金宁汇科技有限公司 | Method, system and storage medium for cutting block chain data |
CN110765193A (en) * | 2019-10-22 | 2020-02-07 | 深圳前海微众银行股份有限公司 | Method and device for exporting block chain data |
CN110825776A (en) * | 2019-11-07 | 2020-02-21 | 腾讯云计算(北京)有限责任公司 | Air quality detection report processing method and device, computing equipment and storage medium |
CN111211876A (en) * | 2020-01-02 | 2020-05-29 | 支付宝(杭州)信息技术有限公司 | Method and device for sending response message aiming at data request and block chain system |
CN111212059A (en) * | 2019-12-31 | 2020-05-29 | 北航(四川)西部国际创新港科技有限公司 | Distributed information processing method and system based on ADS-B |
CN111464539A (en) * | 2020-03-31 | 2020-07-28 | 中国联合网络通信集团有限公司 | Block chain accounting method and accounting node |
CN112118107A (en) * | 2020-08-12 | 2020-12-22 | 北京大学 | Self-adaptive execution method for realizing data credibility |
CN112243008A (en) * | 2020-10-16 | 2021-01-19 | 中国联合网络通信集团有限公司 | Data management method and device |
CN112383610A (en) * | 2020-11-11 | 2021-02-19 | 上海保险交易所股份有限公司 | Synchronous processing method and system for block chain state data |
CN112819463A (en) * | 2021-01-15 | 2021-05-18 | 山大地纬软件股份有限公司 | Block chain high-concurrency signature checking method and system based on trusted key system |
CN113065867A (en) * | 2021-03-30 | 2021-07-02 | 上海万向区块链股份公司 | System, method and medium for data playback-based incompatible blockchain upgrade |
CN115495531B (en) * | 2022-11-17 | 2023-03-24 | 山东区块链研究院 | Block chain data synchronization method and system based on check point |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108234134A (en) * | 2017-12-28 | 2018-06-29 | 江苏通付盾科技有限公司 | Block synchronous method and system |
CN108646983A (en) * | 2018-05-08 | 2018-10-12 | 北京融链科技有限公司 | The treating method and apparatus of storage service data on block chain |
CN108769173A (en) * | 2018-05-21 | 2018-11-06 | 阿里体育有限公司 | The block chain implementation method and equipment of the intelligent contract of operation |
US20180323964A1 (en) * | 2015-11-09 | 2018-11-08 | Nippon Telegraph And Telephone Corporation | Blockchain Generation Apparatus, Blockchain Generation Method, Blockchain Verification Apparatus, Blockchain Verification Method, and Program |
-
2018
- 2018-12-03 CN CN201811465309.2A patent/CN109587238B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180323964A1 (en) * | 2015-11-09 | 2018-11-08 | Nippon Telegraph And Telephone Corporation | Blockchain Generation Apparatus, Blockchain Generation Method, Blockchain Verification Apparatus, Blockchain Verification Method, and Program |
CN108234134A (en) * | 2017-12-28 | 2018-06-29 | 江苏通付盾科技有限公司 | Block synchronous method and system |
CN108646983A (en) * | 2018-05-08 | 2018-10-12 | 北京融链科技有限公司 | The treating method and apparatus of storage service data on block chain |
CN108769173A (en) * | 2018-05-21 | 2018-11-06 | 阿里体育有限公司 | The block chain implementation method and equipment of the intelligent contract of operation |
Cited By (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110187831A (en) * | 2019-05-13 | 2019-08-30 | 华宇金信(北京)软件有限公司 | The block data storage system and method for block chain alliance chain |
CN110601816B (en) * | 2019-09-18 | 2021-09-28 | 腾讯科技(深圳)有限公司 | Lightweight node control method and device in block chain system |
CN110601816A (en) * | 2019-09-18 | 2019-12-20 | 腾讯科技(深圳)有限公司 | Lightweight node control method and device in block chain system |
CN110727644A (en) * | 2019-09-29 | 2020-01-24 | 南京金宁汇科技有限公司 | Method, system and storage medium for cutting block chain data |
CN110727644B (en) * | 2019-09-29 | 2022-06-24 | 南京金宁汇科技有限公司 | Method, system and storage medium for cutting block chain data |
CN110765193A (en) * | 2019-10-22 | 2020-02-07 | 深圳前海微众银行股份有限公司 | Method and device for exporting block chain data |
CN110765193B (en) * | 2019-10-22 | 2024-03-15 | 深圳前海微众银行股份有限公司 | Block chain data export method and device |
CN110825776A (en) * | 2019-11-07 | 2020-02-21 | 腾讯云计算(北京)有限责任公司 | Air quality detection report processing method and device, computing equipment and storage medium |
CN110825776B (en) * | 2019-11-07 | 2023-04-18 | 腾讯云计算(北京)有限责任公司 | Air quality detection report processing method and device, computing equipment and storage medium |
CN111212059A (en) * | 2019-12-31 | 2020-05-29 | 北航(四川)西部国际创新港科技有限公司 | Distributed information processing method and system based on ADS-B |
CN111211876B (en) * | 2020-01-02 | 2021-10-12 | 支付宝(杭州)信息技术有限公司 | Method and device for sending response message aiming at data request and block chain system |
CN111211876A (en) * | 2020-01-02 | 2020-05-29 | 支付宝(杭州)信息技术有限公司 | Method and device for sending response message aiming at data request and block chain system |
CN111464539A (en) * | 2020-03-31 | 2020-07-28 | 中国联合网络通信集团有限公司 | Block chain accounting method and accounting node |
CN112118107B (en) * | 2020-08-12 | 2021-08-27 | 北京大学 | Self-adaptive execution method for realizing data credibility |
CN112118107A (en) * | 2020-08-12 | 2020-12-22 | 北京大学 | Self-adaptive execution method for realizing data credibility |
CN112243008A (en) * | 2020-10-16 | 2021-01-19 | 中国联合网络通信集团有限公司 | Data management method and device |
CN112243008B (en) * | 2020-10-16 | 2023-06-02 | 中国联合网络通信集团有限公司 | Data management method and device |
CN112383610A (en) * | 2020-11-11 | 2021-02-19 | 上海保险交易所股份有限公司 | Synchronous processing method and system for block chain state data |
CN112383610B (en) * | 2020-11-11 | 2022-12-09 | 上海保险交易所股份有限公司 | Synchronous processing method and system for block chain state data |
CN112819463A (en) * | 2021-01-15 | 2021-05-18 | 山大地纬软件股份有限公司 | Block chain high-concurrency signature checking method and system based on trusted key system |
CN113065867A (en) * | 2021-03-30 | 2021-07-02 | 上海万向区块链股份公司 | System, method and medium for data playback-based incompatible blockchain upgrade |
CN115495531B (en) * | 2022-11-17 | 2023-03-24 | 山东区块链研究院 | Block chain data synchronization method and system based on check point |
Also Published As
Publication number | Publication date |
---|---|
CN109587238B (en) | 2021-08-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109587238A (en) | The data processing of block chain and synchronous method, device, equipment and storage medium | |
CN109542888A (en) | The data modification and synchronous method of block chain, device, equipment and storage medium | |
AU2022200535B2 (en) | Method and system for blockchain variant using digital signatures | |
CN105573828B (en) | A kind of operation processing method and device | |
CN109361734A (en) | A kind of data processing method, device, equipment and the medium of block chain | |
CN111327648B (en) | Processing method and system based on block chain intelligent contract | |
CN108961052A (en) | Verification method, storage method, device, equipment and the medium of block chain data | |
KR20210003234A (en) | Maintaining blocks of a blockchain in a segmented blockchain network | |
EP3779760B1 (en) | Blockchain-based data processing method and apparatus, and electronic device | |
CN107220820A (en) | Resource transfers method, device and storage medium | |
CN109241192A (en) | The data modification and block verification method, device, equipment and medium of block chain | |
KR101937220B1 (en) | Method for generating and verifying a digital signature or message authentication code based on a block chain that does not require key management | |
TW202016817A (en) | Block chain based transaction processing method and device and electronic equipment | |
CN109344631A (en) | The data modification and block verification method, device, equipment and medium of block chain | |
CN109754267A (en) | Brand authorization method, device, equipment and medium based on block chain | |
CN108596588A (en) | A kind of processing method of block data, device, computing device and storage medium | |
CN112118239B (en) | Block chain consensus method and device, electronic equipment and storage medium | |
CN109213901A (en) | A kind of method of data synchronization, device, equipment and the medium of block chain | |
CN101051895B (en) | Certifying method and system for integrated biological certification and attribute certificate | |
CN109727044A (en) | Brand transaction methods, device, equipment and medium based on block chain | |
CN109194651A (en) | A kind of identity identifying method, device, equipment and storage medium | |
CN110599175A (en) | Block processing method and related equipment | |
JP7447127B2 (en) | Preventing the sending of accidental copies of data records to a distributed ledger system | |
CN109347803A (en) | A kind of data processing method, device, equipment and the medium of block chain | |
CN110460445A (en) | A kind of loophole process chain network architecture producing benefit based on information security industry |
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 |