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.
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.