CN109672733A - The account book synchronous method and equipment of block chain based on DAG - Google Patents

The account book synchronous method and equipment of block chain based on DAG Download PDF

Info

Publication number
CN109672733A
CN109672733A CN201811561762.3A CN201811561762A CN109672733A CN 109672733 A CN109672733 A CN 109672733A CN 201811561762 A CN201811561762 A CN 201811561762A CN 109672733 A CN109672733 A CN 109672733A
Authority
CN
China
Prior art keywords
block
sequencing
transaction
chain node
bit array
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
Application number
CN201811561762.3A
Other languages
Chinese (zh)
Other versions
CN109672733B (en
Inventor
吴小川
干泽俊
朱博亨
买提阿布都拉·奥布力喀斯木
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baibao Shanghai Technology Co ltd
Shanghai Zhongan Information Technology Service Co ltd
Original Assignee
Zhongan Information Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongan Information Technology Service Co Ltd filed Critical Zhongan Information Technology Service Co Ltd
Priority to CN201811561762.3A priority Critical patent/CN109672733B/en
Publication of CN109672733A publication Critical patent/CN109672733A/en
Application granted granted Critical
Publication of CN109672733B publication Critical patent/CN109672733B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic 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/3236Cryptographic 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 using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Business, Economics & Management (AREA)
  • Computer Security & Cryptography (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

Present disclosure discloses the account book synchronous method and equipment of the block chain based on DAG, the described method includes: receiving the sequencing block ID for the first sequencing block that the first block chain node is stored, wherein, the first sequencing block is the highest sequencing block of sequence number value for the sequencing block ID that the first block chain node is stored;Determine the sequencing block ID of the second sequencing block that is locally stored whether less than the first sequencing block sequencing block ID, wherein the second sequencing block is the highest sequencing block of sequence number value for the sequencing block ID being locally stored;In the case where determining the sequencing block ID of the sequencing block ID of the second sequencing block less than the first sequencing block, the first synchronization request is sent to the first block chain node;And receive sequencing block corresponding with the first synchronization request and transaction block.Present disclosure disclose block chain node realize to the account book of the block chain based on DAG high speed restore with synchronous method, improve data transmission efficiency and reduce transmission time, transmission cost.

Description

The account book synchronous method and equipment of block chain based on DAG
Technical field
Present disclosure belongs to block chain technical field, more particularly to the account book synchronous method of the block chain based on DAG with And the account book synchronizer of the block chain based on DAG.
Background technique
The block catenary system of directed acyclic graph (Directed acyclic graph, DAG) structure is as a kind of distribution The realization of account book provides the oncurrent processing ability more powerful compared to traditional chain type block chain, is the forward position of distributed account book Technology.
In the block chain based on DAG, the latter block (transaction block or sequencing block) needs to link during generation Preposition block known to one or more (for example, transaction block or sequencing block) contains the Kazakhstan of two preposition blocks in block head Uncommon value, so that entire account book shows a kind of netted structure.Link movement can be executed concurrently, and the same preposition block can To be linked simultaneously by multiple postposition blocks.The node of all operations is owned by the complete pair of the block chain based on DAG in network This, so as to reach the common recognition in account book structure.
However, in the existing block chain based on DAG, when the block chain node of any new addition does not have complete block When chain copy, need to be restored from adjacent node with it is synchronous.Since the block chain based on DAG is a kind of unidirectional structure, According to the mode that it is generated, latter block records the cryptographic Hash of previous block, but previous block does not record the Kazakhstan of latter block Uncommon value, and whole network is not stringent orderly, so that relatively difficult for the recovery operation of DAG account book.
In the prior art, the account book recovery of the block chain based on DAG is mainly carried out using recursive mode preposition The retrospect of transaction obtains.After block chain node receives newest block by way of broadcast, local whether obtained judged The preposition transaction of the transaction is got.If it is not, requesting the transaction to adjacent node.If got, pass Return the preposition transaction for checking the preposition transaction, until tracing back to wound generation block (that is, first sequencing block).It is limited by link One-way, postposition transaction can not be obtained from wound generation BOB(beginning of block) batch, also without significant regional for dividing simultaneously in network Bulk transfer, therefore for the node completely new for one, the recovery of account book is related to very more round trip messages, expends a large amount of Time.
Summary of the invention
Preposition transaction is carried out by the way of recurrence retrospect since the block chain based on DAG currently on the market is substantially Retrospect obtain, therefore, for the node completely new for one, recoverys of account book is related to round trip messages much more very, expends greatly The time of amount.
In view of the above-mentioned problems, the account book that the first aspect of present disclosure proposes a kind of block chain based on DAG is synchronous Method, wherein the block chain based on DAG includes multiple transaction blocks and one or more sequencing blocks, and each is handed over Easy block directly quotes other transaction blocks or sequencing block, each sequencing block directly quotes transaction block or other sequencing blocks, each The transaction block that a sequencing block directly quotes it and a part transaction being determined of block of indirect referencing, the sequencing block is extremely It less include sequencing block ID, the sequencing block ID of each sequencing block is the serial number incremented by successively according to generation time sequencing, described Method includes:
Receive the sequencing block ID for the first sequencing block that the first block chain node is stored, wherein the first sequencing block is The highest sequencing block of sequence number value for the sequencing block ID that the first block chain node is stored;
Determine whether the sequencing block ID for the second sequencing block being locally stored is less than the sequencing block ID of the first sequencing block, In, the second sequencing block is the highest sequencing block of sequence number value for the sequencing block ID being locally stored;
In the case where determining that the sequencing block ID of the second sequencing block is less than the sequencing block ID of the first sequencing block, to The first block chain node sends the first synchronization request, wherein first synchronization request includes at least request and stored All sequencing blocks in the first block chain node, bigger than the sequencing block ID of the second sequencing block and its determined The All Activity block of change;
Receive sequencing block corresponding with first synchronization request and transaction block.
According to present disclosure in a first aspect, receiving sequencing block corresponding with first synchronization request and friendship After easy block, the method further includes:
Determine whether received highest sequencing block ID is equal to the sequencing block ID of the first sequencing block;
In the case where determining that received highest sequencing block ID is less than the sequencing block ID of the first sequencing block, to The first block chain node sends the second synchronization request, wherein second synchronization request, which includes at least request and obtains, compares institute Receive the big all sequencing blocks of highest sequencing block ID and the All Activity block of its determinization;
Receive sequencing block corresponding with second synchronization request and transaction block.
According to present disclosure in a first aspect, the sequencing of the first sequencing block stored in the first block chain node In the case that block ID changes, the method further includes:
After receiving sequencing block corresponding with first synchronization request and transaction block, determination is received most Whether high sequencing block ID is equal to the sequencing block ID of newest first sequencing block;
Determining feelings of the received highest sequencing block ID less than the sequencing block ID of the newest first sequencing block Under condition, Xiang Suoshu the first block chain node sends the second synchronization request, wherein second synchronization request includes at least request and obtains Obtain the All Activity block of all sequencing blocks and its determinization bigger than received highest sequencing block ID;
Receive sequencing block corresponding with second synchronization request and transaction block.
According to present disclosure in a first aspect, the second sequencing block sequencing block ID and the first sequencing block In the identical situation of sequencing block ID, the method further includes:
It trades block for all first kind for being locally stored, generates the first bit array that length is m, wherein described the One kind transaction block is the transaction block for not being sequenced block determinization also, 10000≤m≤100000 and m is integer;
Receive the second bit array that the length from the first block chain node is m, wherein second bit number Group is for all first kind transaction block bit array generated stored in the first block chain node;
Determine whether first bit array is identical as second bit array;
In the case where determining that first bit array is different from second bit array, first block is determined The storage of chain node but local not stored one or more first kind transaction block;
Third synchronization request is sent to the first block chain node, wherein the third synchronization request is included at least and asked It asks and obtains not stored one or more first kind transaction block store in the first block chain node but local;
Receive transaction block corresponding with the third synchronization request.
According to present disclosure in a first aspect, for all first kind transaction block, the first bit number that length is m is generated Group or the second bit array further comprise:
It trades block for each first kind of the first block chain node be locally stored or described storage, utilizes described the One kind transaction block carries out k hash function operation, to obtain k cryptographic Hash: H1(x)、H2(x),…,Hk(x), wherein 5≤k≤ 10 and k is integer, and x is perhaps block Hash, and 0≤H in the block of the transaction blocky(x)≤m (y=1,2 ..., k and Hy It (x) is integer);
It generates length and is the source bit array of m, and each position of the source bit array is compiled in sequence Number to form position serial number;
The determining institute rheme serial number equal with each first kind transaction each cryptographic Hash of block;
The value of position corresponding with identified position serial number in the source bit array is set as 1, to generate length as m The first bit array or the second bit array.
According to present disclosure in a first aspect, determining that first bit array is different from second bit array In the case where, determine that not stored transaction block that the first block chain node stores but local further comprises:
The value of corresponding positions in the value of each and second bit array in first bit array is carried out Compare, using position serial number corresponding to the existing position with different value between as difference position serial number;
Based on difference position serial number, determine it is being stored in the first block chain node but it is local not stored one or Multiple cryptographic Hash;
It is handed over based on each first kind stored in one or more of cryptographic Hash and the first block chain node All cryptographic Hash of easy block determine not stored first kind transaction block store in the first block chain node but local.
According to directly drawing in a first aspect, not finding it in local in any transaction block being locally stored for present disclosure With or indirect referencing transaction block or sequencing block, or any sequencing block for being locally stored do not quote directly locally finding its Or in the case where the transaction block or sequencing block of indirect referencing, the method further includes:
Based on the header information of the transaction block or sequencing block that are locally stored, its directly reference or indirect not found is determined The transaction block of reference or the block Hash of sequencing block;
The 4th synchronization request is generated based on described piece of Hash;
The 4th synchronization request is sent to the first block chain node;
In the feelings of the first block chain node storage transaction block corresponding with the 4th synchronization request or sequencing block Under condition, corresponding transaction block or sequencing block from the first block chain node are received.
In view of the above-mentioned problems, the account book that the first aspect of present disclosure proposes a kind of block chain based on DAG is synchronous Equipment, wherein the block chain based on DAG includes multiple transaction blocks and one or more sequencing blocks, and each is handed over Easy block directly quotes other transaction blocks or sequencing block, each sequencing block directly quotes transaction block or other sequencing blocks, each The transaction block that a sequencing block directly quotes it and a part transaction being determined of block of indirect referencing, the sequencing block is extremely It less include sequencing block ID, the sequencing block ID of each sequencing block is the serial number incremented by successively according to generation time sequencing, described Equipment includes:
Processor;And
Memory makes the processor execute following operation when described instruction executes for storing instruction:
Receive the sequencing block ID for the first sequencing block that the first block chain node is stored, wherein the first sequencing block is The highest sequencing block of sequence number value for the sequencing block ID that the first block chain node is stored;
Determine whether the sequencing block ID for the second sequencing block being locally stored is less than the sequencing block ID of the first sequencing block, In, the second sequencing block is the highest sequencing block of sequence number value for the sequencing block ID being locally stored;
In the case where determining that the sequencing block ID of the second sequencing block is less than the sequencing block ID of the first sequencing block, to The first block chain node sends the first synchronization request, wherein first synchronization request includes at least request and stored All sequencing blocks in the first block chain node, bigger than the sequencing block ID of the second sequencing block and its determined The All Activity block of change;
Receive sequencing block corresponding with first synchronization request and transaction block.
According to the second aspect of the present disclosure, sequencing block corresponding with first synchronization request and friendship are being received After easy block, the processor is made further to execute following operation when described instruction executes:
Determine whether received highest sequencing block ID is equal to the sequencing block ID of the first sequencing block;
In the case where determining that received highest sequencing block ID is less than the sequencing block ID of the first sequencing block, to The first block chain node sends the second synchronization request, wherein second synchronization request, which includes at least request and obtains, compares institute Receive the big all sequencing blocks of highest sequencing block ID and the All Activity block of its determinization;And
Receive sequencing block corresponding with second synchronization request and transaction block.
According to the second aspect of the present disclosure, the sequencing of the first sequencing block stored in the first block chain node In the case that block ID changes, the processor is made further to execute following operation when described instruction executes:
After receiving sequencing block corresponding with first synchronization request and transaction block, determination is received most Whether high sequencing block ID is equal to the sequencing block ID of newest first sequencing block;
Determining feelings of the received highest sequencing block ID less than the sequencing block ID of the newest first sequencing block Under condition, Xiang Suoshu the first block chain node sends the second synchronization request, wherein second synchronization request includes at least request and obtains Obtain the All Activity block of all sequencing blocks and its determinization bigger than received highest sequencing block ID;And
Receive sequencing block corresponding with second synchronization request and transaction block.
According to the second aspect of the present disclosure, in the sequencing block ID of the second sequencing block and the first sequencing block In the identical situation of sequencing block ID, the processor is made further to execute following operation when described instruction executes:
It trades block for all first kind for being locally stored, generates the first bit array that length is m, wherein described the One kind transaction block is the transaction block for not being sequenced block determinization also, 10000≤m≤100000 and m is integer;
Receive the second bit array that the length from the first block chain node is m, wherein second bit number Group is for all first kind transaction block bit array generated stored in the first block chain node;
Determine whether first bit array is identical as second bit array;
In the case where determining that first bit array is different from second bit array, first block is determined The storage of chain node but local not stored one or more first kind transaction block;
Third synchronization request is sent to the first block chain node, wherein the third synchronization request is included at least and asked It asks and obtains not stored one or more transaction blocks store in the first block chain node but local;
Receive transaction block corresponding with the third synchronization request.
According to the second aspect of the present disclosure, for all first kind transaction block, the first bit number that length is m is generated Group or the second bit array further comprise:
It trades block for each first kind of the first block chain node be locally stored or described storage, utilizes described the One kind transaction block carries out k hash function operation, to obtain k cryptographic Hash: H1(x)、H2(x),…,Hk(x), wherein 5≤k≤ 10 and k is integer, and x is perhaps block Hash, and 0≤H in the block of the transaction blocky(x)≤m (y=1,2 ..., k and Hy It (x) is integer);
It generates length and is the source bit array of m, and each position of the source bit array is compiled in sequence Number to form position serial number;
The determining institute rheme serial number equal with each first kind transaction each cryptographic Hash of block;
The value of position corresponding with identified position serial number in the source bit array is set as 1, to generate length as m The first bit array or the second bit array.
According to the second aspect of the present disclosure, determining that first bit array is different from second bit array In the case where, determine that not stored transaction block that the first block chain node stores but local further comprises:
The value of corresponding positions in the value of each and second bit array in first bit array is carried out Compare, using position serial number corresponding to the existing position with different value between as difference position serial number;
Based on difference position serial number, determine it is being stored in the first block chain node but it is local not stored one or Multiple cryptographic Hash;
It is handed over based on each first kind stored in one or more of cryptographic Hash and the first block chain node All cryptographic Hash of easy block determine not stored transaction block store in the first block chain node but local.
According to the second aspect of the present disclosure, it is not found in local in any transaction block being locally stored directly to draw With or indirect referencing transaction block or sequencing block, or any sequencing block for being locally stored do not quote directly locally finding its Or in the case where the transaction block or sequencing block of indirect referencing, when described instruction execute when the processor is further executed with Lower operation:
Based on the header information of the transaction block or sequencing block that are locally stored, its directly reference or indirect not found is determined The transaction block of reference or the block Hash of sequencing block;
The 4th synchronization request is generated based on described piece of Hash;
The 4th synchronization request is sent to the first block chain node;And
In the feelings of the first block chain node storage transaction block corresponding with the 4th synchronization request or sequencing block Under condition, corresponding transaction block or sequencing block from the first block chain node are received.
The account book synchronous method and equipment of the block chain based on DAG according to present disclosure can be by based on DAG Block chain in the sequencing block periodically generated is added, enable be located at different sequencing blocks section in block be defined sequence, The transaction of same sequence can be by batch synchronization;In addition, present disclosure proposes for the block after newest sequencing block Account book increment synchronization mode based on Bloom filter avoids great number time and communications cost that recurrence obtains transaction, pole The earth improves the synchronous performance of block.
Detailed description of the invention
It refers to the following detailed description in conjunction with the accompanying drawings, the feature, advantage and other aspects of the presently disclosed embodiments will become Must be more obvious, show several embodiments of the disclosure by way of example rather than limitation herein, in the accompanying drawings:
Fig. 1 is the process of one of embodiment of account book synchronous method of block chain based on DAG according to present disclosure Figure;
Fig. 2 is two process of the embodiment of the account book synchronous method of the block chain based on DAG according to present disclosure Figure;
Fig. 3 is the structural schematic diagram of the block chain based on DAG according to present disclosure;And
Fig. 4 shows the schematic diagram of the account book synchronizer of the block chain based on DAG according to present disclosure.
Specific embodiment
Below with reference to each exemplary embodiment of the attached drawing detailed description disclosure.Flow chart and block diagram in attached drawing are shown The architecture, function and operation in the cards of method and system according to various embodiments of the present disclosure.It should be noted that Each box in flowchart or block diagram can represent a part of a module, program segment or code, the module, program Section or a part of code may include one or more holding for realizing the logic function of defined in each embodiment Row instruction.It should also be noted that in some alternative implementations, function marked in the box can also be attached according to being different from The sequence marked in figure occurs.For example, two boxes succeedingly indicated can actually be basically executed in parallel or it Can also execute in a reverse order sometimes, this depend on related function.It should also be noted that flow chart And/or the combination of each box in block diagram and the box in flowchart and or block diagram, function as defined in execution can be used Can or the dedicated hardware based system of operation realize, or specialized hardware can be used and the combination of computer instruction comes It realizes.
Term as used herein "include", "comprise" and similar terms are understood to open term, i.e., " including/including but not limited to ", expression can also include other content.Term "based" is " being based at least partially on ".Term " one embodiment " expression " at least one embodiment ";Term " another embodiment " expression " at least one other embodiment ", Etc..
Technology, method and apparatus known to person of ordinary skill in the relevant may be not discussed in detail, but suitable In the case of, the technology, method and apparatus should be considered as part of specification.For between each unit in attached drawing Line, it is only for convenient for explanation, indicate that the unit at least line both ends is in communication with each other, it is not intended that limitation does not connect It can not be communicated between the unit of line.
The embodiment of present disclosure is primarily upon following technical problem: all fortune in the block chain network based on DAG Capable node is owned by the complete copy of the DAG account book, so as to reach the common recognition in account book structure.A node not When having complete copy, need to be restored from adjacent node with it is synchronous.Since DAG is a kind of unidirectional graph structure, according to Its mode generated, latter block (for example, transaction block or sequencing block) record previous block (for example, transaction block or sequencing block) Cryptographic Hash, but previous block does not record the cryptographic Hash of latter block, and whole network is not stringent orderly, so that for DAG account This recovery operation is relatively difficult.
To solve the above-mentioned problems, present disclosure is by being added the sequencing block periodically generated in the block chain based on DAG, Enable being determined of transaction block (that is, transaction having the same highly) being located in different sequencing blocks region, and makes Transaction block with same transaction height can be by batch synchronization.For the block after newest sequencing block (for example, transaction Block), present disclosure also proposed a kind of account book increment synchronization mode based on Bloom filter, avoids recurrence and obtains transaction The great number time and communications cost, significantly improve block (or account book) synchronous performance.
Fig. 1 shows the exemplary process diagram of the account book synchronous method of the block chain based on DAG.
In this disclosure, the block chain based on DAG includes multiple transaction blocks and one or more sequencing block, And each transaction block directly quotes other transaction blocks or sequencing block, each sequencing block directly quotes transaction block or other A part transaction being determined of block of sequencing block, the transaction block that each sequencing block directly quotes it and indirect referencing, The sequencing block includes at least sequencing block ID, and the sequencing block ID of each sequencing block is incremented by successively according to time sequencing is generated Serial number.
As shown in figure 3, the latter block (for example, transaction block or sequencing block) is producing in the structure of the block chain based on DAG It needs to link in raw process preposition block known to one or more (for example, transaction block, sequencing block and/or wound generation block), one As block header information in contain the cryptographic Hash of two preposition blocks so that entire account book shows a kind of netted knot Structure.In this disclosure, it trades in the header information of block and at least further includes other than the cryptographic Hash of two preposition block Transaction height, type of transaction, source account information, purpose account information etc..
In this disclosure, network is periodically by way of common common recognition (for example, proof of work (Power of Working, abbreviation PoW), equity proves (Power of Stake, abbreviation PoS), acts on behalf of equity and prove (Delegated Proof of Stake, abbreviation DPoS), practical Byzantine failure tolerance (Practical Byzantine Fault Tolerance, Abbreviation PBFT) etc.) generate and broadcast a sequencing block;In addition to the cryptographic Hash of two preposition block in the header information of sequencing block Except at least further include the information such as transaction height, stringent orderly incremental sequencing block ID, trading order.In this disclosure, First block in block chain based on DAG, which is referred to as, creates generation block, is the sequencing block of the serial number 0 of sequencing block ID.
It can be seen that the sequencing block (that is, wound generation block) and sequencing block Seq1, Seq2, Seq3 of serial number 0 in Fig. 3 (its sequencing block ID is 1,2,3 respectively), and each sequencing block can be to a part transaction being determined of block operation, example Such as, as shown in figure 3, multiple transaction blocks in sequencing block Seq1 determinization region (1), so that the transaction height of sequencing block Seq1 (namely sequencing block ID) is identical as by each transaction transaction height of block of its determinization;Sequencing block Seq2 determinization region (2) multiple transaction blocks in, so that the transaction height (namely sequencing block ID) of sequencing block Seq2 and each by its determinization The transaction height of transaction block is identical;Multiple transaction blocks in sequencing block Seq3 determinization region (3), so that sequencing block Seq3 Transaction height (namely sequencing block ID) is identical as by each transaction transaction height of block of its determinization.
In the present embodiment, any block chain node (being properly termed as " local block chain link point " in this disclosure) can It is specific as follows to implement method shown in FIG. 1:
Step 110: receiving the sequencing block ID for the first sequencing block that the first block chain node is stored.Wherein, described first Sequencing block is the highest sequencing block of sequence number value for the sequencing block ID that the first block chain node is stored.
For example, when storing sequencing block ID in the first block chain node and being respectively equal to 0,1,2,3,4,5 sequencing block, institute State the sequencing block that the first sequencing block is sequencing block ID=5.
Step 120: determine the sequencing block ID of the second sequencing block that is locally stored whether less than the first sequencing block sequencing block ID.Wherein, the second sequencing block is the highest sequencing block of sequence number value for the sequencing block ID being locally stored.
For example, when storing sequencing block ID in local block chain link point and being respectively equal to 0,1,2,3 sequencing block, described the Two sequencing blocks are the sequencing blocks of sequencing block ID=3.
Step 130: in the case where determining the sequencing block ID of the sequencing block ID of the second sequencing block less than the first sequencing block, to First block chain node sends the first synchronization request.Wherein, first synchronization request includes at least request acquisition and is stored in institute State all of all sequencing blocks in the first block chain node, bigger than the sequencing block ID of the second sequencing block and its determinization Transaction block.
For example, in the above-described embodiments, the first synchronization request that local block chain link o'clock is sent to the first block chain node In include request obtain sequencing block ID=4 and 5 sequencing block and these sequencing block institute determinizations All Activity block.
Step 140: receiving sequencing block corresponding with first synchronization request and transaction block.
In this disclosure, it is same can successively to issue multiple first according to the sequence of sequencing block ID for local block chain link point Step request.For example, in the above-described embodiments, the first synchronization request that local block chain link point issues first only includes that request obtains The sequencing block of sequencing block ID=4 and its transaction block of institute's determinization;In the friendship for receiving corresponding sequencing block and its institute's determinization In the case where easy block, the first synchronization request that local block chain link point issues again only includes that request obtains determining for sequencing block ID=5 The transaction block of sequence block and its institute's determinization then receives corresponding sequencing block and its institute's determinization from the first block chain node Transaction block.
After step 140, block chain node also proceeds as follows:
First, determine whether received highest sequencing block ID is equal to the sequencing block ID of the first sequencing block.
Second, determining the case where received highest sequencing block ID is less than the sequencing block ID of the first sequencing block Under, Xiang Suoshu the first block chain node sends the second synchronization request, wherein second synchronization request includes at least request and obtains Big all sequencing blocks and the All Activity block of its determinization than received highest sequencing block ID.
Third receives sequencing block corresponding with second synchronization request and transaction block.
Above-mentioned steps are for ensuring that local block chain link point can be in synchronization gain the first block chain in this disclosure Not stored all sequencing blocks and block of trading accordingly in storage but local block chain link point.
In addition, the case where the sequencing block ID for the first sequencing block that the first block chain node is stored changes Under, following steps can also be performed in block chain node:
Firstly, determination is received after receiving sequencing block corresponding with first synchronization request and transaction block To highest sequencing block ID whether be equal to the sequencing block ID of newest first sequencing block.
Secondly, determining sequencing block ID of the received highest sequencing block ID less than the newest first sequencing block In the case where, Xiang Suoshu the first block chain node sends the second synchronization request, wherein second synchronization request is included at least and asked Seek the All Activity block for obtaining all sequencing blocks and its determinization bigger than received highest sequencing block ID.
For example, then passing through step 140 as the sequencing block ID=7 for the first sequencing block that the first block chain node is stored Highest sequencing block ID=5 received by local block chain link point later, then local block chain link point is needed to the firstth area Block chain node sends the second synchronization request, obtains sequencing block ID=6,7 sequencing block and its transaction block of institute's determinization with request.
Finally, receiving sequencing block corresponding with second synchronization request and transaction block.
Fig. 1 the disclosed embodiments are that there are sequencing block ID sequences between local block chain link point and the first block chain node The case where number difference, so that the process of the respective block of local block chain link point full dose synchronization gain the first block chain node.Institute Disclosed embodiment can be avoided great number time and the communications cost that block is obtained using recursive fashion.
In addition, as shown in Fig. 2, the sequencing block ID phase of sequencing block ID and the first sequencing block in the second sequencing block With in the case where, it is also necessary to realize that increment synchronization block, local block chain link point specifically execute such as using Bloom filter technology Lower step:
Step 210: for all first kind transaction block being locally stored, generating the first bit array that length is m.Its In, first kind transaction block is the transaction block for not being sequenced block determinization also, 10000≤m≤100000 and m is integer.
In this disclosure, for all first kind transaction block, the first bit array or the second ratio that length is m are generated Special array further comprises:
First, for each first kind transaction block of the first block chain node be locally stored or described storage, utilize The k hash function operation that the first kind transaction block is arranged in advance, to obtain k cryptographic Hash: H1(x)、H2(x),…, Hk(x), wherein 5≤k≤10 and k are integers, and x is perhaps block Hash, and 0≤H in the block of the transaction blocky(x)≤m(y =1,2 ... k and HyIt (x) is integer).
Second, generate length be m source bit array, and by each position of the source bit array in sequence into Row number is to form a serial number.
In the present embodiment, each initial set value in source bit array generated is set to 0.
Third, the determining institute rheme serial number equal with each first kind transaction each cryptographic Hash of block.
4th, the value of position corresponding with identified position serial number in the source bit array is set as 1, to generate length Degree is the first bit array or the second bit array of m.
For example, the cryptographic Hash difference 0,3,5,7,300 of some first kind transaction block in some block chain node, another The cryptographic Hash of first kind transaction block distinguishes 1,25,100,107,300, then the 0th of bit array generated, the 3rd, the 5th Position, the 7th, the 300th, the 1st, the 25th, the 100th, the 107th value be 1.
The disclosure uses the combination of hash function and Bloom filter technology, realizes determining either block chain node (example Such as, the first block chain node or local block chain link point) each specific first kind transaction block for being stored.
Step 220: receiving the second bit array that the length from the first block chain node is m.Wherein, described Two bit arrays are for all first kind transaction block bit array generated stored in the first block chain node.
Step 230: determining whether first bit array is identical as second bit array.
Step 240: in the case where determining that first bit array is different from second bit array, described in determination The storage of first block chain node but local not stored one or more first kind transaction block.
This step specifically includes:
Firstly, by the value of the corresponding positions in the value of each and second bit array in first bit array It is compared, using position serial number corresponding to the existing position with different value between as difference position serial number.
Secondly, based on each first kind transaction stored in difference position serial number and the first block chain node All cryptographic Hash of block determine not stored one or more cryptographic Hash store in the first block chain node but local.
Finally, based on stored in one or more of cryptographic Hash and the first block chain node each first All cryptographic Hash of class transaction block determine not stored first kind transaction store in the first block chain node but local Block.
For example, the 0th, 1,3,5,7,25,100,107 and 300 respectively equal to 1 in the first bit array, the second ratio The the 0th, 1,3,5,7,25,100,107,251,295 and 300 respectively equal to 1 in special array;It can then determine the first bit The difference position serial number of array and the second bit array is the 251st and 295.Then which stored in the first block chain node is checked The cryptographic Hash of one or more first kind transaction blocks is equal to 251 or 295;Finding one or more corresponding first kind transaction blocks In the case where, determine that these first kind transaction block is the not stored first kind transaction block of local block chain link point.
Step 250: Xiang Suoshu the first block chain node sends third synchronization request.Wherein, the third synchronization request is extremely Few includes that request obtains not stored one or more first kind transaction block store in the first block chain node but local.
Step 260: receiving transaction block corresponding with the third synchronization request.
First block chain node obtains it from local block chain link point by the way of similar with step 220-260 and does not deposit Stored transaction block in storage but local block chain link point.
Block chain block techniques disclosed in present disclosure based on Bloom filter increment synchronization based on DAG, can The message back reduced during increment synchronization significantly comes number and size.For example, when needing synchronous 10000 local block chains When the not stored block of node (n=10000), if k=8 hash function of selection, only needs to transmit 558,962 bits The information whether the first block chain node possesses each block can be transferred to local block chain link point by (68KB), and False positive rate (that is, itself not stored but be considered the probability of stored block) is less than 0.00001%, and specific algorithm is such as Under:
P=pow (1-exp (- k/ (m/n)), k);
Wherein, p --- false positive rate;N --- need synchronous number of blocks;The length of m --- bit array.
Also, false negative rate (that is, the probability for itself having stored but being considered not stored block) is 0.With it is existing Common synchronization strategy is compared, and according to (for example, block chain based on DAG) the case where network structure, needs round trip message at least Log2 (10000) -1=12 times, most 9999 times;And the disclosure only needs to carry out 1 round trip message and can get 99.99999% missing transaction.
In addition, in this disclosure, when any transaction block being locally stored not locally find its directly reference or The transaction block or sequencing block of indirect referencing, or any sequencing block for being locally stored not locally find its directly reference or When connecing the transaction block or sequencing block of reference, block chain node executes following steps:
Firstly, the header information based on the transaction block or sequencing block that are locally stored, determines that its not found is directly quoted Or the block Hash of trade block or the sequencing block of indirect referencing.
Secondly, generating the 4th synchronization request based on described piece of Hash.
Again, the first block of Xiang Suoshu chain node sends the 4th synchronization request.
4th, transaction block corresponding with the 4th synchronization request or sequencing block are stored in the first block chain node In the case where, receive corresponding transaction block or sequencing block from the first block chain node.
Above-described embodiment is that local block chain link point is still failed to after synchronous, increment synchronization by above-mentioned full dose The block enough synchronized continues using the synchronization gain from the first block chain node of traditional recurrence tracing mode.
Fig. 4 shows the schematic block diagram of the account book synchronizer 400 of the block chain based on DAG.The account book synchronizer 400 include at least processor 410 and memory 420, wherein instruction are stored in memory 420, the instruction is by processor 410 make processor 410 execute following movement when executing:
Receive the sequencing block ID for the first sequencing block that the first block chain node is stored, wherein the first sequencing block is The highest sequencing block of sequence number value for the sequencing block ID that the first block chain node is stored;
Determine whether the sequencing block ID for the second sequencing block being locally stored is less than the sequencing block ID of the first sequencing block, In, the second sequencing block is the highest sequencing block of sequence number value for the sequencing block ID being locally stored;
In the case where determining that the sequencing block ID of the second sequencing block is less than the sequencing block ID of the first sequencing block, to The first block chain node sends the first synchronization request, wherein first synchronization request includes at least request and stored All sequencing blocks in the first block chain node, bigger than the sequencing block ID of the second sequencing block and its determined The All Activity block of change;
Receive sequencing block corresponding with first synchronization request and transaction block.
In one embodiment according to present disclosure, sequencing block corresponding with first synchronization request is being received And after transaction block, the processor 410 is made further to execute following operation when described instruction executes:
Determine whether received highest sequencing block ID is equal to the sequencing block ID of the first sequencing block;
In the case where determining that received highest sequencing block ID is less than the sequencing block ID of the first sequencing block, to The first block chain node sends the second synchronization request, wherein second synchronization request, which includes at least request and obtains, compares institute Receive the big all sequencing blocks of highest sequencing block ID and the All Activity block of its determinization;And
Receive sequencing block corresponding with second synchronization request and transaction block.
In one embodiment according to present disclosure, in the first sequencing block that the first block chain node is stored Sequencing block ID change in the case where, make the processor 410 further execute following behaviour when described instruction executes Make:
After receiving sequencing block corresponding with first synchronization request and transaction block, determination is received most Whether high sequencing block ID is equal to the sequencing block ID of newest first sequencing block;
Determining feelings of the received highest sequencing block ID less than the sequencing block ID of the newest first sequencing block Under condition, Xiang Suoshu the first block chain node sends the second synchronization request, wherein second synchronization request includes at least request and obtains Obtain the All Activity block of all sequencing blocks and its determinization bigger than received highest sequencing block ID;And
Receive sequencing block corresponding with second synchronization request and transaction block.
It is fixed in the sequencing block ID of the second sequencing block and described first in one embodiment according to present disclosure In the identical situation of sequencing block ID of sequence block, the processor is made further to execute following operation when described instruction executes:
It trades block for all first kind for being locally stored, generates the first bit array that length is m, wherein described the One kind transaction block is the transaction block for not being sequenced block determinization also, 10000≤m≤100000 and m is integer;
Receive the second bit array that the length from the first block chain node is m, wherein second bit number Group is for all first kind transaction block bit array generated stored in the first block chain node;
Determine whether first bit array is identical as second bit array;
In the case where determining that first bit array is different from second bit array, first block is determined The storage of chain node but local not stored one or more transaction blocks;
Third synchronization request is sent to the first block chain node, wherein the third synchronization request is included at least and asked It asks and obtains not stored one or more first kind transaction block store in the first block chain node but local;
Receive transaction block corresponding with the third synchronization request.
In one embodiment according to present disclosure, for all first kind transaction block, first that length is m is generated Bit array or the second bit array further comprise:
It trades block for each first kind of the first block chain node be locally stored or described storage, utilizes described the One kind transaction block carries out k hash function operation, to obtain k cryptographic Hash: H1(x)、H2(x),…,Hk(x), wherein 5≤k≤ 10 and k is integer, and x is perhaps block Hash, and 0≤H in the block of the transaction blocky(x)≤m, y=1,2 ... k and Hy It (x) is integer;
It generates length and is the source bit array of m, and each position of the source bit array is compiled in sequence Number to form position serial number;
The determining institute rheme serial number equal with each first kind transaction each cryptographic Hash of block;
The value of position corresponding with identified position serial number in the source bit array is set as 1, to generate length as m The first bit array or the second bit array.
In one embodiment according to present disclosure, first bit array and second bit number are being determined In the case that group is different, determine that not stored transaction block that the first block chain node stores but local further comprises:
The value of corresponding positions in the value of each and second bit array in first bit array is carried out Compare, using position serial number corresponding to the existing position with different value between as difference position serial number;
Based on difference position serial number, determine it is being stored in the first block chain node but it is local not stored one or Multiple cryptographic Hash;
It is handed over based on each first kind stored in one or more of cryptographic Hash and the first block chain node All cryptographic Hash of easy block determine not stored transaction block store in the first block chain node but local.
In one embodiment according to present disclosure, locally it is not being found in any transaction block being locally stored The directly transaction block or sequencing block of reference or indirect referencing, or any sequencing block being locally stored are not finding it locally directly In the case where the transaction block or sequencing block that connect reference or indirect referencing, make the processor further when described instruction executes Execute following operation:
Based on the header information of the transaction block or sequencing block that are locally stored, its directly reference or indirect not found is determined The transaction block of reference or the block Hash of sequencing block;
The 4th synchronization request is generated based on described piece of Hash;
The 4th synchronization request is sent to the first block chain node;And
In the feelings of the first block chain node storage transaction block corresponding with the 4th synchronization request or sequencing block Under condition, corresponding transaction block or sequencing block from the first block chain node are received.
The account book synchronous method and equipment of block chain disclosed herein based on DAG add in the block chain based on DAG Enter multiple sequencing blocks, in order to which the block chain to be carried out to the orderly cutting in topology (that is, some sequencing block directly quoted The part of transaction block and indirect referencing transaction block determinization).For the different transaction blocks stored in different blocks chain node, determine Sequence block carries out full dose synchronization or carries out mutual increment synchronization using Bloom filter technology, so that it is synchronous to significantly improve block Performance.
Alternatively, above-mentioned account book synchronous method can be realized by computer program product.Computer program product It may include computer readable storage medium, refer to containing the computer-readable program for executing various aspects of the disclosure It enables.Computer readable storage medium can be the tangible device that can keep and store the instruction used by instruction execution equipment. Computer readable storage medium can for example be but not limited to storage device electric, magnetic storage apparatus, light storage device, electromagnetism storage Equipment, semiconductor memory apparatus or above-mentioned any appropriate combination.The more specific example of computer readable storage medium (non exhaustive list) include: portable computer diskette, hard disk, random access memory (RAM), read-only memory (ROM), can Erasing programmable read only memory (EPROM or flash memory), static random access memory (SRAM), Portable compressed disk is read-only deposits Reservoir (CD-ROM), memory stick, floppy disk, mechanical coding equipment, is for example stored thereon with instruction at digital versatile disc (DVD) Punch card or groove internal projection structure and above-mentioned any appropriate combination.Computer-readable storage medium used herein above Matter is not interpreted instantaneous signal itself, the electromagnetic wave of such as radio wave or other Free propagations, by waveguide or other The electromagnetic wave (for example, the light pulse for passing through fiber optic cables) that transmission medium is propagated or the electric signal transmitted by electric wire.
The foregoing is merely embodiment of the disclosure alternative embodiments, are not limited to embodiment of the disclosure, for For those skilled in the art, embodiment of the disclosure can have various modifications and variations.It is all in embodiment of the disclosure Within spirit and principle, made any modification, equivalence replacement, improvement etc. should be included in the protection of embodiment of the disclosure Within the scope of.
Although describing embodiment of the disclosure by reference to several specific embodiments, it should be appreciated that, the disclosure Embodiment is not limited to disclosed specific embodiment.Embodiment of the disclosure be intended to cover appended claims spirit and Included various modifications and equivalent arrangements in range.Scope of the following claims is to be accorded the broadest interpretation, thus comprising All such modifications and equivalent structure and function.

Claims (14)

1. a kind of account book synchronous method of the block chain based on DAG, wherein the block chain based on DAG includes multiple transaction Block and one or more sequencing blocks, and each transaction block directly quotes other transaction blocks or sequencing block, and each is fixed Sequence block directly quotes transaction block or other sequencing blocks, transaction block that each sequencing block directly quotes it and indirect referencing A part transaction being determined of block, the sequencing block include at least sequencing block ID, and the sequencing block ID of each sequencing block is According to generation time sequencing serial number incremented by successively, which comprises
Receive the sequencing block ID for the first sequencing block that the first block chain node is stored, wherein the first sequencing block is described The highest sequencing block of sequence number value for the sequencing block ID that first block chain node is stored;
Determine whether the sequencing block ID for the second sequencing block being locally stored is less than the sequencing block ID of the first sequencing block, wherein The second sequencing block is the highest sequencing block of sequence number value for the sequencing block ID being locally stored;
In the case where determining that the sequencing block ID of the second sequencing block is less than the sequencing block ID of the first sequencing block, Xiang Suoshu First block chain node sends the first synchronization request, wherein first synchronization request includes at least request acquisition and is stored in institute State all sequencing blocks in the first block chain node, bigger than the sequencing block ID of the second sequencing block and its determinization All Activity block;
Receive sequencing block corresponding with first synchronization request and transaction block.
2. account book synchronous method according to claim 1, wherein corresponding fixed with first synchronization request receiving After sequence block and transaction block, the method further includes:
Determine whether received highest sequencing block ID is equal to the sequencing block ID of the first sequencing block;
In the case where determining that received highest sequencing block ID is less than the sequencing block ID of the first sequencing block, Xiang Suoshu First block chain node sends the second synchronization request, wherein second synchronization request includes at least request acquisition ratio and received To the All Activity block of highest sequencing block ID big all sequencing blocks and its determinization;
Receive sequencing block corresponding with second synchronization request and transaction block.
3. account book synchronous method according to claim 1, wherein it is first fixed to be stored in the first block chain node In the case that the sequencing block ID of sequence block changes, the method further includes:
It is highest received by determination after receiving sequencing block corresponding with first synchronization request and transaction block Whether sequencing block ID is equal to the sequencing block ID of newest first sequencing block;
In the case where determining that received highest sequencing block ID is less than the sequencing block ID of the newest first sequencing block, The second synchronization request is sent to the first block chain node, wherein second synchronization request includes at least request and obtains ratio The All Activity block of received highest sequencing block ID big all sequencing blocks and its determinization;
Receive sequencing block corresponding with second synchronization request and transaction block.
4. account book synchronous method according to claim 1, wherein in the sequencing block ID of the second sequencing block and described the In the identical situation of sequencing block ID of one sequencing block, the method further includes:
For all first kind transaction block being locally stored, the first bit array that length is m is generated, wherein the first kind Transaction block is the transaction block for not being sequenced block determinization also, 10000≤m≤100000 and m is integer;
Receive the second bit array that the length from the first block chain node is m, wherein second bit array is For all first kind transaction block bit array generated stored in the first block chain node;
Determine whether first bit array is identical as second bit array;
In the case where determining that first bit array is different from second bit array, the first block chain link is determined Point storage but local not stored one or more first kind transaction block;
Third synchronization request is sent to the first block chain node, wherein the third synchronization request includes at least request and obtains Obtain not stored one or more first kind transaction block store in the first block chain node but local;
Receive transaction block corresponding with the third synchronization request.
5. account book synchronous method according to claim 4, wherein for all first kind transaction block, generating length is m's First bit array or the second bit array further comprise:
For each first kind transaction block of the first block chain node be locally stored or described storage, the first kind is utilized Block of trading carries out k hash function operation, to obtain k cryptographic Hash: H1(x)、H2(x),…,Hk(x), wherein 5≤k≤10 are simultaneously And k is integer, x is perhaps block Hash, and 0≤H in the block of the transaction blocky(x)≤m (y=1,2 ..., k and Hy(x) it is Integer);
Generate length be m source bit array, and by each position of the source bit array be numbered in sequence with Form position serial number;
The determining institute rheme serial number equal with each first kind transaction each cryptographic Hash of block;
The value of position corresponding with identified position serial number in the source bit array is set as 1, to generate length as the of m One bit array or the second bit array.
6. account book synchronous method according to claim 5, wherein determining first bit array and second ratio In the case that special array is different, determine that not stored transaction block that the first block chain node stores but local further wraps It includes:
The value of each in first bit array is compared with the value of the corresponding positions in second bit array, Using by position serial number corresponding to the existing position with different value between as difference position serial number;
Based on difference position serial number, not stored one or more store in the first block chain node but local is determined Cryptographic Hash;
Based on each first kind transaction block stored in one or more of cryptographic Hash and the first block chain node All cryptographic Hash, determine not stored first kind transaction block store in the first block chain node but local.
7. account book synchronous method according to claim 1, wherein in any transaction block being locally stored not in local lookup It is directly quoted to it or the transaction block or sequencing block of indirect referencing, or any sequencing block being locally stored is not found locally Its directly quote or the transaction block or sequencing block of indirect referencing in the case where, the method further includes:
Based on the header information of the transaction block or sequencing block that are locally stored, its directly reference or the indirect referencing not found is determined Transaction block or sequencing block block Hash;
The 4th synchronization request is generated based on described piece of Hash;
The 4th synchronization request is sent to the first block chain node;
In the case where the first block chain node stores transaction block corresponding with the 4th synchronization request or sequencing block, Receive corresponding transaction block or sequencing block from the first block chain node.
8. a kind of account book synchronizer of the block chain based on DAG, wherein the block chain based on DAG includes multiple transaction Block and one or more sequencing blocks, and each transaction block directly quotes other transaction blocks or sequencing block, and each is fixed Sequence block directly quotes transaction block or other sequencing blocks, transaction block that each sequencing block directly quotes it and indirect referencing A part transaction being determined of block, the sequencing block include at least sequencing block ID, and the sequencing block ID of each sequencing block is According to generation time sequencing serial number incremented by successively, the equipment includes:
Processor;And
Memory makes the processor execute following operation when described instruction executes for storing instruction:
Receive the sequencing block ID for the first sequencing block that the first block chain node is stored, wherein the first sequencing block is described The highest sequencing block of sequence number value for the sequencing block ID that first block chain node is stored;
Determine whether the sequencing block ID for the second sequencing block being locally stored is less than the sequencing block ID of the first sequencing block, wherein The second sequencing block is the highest sequencing block of sequence number value for the sequencing block ID being locally stored;
In the case where determining that the sequencing block ID of the second sequencing block is less than the sequencing block ID of the first sequencing block, Xiang Suoshu First block chain node sends the first synchronization request, wherein first synchronization request includes at least request acquisition and is stored in institute State all sequencing blocks in the first block chain node, bigger than the sequencing block ID of the second sequencing block and its determinization All Activity block;
Receive sequencing block corresponding with first synchronization request and transaction block.
9. account book synchronizer according to claim 8, wherein corresponding fixed with first synchronization request receiving After sequence block and transaction block, the processor is made further to execute following operation when described instruction executes:
Determine whether received highest sequencing block ID is equal to the sequencing block ID of the first sequencing block;
In the case where determining that received highest sequencing block ID is less than the sequencing block ID of the first sequencing block, Xiang Suoshu First block chain node sends the second synchronization request, wherein second synchronization request includes at least request acquisition ratio and received To the All Activity block of highest sequencing block ID big all sequencing blocks and its determinization;And
Receive sequencing block corresponding with second synchronization request and transaction block.
10. account book synchronizer according to claim 8, wherein first stored in the first block chain node In the case that the sequencing block ID of sequencing block changes, execute the processor further following Operation:
It is highest received by determination after receiving sequencing block corresponding with first synchronization request and transaction block Whether sequencing block ID is equal to the sequencing block ID of newest first sequencing block;
In the case where determining that received highest sequencing block ID is less than the sequencing block ID of the newest first sequencing block, The second synchronization request is sent to the first block chain node, wherein second synchronization request includes at least request and obtains ratio The All Activity block of received highest sequencing block ID big all sequencing blocks and its determinization;And
Receive sequencing block corresponding with second synchronization request and transaction block.
11. account book synchronizer according to claim 8, wherein the second sequencing block sequencing block ID with it is described In the identical situation of sequencing block ID of first sequencing block, execute the processor further following Operation:
For all first kind transaction block being locally stored, the first bit array that length is m is generated, wherein the first kind Transaction block is the transaction block for not being sequenced block determinization also, 10000≤m≤100000 and m is integer;
Receive the second bit array that the length from the first block chain node is m, wherein second bit array is For all first kind transaction block bit array generated stored in the first block chain node;
Determine whether first bit array is identical as second bit array;
In the case where determining that first bit array is different from second bit array, the first block chain link is determined Point storage but local not stored one or more first kind transaction block;
Third synchronization request is sent to the first block chain node, wherein the third synchronization request includes at least request and obtains Obtain not stored one or more transaction blocks store in the first block chain node but local;
Receive transaction block corresponding with the third synchronization request.
12. account book synchronizer according to claim 11, wherein for all first kind transaction block, generation length is m The first bit array or the second bit array further comprise:
For each first kind transaction block of the first block chain node be locally stored or described storage, the first kind is utilized Block of trading carries out k hash function operation, to obtain k cryptographic Hash: H1(x)、H2(x),…,Hk(x), wherein 5≤k≤10 are simultaneously And k is integer, x is perhaps block Hash, and 0≤H in the block of the transaction blocky(x)≤m (y=1,2 ..., k and Hy(x) it is Integer);
Generate length be m source bit array, and by each position of the source bit array be numbered in sequence with Form position serial number;
The determining institute rheme serial number equal with each first kind transaction each cryptographic Hash of block;
The value of position corresponding with identified position serial number in the source bit array is set as 1, to generate length as the of m One bit array or the second bit array.
13. account book synchronizer according to claim 12, wherein determining first bit array and described second In the case that bit array is different, determine that not stored transaction block that the first block chain node stores but local further wraps It includes:
The value of each in first bit array is compared with the value of the corresponding positions in second bit array, Using by position serial number corresponding to the existing position with different value between as difference position serial number;
Based on difference position serial number, not stored one or more store in the first block chain node but local is determined Cryptographic Hash;
Based on each first kind transaction block stored in one or more of cryptographic Hash and the first block chain node All cryptographic Hash, determine not stored transaction block store in the first block chain node but local.
14. account book synchronizer according to claim 8, wherein do not looked into locally in any transaction block being locally stored The transaction block or sequencing block of its direct reference or indirect referencing are found, or any sequencing block being locally stored is not in local lookup Directly quoted to it or the transaction block or sequencing block of indirect referencing in the case where, when described instruction execute when make the processor Further execute following operation:
Based on the header information of the transaction block or sequencing block that are locally stored, its directly reference or the indirect referencing not found is determined Transaction block or sequencing block block Hash;
The 4th synchronization request is generated based on described piece of Hash;
The 4th synchronization request is sent to the first block chain node;And
In the case where the first block chain node stores transaction block corresponding with the 4th synchronization request or sequencing block, Receive corresponding transaction block or sequencing block from the first block chain node.
CN201811561762.3A 2018-12-20 2018-12-20 Account book synchronization method and device based on DAG block chain Active CN109672733B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811561762.3A CN109672733B (en) 2018-12-20 2018-12-20 Account book synchronization method and device based on DAG block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811561762.3A CN109672733B (en) 2018-12-20 2018-12-20 Account book synchronization method and device based on DAG block chain

Publications (2)

Publication Number Publication Date
CN109672733A true CN109672733A (en) 2019-04-23
CN109672733B CN109672733B (en) 2022-06-07

Family

ID=66144956

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811561762.3A Active CN109672733B (en) 2018-12-20 2018-12-20 Account book synchronization method and device based on DAG block chain

Country Status (1)

Country Link
CN (1) CN109672733B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110569246A (en) * 2019-07-23 2019-12-13 腾讯科技(深圳)有限公司 block chain node information synchronization method and device, computer equipment and storage medium
CN111861459A (en) * 2019-04-28 2020-10-30 常州一仙智能科技有限公司 Iota account book optimization system and method based on DPoS consensus algorithm
US11336455B2 (en) 2019-09-25 2022-05-17 International Business Machines Corporation Consensus protocol for blockchain DAG structure

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106815330A (en) * 2016-12-29 2017-06-09 北京瑞卓喜投科技发展有限公司 The generation method and system of the block chain expanded along Spatial Dimension
CN106897351A (en) * 2016-12-29 2017-06-27 北京瑞卓喜投科技发展有限公司 The generation method and system of directed acyclic pattern block chain
CN108351882A (en) * 2015-08-28 2018-07-31 斯沃尔德斯股份有限公司 Method and apparatus for the distributed data base in network
CN108765151A (en) * 2018-05-11 2018-11-06 深圳市恋上互联网技术有限公司 A kind of method of commerce based on block chain
CN108769154A (en) * 2018-05-15 2018-11-06 北京工业大学 Date storage method based on directed acyclic graph and distributed account book
CN108984789A (en) * 2018-08-15 2018-12-11 赵东洋 Method, apparatus, storage medium and the electronic equipment of distribution book keeping operation

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108351882A (en) * 2015-08-28 2018-07-31 斯沃尔德斯股份有限公司 Method and apparatus for the distributed data base in network
CN106815330A (en) * 2016-12-29 2017-06-09 北京瑞卓喜投科技发展有限公司 The generation method and system of the block chain expanded along Spatial Dimension
CN106897351A (en) * 2016-12-29 2017-06-27 北京瑞卓喜投科技发展有限公司 The generation method and system of directed acyclic pattern block chain
CN108765151A (en) * 2018-05-11 2018-11-06 深圳市恋上互联网技术有限公司 A kind of method of commerce based on block chain
CN108769154A (en) * 2018-05-15 2018-11-06 北京工业大学 Date storage method based on directed acyclic graph and distributed account book
CN108984789A (en) * 2018-08-15 2018-12-11 赵东洋 Method, apparatus, storage medium and the electronic equipment of distribution book keeping operation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ALAN DURING: "ByteBall中DAG交易数据同步算法详解", 《BBFANS》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111861459A (en) * 2019-04-28 2020-10-30 常州一仙智能科技有限公司 Iota account book optimization system and method based on DPoS consensus algorithm
CN110569246A (en) * 2019-07-23 2019-12-13 腾讯科技(深圳)有限公司 block chain node information synchronization method and device, computer equipment and storage medium
CN110569246B (en) * 2019-07-23 2022-03-11 腾讯科技(深圳)有限公司 Block chain node information synchronization method and device, computer equipment and storage medium
US11336455B2 (en) 2019-09-25 2022-05-17 International Business Machines Corporation Consensus protocol for blockchain DAG structure

Also Published As

Publication number Publication date
CN109672733B (en) 2022-06-07

Similar Documents

Publication Publication Date Title
Subramanian et al. A hybrid algorithm for a class of vehicle routing problems
CN109672733A (en) The account book synchronous method and equipment of block chain based on DAG
CN110493325A (en) Block chain state method of data synchronization and device, electronic equipment
CN110493148B (en) Block processing, block consensus and block synchronization method and device
CN109377232A (en) The transaction method for sequencing and equipment of block chain based on DAG
CN109325762A (en) Across the chain method of commerce of parallel chain, equipment and storage medium
Collins et al. Multiplexed memory-insensitive quantum repeaters
CN110471795A (en) Block chain state data reconstruction method and device, electronic equipment
CN107169865A (en) Asset data processing system based on block chain technology
Labadie et al. Hybridized evolutionary local search algorithm for the team orienteering problem with time windows
CN110866751A (en) Block chain parallel chain maintenance method and block chain parallel chain
CN109377365A (en) A kind of assets transfer method, equipment and storage medium
CN110457319A (en) Block chain state date storage method and device, electronic equipment
CN110334154A (en) Based on the classification storage method and device of block chain, electronic equipment
CN107480990A (en) Block chain bookkeeping methods and device
CN110347660B (en) Block chain based hierarchical storage method and device and electronic equipment
Dryja Utreexo: A dynamic hash-based accumulator optimized for the Bitcoin UTXO set
CN110033244A (en) Intelligent contract based on block chain executes method and device and electronic equipment
CN110471985A (en) Electronic bill based on block chain cancels method and device, electronic equipment
CN109391645A (en) Block chain light-weight technologg method, block chain node and storage medium
CN110347684A (en) Based on the classification storage method and device of block chain, electronic equipment
CN109711192A (en) Method of commerce and system between block catenary system construction method, node
CN112887148B (en) Method and device for simulating and predicting network flow
CN110473081A (en) Based on the electronic bill method of charging out and device of block chain, electronic equipment
CN109041010A (en) Vehicle-mounted Delay Tolerant Network data forwarding method based on semi-naive Bayes classifier

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20210915

Address after: Room 201, building a, No.1 Qianwan 1st Road, Shenzhen Hong Kong cooperation zone, Qianhai, Shenzhen, Guangdong 518066

Applicant after: ZHONGAN INFORMATION TECHNOLOGY SERVICE Co.,Ltd.

Applicant after: Baibao (Shanghai) Technology Co.,Ltd.

Address before: 518052 Room 201, building A, 1 front Bay Road, Shenzhen Qianhai cooperation zone, Shenzhen, Guangdong

Applicant before: ZHONGAN INFORMATION TECHNOLOGY SERVICE Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240227

Address after: Room 1179, W Zone, 11th Floor, Building 1, No. 158 Shuanglian Road, Qingpu District, Shanghai, 201702

Patentee after: Shanghai Zhongan Information Technology Service Co.,Ltd.

Country or region after: China

Patentee after: Baibao (Shanghai) Technology Co.,Ltd.

Address before: Room 201, building a, No.1 Qianwan 1st Road, Shenzhen Hong Kong cooperation zone, Qianhai, Shenzhen, Guangdong 518066

Patentee before: ZHONGAN INFORMATION TECHNOLOGY SERVICE Co.,Ltd.

Country or region before: China

Patentee before: Baibao (Shanghai) Technology Co.,Ltd.