CN109961364A - A kind of method of commerce and system based on directed acyclic graph - Google Patents

A kind of method of commerce and system based on directed acyclic graph Download PDF

Info

Publication number
CN109961364A
CN109961364A CN201910124802.6A CN201910124802A CN109961364A CN 109961364 A CN109961364 A CN 109961364A CN 201910124802 A CN201910124802 A CN 201910124802A CN 109961364 A CN109961364 A CN 109961364A
Authority
CN
China
Prior art keywords
transaction
critical path
common recognition
node
path
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
CN201910124802.6A
Other languages
Chinese (zh)
Other versions
CN109961364B (en
Inventor
刘雄文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baibao Shanghai Technology Co ltd
Shanghai Zhongan Information Technology Service Co ltd
Original Assignee
Zhongan Information Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongan Information Technology Service Co Ltd filed Critical Zhongan Information Technology Service Co Ltd
Priority to CN201910124802.6A priority Critical patent/CN109961364B/en
Publication of CN109961364A publication Critical patent/CN109961364A/en
Application granted granted Critical
Publication of CN109961364B publication Critical patent/CN109961364B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/42Confirmation, e.g. check or permission by the legal debtor of payment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The invention discloses a kind of method of commerce and system based on directed acyclic graph sets up common recognition node this method comprises: sequentially numbering for each node participated in business in each node, and sets the time interval of common recognition, common recognition number of transaction;Each node is that respectively transaction applies for that transaction number, transaction number sequentially increase and globally unique;According to selected first transaction of time interval or common recognition number of transaction, will create that family friend is easy or the end transaction of previous critical path to the path of the first transaction as the critical path of candidate;Common recognition node confirms candidate critical path, chooses this critical path;It determines the growing direction that this critical path is main chain and broadcasts to each node participated in business the account book that consistency is written.The present invention carries out preliminery application and sequentially distributes to number to transaction, avoids transaction conflict, and devise the main chain generation method of directed acyclic graph, and the consistency of transaction account book among the nodes and successive succession of trading has been determined by main chain.

Description

A kind of method of commerce and system based on directed acyclic graph
Technical field
The present invention relates to block chain technical field, in particular to a kind of method of commerce and system based on directed acyclic graph.
Background technique
In the prior art, such as usually using the project of the distributed account book technology based on DAG (directed acyclic graph) structure IOTA, Byteball etc. are used to solve the decentralization that block chain is developed so far, scalability, and safety waits the balance of three aspects Bottleneck.However due to there is no miner's uniform packing in DAG model there is no very strong causality between most of transaction The step for transaction, each node are likely to difference at each moment for the understanding of network, this causes all transaction to be in An existing unordered state, and unordered transaction and state consistency are conflicting.The transaction of structure based on DAG also band Come consistency it is uncontrollable the problems such as, and block follows sequence no longer come after arranging, and the transaction in each block conflicts thing Part will be substantially improved, such as the problems such as honeysuckle.
Summary of the invention
In order to solve problems in the prior art, the embodiment of the invention provides a kind of method of commerce based on directed acyclic graph And system, to overcome the transaction of the structure based on DAG in the prior art that a unordered state is presented, so as to cause consistency The problems such as uncontrollable.
To solve said one or multiple technical problems, the technical solution adopted by the present invention is that:
On the one hand, a kind of method of commerce based on directed acyclic graph is provided, described method includes following steps:
S1: each node to participate in business sequentially is numbered, and sets up common recognition node in each node, and set common recognition Time interval, common recognition number of transaction;
S2: each node participated in business be respectively transaction apply transaction number, the transaction number sequentially increase and It is globally unique;
S3: according to selected first transaction of the time interval or the common recognition number of transaction, it will create that family friend is easy or previous pass The end transaction in key path is to the path of first transaction as candidate critical path;
S4: the common recognition node confirms the critical path of the candidate, if the wound family friend is easy or previous key The end transaction in path is identified to the All Activity between the second transaction, then chooses that the wound family friend is easy or previous critical path The path of the end transaction of diameter to second transaction is this critical path;
S5: it determines the growing direction that this described critical path is main chain and broadcasts to each node participated in business and write Enter the account book of consistency;
S6: time interval or common recognition number of transaction based on the common recognition repeat step S2 to S5.
Further, the step S2 includes:
Each node presses the number of transaction of the respective number size client of pre- first to file oneself in turn;
When the remaining quantity of the number of transaction of node application is lower than preset threshold, then next round application is initiated;
Each node is compared transaction content when transaction is submitted, and trades within the set time by content is identical It filters, does not distribute transaction number;
The easy number of family friend will be created and be set as 0, the number of other transaction sequentially increases.
Further, the step S3 is specifically included:
S3.1: after the time interval or the common recognition number of transaction reach, selected number is n or common recognition number of transaction Transaction be the first transaction, wherein n is the quantity traded in system;
S3.2: the common recognition node to it is described first transaction carry out common recognition ballot, if voting through, will wound family friend easily or The end transaction of previous critical path is to the path of first transaction as candidate critical path.
Further, second transaction is any one transaction in the critical path of the candidate.
Further, the step S4 is specifically included:
S4.1: the common recognition node confirms the critical path of the candidate, if the critical path of the candidate On transaction be not identified, then follow the steps S4.2 or step S4.3;
S4.2: the common recognition node carries out common recognition ballot to the transaction of all not confirmeds, described if voting through The transaction of not confirmed is identified through, if ballot does not pass through, is carried out to the previous transaction of the transaction of the not confirmed Common recognition ballot, circulate operation in critical path until finding the second transaction, from wound family friend is easy or the end of previous critical path It trades to the All Activity between second transaction and is all identified;
S4.3: the common recognition node is checked from wound family friend in the critical path of the candidate easily to the transaction of not confirmed Previous transaction, circulate operation until finding the second transaction in the critical path in the candidate, from wound family friend it is easy or previous The end transaction of critical path is all identified to the All Activity between second transaction;
S4.4: choose that the wound family friend is easy or the path of end transaction to second transaction of previous critical path is this Secondary critical path.
On the other hand, a kind of transaction system based on directed acyclic graph is provided, the system comprises:
Setup module, user are that each node participated in business sequentially is numbered, and common recognition node is set up in each node, and Set time interval, the common recognition number of transaction of common recognition;
Number module is that respectively transaction number, the transaction number are applied in transaction for each node participated in business Sequentially increase and globally unique;
First chooses module, for will create according to selected first transaction of the time interval or the common recognition number of transaction Family friend is easy or critical path of the end transaction of previous critical path to the path of first transaction as candidate;
Second chooses module, confirms for the common recognition node to the critical path of the candidate, if the wound generation The transaction of the end of transaction or previous critical path is identified to the All Activity between the second transaction, then chooses the wound family friend The path of the end transaction of easy or previous critical path to second transaction is this critical path;
Broadcast module, for determining that growing direction and broadcast that this described critical path is main chain are participated in business to described Each node write-in consistency account book.
Further, the number module includes:
Quantity application unit presses the friendship of the respective number size client of pre- first to file oneself in turn for each node Easy quantity;
Whether judging unit, the remaining quantity of number of transaction for predicate node application are lower than preset threshold;
Filter element, each node is compared transaction content when submitting for trading, within the set time will be interior Hold identical transaction to filter out, does not distribute transaction number;Numbered cell is set as 0 for will create the easy number of family friend, other friendships Easy number sequentially increases.
Further, the first selection module includes:
Trade selection unit, for after the time interval or the common recognition number of transaction reach, it is selected number be n or The transaction of common recognition number of transaction is the first transaction, and wherein n is the quantity traded in system;
Path candidate selection unit carries out common recognition ballot to first transaction for the common recognition node, if ballot is logical Cross, then will create that family friend is easy or the end transaction of previous critical path to the path of first transaction as the critical path of candidate Diameter.
Further, second transaction is any one transaction in the critical path of the candidate.
Further, the second selection module includes:
Confirmation unit confirms the critical path of the candidate for the common recognition node;
Common recognition unit, carries out common recognition ballot to the transaction of all not confirmeds for the common recognition node, if voting through Then being identified through the transaction of the not confirmed, if ballot does not pass through, to the previous of the transaction of the not confirmed Transaction carries out common recognition ballot, and circulate operation in critical path until finding the second transaction, from wound family friend is easy or previous critical path The end transaction of diameter is all identified to the All Activity between second transaction;
Query unit is checked in the critical path of the candidate from wound family friend for the common recognition node easily to not true The previous transaction for the transaction recognized, circulate operation is until finding the second transaction in the critical path in the candidate, from wound family friend The end transaction of easy or previous critical path is all identified to the All Activity between second transaction;
Critical path selection unit, for choosing that the wound family friend is easy or the end transaction of previous critical path is to described the The path of two transaction is this critical path.
Technical solution provided in an embodiment of the present invention has the benefit that
Method of commerce and system provided in an embodiment of the present invention based on directed acyclic graph carries out preliminery application to transaction and presses Sequence distribution number, avoids transaction conflict, and devise the main chain generation method of directed acyclic graph, transaction has been determined by main chain The consistency of account book among the nodes and successive succession of trading.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, it can also be obtained according to these attached drawings other Attached drawing.
Fig. 1 is the flow chart of the method for commerce shown according to an exemplary embodiment based on directed acyclic graph;
Fig. 2 is the schematic diagram of directed acyclic graph shown according to an exemplary embodiment;
Fig. 3 is the structural schematic diagram of the transaction system shown according to an exemplary embodiment based on directed acyclic graph.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with attached in the embodiment of the present invention Figure, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only this Invention a part of the embodiment, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art exist Every other embodiment obtained under the premise of creative work is not made, shall fall within the protection scope of the present invention.
Fig. 1 is the flow chart of the method for commerce shown according to an exemplary embodiment based on directed acyclic graph, referring to Fig.1 Shown, this method comprises the following steps:
S1: each node to participate in business sequentially is numbered, and sets up common recognition node in each node, and set common recognition Time interval, common recognition number of transaction.
Specifically, sequentially numbered for each node for participating in business, in each node (including each block chain node participated in business Or each system node) in set up common recognition node or witness's node, these common recognition nodes or witness's node can scheme DAG Critical path, transaction on (directed acyclic graph) carry out common recognition confirmation.Referring to shown in 2, Fig. 2 is according to an exemplary embodiment The schematic diagram of the directed acyclic graph shown.The time interval and common recognition number of deals known together for each node sets participated in business Amount, each node of system can carry out time synchronization by Network Time Protocol (NTP).For example, node serial number can be 1,2 ... N, the time interval of common recognition are denoted as T, and common recognition number of transaction is denoted as TxNum.What needs to be explained here is that the present invention is implemented In example, common recognition node is preferentially numbered, i.e., the number for node of knowing together preferentially is set as 1,2,3 ... etc., and known together and node or see The quantity of card person's node is at least 4.
S2: each node participated in business be respectively transaction apply transaction number, the transaction number sequentially increase and It is globally unique.
Specifically, user submits transaction by the client of each node, transaction number sequentially increases.In the embodiment of the present invention In, it need to guarantee that the transaction number of All Activity is globally unique.
S3: according to selected first transaction of the time interval or the common recognition number of transaction, family friend will be created easily or arrived previous The end transaction of critical path is to the path of first transaction as candidate critical path.
Specifically, selecting transaction (i.e. the when the time interval or common recognition number of transaction of common recognition reach the value of setting One transaction), will create that family friend is easy or the end transaction of previous critical path to the path of the transaction (the i.e. first transaction) as candidate Critical path.For example, it is assumed that wound generation transaction number is 0, first time critical path is that (40 be the transaction after confirmation from 0 to 40 Number, i.e., the number of the first transaction), second critical path number is then from 40 to N, i.e. second of critical path is from 40 Start, rather than since wound family friend is easily.
S4: the common recognition node confirms the critical path of the candidate, if the wound family friend is easy or previous key The end transaction in path is identified to the All Activity between the second transaction, then chooses that the wound family friend is easy or previous critical path The path of the end transaction of diameter to second transaction is this critical path.
Specifically, critical path refer to from wound family friend is easy or the end transaction of previous critical path to specified number friendship With the path of maximum length between easily, the transaction in critical path is called crucial transaction.What needs to be explained here is that here Confirmation refer to by 2 or 2 or more other trade confirmations.Based in directed acyclic graph (DAG) tactic pattern, generally by 2 The transaction that other trade confirmations are crossed can be by one of the candidate as the crucial transaction in critical path.Trade confirmation is traded The common practice of DAG model, the process of confirmation are to approve that the content of cryptographic Hash and transaction including transaction is simultaneously to last time transaction And its transaction confirmed can be linked.If a point is regarded in each transaction as, it is equivalent to by a certain transaction confirmation An access is taken between two o'clock, such confirmation relationship is unidirectional.Such as transaction A confirmation transaction B:A.Confirm (transaction B Hash, trade the source B account, trade B mesh account, transaction amount, other parameters) judge transaction it is whether reasonable.
S5: it determines the growing direction that this described critical path is main chain and broadcasts to each node participated in business and write Enter the account book of consistency.
Specifically, selected critical path to be used as to the growing direction of main chain, and broadcast to it is described participate in business own The account book of consistency is written in the information by node, all nodes.What needs to be explained here is that in embodiments of the present invention, new Transaction can only confirm the transaction on existing main chain.
S6: time interval or common recognition number of transaction based on the common recognition repeat step S2 to S5.
Specifically, repeating the above steps S2 extremely when the time interval or common recognition number of transaction of common recognition reach the value of setting S5 determines new critical path.What needs to be explained here is that subsequent critical path with the transaction of last Trail termination (i.e. Trade the end of previous critical path) main chain is increased as starting transaction.
As a kind of preferably embodiment, in the embodiment of the present invention, the step S2 includes:
Each node presses the number of transaction of the respective number size client of pre- first to file oneself in turn;
When the remaining quantity of the number of transaction of node application is lower than preset threshold, then next round application is initiated;
Each node is compared transaction content when transaction is submitted, and trades within the set time by content is identical It filters, does not distribute transaction number;
The easy number of family friend will be created and be set as 0, the number of other transaction sequentially increases.
Specifically, in the embodiment of the present invention, each node can preparatory Shen to guarantee that the transaction number of All Activity is globally unique Please oneself client number of transaction, each node applied for that record is as follows: (system works as prosthomere by respective number size in turn Maximum transaction number value, application round, node serial number, the Base Serial Number of this transaction application, this transaction Shen before point application Finish number please).For example, (21,2,1,22,40), wherein 21 represent the maximum transaction number before system present node application Be 21,2 represent present application round as second wheel, 1 be present node number, 22 and 40 respectively represent this transaction application rise Begin number and finish number;(50,2,3,51,100), 50 to represent the maximum transaction number before system present node application be 50, Transaction number value after representing the application of node 1 and node 2 is 50.
What needs to be explained here is that in embodiments of the present invention, the remaining number of number of transaction of node application can be set When amount is lower than 40% (this value can be configured according to the demand of user), next round application is initiated.Transaction each section when submitting Point is compared transaction content, and the identical transaction of (such as 20 seconds or 1 minute) content within the set time can be filtered, Do not distribute transaction number.
In addition in embodiments of the present invention, it will preferably create the easy number of family friend and be set as 0, the number of other transaction is sequentially Increase.But it is noted that the number of all transaction is globally unique, and within the set time, the identical trade fair of content It is filtered, does not redistribute transaction number.
As a kind of preferably embodiment, in the embodiment of the present invention, the step S3 is specifically included:
S3.1: after the time interval or the common recognition number of transaction reach, selected number is n or common recognition number of transaction Transaction be the first transaction, wherein n is the quantity traded in system.
Specifically, selecting number after the time interval or common recognition number of transaction of common recognition reach the value of setting and being equal to currently The transaction for the quantity traded in system or common recognition number of transaction are the first transaction.For example, the time interval in common recognition reaches setting Value after, and the quantity traded in current system be n, then choose number be n transaction as first transaction, alternatively, knowing together After number of transaction reaches the value of setting, then chooses the transaction that number is common recognition number of transaction and trade as first.
What needs to be explained here is that selecting the first transaction in the manner described above, critical path can be maximized.Such as system Number of transaction is 10000, because ensuring that transaction is sequentially to number in the step of before.So from a certain transaction A to 10000, From A to 900, if A to 10000 is critical path, 900 to 10000 transaction is not had to consider further that.Model is reduced from big to small It encloses confirmation critical path and reduces the time for determining key, improve efficiency.
S3.2: the common recognition node to it is described first transaction carry out common recognition ballot, if voting through, will wound family friend easily or The end transaction of previous critical path is to the path of first transaction as candidate critical path.
Specifically, common recognition node carries out common recognition ballot to first transaction after the first transaction is selected, if voting through, To then create that family friend is easy or the end transaction of previous critical path to the path of first transaction as the critical path of candidate.This In it should be noted that in embodiments of the present invention, common recognition ballot follows BFT (Tendermint) or PBFT algorithm (N=3f+ 1, N represents node total number, f representing fault node or malicious node).
As a kind of preferably embodiment, in the embodiment of the present invention, second transaction is the critical path of the candidate Any one transaction on diameter.
Specifically, the second transaction can be first transaction itself that is, in embodiments of the present invention, it is also possible to Any one transaction in candidate critical path, i.e., from wound family friend easily to any one transaction the first transaction.
As a kind of preferably embodiment, in the embodiment of the present invention, the step S4 is specifically included:
S4.1: the common recognition node confirms the critical path of the candidate, if the critical path of the candidate On transaction be not identified, then follow the steps S4.2 or step S4.3.
Specifically, common recognition node is confirmed that (confirmation refers to by 2 or 2 or more other friendships to candidate critical path Easily confirmation), if there is a transaction (the i.e. second transaction) in candidate critical path, from family friend is created easily to the transaction (i.e. the Two transaction) between All Activity be identified that then choosing wound family friend and easily arriving the path of the transaction (the i.e. second transaction) is key Path.If the transaction in candidate critical path is not identified, is then handled there are two types of mode, respectively refer to step S4.2 Or step S4.3.What needs to be explained here is that then selecting candidate pass if the transaction in candidate critical path is identified Key path is critical path, and the second transaction at this time is the first transaction.
S4.2: the common recognition node carries out common recognition ballot to the transaction of all not confirmeds, described if voting through The transaction of not confirmed is identified through, if ballot does not pass through, is carried out to the previous transaction of the transaction of the not confirmed Common recognition ballot, circulate operation in critical path until finding the second transaction, from wound family friend is easy or the end of previous critical path It trades to the All Activity between second transaction and is all identified.
Specifically, all common recognition nodes carry out common recognition ballot to the transaction of all not confirmeds, likewise, common recognition is thrown here Ticket follows BFT (Tendermint) or PBFT algorithm, and (N=3f+1, N represent node total number, and f representing fault node or malice save Point).If voting through, the confirmation number of the transaction of the not confirmed is denoted as 2, i.e., the trade confirmation of the not confirmed is led to Cross, if otherwise ballot does not pass through, common recognition ballot carried out to the previous transaction of the transaction of not confirmed, circulate operation until A transaction (i.e. second transaction) is found in critical path, from wound family friend is easy or the end transaction of previous critical path is to the transaction All Activity between (the i.e. second transaction) is all identified.
S4.3: the common recognition node is checked from wound family friend in the critical path of the candidate easily to the transaction of not confirmed Previous transaction, circulate operation until finding the second transaction in the critical path in the candidate, from wound family friend it is easy or previous The end transaction of critical path is all identified to the All Activity between second transaction.
Specifically, all common recognition nodes do not carry out common recognition ballot to the transaction of not confirmed, but in candidate critical path It is checked on diameter from whether wound family friend is easily identified to the previous transaction of the transaction of not confirmed, circulate operation, until in candidate Critical path on find a transaction (i.e. second transaction), from wound family friend easily to all the transaction (the i.e. second transaction) Transaction is all identified.
S4.4: choose that the wound family friend is easy or the path of end transaction to second transaction of previous critical path is this Secondary critical path.
Specifically, from wound family friend is easy or the end transaction of previous critical path to the second transaction All Activity at this In critical path, and creates family friend and be easily all identified to the All Activity between the second transaction.
Fig. 3 is the structural schematic diagram of the transaction system shown according to an exemplary embodiment based on directed acyclic graph, ginseng According to shown in Fig. 3, which includes:
Setup module, user are that each node participated in business sequentially is numbered, and common recognition node is set up in each node, and Set time interval, the common recognition number of transaction of common recognition;
Number module is that respectively transaction number, the transaction number are applied in transaction for each node participated in business Sequentially increase and globally unique;
First chooses module, for will create according to selected first transaction of the time interval or the common recognition number of transaction Family friend is easy or critical path of the end transaction of previous critical path to the path of first transaction as candidate;
Second chooses module, confirms for the common recognition node to the critical path of the candidate, if the wound generation The transaction of the end of transaction or previous critical path is identified to the All Activity between the second transaction, then chooses the wound family friend The path of the end transaction of easy or previous critical path to second transaction is this critical path;
Broadcast module, for determining that growing direction and broadcast that this described critical path is main chain are participated in business to described Each node write-in consistency account book.
As a kind of preferably embodiment, in the embodiment of the present invention, the number module includes:
Quantity application unit presses the friendship of the respective number size client of pre- first to file oneself in turn for each node Easy quantity;
Whether judging unit, the remaining quantity of number of transaction for predicate node application are lower than preset threshold;
Filter element, each node is compared transaction content when submitting for trading, within the set time will be interior Hold identical transaction to filter out, does not distribute transaction number;
Numbered cell is set as 0 for will create the easy number of family friend, and the number of other transaction sequentially increases.
As a kind of preferably embodiment, in the embodiment of the present invention, the first selection module includes:
Trade selection unit, for after the time interval or the common recognition number of transaction reach, it is selected number be n or The transaction of common recognition number of transaction is the first transaction, and wherein n is the quantity traded in system;
Path candidate selection unit carries out common recognition ballot to first transaction for the common recognition node, if ballot is logical Cross, then will create that family friend is easy or the end transaction of previous critical path to the path of first transaction as the critical path of candidate Diameter.
As a kind of preferably embodiment, in the embodiment of the present invention, second transaction is the critical path of the candidate Any one transaction on diameter.
As a kind of preferably embodiment, in the embodiment of the present invention, the second selection module includes:
Confirmation unit confirms the critical path of the candidate for the common recognition node;
Common recognition unit, carries out common recognition ballot to the transaction of all not confirmeds for the common recognition node, if voting through Then being identified through the transaction of the not confirmed, if ballot does not pass through, to the previous of the transaction of the not confirmed Transaction carries out common recognition ballot, and circulate operation in critical path until finding the second transaction, from wound family friend is easy or previous critical path The end transaction of diameter is all identified to the All Activity between second transaction;
Query unit is checked in the critical path of the candidate from wound family friend for the common recognition node easily to not true The previous transaction for the transaction recognized, circulate operation is until finding the second transaction in the critical path in the candidate, from wound family friend The end transaction of easy or previous critical path is all identified to the All Activity between second transaction;
Critical path selection unit, for choosing that the wound family friend is easy or the end transaction of previous critical path is to described the The path of two transaction is this critical path.
In conclusion technical solution provided in an embodiment of the present invention has the benefit that
Method of commerce and system provided in an embodiment of the present invention based on directed acyclic graph carries out preliminery application to transaction and presses Sequence distribution number, avoids transaction conflict, and devise the main chain generation method of directed acyclic graph, transaction has been determined by main chain The consistency of account book among the nodes and successive succession of trading.
It should be understood that provided by the above embodiment triggering transaction business based on the transaction system of directed acyclic graph When, only the example of the division of the above functional modules, in practical application, it can according to need and divide above-mentioned function With being completed by different functional modules, i.e., the internal structure of system is divided into different functional modules, to complete above description All or part of function.In addition, the transaction system provided by the above embodiment based on directed acyclic graph be based on oriented nothing The method of commerce embodiment of ring figure belongs to same design, i.e. this method is based on the system, the specific implementation process side of being detailed in Method embodiment, which is not described herein again.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of method of commerce based on directed acyclic graph, which is characterized in that described method includes following steps:
S1: each node to participate in business sequentially is numbered, and sets up common recognition node in each node, and set the time of common recognition Interval, common recognition number of transaction;
S2: each node participated in business is that transaction number is applied in respectively transaction, and the transaction number sequentially increases and the overall situation Uniquely;
S3: according to selected first transaction of the time interval or the common recognition number of transaction, it will create that family friend is easy or previous critical path The end transaction of diameter is to the path of first transaction as candidate critical path;
S4: the common recognition node confirms the critical path of the candidate, if the wound family friend is easy or previous critical path End transaction be identified to the All Activity between the second transaction, then choose that the wound family friend is easy or previous critical path The path of end transaction to second transaction is this critical path;
S5: it determines the growing direction that this described critical path is main chain and broadcasts to each node write-in one participated in business The account book of cause property;
S6: time interval or common recognition number of transaction based on the common recognition repeat step S2 to S5.
2. the method for commerce according to claim 1 based on directed acyclic graph, which is characterized in that the step S2 includes:
Each node presses the number of transaction of the respective number size client of pre- first to file oneself in turn;
When the remaining quantity of the number of transaction of node application is lower than preset threshold, then next round application is initiated;
Each node is compared transaction content when transaction submission, within the set time filters the identical transaction of content Fall, does not distribute transaction number;The easy number of family friend will be created and be set as 0, the number of other transaction sequentially increases.
3. the method for commerce according to claim 1 or 2 based on directed acyclic graph, which is characterized in that the step S3 tool Body includes:
S3.1: after the time interval or the common recognition number of transaction reach, selected number is n or the friendship for number of transaction of knowing together It is easily the first transaction, wherein n is the quantity traded in system;
S3.2: the common recognition node carries out common recognition ballot to first transaction, if voting through, it is easy or previous will to create family friend The end transaction of critical path is to the path of first transaction as candidate critical path.
4. the method for commerce according to claim 1 or 2 based on directed acyclic graph, which is characterized in that second transaction For any one transaction in the critical path of the candidate.
5. the method for commerce according to claim 1 or 2 based on directed acyclic graph, which is characterized in that the step S4 tool Body includes:
S4.1: the common recognition node confirms the critical path of the candidate, if in the critical path of the candidate Transaction is not identified, thens follow the steps S4.2 or step S4.3;
S4.2: the common recognition node carries out common recognition ballot to the transaction of all not confirmeds, if voting through it is described not by The transaction of confirmation is identified through, if ballot does not pass through, is known together to the previous transaction of the transaction of the not confirmed Ballot, circulate operation in critical path until finding the second transaction, from wound family friend is easy or the end of previous critical path is traded It is all identified to the All Activity between second transaction;
S4.3: before the common recognition node checks the transaction from wound family friend easily to not confirmed in the critical path of the candidate One transaction, circulate operation is until finding the second transaction in the critical path in candidate, and from creating, family friend is easy or previous key The end transaction in path is all identified to the All Activity between second transaction;
S4.4: choose that the wound family friend is easy or the path of end transaction to second transaction of previous critical path is that this is closed Key path.
6. a kind of transaction system based on directed acyclic graph, which is characterized in that the system comprises:
Setup module, user are that each node participated in business sequentially is numbered, and set up common recognition node in each node, and set The time interval of common recognition, common recognition number of transaction;
Number module is that respectively transaction number is applied in transaction for each node participated in business, and the transaction number is sequentially Increase and globally unique;
First chooses module, for will create family friend according to selected first transaction of the time interval or the common recognition number of transaction The end transaction of easy or previous critical path is to the path of first transaction as candidate critical path;
Second chooses module, confirms for the common recognition node to the critical path of the candidate, if the wound family friend is easy Or the end transaction of previous critical path is identified to the All Activity between the second transaction, then choose the wound family friend it is easy or The path of the end transaction of previous critical path to second transaction is this critical path;
Broadcast module, for determine growing direction that this described critical path is main chain and broadcast to it is described participate in business it is each The account book of node write-in consistency.
7. the transaction system according to claim 6 based on directed acyclic graph, which is characterized in that the number module packet It includes:
Quantity application unit presses the number of deals of the respective number size client of pre- first to file oneself in turn for each node Amount;
Whether judging unit, the remaining quantity of number of transaction for predicate node application are lower than preset threshold;
Filter element, each node is compared transaction content when submitting for trading, within the set time by content phase Same transaction filters out, and does not distribute transaction number;
Numbered cell is set as 0 for will create the easy number of family friend, and the number of other transaction sequentially increases.
8. the transaction system according to claim 6 or 7 based on directed acyclic graph, which is characterized in that described first chooses Module includes:
Transaction selection unit, for after the time interval or the common recognition number of transaction reach, selected number to be n or common recognition The transaction of number of transaction is the first transaction, and wherein n is the quantity traded in system;
Path candidate selection unit carries out common recognition ballot to first transaction for the common recognition node, if voting through, To create that family friend is easy or the end transaction of previous critical path to the path of first transaction as the critical path of candidate.
9. the transaction system according to claim 6 or 7 based on directed acyclic graph, which is characterized in that second transaction For any one transaction in the critical path of the candidate.
10. the transaction system according to claim 6 or 7 based on directed acyclic graph, which is characterized in that described second chooses Module includes:
Confirmation unit confirms the critical path of the candidate for the common recognition node;
Know together unit, common recognition ballot is carried out to the transaction of all not confirmeds for the common recognition node, if voting through The transaction of the not confirmed is identified through, if ballot does not pass through, the previous transaction to the transaction of the not confirmed Common recognition ballot is carried out, circulate operation in critical path until finding the second transaction, from wound family friend is easy or previous critical path End transaction is all identified to the All Activity between second transaction;
Query unit is checked in the critical path of the candidate from wound family friend for the common recognition node easily to not confirmed The previous transaction of transaction, circulate operation until finding the second transaction in the critical path in candidate, from wound family friend it is easy or The end transaction of previous critical path is all identified to the All Activity between second transaction;
Critical path selection unit, for choosing, the wound family friend is easy or the end transaction of previous critical path is handed over to described second Easy path is this critical path.
CN201910124802.6A 2019-02-19 2019-02-19 Transaction method and system based on directed acyclic graph Active CN109961364B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910124802.6A CN109961364B (en) 2019-02-19 2019-02-19 Transaction method and system based on directed acyclic graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910124802.6A CN109961364B (en) 2019-02-19 2019-02-19 Transaction method and system based on directed acyclic graph

Publications (2)

Publication Number Publication Date
CN109961364A true CN109961364A (en) 2019-07-02
CN109961364B CN109961364B (en) 2021-04-06

Family

ID=67023562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910124802.6A Active CN109961364B (en) 2019-02-19 2019-02-19 Transaction method and system based on directed acyclic graph

Country Status (1)

Country Link
CN (1) CN109961364B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110517144A (en) * 2019-08-29 2019-11-29 南京烽火天地通信科技有限公司 A kind of fund loop optimization method based on BSP model
CN112887253A (en) * 2021-01-29 2021-06-01 哈尔滨工业大学 Event cause and effect time sequence consistency control method in combined test system
CN113516557A (en) * 2021-07-14 2021-10-19 桂林电子科技大学 Block chain with directed acyclic graph structure and implementation method thereof
CN114144994A (en) * 2019-08-01 2022-03-04 Bloom技术株式会社 Directed acyclic graph-account intelligent transaction chain general ledger system of Byzantine fault-tolerant deterministic consensus mode
CN115662158A (en) * 2022-10-31 2023-01-31 东南大学 Traffic overflow-oriented critical path signal control optimization method
RU2809645C2 (en) * 2019-08-01 2023-12-14 Блум Текнолоджи, Инк. Dag-awtc register system using consensus bft verification mechanism

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170316391A1 (en) * 2016-04-29 2017-11-02 Digital Asset Holdings Digital asset modeling
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
CN108984789A (en) * 2018-08-15 2018-12-11 赵东洋 Method, apparatus, storage medium and the electronic equipment of distribution book keeping operation
CN109102296A (en) * 2018-08-31 2018-12-28 北京八分量信息科技有限公司 A kind of node common recognition method and system
CN109214795A (en) * 2018-09-18 2019-01-15 北京物链互联科技有限公司 A kind of block chain mixing common recognition method based on DAG algorithm

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170316391A1 (en) * 2016-04-29 2017-11-02 Digital Asset Holdings Digital asset modeling
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
CN108984789A (en) * 2018-08-15 2018-12-11 赵东洋 Method, apparatus, storage medium and the electronic equipment of distribution book keeping operation
CN109102296A (en) * 2018-08-31 2018-12-28 北京八分量信息科技有限公司 A kind of node common recognition method and system
CN109214795A (en) * 2018-09-18 2019-01-15 北京物链互联科技有限公司 A kind of block chain mixing common recognition method based on DAG algorithm

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114144994A (en) * 2019-08-01 2022-03-04 Bloom技术株式会社 Directed acyclic graph-account intelligent transaction chain general ledger system of Byzantine fault-tolerant deterministic consensus mode
RU2809645C2 (en) * 2019-08-01 2023-12-14 Блум Текнолоджи, Инк. Dag-awtc register system using consensus bft verification mechanism
CN110517144A (en) * 2019-08-29 2019-11-29 南京烽火天地通信科技有限公司 A kind of fund loop optimization method based on BSP model
CN112887253A (en) * 2021-01-29 2021-06-01 哈尔滨工业大学 Event cause and effect time sequence consistency control method in combined test system
CN112887253B (en) * 2021-01-29 2022-07-01 哈尔滨工业大学 Event cause and effect time sequence consistency control method in combined test system
CN113516557A (en) * 2021-07-14 2021-10-19 桂林电子科技大学 Block chain with directed acyclic graph structure and implementation method thereof
CN113516557B (en) * 2021-07-14 2022-09-23 桂林电子科技大学 Block chain with directed acyclic graph structure and implementation method thereof
CN115662158A (en) * 2022-10-31 2023-01-31 东南大学 Traffic overflow-oriented critical path signal control optimization method
CN115662158B (en) * 2022-10-31 2023-08-29 东南大学 Traffic overflow-oriented critical path signal control optimization method

Also Published As

Publication number Publication date
CN109961364B (en) 2021-04-06

Similar Documents

Publication Publication Date Title
CN109961364A (en) A kind of method of commerce and system based on directed acyclic graph
CN110730204B (en) Method for deleting nodes in block chain network and block chain system
CN110727731B (en) Method for adding node in block chain network and block chain system
WO2021032138A1 (en) Consensus method and device based on blockchain system, and system
CN107733855B (en) A kind of block catenary system and application method that can support publicly-owned chain, alliance's chain and privately owned chain simultaneously
CN108062672B (en) Flow scheduling method based on block chain intelligent contract
CN107301536B (en) Resource transfers method and device
US7627611B2 (en) Conflict resolution in database replication through autonomous node qualified folding
CN101662461B (en) Method, device and system for recombining multilink protocol fragment data
CN106407430A (en) Complex and intelligent contract state synchronization method based on phase buckets
CN105701159B (en) A kind of data synchronization unit and method
CN109391645A (en) Block chain light-weight technologg method, block chain node and storage medium
CN107330786A (en) A kind of block chain network node communication method based on weight
CN110704438B (en) Method and device for generating bloom filter in blockchain
CN110287205A (en) A kind of across the fragment transaction data processing method of block chain and device
CN111241589A (en) Database system, node and method
CN110070445A (en) A kind of transaction processing method and device based on block catenary system
CN110557416B (en) Multi-node collaborative blocking method and system
CN111241590A (en) Database system, node and method
CN109658249A (en) A kind of block chain performance optimization method
CN103294799B (en) A kind of data parallel batch imports the method and system of read-only inquiry system
CN110232053A (en) Log processing method, relevant device and system
CN113037863B (en) Block chain multi-party collaborative cross consensus verification method and system
CN111813580B (en) Matrix representation-based distributed model training optimization method
CN109391643A (en) Block chain light-weight technologg method, block chain node and storage medium

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: 518052 Room 201, building A, 1 front Bay Road, Shenzhen Qianhai cooperation zone, Shenzhen, Guangdong

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

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

Address before: 518052 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

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

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240229

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: 518052 Room 201, building A, 1 front Bay Road, Shenzhen Qianhai cooperation zone, Shenzhen, Guangdong

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

Country or region before: China

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

Country or region before: China

TR01 Transfer of patent right