CN109544344A - The transaction processing method and equipment of block chain based on DAG - Google Patents

The transaction processing method and equipment of block chain based on DAG Download PDF

Info

Publication number
CN109544344A
CN109544344A CN201811579503.3A CN201811579503A CN109544344A CN 109544344 A CN109544344 A CN 109544344A CN 201811579503 A CN201811579503 A CN 201811579503A CN 109544344 A CN109544344 A CN 109544344A
Authority
CN
China
Prior art keywords
transaction
block
type
blocks
stored
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
CN201811579503.3A
Other languages
Chinese (zh)
Other versions
CN109544344B (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
Zhong'an Xinke Shenzhen 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 CN201811579503.3A priority Critical patent/CN109544344B/en
Publication of CN109544344A publication Critical patent/CN109544344A/en
Application granted granted Critical
Publication of CN109544344B publication Critical patent/CN109544344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • G—PHYSICS
    • G06—COMPUTING OR CALCULATING; COUNTING
    • G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Development Economics (AREA)
  • 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

本公开内容公开了基于DAG的区块链的交易处理方法及设备,所述方法包括:将第一类交易块作为待确认交易块存入交易池中,其中,所述第一类交易块是通过验证的交易块;将通过验证的定序块存入所述交易池中;在所述定序块是正常定序块的情况下,在所述交易池中查找被所述定序块确定化的一个或多个第一类交易块;将所查找到的所有第一类交易块以及所述定序块形成祖先集;确定所述祖先集中的每一个第一类交易块是否合理;将被确定为合理的所有第一类交易块以及所述定序块写入账本中。本公开内容能够实现区块链节点对接收到的所有交易块进行高效处理,并将经处理后的交易块存储在区块链节点的数据库中。

The present disclosure discloses a DAG-based blockchain transaction processing method and device. The method includes: depositing a first-type transaction block as a pending transaction block into a transaction pool, wherein the first-type transaction block is The verified transaction block; the verified sequenced block is stored in the transaction pool; in the case that the sequenced block is a normal sequenced block, the search in the transaction pool is determined by the sequenced block One or more first-type transaction blocks that have been sorted; form an ancestor set with all the first-type transaction blocks found and the sequenced blocks; determine whether each first-type transaction block in the ancestor set is reasonable; All blocks of transactions of the first type that are determined to be legitimate are written to the ledger as well as the sequenced blocks. The present disclosure enables the blockchain node to efficiently process all the received transaction blocks, and store the processed transaction blocks in the database of the blockchain node.

Description

The transaction processing method and equipment of block chain based on DAG
Technical field
Present disclosure belongs to block chain technical field more particularly to a kind of trading processing side of the block chain based on DAG Method and a kind of transaction processing device of the block chain based on DAG.
Background technique
Block chain (Blockchain) technology is a kind of technology of peer-to-peer network based on decentralization, by cryptography original It is coherent and persistently that reason combines the data to ensure distributed each node with common recognition mechanism, thus realize information verify immediately, can The purpose that retrospect, difficulty are distorted and can not be shielded, and then create a set of privacy, shareable value system efficiently, safe.
Existing major part block chain all uses traditional chain account book structure, but this structure has system for restricting Performance, the scalability of very big influence block catenary system.In view of this, can use has DAG (Directed Acyclic Graph, directed acyclic graph) structure construct entire account book.DAG structure can make not interfereing with each other between transaction, efficiently use The whole of network calculates power.Meanwhile although the block chain based on DAG can greatly increase scalability and performance, and tradition Chain structure comparison, it weakens the consistency of account book.In the block chain based on DAG, each node is had no idea as chain Shape structure equally guarantees that the account book of all nodes of the whole network is consistent, and can only accomplish one in a long-range timing node account book It causes.This characteristic will lead to the scene that the block chain based on DAG can not be adapted to intelligent contract.Because intelligent contract executes needs The execution sequence of each node is consistent, and otherwise implementing result will appear deviation.
In order to solve the problems, such as to execute intelligent contract on the block chain based on DAG, there is team to propose the concept of sequencing block. Sequencing block and general transaction block belong to same type, the two the difference is that, sequencing block is not traded attribute, it mainly bears It blames and carries out sequencing and confirmation to the transaction block in DAG structure.After sequencing by sequencing block, the transaction block in DAG structure just has Trading order, also can be executed by the virtual machine of intelligent contract.
Summary of the invention
Since the block chain based on DAG currently on the market is also in theory stage, there are no a relatively good realizations Mode is realized, can not be efficiently treated through transaction block caused by it, also be cannot achieve and carry out to data generated Inquiry, storage.
In view of the above-mentioned problems, the first aspect of present disclosure proposes a kind of trading processing of block chain based on DAG 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 quote other transaction blocks or sequencing blocks, and each sequencing block transaction block for directly quoting it and indirect A part transaction being determined of block of reference, which comprises
Using first kind transaction block as in transaction block to be confirmed deposit trading pit, wherein the first kind transaction block is logical The transaction block of verifying is crossed, the header information of the transaction block includes at least source account information, relevant to the source account information Transaction serial number, transaction amount;
It will be stored in the trading pit by the sequencing block of verifying;
In the case where the sequencing block is normal sequencing block, search in the trading pit by the sequencing block determinization One or more first kind trade block;
All first kind found transaction block and the sequencing block are formed into ancestors' collection;
Determine whether each of described ancestors' collection first kind transaction block is reasonable;
It will be confirmed as in reasonable all first kind transaction blocks and sequencing block write-in account book.
According to the first aspect of present disclosure, wherein be stored in first kind transaction block as transaction block to be confirmed and trade Pond further comprises:
Based on each first kind transaction block father trade block whether be stored in the trading pit or the account book, institute State the first kind transaction block in transaction serial number whether meet transaction order standard and the first kind trade block in trade gold Whether volume is more than remaining sum in the source account, determines whether the first kind transaction block is doubtful abnormal exchanges block, wherein Father's transaction block of the first kind transaction block is transaction block or sequencing block that the first kind transaction block is directly quoted;
The first kind transaction block father trade block be stored in the trading pit or the account book, the transaction sequence Number meet the transaction order standard and in the case that the transaction amount is less than remaining sum in the source account, determines institute Stating first kind transaction block is not doubtful abnormal exchanges block;
Alternatively, the first kind transaction block father trade block be not stored in the trading pit or the account book or The transaction serial number does not meet the transaction order standard or the transaction amount is more than the feelings of the remaining sum in the source account Under condition, determine that the first kind transaction block is doubtful abnormal exchanges block.
According to the first aspect of present disclosure, wherein determining that the first kind transaction block is not doubtful improper friendship In the case where easy block, the method further includes:
In the case where determining the first kind transaction block is not doubtful abnormal exchanges block, by first kind transaction block It is stored in not following in module for the trading pit;
Determine whether father's transaction block of the first kind transaction block is stored in not following in module for the trading pit;
Determining that father block of trading is stored in the case where not following in module of the trading pit, the father is traded Block is transferred in the module to be confirmed of the trading pit.
According to present disclosure in a first aspect, determining that the first kind transaction block is the feelings of doubtful abnormal exchanges block Under condition, the method further includes:
First kind transaction block is stored in the doubtful abnormal exchanges module of the trading pit.
According to present disclosure in a first aspect, after it will be stored in the trading pit by the sequencing block of verifying, institute The method of stating further comprises:
Determine whether the sequencing block is normal sequencing block based on the header information of the sequencing block, wherein the sequencing The header information of block includes at least sequencing block ID, father's transaction block Hash, and father's transaction block of the sequencing block is that the sequencing block is straight Connect the transaction block or sequencing block of reference.
According to the first aspect of present disclosure, wherein determine the sequencing block based on the header information of the sequencing block Whether it is that normal sequencing block further comprises:
When the father of sequencing block block of trading is stored in the trading pit or the account book and the sequencing block is determined When sequence block ID meets sequencing block sequencing standard, determine that the sequencing block is normal sequencing block.
According to present disclosure in a first aspect, determining whether each of described ancestors' collection first kind transaction block is reasonable Further comprise:
Meet in transaction order standard and first kind transaction block in the transaction serial number in first kind transaction block In the case that transaction amount is less than the remaining sum in the source account, the first kind transaction block for determining that the ancestors concentrate is reasonable 's.
According to present disclosure in a first aspect, reasonable all first kind transaction blocks and the sequencing will be confirmed as Block write-in account book further comprises:
The ancestors are concentrated and are confirmed as reasonable all first kind transaction blocks and sequencing block generation confirmation collection, Wherein, the confirmation collection includes multiple Transaction Sets, each Transaction Set includes source account information and the source account institute All first kind transaction block and/or sequencing block generated;
It sends confirmation collection in the account book;
Each of confirmation collection Transaction Set is stored in the hard disc data library in the account book;
Transaction Information corresponding to each of confirmation collection source account information is stored in the memory in the account book In database, wherein the Transaction Information include at least the source account information, it is corresponding with the source account information it is final more than Transaction serial number in volume, last performed first kind transaction block;
The account book in the account book is written using the sequencing block ID for the sequencing block that the confirmation is concentrated as current transaction height In information module.
According to present disclosure in a first aspect, reasonable all first kind transaction blocks and described fixed will be confirmed as After sequence block is written in account book, the method further includes:
It, will be described in the case where the doubtful abnormal exchanges block is confirmed as reasonably and is stored in the account book Doubtful abnormal exchanges block is deleted from the doubtful abnormal exchanges module;
The module to be confirmed and/or it is described do not follow the first kind stored in module transaction block be confirmed as it is non-rationally In the case where, it is stored in the doubtful abnormal exchanges module using first kind transaction block as doubtful abnormal exchanges block.
In view of the above-mentioned problems, the second aspect of present disclosure proposes a kind of trading processing of block chain based on DAG 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 quote other transaction blocks or sequencing blocks, and each sequencing block transaction block for directly quoting it and indirect A part transaction being determined of block of reference, the equipment include:
Processor;And
Memory makes the processor execute following operation when described instruction executes for storing instruction:
Using first kind transaction block as in transaction block to be confirmed deposit trading pit, wherein the first kind transaction block is logical The transaction block of verifying is crossed, the header information of the transaction block includes at least source account information, relevant to the source account information Transaction serial number, transaction amount;
It will be stored in the trading pit by the sequencing block of verifying;
In the case where the sequencing block is normal sequencing block, search in the trading pit by the sequencing block determinization One or more first kind trade block;
All first kind found transaction block and the sequencing block are formed into ancestors' collection;
Determine whether each of described ancestors' collection first kind transaction block is reasonable;
It will be confirmed as in reasonable all first kind transaction blocks and sequencing block write-in account book.
According to the second aspect of the present disclosure, trading pit is stored in into one using first kind transaction block as transaction block to be confirmed Step includes:
Based on each first kind transaction block father trade block whether be stored in the trading pit or the account book, institute State the first kind transaction block in transaction serial number whether meet transaction order standard and the first kind trade block in trade gold Whether volume is more than remaining sum in the source account, determines whether the first kind transaction block is doubtful abnormal exchanges block, wherein Father's transaction block of the first kind transaction block is transaction block or sequencing block that the first kind transaction block is directly quoted;
The first kind transaction block father trade block be stored in the trading pit or the account book, the transaction sequence Number meet the transaction order standard and in the case that the transaction amount is less than remaining sum in the source account, determines institute Stating first kind transaction block is not doubtful abnormal exchanges block;
Alternatively, the first kind transaction block father trade block be not stored in the trading pit or the account book or The transaction serial number does not meet the transaction order standard or the transaction amount is more than the feelings of the remaining sum in the source account Under condition, determine that the first kind transaction block is doubtful abnormal exchanges block.
According to the second aspect of the present disclosure, determining that the first kind transaction block is not doubtful abnormal exchanges block In the case of, make the processor further execute following operation when described instruction executes:
In the case where determining the first kind transaction block is not doubtful abnormal exchanges block, by first kind transaction block It is stored in not following in module for the trading pit;
Determine whether father's transaction block of the first kind transaction block is stored in not following in module for the trading pit;
Determining that father block of trading is stored in the case where not following in module of the trading pit, the father is traded Block is transferred in the module to be confirmed of the trading pit.
According to the second aspect of the present disclosure, determining that the first kind transaction block is the feelings of doubtful abnormal exchanges block Under condition, the processor is made further to execute following operation when described instruction executes:
First kind transaction block is stored in the doubtful abnormal exchanges module of the trading pit.
According to the second aspect of the present disclosure, after it will be stored in the trading pit by the sequencing block of verifying, when Described instruction makes the processor further execute following operation when executing:
Determine whether the sequencing block is normal sequencing block based on the header information of the sequencing block, wherein the sequencing The header information of block includes at least sequencing block ID, father's transaction block Hash, and father's transaction block of the sequencing block is that the sequencing block is straight Connect the transaction block or sequencing block of reference.
According to the second aspect of the present disclosure, the header information based on the sequencing block determine the sequencing block whether be Normal sequencing block further comprises:
When the father of sequencing block block of trading is stored in the trading pit or the account book and the sequencing block is determined When sequence block ID meets sequencing block sequencing standard, determine that the sequencing block is normal sequencing block.
According to the second aspect of the present disclosure, determine whether each of described ancestors' collection first kind transaction block is reasonable Further comprise:
Meet in transaction order standard and first kind transaction block in the transaction serial number in first kind transaction block In the case that transaction amount is less than the remaining sum in the source account, the first kind transaction block for determining that the ancestors concentrate is reasonable 's.
According to the second aspect of the present disclosure, reasonable all first kind transaction blocks and the sequencing will be confirmed as Block write-in account book further comprises:
The ancestors are concentrated and are confirmed as reasonable all first kind transaction blocks and sequencing block generation confirmation collection, Wherein, the confirmation collection includes multiple Transaction Sets, each Transaction Set includes source account information and the source account institute All first kind transaction block and/or sequencing block generated;
It sends confirmation collection in the account book;
Each of confirmation collection Transaction Set is stored in the hard disc data library in the account book;
Transaction Information corresponding to each of confirmation collection source account information is stored in the memory in the account book In database, wherein the Transaction Information include at least the source account information, it is corresponding with the source account information it is final more than Transaction serial number in volume, last performed first kind transaction block;
The account book in the account book is written using the sequencing block ID for the sequencing block that the confirmation is concentrated as current transaction height In information module.
According to the second aspect of the present disclosure, reasonable all first kind transaction blocks and described fixed will be confirmed as After sequence block is written in account book, the processor is made further to execute following operation when described instruction executes:
It, will be described in the case where the doubtful abnormal exchanges block is confirmed as reasonably and is stored in the account book Doubtful abnormal exchanges block is deleted from the doubtful abnormal exchanges module;
The module to be confirmed and/or it is described do not follow the first kind stored in module transaction block be confirmed as it is non-rationally In the case where, it is stored in the doubtful abnormal exchanges module using first kind transaction block as doubtful abnormal exchanges block.
The transaction processing method and equipment of the block chain based on DAG according to present disclosure can be realized to based on DAG The transaction block of block chain, sequencing block efficient process, and confirmed transaction block, sequencing block are stored in block chain node In database.The feasible block catenary system so that the block catenary system based on DAG becomes a reality, can greatly increase area The scalability and availability of block chain technology.
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 exemplary process diagram of the transaction processing method of the block chain based on DAG according to present disclosure;
Fig. 2 is the flow chart of the embodiment of the transaction processing method of the block chain based on DAG according to present disclosure;
Fig. 3 is the knot for the trading pit 300 of the transaction processing method of the block chain based on DAG according to present disclosure Structure schematic diagram;
Fig. 4 is the structure for the account book 400 of the transaction processing method of the block chain based on DAG according to present disclosure Schematic diagram
Fig. 5 is the schematic diagram of the block chain based on DAG according to present disclosure;And
Structural schematic diagram of the Fig. 6 according to the transaction processing device 600 of the block chain based on DAG of 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.
The embodiment of present disclosure is primarily upon following technical problem: how to realize the friendship to the block chain based on DAG Reception, confirmation and the storage of easy block and/or sequencing block.
To solve the above-mentioned problems, present disclosure realizes the transaction processing method and equipment of the block chain based on DAG, It can will be analyzed and processed and be stored in the disparate modules of trading pit by the transaction block verified, and utilize sequencing block pair The transaction being stored in trading pit carries out reasonability confirmation, and the transaction block confirmed, sequencing block are stored in account book.
As shown in figure 5, the latter block (for example, transaction block or sequencing block) exists in the structure of the block chain based on DAG Need to link preposition block known to one or more (usually two) during generation (for example, transaction block and/or sequencing Block), the cryptographic Hash of two preposition blocks is contained in the header information of block, 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, source account information, purpose account information, transaction serial number relevant to source account information, transaction amount 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. 5 (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 5, 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 addition, in the present embodiment, block chain node can be implemented at the transaction of the block chain shown in FIG. 1 based on DAG Reason method, specific as follows:
Step 110: using first kind transaction block as in transaction block to be confirmed deposit trading pit.First kind transaction block is By the transaction block of verifying, the verifying refers to whether verifying transaction block meets DAG architectural characteristic etc..
In this step, block chain node concrete operations include:
Firstly, the father based on each first kind transaction block trades block whether be stored in trading pit or account book, this Whether whether the transaction serial number in one kind transaction block meet the transaction amount in transaction order standard and first kind transaction block More than the remaining sum in the account of source, determine whether the first kind transaction block is doubtful abnormal exchanges block.In the present embodiment, Father's transaction block of first kind transaction block is transaction block or sequencing block that first kind transaction block is directly quoted;The transaction serial number is used In which transaction that mark source account is issued, which is an incremental and not reproducible number.
In the present embodiment, block chain node will trade according to the transaction serial number and the first kind of the local transaction block safeguarded The transaction serial number of block is compared, and is judged between the transaction serial number of safeguarded transaction block and the transaction serial number of first kind transaction block Whether it is ordinal relation incremented by successively, in the case where determination is ordinal relation incremented by successively, determines first kind transaction block Transaction serial number be that the incremental serial number that is arranged of time of transaction block is generated according to its source account, that is, determining that the first kind is handed over The transaction serial number of easy block meets transaction order standard.
Secondly, father's transaction block in first kind transaction block has been stored in trading pit or account book, first kind transaction block Transaction serial number meet transaction order standard and in the case that transaction amount is less than remaining sum in the account of source, determine this first Class transaction block is not doubtful abnormal exchanges block.
The operating process of this step is specific as follows:
First, in the case where determining the first kind transaction block is not doubtful abnormal exchanges block, by the first kind Transaction block is stored in not following in module for the trading pit.
Second, determine that the father of first kind transaction block trades whether block be stored in the trading pit does not follow module In.
Third will be described determining that father block of trading is stored in the case where not following in module of the trading pit Father's transaction block is transferred in the module to be confirmed of the trading pit.
Alternatively, the first kind transaction block father trade block be not stored in trading pit or account book or this first It is more than described that the transaction serial number of class transaction block, which does not meet the transaction order standard or the transaction amount of first kind transaction block, In the case where remaining sum in the account of source, determine that the first kind transaction block is doubtful abnormal exchanges block;The specific behaviour of this step Make as follows:
In the case where determining the first kind transaction block is doubtful abnormal exchanges block, first kind transaction block is deposited Enter in the doubtful abnormal exchanges module of the trading pit.
Herein, block chain node includes at least processing unit, trading pit and account book.Wherein, processing unit is used for Complete primary operational movement;Trading pit is for storing all transaction blocks that may be identified, and all new transaction blocks all can It is introduced into trading pit and carries out subsequent operation again, meanwhile, during each New Transaction block generates, require from trading pit It pulls with being verified transaction block;The major responsibility of account book is to record all transaction blocks being identified, sequencing block, and support to trade The inquiry in pond, account book all can be finally written in all transaction blocks after being identified, therefore account book will also undertake the work of data storage Make.
As shown in figure 3, an illustrative diagram of trading pit disclosed herein, trading pit 300 includes: not follow mould Block 310, module to be confirmed 320, doubtful abnormal exchanges module 330, interim account book module 340 and enquiry module 350.At this In embodiment, do not follow module 310 for storing the New Transaction block not followed by other transaction blocks also or sequencing block (that is, also The not New Transaction block or sequencing block as father's transaction block).Module 320 to be confirmed is not sequenced also still for storing to be followed The transaction block of block confirmation.Doubtful abnormal exchanges module 330 is for storing all fixed tentatively as the transaction of doubtful abnormal exchanges Block.Interim account book module 340 is for recording the account book change information for the transaction block being saved in trading pit 300, in order to fast Influence of any transaction block to local account book in current trading pit is searched fastly;Interim account book module 340 is responsible for not following mould The change of account book caused by transaction block in block 310 and module to be confirmed 320.Enquiry module 350 is for outwardly providing fast quick checking Ask the service of the data in trading pit.Enquiry module 350 can contact and read the data of other four modules.Mould is not followed Respective data can not be communicated between block 310 and module 320 to be confirmed, but both can change interim account book module 340 In data.
When confirming that any transaction block is doubtful abnormal exchanges block according to step 110, which is stored in doubtful In abnormal exchanges module 330;When confirming that any transaction block is not doubtful abnormal exchanges block according to step 110, by the friendship Easy block, which is stored in, not to be followed in module 310, and the father of transaction block transaction block is never followed in module 310 and is transferred to true Recognize in module 320.
So far, first kind transaction block waits the subsequent block that is sequenced to be confirmed completely into loitering phase.
Step 120: will be stored in the trading pit by the sequencing block of verifying.
In the present embodiment, after it will be stored in the trading pit by the sequencing block of verifying, the method is further The following steps are included:
Determine whether the sequencing block is normal sequencing block based on the header information of the sequencing block.Wherein, the sequencing The header information of block includes at least sequencing block ID, father's transaction block Hash, and father's transaction block of the sequencing block is that the sequencing block is straight Connect the transaction block or sequencing block of reference.
Specifically, when father's transaction block of the sequencing block is stored in the trading pit or the account book and the sequencing When the sequencing block ID of block meets sequencing block sequencing standard, determine that the sequencing block is normal sequencing block.Sequencing block row herein Sequence standard refers to that sequencing block generated must be ranked up to generate this according to the sequencing that sequencing block generates the time The sequencing block ID of sequencing block.
Step 130: in the case where the sequencing block is normal sequencing block, searching in the trading pit by the sequencing One or more first kind transaction block of block determinization.
In the block chain based on DAG of the present embodiment, when any transaction block is directly or indirectly quoted by some sequencing block A And when not quoted directly or indirectly by other transaction blocks, which is sequenced block A determinization.That is, being searched in trading pit To quilt and the only transaction block directly or indirectly quoted by some sequencing block (for example, sequencing block A), be to be confirmed by the sequencing block Transaction block.Thus, it is possible to find by the All Activity block of the sequencing block determinization.
Step 140: all first kind found transaction block and the sequencing block are formed into ancestors' collection.
Step 150: determining whether each of described ancestors' collection first kind transaction block is reasonable.
In the present embodiment, the transaction serial number in first kind transaction block meets transaction order standard and described the In the case that transaction amount is less than the remaining sum in the source account in one kind transaction block, the first kind that the ancestors concentrate is determined Block of trading is reasonable.
Step 160: will be confirmed as in reasonable all first kind transaction blocks and sequencing block write-in account book.
As shown in Fig. 2, the concrete operations of step 160 are as follows:
Step 161, the ancestors are concentrated and is confirmed as reasonable all first kind transaction blocks and sequencing block life Collect at confirmation.The confirmation collection includes multiple Transaction Sets, each Transaction Set includes source account information and the source account All first kind transaction blocks, sequencing block generated.
Step 162, it sends confirmation collection in the account book.
Fig. 4 is an illustrative diagram of the account book 400 of block chain node disclosed herein.In the present embodiment, Account book 400 includes account book information module 410, memory database 420 and hard disc data library 430.Wherein, account book information module 410 for recording the base state of account book 400, including but not limited to initial transaction, the height of the identity ID of account book, current account book Deng;Internal storage data module 420 is the cache database in memory, mainly saves the remaining sum of account, the newest transaction of the account The status informations such as serial number;Since these status datas can be often read, and it can reduce the read-write pressure of database, by one Divided data is extracted in memory, and system is facilitated quickly to read and inquire.Hard disc data library 430 is for storing all data.
Step 163, each of confirmation collection Transaction Set is stored in the hard disc data library in the account book;
Step 164, Transaction Information corresponding to each of confirmation collection source account information is stored in the account book In memory database in, wherein the Transaction Information includes at least source account information, corresponding most with the source account information Transaction serial number in whole remaining sum, last performed first kind transaction block;
In the present embodiment, Transaction Information is stored using key assignments format.Such as (key, value, nonce), wherein Key --- source account information, value --- the resulting balance in the account of source, nonce --- the transaction serial number for sorting last.
Step 165, the account book is written using the sequencing block ID for the sequencing block that the confirmation is concentrated as current transaction height In account book information module in.
In the present embodiment, using sequencing block ID as in current transaction height write-in account book information module 410.
In present disclosure, after step 165 completion, receipt is sent to trading pit 300, to inform the trading pit 300 will confirm that in the data write-in account book 400 of concentration.
When the receipt has been received in trading pit 300, block chain link point further executes following movement:
Be considered as in step 110 doubtful abnormal exchanges block transaction block be confirmed as it is reasonable and described in being stored in In the case where in account book, the doubtful abnormal exchanges block is deleted from the doubtful abnormal exchanges module.
Also, the module to be confirmed and/or it is described do not follow the first kind stored in module transaction block be confirmed as In non-reasonable situation, the doubtful abnormal exchanges mould is stored in using first kind transaction block as doubtful abnormal exchanges block In block.
In addition, being directed to the module to be confirmed 320 of trading pit 300, not following module 310, doubtful abnormal exchanges module 330 It is middle residue not confirmed transaction block, check whether there are problem (for example, some not confirmed transaction block in source account In the corresponding transaction serial number of information and account book the corresponding transaction serial number of source account information that stores it is identical or some not by Transaction amount corresponding with source account information in the transaction block of confirmation is greater than the remaining sum in the source account stored in account book Deng), when find module 320 to be confirmed and/or do not follow in module 310 and/or doubtful abnormal exchanges module 330 it is remaining certain In a transaction block situation of problems, which is deleted labeled as abnormal exchanges block and from trading pit 300.
In addition, being directed to the module to be confirmed 320 of trading pit 300, not following module 310, doubtful abnormal exchanges module 330 It is middle residue not confirmed transaction block, according in above-mentioned steps 110 to these transaction blocks the phase for being stored in trading pit 300 again It answers in module.
The transaction processing method of block chain disclosed herein based on DAG is to the transaction block by verifying (that is, first Class is traded block) processing include first classification processing and be stored in the disparate modules of trading pit to first kind transaction block, etc. After sequencing block is verified, using sequencing block to transaction being determined of block in trading pit, and to the transaction block of determinization Confirmed, finally confirmed transaction block is stored in account book.This method can effectively be directed to the block chain based on DAG Transaction realize confirmation and save.
As shown in fig. 6, the transaction processing device 600 of the block chain disclosed herein based on DAG includes 610 He of processor Memory 620.Wherein, memory 620 is configured as store instruction, so that processor 610 executes following operation:
Using first kind transaction block as in transaction block to be confirmed deposit trading pit, wherein the first kind transaction block is logical The transaction block of verifying is crossed, the header information of the transaction block includes at least source account information, relevant to the source account information Transaction serial number, transaction amount;
It will be stored in the trading pit by the sequencing block of verifying;
In the case where the sequencing block is normal sequencing block, search in the trading pit by the sequencing block determinization One or more first kind trade block;
All first kind found transaction block and the sequencing block are formed into ancestors' collection;
Determine whether each of described ancestors' collection first kind transaction block is reasonable;
It will be confirmed as in reasonable all first kind transaction blocks and sequencing block write-in account book.
In one embodiment according to present disclosure, first kind transaction block is stored in as transaction block to be confirmed and is traded Pond further comprises:
Based on each first kind transaction block father trade block whether be stored in the trading pit or the account book, institute State the first kind transaction block in transaction serial number whether meet transaction order standard and the first kind trade block in trade gold Whether volume is more than remaining sum in the source account, determines whether the first kind transaction block is doubtful abnormal exchanges block, wherein Father's transaction block of the first kind transaction block is transaction block or sequencing block that the first kind transaction block is directly quoted;
The first kind transaction block father trade block be stored in the trading pit or the account book, the transaction sequence Number meet the transaction order standard and in the case that the transaction amount is less than remaining sum in the source account, determines institute Stating first kind transaction block is not doubtful abnormal exchanges block;
Alternatively, the first kind transaction block father trade block be not stored in the trading pit or the account book or The transaction serial number does not meet the transaction order standard or the transaction amount is more than the feelings of the remaining sum in the source account Under condition, determine that the first kind transaction block is doubtful abnormal exchanges block.
In one embodiment according to present disclosure, determining that the first kind transaction block is not doubtful improper friendship In the case where easy block, the processor is made further to execute following operation when described instruction executes:
In the case where determining the first kind transaction block is not doubtful abnormal exchanges block, by first kind transaction block It is stored in not following in module for the trading pit;
Determine whether father's transaction block of the first kind transaction block is stored in not following in module for the trading pit;
Determining that father block of trading is stored in the case where not following in module of the trading pit, the father is traded Block is transferred in the module to be confirmed of the trading pit.
In one embodiment according to present disclosure, determining that the first kind transaction block is doubtful abnormal exchanges In the case where block, the processor is made further to execute following operation when described instruction executes:
First kind transaction block is stored in the doubtful abnormal exchanges module of the trading pit.
In one embodiment according to present disclosure, it in the trading pit will be stored in by the sequencing block of verifying Afterwards, the processor is made further to execute following operation when described instruction executes:
Determine whether the sequencing block is normal sequencing block based on the header information of the sequencing block, wherein the sequencing The header information of block includes at least sequencing block ID, father's transaction block Hash, and father's transaction block of the sequencing block is that the sequencing block is straight Connect the transaction block or sequencing block of reference.
In one embodiment according to present disclosure, the sequencing block is determined based on the header information of the sequencing block Whether it is that normal sequencing block further comprises:
When the father of sequencing block block of trading is stored in the trading pit or the account book and the sequencing block is determined When sequence block ID meets sequencing block sequencing standard, determine that the sequencing block is normal sequencing block.
In one embodiment according to present disclosure, determine that each of described ancestors' collection first kind transaction block is It is no rationally to further comprise:
Meet in transaction order standard and first kind transaction block in the transaction serial number in first kind transaction block In the case that transaction amount is less than the remaining sum in the source account, the first kind transaction block for determining that the ancestors concentrate is reasonable 's.
In one embodiment according to present disclosure, reasonable all first kind transaction blocks and institute will be confirmed as Stating sequencing block write-in account book further comprises:
The ancestors are concentrated and are confirmed as reasonable all first kind transaction blocks and sequencing block generation confirmation collection, Wherein, the confirmation collection includes multiple Transaction Sets, each Transaction Set includes source account information and the source account institute All first kind transaction block and/or sequencing block generated;
It sends confirmation collection in the account book;
Each of confirmation collection Transaction Set is stored in the hard disc data library in the account book;
Transaction Information corresponding to each of confirmation collection source account information is stored in the memory in the account book In database, wherein the Transaction Information include at least source account information, resulting balance corresponding with the source account information, Transaction serial number in last performed first kind transaction block;
The account book in the account book is written using the sequencing block ID for the sequencing block that the confirmation is concentrated as current transaction height In information module.
In one embodiment according to present disclosure, will be confirmed as reasonable all first kind transaction blocks and After in the sequencing block write-in account book, the processor is made further to execute following operation when described instruction executes:
It, will be described in the case where the doubtful abnormal exchanges block is confirmed as reasonably and is stored in the account book Doubtful abnormal exchanges block is deleted from the doubtful abnormal exchanges module;
The module to be confirmed and/or it is described do not follow the first kind stored in module transaction block be confirmed as it is non-rationally In the case where, it is stored in the doubtful abnormal exchanges module using first kind transaction block as doubtful abnormal exchanges block.
Alternatively, above-mentioned transaction processing 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 (18)

1.一种基于DAG的区块链的交易处理方法,其中,所述基于DAG的区块链包括多个交易块以及一个或多个定序块,并且每一个交易块直接引用其他的交易块或定序块,并且每一个定序块将其直接引用的交易块以及间接引用的一部分交易块进行确定化,所述方法包括:1. A transaction processing method based on a DAG-based blockchain, wherein the DAG-based blockchain includes multiple transaction blocks and one or more sequenced blocks, and each transaction block directly references other transaction blocks or ordering blocks, and each ordering block determines the transaction block it directly references and a part of the transaction block that it indirectly references, the method includes: 将第一类交易块作为待确认交易块存入交易池中,其中,所述第一类交易块是通过验证的交易块,所述交易块的头部信息至少包括源账户信息、与所述源账户信息相关的交易序号、交易金额;The first type of transaction block is stored in the transaction pool as a to-be-confirmed transaction block, wherein the first type of transaction block is a verified transaction block, and the header information of the transaction block at least includes the source account information, and the The transaction serial number and transaction amount related to the source account information; 将通过验证的定序块存入所述交易池中;deposit the verified sequenced block into the transaction pool; 在所述定序块是正常定序块的情况下,在所述交易池中查找被所述定序块确定化的一个或多个第一类交易块;In the case where the sequenced block is a normal sequenced block, searching the transaction pool for one or more first-type transaction blocks determined by the sequenced block; 将所查找到的所有第一类交易块以及所述定序块形成祖先集;forming an ancestor set of all the found transaction blocks of the first type and the sequenced blocks; 确定所述祖先集中的每一个第一类交易块是否合理;determining whether each block of transactions of the first type in the ancestor set is reasonable; 将被确定为合理的所有第一类交易块以及所述定序块写入账本中。All blocks of transactions of the first type that are determined to be legitimate are written to the ledger, as well as the sequenced blocks. 2.根据权利要求1所述的交易处理方法,其中,将第一类交易块作为待确认交易块存入交易池进一步包括:2. The transaction processing method according to claim 1, wherein depositing the first type of transaction block as the transaction block to be confirmed into the transaction pool further comprises: 基于每一个第一类交易块的父交易块是否已存储在所述交易池或所述账本中、所述第一类交易块中的交易序号是否符合交易排序标准以及所述第一类交易块中的交易金额是否超过所述源账户中的余额,确定所述第一类交易块是否是疑似非正常交易块,其中,所述第一类交易块的父交易块是所述第一类交易块直接引用的交易块或定序块;Based on whether the parent transaction block of each first-type transaction block has been stored in the transaction pool or the ledger, whether the transaction sequence number in the first-type transaction block meets the transaction sorting criteria, and whether the first-type transaction block Whether the transaction amount in the source account exceeds the balance in the source account, it is determined whether the first type of transaction block is a suspected abnormal transaction block, wherein the parent transaction block of the first type of transaction block is the first type of transaction. Transaction blocks or sequenced blocks directly referenced by the block; 在所述第一类交易块的父交易块已存储在所述交易池或所述账本中、所述交易序号符合所述交易排序标准并且所述交易金额未超过所述源账户中的余额的情况下,确定所述第一类交易块不是疑似非正常交易块;The parent transaction block of the first type of transaction block has been stored in the transaction pool or the ledger, the transaction sequence number meets the transaction sorting criteria, and the transaction amount does not exceed the balance in the source account. In this case, it is determined that the first type of transaction block is not a suspected abnormal transaction block; 或者,在所述第一类交易块的父交易块未存储在所述交易池或所述账本中、或者所述交易序号不符合所述交易排序标准、或者所述交易金额超过所述源账户中的余额的情况下,确定所述第一类交易块是疑似非正常交易块。Or, the parent transaction block of the first type of transaction block is not stored in the transaction pool or the ledger, or the transaction sequence number does not meet the transaction sorting criteria, or the transaction amount exceeds the source account In the case of the balance in , it is determined that the first type of transaction block is a suspected abnormal transaction block. 3.根据权利要求2所述的交易处理方法,其中,在确定所述第一类交易块不是疑似非正常交易块的情况下,所述方法进一步包括:3. The transaction processing method according to claim 2, wherein, in the case where it is determined that the first type of transaction block is not a suspected abnormal transaction block, the method further comprises: 在确定所述第一类交易块不是疑似非正常交易块的情况下,将所述第一类交易块存入所述交易池的未跟随模块中;In the case that it is determined that the first type of transaction block is not a suspected abnormal transaction block, the first type of transaction block is stored in the non-following module of the transaction pool; 确定所述第一类交易块的父交易块是否存储在所述交易池的未跟随模块中;determining whether the parent transaction block of the first type of transaction block is stored in the unfollowing module of the transaction pool; 在确定所述父交易块存储在所述交易池的未跟随模块中的情况下,将所述父交易块转移到所述交易池的待确认模块中。If it is determined that the parent transaction block is stored in the unfollowing module of the transaction pool, the parent transaction block is transferred to the pending module of the transaction pool. 4.根据权利要求2所述的交易处理方法,其中,在确定所述第一类交易块是疑似非正常交易块的情况下,所述方法进一步包括:4. The transaction processing method according to claim 2, wherein, in the case that the first type of transaction block is determined to be a suspected abnormal transaction block, the method further comprises: 将所述第一类交易块存入所述交易池的疑似非正常交易模块中。The first type of transaction block is stored in the suspected abnormal transaction module of the transaction pool. 5.根据权利要求1所述的交易处理方法,其中,在将通过验证的定序块存入所述交易池中之后,所述方法进一步包括:5. The transaction processing method according to claim 1, wherein after depositing the sequenced blocks that pass the verification into the transaction pool, the method further comprises: 基于所述定序块的头部信息确定所述定序块是否是正常定序块,其中,所述定序块的头部信息至少包括定序块ID、父交易块哈希,所述定序块的父交易块是所述定序块直接引用的交易块或定序块。Whether the sequence block is a normal sequence block is determined based on the header information of the sequence block, wherein the header information of the sequence block at least includes the sequence block ID and the hash of the parent transaction block. The parent transaction block of a sequence block is the transaction block or sequence block directly referenced by the sequence block. 6.根据权利要求5所述的交易处理方法,其中,基于所述定序块的头部信息确定所述定序块是否是正常定序块进一步包括:6. The transaction processing method according to claim 5, wherein determining whether the sequenced block is a normal sequenced block based on header information of the sequenced block further comprises: 当所述定序块的父交易块存储在所述交易池或所述账本中并且所述定序块的定序块ID符合定序块排序标准时,确定所述定序块是正常定序块。When the parent transaction block of the sequencer block is stored in the transaction pool or the ledger and the sequencer block ID of the sequencer block conforms to the sequencer block ordering standard, it is determined that the sequencer block is a normal sequencer block . 7.根据权利要求1所述的交易处理方法,其中,确定所述祖先集中的每一个第一类交易块是否合理进一步包括:7. The transaction processing method of claim 1, wherein determining whether each first type of transaction block in the ancestor set is reasonable further comprises: 在所述第一类交易块中的交易序号符合交易排序标准并且所述第一类交易块中交易金额未超过所述源账户中的余额的情况下,确定所述祖先集中的第一类交易块是合理的。In the case that the transaction sequence numbers in the first-type transaction block meet the transaction sorting criteria and the transaction amount in the first-type transaction block does not exceed the balance in the source account, determine the first-type transaction in the ancestor set Blocks are reasonable. 8.根据权利要求1所述的交易处理方法,其中,将被确定为合理的所有第一类交易块以及所述定序块写入账本中进一步包括:8. The transaction processing method of claim 1, wherein writing all first type transaction blocks determined to be reasonable and the sequenced blocks into the ledger further comprises: 将所述祖先集中被确定为合理的所有第一类交易块以及所述定序块生成确认集,其中,所述确认集包括多个交易集合,每一个交易集合包括源账户信息以及所述源账户所生成的所有第一类交易块和/或定序块;The ancestor set is determined to be reasonable for all first-type transaction blocks and the sequencing block generates a confirmation set, wherein the confirmation set includes a plurality of transaction sets, each transaction set includes source account information and the source all first-class transaction blocks and/or sequencing blocks generated by the account; 将所述确认集发送到所述账本中;sending the confirmation set to the ledger; 将所述确认集中的每一个交易集合存入所述账本中的硬盘数据库中;storing each transaction set in the confirmation set into the hard disk database in the ledger; 将所述确认集中的每一个源账户信息所对应的交易信息存入所述账本中的内存数据库中,其中,所述交易信息至少包括所述源账户信息、与所述源账户信息对应的最终余额、最后所执行的第一类交易块中的交易序号;The transaction information corresponding to each source account information in the confirmation set is stored in the in-memory database in the account book, wherein the transaction information at least includes the source account information and the final transaction information corresponding to the source account information. Balance, transaction sequence number in the last executed first-type transaction block; 将所述确认集中的定序块的定序块ID作为当前交易高度写入所述账本中的账本信息模块中。The sequence block ID of the sequence block in the confirmation set is written into the account book information module in the account book as the current transaction height. 9.根据权利要求4所述的交易处理方法,其中,在将被确定为合理的所有第一类交易块以及所述定序块写入账本中之后,所述方法进一步包括:9. The transaction processing method according to claim 4, wherein after writing all first type transaction blocks determined to be reasonable and the sequenced blocks into the ledger, the method further comprises: 在所述疑似非正常交易块被确定为合理的并且存入所述账本中的情况下,将所述疑似非正常交易块从所述疑似非正常交易模块中删除;In the case that the suspected abnormal transaction block is determined to be reasonable and stored in the ledger, delete the suspected abnormal transaction block from the suspected abnormal transaction module; 在所述待确认模块和/或所述未跟随模块中存储的第一类交易块被确定为非合理的情况下,将所述第一类交易块作为疑似非正常交易块存入所述疑似非正常交易模块中。In the case that the first type of transaction block stored in the module to be confirmed and/or the non-following module is determined to be unreasonable, the first type of transaction block is stored as a suspected abnormal transaction block in the suspected abnormal transaction block. in the normal transaction module. 10.一种基于DAG的区块链的交易处理设备,其中,所述基于DAG的区块链包括多个交易块以及一个或多个定序块,并且每一个交易块直接引用其他的交易块或定序块,并且每一个定序块将其直接引用的交易块以及间接引用的一部分交易块进行确定化,所述设备包括:10. A DAG-based blockchain transaction processing device, wherein the DAG-based blockchain includes multiple transaction blocks and one or more sequenced blocks, and each transaction block directly references other transaction blocks or ordering blocks, and each ordering block determinizes its directly referenced transaction blocks and a portion of its indirectly referenced transaction blocks, the apparatus comprising: 处理器;以及processor; and 存储器,其用于存储指令,当所述指令执行时使得所述处理器执行以下操作:A memory for storing instructions that, when executed, cause the processor to: 将第一类交易块作为待确认交易块存入交易池中,其中,所述第一类交易块是通过验证的交易块,所述交易块的头部信息至少包括源账户信息、与所述源账户信息相关的交易序号、交易金额;The first type of transaction block is stored in the transaction pool as a to-be-confirmed transaction block, wherein the first type of transaction block is a verified transaction block, and the header information of the transaction block at least includes the source account information, and the The transaction serial number and transaction amount related to the source account information; 将通过验证的定序块存入所述交易池中;deposit the verified sequenced block into the transaction pool; 在所述定序块是正常定序块的情况下,在所述交易池中查找被所述定序块确定化的一个或多个第一类交易块;In the case where the sequenced block is a normal sequenced block, searching the transaction pool for one or more first-type transaction blocks determined by the sequenced block; 将所查找到的所有第一类交易块以及所述定序块形成祖先集;forming an ancestor set of all the found transaction blocks of the first type and the sequenced blocks; 确定所述祖先集中的每一个第一类交易块是否合理;determining whether each block of transactions of the first type in the ancestor set is reasonable; 将被确定为合理的所有第一类交易块以及所述定序块写入账本中。All blocks of transactions of the first type that are determined to be legitimate are written to the ledger, as well as the sequenced blocks. 11.根据权利要求10所述的交易处理设备,其中,将第一类交易块作为待确认交易块存入交易池进一步包括:11. The transaction processing device of claim 10, wherein depositing the first type of transaction block as a pending transaction block into the transaction pool further comprises: 基于每一个第一类交易块的父交易块是否已存储在所述交易池或所述账本中、所述第一类交易块中的交易序号是否符合交易排序标准以及所述第一类交易块中的交易金额是否超过所述源账户中的余额,确定所述第一类交易块是否是疑似非正常交易块,其中,所述第一类交易块的父交易块是所述第一类交易块直接引用的交易块或定序块;Based on whether the parent transaction block of each first-type transaction block has been stored in the transaction pool or the ledger, whether the transaction sequence number in the first-type transaction block meets the transaction sorting criteria, and whether the first-type transaction block Whether the transaction amount in the source account exceeds the balance in the source account, it is determined whether the first type of transaction block is a suspected abnormal transaction block, wherein the parent transaction block of the first type of transaction block is the first type of transaction. Transaction blocks or sequenced blocks directly referenced by the block; 在所述第一类交易块的父交易块已存储在所述交易池或所述账本中、所述交易序号符合所述交易排序标准并且所述交易金额未超过所述源账户中的余额的情况下,确定所述第一类交易块不是疑似非正常交易块;The parent transaction block of the first type of transaction block has been stored in the transaction pool or the ledger, the transaction sequence number meets the transaction sorting criteria, and the transaction amount does not exceed the balance in the source account. In this case, it is determined that the first type of transaction block is not a suspected abnormal transaction block; 或者,在所述第一类交易块的父交易块未存储在所述交易池或所述账本中、或者所述交易序号不符合所述交易排序标准、或者所述交易金额超过所述源账户中的余额的情况下,确定所述第一类交易块是疑似非正常交易块。Or, the parent transaction block of the first type of transaction block is not stored in the transaction pool or the ledger, or the transaction sequence number does not meet the transaction sorting criteria, or the transaction amount exceeds the source account In the case of the balance in , it is determined that the first type of transaction block is a suspected abnormal transaction block. 12.根据权利要求11所述的交易处理设备,其中,在确定所述第一类交易块不是疑似非正常交易块的情况下,当所述指令执行时使得所述处理器进一步执行以下操作:12. The transaction processing device according to claim 11, wherein, in the case of determining that the first type of transaction block is not a suspected abnormal transaction block, when the instruction is executed, the processor is caused to further perform the following operations: 在确定所述第一类交易块不是疑似非正常交易块的情况下,将所述第一类交易块存入所述交易池的未跟随模块中;In the case that it is determined that the first type of transaction block is not a suspected abnormal transaction block, the first type of transaction block is stored in the non-following module of the transaction pool; 确定所述第一类交易块的父交易块是否存储在所述交易池的未跟随模块中;determining whether the parent transaction block of the first type of transaction block is stored in the unfollowing module of the transaction pool; 在确定所述父交易块存储在所述交易池的未跟随模块中的情况下,将所述父交易块转移到所述交易池的待确认模块中。If it is determined that the parent transaction block is stored in the unfollowing module of the transaction pool, the parent transaction block is transferred to the pending module of the transaction pool. 13.根据权利要求11所述的交易处理设备,其中,在确定所述第一类交易块是疑似非正常交易块的情况下,当所述指令执行时使得所述处理器进一步执行以下操作:13. The transaction processing device according to claim 11, wherein, in the case where it is determined that the first type of transaction block is a suspected abnormal transaction block, when the instruction is executed, the processor is caused to further perform the following operations: 将所述第一类交易块存入所述交易池的疑似非正常交易模块中。The first type of transaction block is stored in the suspected abnormal transaction module of the transaction pool. 14.根据权利要求10所述的交易处理设备,其中,在将通过验证的定序块存入所述交易池中之后,当所述指令执行时使得所述处理器进一步执行以下操作:14. The transaction processing device of claim 10, wherein, after the verified sequenced block is stored in the transaction pool, when the instruction is executed, the processor is caused to further perform the following operations: 基于所述定序块的头部信息确定所述定序块是否是正常定序块,其中,所述定序块的头部信息至少包括定序块ID、父交易块哈希,所述定序块的父交易块是所述定序块直接引用的交易块或定序块。Whether the sequence block is a normal sequence block is determined based on the header information of the sequence block, wherein the header information of the sequence block at least includes the sequence block ID and the hash of the parent transaction block. The parent transaction block of a sequence block is the transaction block or sequence block directly referenced by the sequence block. 15.根据权利要求14所述的交易处理设备,其中,基于所述定序块的头部信息确定所述定序块是否是正常定序块进一步包括:15. The transaction processing apparatus of claim 14, wherein determining whether the sequenced block is a normal sequenced block based on header information of the sequenced block further comprises: 当所述定序块的父交易块存储在所述交易池或所述账本中并且所述定序块的定序块ID符合定序块排序标准时,确定所述定序块是正常定序块。When the parent transaction block of the sequencer block is stored in the transaction pool or the ledger and the sequencer block ID of the sequencer block conforms to the sequencer block ordering standard, it is determined that the sequencer block is a normal sequencer block . 16.根据权利要求10所述的交易处理设备,其中,确定所述祖先集中的每一个第一类交易块是否合理进一步包括:16. The transaction processing apparatus of claim 10, wherein determining whether each first type of transaction block in the ancestor set is reasonable further comprises: 在所述第一类交易块中的交易序号符合交易排序标准并且所述第一类交易块中交易金额未超过所述源账户中的余额的情况下,确定所述祖先集中的第一类交易块是合理的。In the case that the transaction sequence numbers in the first-type transaction block meet the transaction sorting criteria and the transaction amount in the first-type transaction block does not exceed the balance in the source account, determine the first-type transaction in the ancestor set Blocks are reasonable. 17.根据权利要求10所述的交易处理设备,其中,将被确定为合理的所有第一类交易块以及所述定序块写入账本中进一步包括:17. The transaction processing device of claim 10, wherein writing all first type of transaction blocks determined to be reasonable and the sequenced blocks into the ledger further comprises: 将所述祖先集中被确定为合理的所有第一类交易块以及所述定序块生成确认集,其中,所述确认集包括多个交易集合,每一个交易集合包括源账户信息以及所述源账户所生成的所有第一类交易块和/或定序块;The ancestor set is determined to be reasonable for all first-type transaction blocks and the sequencing block generates a confirmation set, wherein the confirmation set includes a plurality of transaction sets, each transaction set includes source account information and the source all first-class transaction blocks and/or sequencing blocks generated by the account; 将所述确认集发送到所述账本中;sending the confirmation set to the ledger; 将所述确认集中的每一个交易集合存入所述账本中的硬盘数据库中;storing each transaction set in the confirmation set into the hard disk database in the ledger; 将所述确认集中的每一个源账户信息所对应的交易信息存入所述账本中的内存数据库中,其中,所述交易信息至少包括所述源账户信息、与所述源账户信息对应的最终余额、最后所执行的第一类交易块中的交易序号;The transaction information corresponding to each source account information in the confirmation set is stored in the in-memory database in the account book, wherein the transaction information at least includes the source account information and the final transaction information corresponding to the source account information. Balance, transaction sequence number in the last executed first-type transaction block; 将所述确认集中的定序块的定序块ID作为当前交易高度写入所述账本中的账本信息模块中。The sequence block ID of the sequence block in the confirmation set is written into the account book information module in the account book as the current transaction height. 18.根据权利要求13所述的交易处理设备,其中,在将被确定为合理的所有第一类交易块以及所述定序块写入账本中之后,当所述指令执行时使得所述处理器进一步执行以下操作:18. The transaction processing device of claim 13, wherein the processing is caused when the instruction is executed after all first type transaction blocks determined to be reasonable and the sequenced blocks are written into the ledger The controller further performs the following actions: 在所述疑似非正常交易块被确定为合理的并且存入所述账本中的情况下,将所述疑似非正常交易块从所述疑似非正常交易模块中删除;In the case that the suspected abnormal transaction block is determined to be reasonable and stored in the ledger, delete the suspected abnormal transaction block from the suspected abnormal transaction module; 在所述待确认模块和/或所述未跟随模块中存储的第一类交易块被确定为非合理的情况下,将所述第一类交易块作为疑似非正常交易块存入所述疑似非正常交易模块中。In the case that the first type of transaction block stored in the module to be confirmed and/or the non-following module is determined to be unreasonable, the first type of transaction block is stored as a suspected abnormal transaction block in the suspected abnormal transaction block. in the normal transaction module.
CN201811579503.3A 2018-12-24 2018-12-24 DAG-based blockchain transaction processing method and device Active CN109544344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811579503.3A CN109544344B (en) 2018-12-24 2018-12-24 DAG-based blockchain transaction processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811579503.3A CN109544344B (en) 2018-12-24 2018-12-24 DAG-based blockchain transaction processing method and device

Publications (2)

Publication Number Publication Date
CN109544344A true CN109544344A (en) 2019-03-29
CN109544344B CN109544344B (en) 2021-07-02

Family

ID=65856636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811579503.3A Active CN109544344B (en) 2018-12-24 2018-12-24 DAG-based blockchain transaction processing method and device

Country Status (1)

Country Link
CN (1) CN109544344B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362633A (en) * 2019-07-23 2019-10-22 腾讯科技(深圳)有限公司 Block data storage method and device, computer equipment and storage medium
CN110910237A (en) * 2019-11-20 2020-03-24 腾讯科技(深圳)有限公司 Data processing method and device in block chain, intelligent terminal and storage medium
CN113256424A (en) * 2021-06-15 2021-08-13 腾讯科技(深圳)有限公司 Transaction data processing method, device, equipment and storage medium
CN114119224A (en) * 2021-11-24 2022-03-01 安徽中科晶格技术有限公司 Intelligent contract non-increment sequencing execution method, system, equipment and storage medium under DAG structure based on account chain and guard chain
CN114756561A (en) * 2022-04-26 2022-07-15 蚂蚁区块链科技(上海)有限公司 Transaction execution method and device and electronic equipment
CN115115366A (en) * 2022-07-22 2022-09-27 上海万向区块链股份公司 Relay chain consensus system and method based on DAG transaction storage structure
US11711220B1 (en) * 2019-11-08 2023-07-25 Alicorn Systems, Inc. System and methods for computation, storage, and consensus in distributed systems

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103852513A (en) * 2012-11-29 2014-06-11 中国科学院计算技术研究所 Method and system based on HCD mass spectrogram and ETD mass spectrogram for peptide fragment de novo sequencing
US20160253622A1 (en) * 2015-02-26 2016-09-01 Skuchain, Inc. Tracking unitization occurring in a supply chain
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 a distributed database within a network
US20180255131A1 (en) * 2015-11-09 2018-09-06 Innogy Innovation Gmbh System and Method for Transporting an Object
CN108765151A (en) * 2018-05-11 2018-11-06 深圳市恋上互联网技术有限公司 A kind of method of commerce based on block chain
CN108985732A (en) * 2018-06-08 2018-12-11 中国地质大学(武汉) The common recognition and account book data organization method and system of DAG technology based on no block

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103852513A (en) * 2012-11-29 2014-06-11 中国科学院计算技术研究所 Method and system based on HCD mass spectrogram and ETD mass spectrogram for peptide fragment de novo sequencing
US20160253622A1 (en) * 2015-02-26 2016-09-01 Skuchain, Inc. Tracking unitization occurring in a supply chain
CN108351882A (en) * 2015-08-28 2018-07-31 斯沃尔德斯股份有限公司 Method and apparatus for a distributed database within a network
US20180255131A1 (en) * 2015-11-09 2018-09-06 Innogy Innovation Gmbh System and Method for Transporting an Object
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
CN108985732A (en) * 2018-06-08 2018-12-11 中国地质大学(武汉) The common recognition and account book data organization method and system of DAG technology based on no block

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ALAN DURING: "ByteBall中DAG交易数据同步算法详解", 《HTTPS://BBFANS.ORG/2018/12/09/BYTEBALL-CATCHUP/》 *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110362633A (en) * 2019-07-23 2019-10-22 腾讯科技(深圳)有限公司 Block data storage method and device, computer equipment and storage medium
CN110362633B (en) * 2019-07-23 2023-12-05 腾讯科技(深圳)有限公司 Block data storage method, device, computer equipment and storage medium
US11711220B1 (en) * 2019-11-08 2023-07-25 Alicorn Systems, Inc. System and methods for computation, storage, and consensus in distributed systems
CN110910237A (en) * 2019-11-20 2020-03-24 腾讯科技(深圳)有限公司 Data processing method and device in block chain, intelligent terminal and storage medium
CN110910237B (en) * 2019-11-20 2024-05-24 腾讯科技(深圳)有限公司 Data processing method, device, intelligent terminal and storage medium in blockchain
CN113256424A (en) * 2021-06-15 2021-08-13 腾讯科技(深圳)有限公司 Transaction data processing method, device, equipment and storage medium
CN113256424B (en) * 2021-06-15 2021-09-24 腾讯科技(深圳)有限公司 A transaction data processing method, device, equipment and storage medium
CN114119224A (en) * 2021-11-24 2022-03-01 安徽中科晶格技术有限公司 Intelligent contract non-increment sequencing execution method, system, equipment and storage medium under DAG structure based on account chain and guard chain
CN114756561A (en) * 2022-04-26 2022-07-15 蚂蚁区块链科技(上海)有限公司 Transaction execution method and device and electronic equipment
CN114756561B (en) * 2022-04-26 2025-08-12 蚂蚁区块链科技(上海)有限公司 Transaction execution method and device and electronic equipment
CN115115366A (en) * 2022-07-22 2022-09-27 上海万向区块链股份公司 Relay chain consensus system and method based on DAG transaction storage structure

Also Published As

Publication number Publication date
CN109544344B (en) 2021-07-02

Similar Documents

Publication Publication Date Title
CN120011126B (en) Distributed account asynchronous data processing method and system based on MEMO state machine
CN107169865A (en) Asset data processing system based on block chain technology
CN109544344B (en) DAG-based blockchain transaction processing method and device
Zhan et al. A loan application fraud detection method based on knowledge graph and neural network
CN109242685A (en) Common recognition and verification method and device based on block chain
CN110852730A (en) Transaction processing method and device based on digital currency and electronic equipment
CN105426410A (en) Data acquisition system and analytic method for same
CN110471931A (en) A kind of digital asset trade identity maintaining method based on transaction in assets chain
CN109118230A (en) Information processing method and device based on block chain
Bai State-of-the-art and future trends of blockchain based on dag structure
Neal et al. Forecasting the world city network
Ashouri et al. A Combination of Meta-heuristic and Heuristic Algorithms for the VRP, OVRP and VRP with Simultaneous Pickup and Delivery
CN107346511A (en) A kind of big data method for secure transactions
CN108614864A (en) Bank transaction information processing method and processing device
CN115496572A (en) Clearing task processing method, device, equipment and storage medium
CN109189658A (en) A kind of log storing method, control node and computer readable storage medium
CN115687599B (en) Service data processing method and device, electronic equipment and storage medium
KR20190134874A (en) Analyzing news contents service system of cryptocurrency using robot journalism
CN113643032B (en) Information processing method, device and data management system based on block chain
CN115328943B (en) Data processing method and device
Bossek et al. Local search effects in bi-objective orienteering
Gluck Global Competition in the 1980s
Song et al. Study on the combination of genetic algorithms and ant colony algorithms for solving fuzzy job shop scheduling problems
Gogol et al. The writing is on the wall: Analyzing the boom of inscriptions and its impact on rollup performance and cost efficiency
CN109191296A (en) The automatic account checking method of digital asset and readable storage medium storing program for executing based on block chain

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

Effective date of registration: 20210914

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

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

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

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

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

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240304

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.

TR01 Transfer of patent right
CP03 Change of name, title or address

Address after: 3F-24, Group A, Qianhai Shenzhen Hong Kong Innovation Center, No. 4008 Menghai Avenue, Nanshan Street, Qianhai Shenzhen Hong Kong Cooperation Zone, Shenzhen, Guangdong Province 518054

Patentee after: Zhong'an Xinke (Shenzhen) Co.,Ltd.

Country or region after: China

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

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

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

Country or region before: China

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

CP03 Change of name, title or address