CN110517141A - A kind of common recognition method and device based on block catenary system - Google Patents
A kind of common recognition method and device based on block catenary system Download PDFInfo
- Publication number
- CN110517141A CN110517141A CN201910798196.6A CN201910798196A CN110517141A CN 110517141 A CN110517141 A CN 110517141A CN 201910798196 A CN201910798196 A CN 201910798196A CN 110517141 A CN110517141 A CN 110517141A
- Authority
- CN
- China
- Prior art keywords
- block
- node
- common recognition
- transaction data
- consensus information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Marketing (AREA)
- Signal Processing (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention discloses a kind of common recognition method and devices based on block catenary system, wherein method includes: in I wheel block common recognition, first node receives the consensus information for the M block to be known together that second node is sent, if it is determined that the first node is the host node that I+1 takes turns block common recognition, then when being known together according to the consensus information of the M block to the M block, the consensus information of parallel generation M+1 block to be known together.In the embodiment of the present invention, the host node for taking turns block common recognition by starting I+1 in the implementation procedure that I wheel block is known together, I+1 is set to take turns the host node automatic packaging M+1 block that block was known together, realize the parallel execution that the block packing process of block common recognition is taken turns to the common recognition process and I+1 of I wheel block common recognition, reduce the operating time that I+1 takes turns block common recognition, so as to improve the common recognition efficiency of block catenary system.
Description
Technical field
The present invention relates to financial technology (Fintech) technical field more particularly to a kind of common recognitions based on block catenary system
Method and device.
Background technique
With the development of computer technology, more and more technical applications are in financial field, and traditional financial industry is gradually
Changing to financial technology (Fintech), block chain technology is no exception, but due to the safety of financial industry, requirement of real-time,
Also to technology, more stringent requirements are proposed.In block catenary system, in order to guarantee the accuracy of transaction execution, it usually needs use
Multiple nodes know together to block, if the number of nodes reached common understanding to block is more than preset quantity, illustrate block linkwork
The obtained block of most of node processing transaction is consistent in system;In this way, the block can successfully go out block, and node
Transaction data base inside being updated according to the block.
PBFT common recognition algorithm is a kind of existing more common common recognition algorithm, in PBFT common recognition algorithm, when block linkwork
Unite it is every executed a wheel block common recognition (i.e. last round of block know together successfully go out block) after, PBFT common recognition algorithm can be from block linkwork
A host node is selected in multiple nodes of system, host node is used to obtain transaction data to be processed in epicycle block common recognition,
And the other sections being sent in block catenary system after original block are packaged according to transaction data to be processed in epicycle block common recognition
Point.Correspondingly, in epicycle block common recognition, each node (including host node) in block catenary system can be beaten based on host node
The original block processing transaction of packet obtains target block, and then knows together target block with other nodes in block catenary system, if
Target block is known together successfully, then successfully goes out block, completes epicycle block common recognition, in this way, PBFT common recognition algorithm can be again from multiple
The host node that next round block common recognition is chosen in node executes next round block common recognition process.It follows that being known together using PBFT
Algorithm, every wheel block common recognition are individually performed, i.e., next round block common recognition needs that epicycle block common recognition is waited to execute completion
After can start to execute, it is lower so as to cause the common recognition efficiency of block catenary system.
To sum up, need a kind of common recognition method based on block catenary system at present, to solve existing block catenary system according to
The lower technical problem of the secondary common recognition efficiency for executing block catenary system caused by every wheel block common recognition.
Summary of the invention
The embodiment of the present invention provides a kind of common recognition method based on block catenary system, to solve existing block catenary system
Successively execute the lower technical problem of the common recognition efficiency of block catenary system caused by every wheel block common recognition.
In a first aspect, a kind of common recognition method based on block catenary system provided in an embodiment of the present invention, comprising:
In I wheel block common recognition, first node receives the common recognition letter for the M block to be known together that second node is sent
Breath, the consensus information of the M block include the first transaction data to be processed in I wheel block common recognition, and described second
Node is the host node of I wheel block common recognition;Further, the first node if it is determined that the first node be I+
The host node of 1 wheel block common recognition, then when being known together according to the consensus information of the M block to the M block, parallel
Generate the consensus information of M+1 block to be known together;The consensus information of the M+1 block includes that the wheel of I+1 block is total
Second transaction data to be processed in knowledge;Second transaction data is different from first transaction data;Wherein, I, M are positive
Integer.
In above-mentioned design, the main section that block is known together is taken turns by starting I+1 in the implementation procedure that I wheel block is known together
Point makes I+1 take turns the host node automatic packaging block that block was known together, so as to be performed in parallel I wheel block common recognition
Common recognition process and I+1 take turns the block packing process of block common recognition, reduce the operating time that I+1 takes turns block common recognition, improve area
The common recognition efficiency of block catenary system.
In a kind of possible design, the consensus information of first node parallel generation M+1 block to be known together, packet
Include: the first node obtains the second number of deals in addition to first transaction data from the trading pit of the first node
According to, it is high according to the block of M+1 block described in the block high setting of the M block, and according to second transaction data, described the
The block height and current time stamp of M+1 block, generate the consensus information of the M+1 block.
In above-mentioned design, by removing the first transaction data to be processed in I wheel block common recognition from acquisition in trading pit
It is total can to take turns block to avoid I+1 using the second transaction data as the block body of M+1 block for the second transaction data in addition
Know transaction data handled by reprocessing I wheel block common recognition, guarantees executing I wheel block common recognition and the wheel of I+1 parallel
The accuracy of trading processing when block is known together;And when parallel execution I wheel block common recognition and the wheel block common recognition of I+1, although the
The history maximum block of two nodes is M-1 block, but by according to M block to be known together in I wheel block common recognition
The block that block high setting I+1 takes turns M+1 block to be known together in block common recognition is high, can make second node accurately generate I+
The corresponding block head of 1 wheel block common recognition process, so that executing parallel, I wheel block is known together and I+1 takes turns block common recognition.
In a kind of possible design, the consensus information of first node parallel generation M+1 block to be known together it
Afterwards, however, it is determined that the common recognition result of the I wheel block common recognition is to know together successfully, then the cryptographic Hash addition of the M block exists
In the consensus information of the M+1 block, and the consensus information of the M+1 block is sent in the block catenary system
Other nodes.
In above-mentioned design, after I wheel block is known together successfully, pass through the area M to be known together during I wheel block is known together
The cryptographic Hash addition of block is taken turns in I+1 in M+1 block to be known together in block common recognition, can be taken turns in block common recognition in I+1
Complete M+1 block is assembled, to accurately establish the incidence relation of M block and M+1 block, guarantees block common recognition process
Sequence carry out and block chain integrality.
In a kind of possible design, the consensus information of first node parallel generation M+1 block to be known together it
Afterwards, however, it is determined that the common recognition result of the I wheel block common recognition is common recognition failure, then obtains from the trading pit of the first node
First transaction data, and the block of the M block according to the block high setting of history maximum block is high;Further, described
First node is according to the cryptographic Hash of high, the described history maximum block of block of first transaction data, the M block and current
Timestamp, generates the consensus information of the M block, and the consensus information of the M block is sent to the block linkwork
Other nodes in system.
In above-mentioned design, after the common recognition failure of I wheel block, to be known together the is re-assemblied by using first node
M block and to M onblock executing know together process, can to avoid parallel processing two-wheeled block know together process when due to last round of area
The problem of block to be known together in last round of block common recognition is omitted caused by block common recognition failure, guarantees the accurate of block catenary system common recognition
Property.
In a kind of possible design, the first node be determined as follows the first node be the I+
The host node of 1 wheel block common recognition: the first node is according to the block height of the M block and the number of nodes of the block catenary system
Amount determines that the I+1 takes turns the number of the host node of block common recognition, if the mark of the first node and the I+1 take turns block
The number of the host node of common recognition matches, it is determined that the first node is the host node that the I+1 takes turns block common recognition.
In above-mentioned design, any node being directed in block catenary system, by using the mark of the node automatic
The number that the host node of block common recognition is taken turns with I+1 determines whether the node is host node that I+1 takes turns block common recognition, can be with
M+1 block to be known together in the node automatic packaging I+1 wheel block common recognition is called in the success of a certain node matching, thus
It can guarantee that I+1 takes turns the automatic paralleling execution of block common recognition with I wheel block common recognition, improve the accurate of block catenary system common recognition
Property.
Second aspect, the embodiment of the present invention provide a kind of common recognition device based on block catenary system, and described device includes:
Transceiver module, for receiving being total to for the M block to be known together that second node is sent in I wheel block common recognition
Know information, the consensus information of the M block includes the first transaction data to be processed in the I wheel block common recognition, described
Second node is the host node of I wheel block common recognition;Wherein, I, M are positive integer;
Generation module, for if it is determined that first node is the host node that I+1 takes turns block common recognition, then according to the M
When the consensus information of block knows together to the M block, the consensus information of parallel generation M+1 block to be known together;Institute
The consensus information for stating M+1 block includes that the I+1 takes turns the second transaction data to be processed in block common recognition;Described second hands over
Easy data are different from first transaction data.
In a kind of possible design, the generation module is specifically used for: obtaining from the trading pit of the first node
The second transaction data in addition to first transaction data, according to M+1 block described in the block high setting of the M block
Block is high, and according to second transaction data, the block height of the M+1 block and current time stamp, generates the M+1 block
Consensus information.
In a kind of possible design, in the consensus information of generation module parallel generation M+1 block to be known together
Later, the transceiver module is also used to: if it is determined that the common recognition result of I wheel block common recognition is to know together successfully, then it will be described
The cryptographic Hash of M block is added in the consensus information of the M+1 block, and the consensus information of the M+1 block is sent out
Give other nodes in the block catenary system.
In a kind of possible design, the generation module is also used to: if it is determined that the common recognition knot of I wheel block common recognition
Fruit is common recognition failure, then first transaction data is obtained from the trading pit of the first node, and according to history maximum area
The block of M block described in the block high setting of block is high;Further, according to first transaction data, the block of the M block
The cryptographic Hash and current time stamp of high, the described history maximum block, generate the consensus information of the M block, and by the M
The consensus information of block is sent to other nodes in the block catenary system.
In a kind of possible design, the generation module is specifically used for: according to the block height of the M block and the area
The number of nodes of block catenary system determines that the I+1 takes turns the number of the host node of block common recognition, if the mark of the first node
It is matched with the number of the host node of the I+1 wheel block common recognition, it is determined that the first node is that the I+1 wheel block is total
The host node of knowledge.
The third aspect, the embodiment of the invention also provides a kind of calculating equipment, including at least one processing unit and extremely
A few storage unit, wherein the storage unit is stored with computer program, when described program is executed by the processing unit
When, so that the processing unit executes any common recognition method based on block catenary system of above-mentioned first aspect.
Fourth aspect, the embodiment of the invention also provides a kind of computer readable storage medium, being stored with can be by calculating
The computer program that equipment executes, when described program is run on said computing device, so that the calculating equipment executes
State any common recognition method based on block catenary system of first aspect.
The aspects of the invention or other aspects can more straightforwards in the following description.
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 introduced, it should be apparent that, drawings in the following description are only some embodiments of the invention, for this
For the those of ordinary skill in field, without any creative labor, it can also be obtained according to these attached drawings
His attached drawing.
Fig. 1 is a kind of configuration diagram of block catenary system provided in an embodiment of the present invention;
Fig. 2 corresponding process signal when being a kind of common recognition algorithm process transaction using PBFT provided in an embodiment of the present invention
Figure;
Fig. 3 is a kind of corresponding flow diagram of common recognition method based on block catenary system provided in an embodiment of the present invention;
Fig. 4 is a kind of flow diagram for executing block common recognition provided in an embodiment of the present invention;
Fig. 5 is a kind of structural schematic diagram of common recognition device based on block catenary system provided in an embodiment of the present invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention make into
It is described in detail to one step, it is clear that described embodiments are only a part of the embodiments of the present invention, rather than whole implementation
Example.Based on the embodiments of the present invention, obtained by those of ordinary skill in the art without making creative efforts
All other embodiment, shall fall within the protection scope of the present invention.
Financial technology (Fintech) technical field generally involves multi-exchange, for example, the transaction of bank may include selling
Block transaction, deposit transaction, loan transaction, insurance transaction, financing transaction etc., the daily trading volume of bank can achieve thousands of pens very
To tens of thousands of pens.With the gradually development of block chain technology, financial technology field block chain technology also can be used handle transaction,
For example, if being related to relationship trading between more banks, can by setting alliance's chain come synchronization process relationship trading,
Or it can also be by law court, client etc. while cochain, the safety and stabilization of common Maintenance Association chain.
Block catenary system can be point-to-point (Peer To Peer, the P2P) network being made of multiple nodes.P2P is one
Kind operates in the application layer protocol on transmission control protocol (Transmission Control Protocol, TCP) agreement,
Node in block catenary system can be reciprocity each other, central node is not present in system, therefore each node can be random
Ground connects other nodes.In block catenary system, each intra-node can be provided with presetting database, and each node passes through
Presetting database safeguards the public account book in block catenary system jointly, and the presetting database of intra-node can store block linkwork
Block data in system;Wherein, block data includes block head and block body, and block head includes the cryptographic Hash of a upper block, sheet
Information, the block bodies such as the cryptographic Hash of block, the block height of this block, timestamp include in transaction data, such as block catenary system
Node handles transaction transaction data generated to be processed during knowing together to the block.
Fig. 1 is a kind of configuration diagram of block catenary system provided in an embodiment of the present invention, as shown in Figure 1, block linkwork
It may include one or more nodes, such as node 101, node 102, node 103 and node 104,101~node of node in system
Any two node in 104 can communicate to connect, to safeguard block catenary system jointly.Wherein, any two node can be with
It is connected, or can also be connected wirelessly by wired mode, is specifically not construed as limiting.
In the embodiment of the present invention, the node in block catenary system can have multiple functions, for example, routing function, transaction
Function, block chain function and common recognition function etc..Specifically, the node in block catenary system can send other nodes
The information such as transaction data send more nodes to realize the communication between node;Alternatively, the node in block catenary system
Can be used for that user is supported to trade;Alternatively, the node in block catenary system can be used for the All Activity on log history;
Alternatively, the node in block catenary system can be by verifying and recording the new block in transaction generation block chain.In practical application,
Routing function is the function that each node in block catenary system must have, and other functions can be by those skilled in the art's root
It is configured according to actual needs.
It should be noted that a node in block catenary system can be on a physical machine (server), and one
Node can specifically refer to a series of process or processes run in server.For example, the node in block chain network
101 can be the process run on a server, or may be to refer to server, specifically be not construed as limiting.
As shown in Figure 1, can also include client device 200 in the system architecture, client device 200 can be by connecing
Enter block chain network to connect with any node in block catenary system.In specific implementation, client device 200 can be sent out transaction
Any node in block catenary system is given, a certain node in block catenary system, can be same by transaction after receiving transaction
It walks to other nodes in block catenary system.Transaction can also be stored in the friendship of intra-node after isochronous transaction by the node
Yi Chizhong;Correspondingly, transaction can also be stored in other nodes by other nodes after receiving the synchronous transaction of the node
In the trading pit in portion.In this way, if a certain node, which determines, handles a plurality of transaction a plurality of friendship can be obtained from internal trading pit
Easily, and then subsequent trading processing and block common recognition are carried out.
Wherein, transaction can be stored in trading pit in the form of stack;In this way, if a certain node, which determines, handles a plurality of friendship
Easily, then a plurality of transaction that earliest stacking can be obtained from internal trading pit carries out subsequent processing and common recognition process.
Based on system architecture illustrated in Figure 1, Fig. 2 is at a kind of use PBFT common recognition algorithm provided in an embodiment of the present invention
Corresponding flow diagram when reason transaction, as shown in Fig. 2, the process of PBFT common recognition algorithm process transaction can be divided into three ranks
Section: pre-prepare stage, prepare stage and commit stage.The specific implementation of three phases is described separately below
Journey.
The pre-prepare stage
Knowing together algorithm using PBFT can be from the more of block catenary system after each successful execution one wheel block common recognition
A node is chosen in a node as host node, using other nodes as from node;Wherein, successful execution one takes turns block common recognition
It can determine, if having newly increased a history block in the memory than detecting node, then can recognize in several ways
Take turns block common recognition for successful execution one, if detect the internal presetting database of node updates, it may be considered that at
Function performs wheel block common recognition, etc..
PBFT common recognition algorithm can choose different nodes as host node in turn from multiple nodes of block catenary system;
Specifically, a form numerical value v can be set in each intra-node, if last round of block common recognition runs succeeded, each
The form numerical value v of intra-node can be zeroed out, if last round of block common recognition executes failure, the form number of each intra-node
Value v is incremented by (i.e. plus 1).Correspondingly, if each node, which detects, has newly increased a history block in the memory of the node, or
It detects the internal presetting database of the node updates, then can determine the main section of next round block common recognition according to following formula
The number of point:
Leader=(h+v) %n
Wherein, leader is the number of the host node of next round block common recognition, and h is that the block of block to be known together is high, and v is view
Window numerical value, n are the number of nodes in block catenary system.
In one example, the number of respectively determining host node can be sent in block catenary system by each node
Other nodes can be by the number pair if the number of nodes passed through to the number common recognition of a certain host node is greater than preset quantity
The host node that the node answered is known together as next round block.In another example, after each node determines the number of host node,
If the node identification of oneself is matched with the number of host node, which is used as the host node of next round block common recognition automatically;If
The number of oneself node identification and host node mismatches, then can be used as from node, and with no treatment, wait it is pending under
One wheel block common recognition.
For example, table 1 is a kind of corresponding relationship of the number of node identification and host node provided in an embodiment of the present invention
Schematic table.
A kind of table 1: the signal of the corresponding relationship of the number of node identification and host node
The number of host node | Node identification |
0 | Node 101 |
1 | Node 102 |
2 | Node 103 |
3 | Node 104 |
As shown in table 1, if the number for the host node that node is determined is 0, node 101 can be regard as next round block
The host node of common recognition, the slave node that node 102, node 103 and node 104 are known together as next round block;If node determines
The number of host node out is 1, then the host node that node 102 can be known together as next round block, by node 101, node
103 and the slave node known together as next round block of node 104;If the number for the host node that node is determined is 2, by node
103 host node as next round block common recognition knows together node 101, node 102 and node 104 as next round block
From node;If the number for the host node that node is determined is 3, the host node that node 104 is known together as next round block will
The slave node that node 101, node 102 and node 103 are known together as next round block.
For example, if the host node of last round of block common recognition is node 102, and stored in the memory of node 101 one it is new
History block 1, then form numerical value v is zeroed out, and the number of nodes in block catenary system is 4, therefore, (or the node of node 101
102~node 104) number of host node determined using above-mentioned formula is 2;Based on table 1 it is found that next round block was known together
Host node can be node 103, and the common recognition of block 2 is executed using host node 103.Correspondingly, if node 102 is not rung for a long time
It answers, then maximum history block is still 0 in the memory of node, is known together and is failed due to last round of block, and form numerical value v is incremented by
Be 1, in this way, the number for the host node that node 101 (or 102~node of node 104) is determined using above-mentioned formula is 2, i.e., under
The host node of one wheel block common recognition can be node 103, and the common recognition of block 1 is executed using host node 103;Further, if section
Point 103 does not respond for a long time, then maximum history block is still 0 in the memory of node 103, is known together and is lost due to last round of block
It loses, therefore form numerical value v is incremented by 2, in this way, what node 101 (or 102~node of node 104) was determined using above-mentioned formula
The number of host node is 3, i.e., the host node of next round block common recognition can be node 104, executes block 1 using host node 104
Common recognition.
In the pre-prepare stage, if a certain take turns the host node that block is known together as node 101, and the memory of node 101
The maximum block of middle storage is block 1, then host node 101 can obtain wheel block common recognition from the trading pit of host node 101
Transaction data to be processed, and block 2 is packaged according to the transaction data that the wheel block is known together to be processed, generate pre-prepare
Packet.Specifically, the cryptographic Hash of block 1, the block height of block 2 and current timestamp assembling area can be used in host node 101
The block head of block 2, and the block body for the transaction data assembling block 2 that the wheel block knows together to be processed can be used, and then can be with
Pre-prepare packet is generated according to the block head of block 2 and block body.Further, host node 101 can be by pre-
Prepare packet is sent to any node in block catenary system, i.e. node 102, node 103 and node 104.
So far, the pre-prepare stage executes and terminates.
The prepare stage
In the prepare stage, any node in block catenary system receives the pre- of the transmission of host node 101
After prepare packet, it can parse pre-prepare packet and obtain the wheel block and know together transaction data to be processed;In this way, the section
Point can execute wheel block transaction data to be processed of knowing together and obtain transaction results.Further, which can be according to friendship
Easy result generates the first cryptographic Hash, generates the second cryptographic Hash according to the receipt information of each transaction, is disappeared according to the request of transaction
Breath generates third cryptographic Hash, and then the first cryptographic Hash, the second cryptographic Hash and third cryptographic Hash are assembled into the block head of block 2
In, and the cryptographic Hash of block 2 can be generated according to the data in the block head of block 2.In this way, the node can be by block 2
Cryptographic Hash and the wheel block common recognition processing transaction data be assembled into the block body of block 2, and using the node private key,
The information such as cryptographic Hash, the mark of block height, node of block 2 generate the node to the signature packets of block 2, and then can be by the node
Signature packets be sent to other nodes in block catenary system.
So far, the prepare stage executes and terminates.
The commit stage
It can store in block catenary system and owned in the commit stage, inside any node in block catenary system
The public key of node, in this way, any node is after determining that signature packets that other nodes are sent reach the node, it can be first from the node
Inside obtains the public key of other nodes, and is decrypted using signature packets of the public key of other nodes to other nodes, obtains it
The cryptographic Hash of its determining block 2 of each node processing transaction.Further, oneself can be handled transaction and determined by any node
The cryptographic Hash of block 2 and the cryptographic Hash of the determining block 2 of any other node processings transaction compare, if they are the same, then may be used
To receive the signature packets that other nodes are sent, if it is different, can then refuse the signature packets that other nodes are sent.
Any node being directed in block catenary system, if the quantity for the signature packets that the node receives in time-out time
Less than preset threshold, then the node thinks the common recognition failure of epicycle block, which can initiate view switching, that is, be incremented by inside
(if comparing former form numerical value is 1, then 2) the form numerical value after being incremented by is to form numerical value v.Correspondingly, if the node is in time-out
In the quantity of signature packets that receives be greater than or equal to preset threshold, then illustrate the node processing hand over facile block 2 with
Other major part node processings hand over facile block 2 identical in block catenary system, and the block 2 which generates is in be committed
State;It is generated in this way, the information such as the mark of the private key of the node, the cryptographic Hash of block 2, block height, node can be used in the node
The node is to the commit packet of block 2, and the other nodes that commit packet can be sent in block catenary system, commit packet
It is used to indicate the node and is in state to be committed.Wherein, preset threshold is calculated according to total common recognition number of nodes n in block catenary system
It obtains, calculation formula isFor example, when n is 8, preset threshold 5, if then the node is received in the prepare stage
To 4 signature packets, illustrate that the node fails in epicycle block common recognition, therefore the node can initiate view switching;If the section
Point receives 6 signature packets in the prepare stage, illustrates that the node processing hands over facile block 2 and its in block catenary system
Largely common recognition node processing hands over facile block 2 identical for it, therefore commit packet can be generated in the node.
Further, any node in block catenary system reaches the node in the commit packet for determining other nodes transmissions
Afterwards, the commit packet that can parse other nodes obtains the cryptographic Hash of the determining block 2 of other each node processing transaction;Such as
This, which can handle oneself the cryptographic Hash of the determining block 2 of transaction and the area that any other node processing transaction are determining
The cryptographic Hash of block 2 compares, and if they are the same, then can receive the commit packet that the other nodes are sent, if it is different, then can be with
Refuse the commit packet that other nodes are sent.Correspondingly, if commit packet that the node receives in time-out time
Quantity is less than preset threshold, then the node thinks the common recognition failure of epicycle block, which can initiate view switching;Correspondingly,
If the quantity for the commit packet that the node receives in time-out time is greater than or equal to preset threshold, illustrate the node processing
Facile block 2 is handed over to hand over facile block 2 identical with major part node processings other in block catenary system, in this way, the section
Point can obtain node processing transaction block 2 generated from memory, and the pre- of the intra-node can be written in block 2
If in database, to complete wheel block common recognition.
So far, the commit stage executes and terminates.
To sum up, during executing more wheel block common recognitions, PBFT knows together algorithm from multiple nodes of block catenary system
After the host node for determining epicycle block common recognition, the block that the host node known together using epicycle block executes epicycle block common recognition is beaten
Packet, and after each node in block catenary system has executed pre-prepare stage, prepare stage, commit node,
Determine that epicycle block common recognition terminates;Further, PBFT common recognition algorithm is determined down from multiple nodes of block catenary system again
The host node of one wheel block common recognition, is packaged using the block that the host node that next round block is known together executes next round block common recognition,
And after each node in block catenary system has executed pre-prepare stage, prepare stage, commit node, determine
Next round block common recognition terminates;The above process is repeated, until transaction data to be processed is not present in trading pit.
It follows that every wheel block common recognition can be executed sequentially in PBFT common recognition algorithm, i.e., terminate in last round of block common recognition
Starting next round block common recognition afterwards, using this kind of mode, can preferably carry out in the lesser block catenary system of trading volume
Trading processing.However, may generate thousands of or even tens of thousands of transactions each second in financial technology field, lead to financial section
Transaction data to be processed is very more in the block catenary system in skill field, if successively executing every wheel block using PBFT common recognition algorithm
Common recognition, then may may require that a large amount of time, cause the efficiency of trading processing very low, in some instances it may even be possible to so that transaction blocking, from
It and is that huge loss is brought in financial field.
It is existing to solve the embodiment of the invention provides a kind of common recognition method based on block catenary system based on this
Block catenary system successively execute it is every wheel block common recognition caused by block catenary system common recognition efficiency and transaction processing efficiency compared with
Low technical problem.
Based on the common recognition algorithm of PBFT described in block catenary system shown in FIG. 1 and Fig. 2, Fig. 3 provides for the embodiment of the present invention
A kind of corresponding flow diagram of common recognition method based on block catenary system, this method comprises:
Step 301, in I wheel block common recognition, first node receives the M block to be known together that second node is sent
Consensus information;The consensus information of M block includes the first transaction data to be processed in I wheel block common recognition, and second node is
The host node of I wheel block common recognition.
In the embodiment of the present invention, if I -1, which takes turns M-1 block to be known together in block common recognition, is successfully written block catenary system
The presetting database of interior joint can then determine that I -1 takes turns block and knows together successfully;In this way, if the host node of I wheel block common recognition
For second node, then the consensus information of M block to be known together in I wheel block common recognition can be sent to block by second node
Other nodes in catenary system.Wherein, the generating mode of the consensus information of M block can there are many, describe two separately below
The possible implementation of kind:
In one possible implementation, it is total can to take turns block in I -1 for second node for the consensus information of M block
It is generated after knowing successfully;Specifically, second node can be from second node after determining that the wheel block of I -1 is known together successfully
The first transaction data to be processed in I wheel block common recognition is obtained in memory pool, and the first transaction data assembling M can be used
The block body of block, it is high according to the block of the block high setting M block of M-1 block, and the high, area M-1 using the block of M block
The block head of cryptographic Hash and current time stamp the assembling M block of block, and then according to the block head of M block and M block
The consensus information of block body generation M block.
For example, it based on block catenary system illustrated in Figure 1, knows together successfully if I -1 takes turns block, and block catenary system
In the block a height of 1 of current time history maximum block, therefore, block to be known together is block 2 in I wheel block common recognition, in I
When taking turns block common recognition starting, form numerical value v=0, number of nodes n=4, the high h=2 of block, and based on I wheel block common recognition known to table 1
Host node be node 103;In this way, node 103 can be obtained in I wheel block common recognition from the trading pit of internal setting to from
First transaction data of reason, and the block that block 2 can be used is high, the area of the cryptographic Hash of block 1 and current time stamp assembling block 2
Build, using the block body of the first transaction data assembling block 2, so that it is raw using the block body of the block head of block 2 and block 2
At pre-prepare packet.
In alternatively possible implementation, the consensus information of M block can take turns block in I -1 for second node
It is generated during common recognition, for example second node is after the consensus information for receiving M-1 block, however, it is determined that second node the
I takes turns the host node of block common recognition, then can be during participating in the wheel block common recognition of I -1, concurrently according to M-1 block
The consensus information of consensus information generation M block.It should be noted that this kind of implementation is referred to step 301 and step
The process that the consensus information of M+1 block is generated in 302 is embodied, and details are not described herein again.
In one example, the consensus information of M block may include the Hash of the block height of M block, M-1 block
The generation timestamp and the first transaction data of value, M block.Wherein, the first transaction data may include the transaction of a transaction
Data, or also may include the transaction data of multiple (i.e. two or more) transaction, specifically it is not construed as limiting.
Step 302, first node is if it is determined that first node is the host node that I+1 takes turns block common recognition, then according to the area M
When the consensus information of block knows together to M block, the consensus information of parallel generation M+1 block to be known together;Wherein, M+
The consensus information of 1 block includes that I+1 takes turns the second transaction data to be processed in block common recognition;Second transaction data and first is handed over
Easy data are different.
In the embodiment of the present invention, each node in block catenary system is receiving the M block of second node transmission
After consensus information, the consensus information that can parse M block obtains the block height of M block, the cryptographic Hash of M-1 block, M
The generation timestamp and the first transaction data of block.Further, each node being directed in block catenary system, which can
Determine whether the node is that the wheel block of I+1 is known together with the node data in the block height and block catenary system according to M block
Host node, if it is not, then the node can directly participate in I wheel block common recognition process, if so, the node can participate in the
The consensus information that I+1 takes turns M+1 block to be known together in block common recognition is concurrently generated when I wheel block common recognition.
As an example, node can determine whether the node is that I+1 takes turns block common recognition based on following formula and table 1
Host node:
leaderI+1=(hM+ 1) %n
Wherein, leaderI+1The number of the host node of block common recognition, h are taken turns for I+1MHigh for the block of M block, n is area
It always knows together in block catenary system the quantity of node.
For example, if M block is block 2, the host node of I wheel block common recognition is node 103, then node 101, section
Point 102 and node 104 can use above-mentioned public affairs after receiving the pre-prepare packet of block 2 of the transmission of node 103 respectively
Formula determines that I+1 takes turns the number of the host node of block common recognition.It is directed to for node 101, node 102 and node 103, due to upper
The number for stating the host node that formula is determined is 3, is node 104 according to the corresponding node of host node that table 1 determines that number is 3,
Therefore node 101, node 102 and node 103 can continue to execute I wheel block common recognition process;Correspondingly, it is directed to node
For 104, the number for the host node determined due to above-mentioned formula is 3, and the host node for determining that number is 3 according to table 1 is corresponding
Node is node 104, therefore node 104 can concurrently generate the pre- of block 3 during executing I wheel block common recognition
Prepare packet.
In the embodiment of the present invention, any node being directed in block catenary system is automatic by using the mark of the node
Match I+1 take turns block common recognition host node number, determine the node whether be I+1 take turns block common recognition host node, can
To call M+1 block to be known together in the node automatic packaging I+1 wheel block common recognition in the success of a certain node matching, from
And can guarantee that I+1 takes turns the automatic paralleling execution of block common recognition with I wheel block common recognition, improve the standard of block catenary system common recognition
True property.
By taking node 101 as an example, after determination is not the host node that I+1 takes turns block common recognition, node 101 can handle first
Transaction data obtains the processing result of the first transaction data, and can generate first according to the processing result of the first transaction data and breathe out
Uncommon value generates the second cryptographic Hash according to the first transaction data, is generated according to the receipt for executing every transaction in the first transaction data
Third cryptographic Hash, and then default hash algorithm can be used, the first cryptographic Hash, the second cryptographic Hash and third cryptographic Hash are counted
Calculation obtains the cryptographic Hash of block 2.Further, node 101 can by the first cryptographic Hash, the second cryptographic Hash, third cryptographic Hash and
The cryptographic Hash of block 2 is assembled into the block head of block 2, and the cryptographic Hash of block 2 and the first transaction data can be assembled
Into the block body of block 2, the private key of node 101, the cryptographic Hash of block 2, the height of block 2, mark of node 101 etc. are used
Information generates node 101 to the signature packets of block 2, and then signature packets of the node 101 to block 2 are sent to node 102, node
103 and node 104;And the signature packets that node 101 can wait node 102, node 103 and node 104 to send respectively, and can
To continue to execute the commit stage in I wheel block common recognition according to the quantity of the signature packets received.
Correspondingly, the pre-prepare packet of the parallel generation block 3 during executing I wheel block common recognition of node 104
Mode can there are many, for example node 104 can first carry out the prepare stage and obtain node 104 to the signature packets of block 2,
And signature packets of the node 104 to block 2 are sent to node 101, node 102 and node 103, then waiting node 101, section
When the signature packets that point 102 and node 103 are sent, the pre-prepare of block 3 is generated according to the pre-prepare packet of block 2
Packet;Or it can also be after receiving the consensus information of block 2 of the transmission of node 103, first according to the pre-prepare of block 2
Packet generates the pre-prepare packet of block 3, generates node 104 further according to the pre-prepare packet for the block 2 that node 103 is sent
To the signature packets of block 2;Or the prepare stage can also be first carried out and the commit stage obtains node 104 to block 2
Commit packet, and commit packet of the node 104 to block 2 is sent to node 101, node 102 and node 103, then waiting
When the commit packet that node 101, node 102 and node 103 are sent, block 3 is generated according to the pre-prepare packet of block 2
Pre-prepare packet;Etc., specifically it is not construed as limiting.
In one possible implementation, node 104 can generate the pre-prepare of block 3 in the following way
Packet: the pre-prepare packet that node 104 can first parse block 2 obtains the block height and the first transaction data of block 2, then may be used
With high according to the block of the block high setting block 3 of block 2, and it can be obtained from the trading pit of node 104 and remove the first transaction data
Except the second transaction data;Further, the block height of block 3 can be used in node 104 and current time stamp assembles to obtain area
The block head of block 3, and the second transaction data can be used and assemble to obtain the block body of block 3, and then can be according to the area of block 3
The pre-prepare packet of the block body of build and block 3 generation block 3.
Wherein, pre-prepare packet can be the data packet with preset format, and pre-prepare packet can be by multiple
Storage region is constituted, and each storage region is for storing setting data.For example, the pre-prepare packet of block 3 can be by
First storage field, the second storage field, third storage field and the 4th storage field, wherein the first storage field is for depositing
The generation timestamp that the block of storage area block 3 is high, the second storage field is for memory block 3, third store field and are used for memory block 2
Cryptographic Hash, the 4th storage field can store transaction data to be processed in block 3 (i.e. the second transaction data).Herein,
One~the 4th storage storable data volume of field can be rule of thumb configured by those skilled in the art, be not construed as limiting.
It, can the area Xian Jiang after node 104 obtains the block head of block 3 and the block body of block 3 in assembling in specific implementation
The block head of block 3 and the block body of block 3 are stored in the memory of node 104, then generate the initial pre- of block 3
Prepare packet (can be empty data packet);Further, node 104 can convert the block height of block 3 to preset format (ratio
Such as binary system) after be placed on initial pre-prepare packet first storage field in, convert the generation timestamp of block 3 to
It is placed on after preset format in the second storage field of initial pre-prepare packet, converts default lattice for the second transaction data
It is placed on after formula in the 4th storage field of initial pre-prepare packet, since block 2 does not complete common recognition also, can make
The third of initial pre-prepare packet stores field vacant;In this way, the pre-prepare packet of the available block 3 of node 104,
And the pre-prepare packet of block 3 can be stored in memory.
In the embodiment of the present invention, by removing the first number of deals to be processed in I wheel block common recognition from acquisition in trading pit
The second outer transaction data accordingly can take turns block using the second transaction data as the block body of M+1 block to avoid I+1
The handled transaction data of common recognition reprocessing I wheel block common recognition guarantees executing I wheel block common recognition and I+1 parallel
The accuracy of trading processing when taking turns block common recognition;And when parallel execution I wheel block common recognition and the wheel block common recognition of I+1, although
The history maximum block of second node is M-1 block, but by according to M block to be known together in I wheel block common recognition
Block high setting I+1 take turns M+1 block to be known together in block common recognition block it is high, second node can be made to accurately generate the
I+1 takes turns the corresponding block head of block common recognition process, so that executing parallel, I wheel block is known together and I+1 takes turns block common recognition.
Further, node 104 can continue to execute the common recognition process of block 2, for example, successively execute the prepare stage and
The commit stage, and determine whether block 2 knows together success after the completion of executing in the commit stage, if node 104 is successfully by block 2
Common recognition result storage in the preset database, it is determined that block 2 know together successfully, thus node 104 can to node 101, save
Point 102 and node 103 send the pre-prepare packet of block 3;The common recognition result of block 2 is stored if node 104 fails
In the preset database, it is determined that the common recognition failure of block 2, therefore node 104 can re-execute the common recognition process of block 2.
In one example, node 104 can also obtain after determining that block 2 is known together successfully from the common recognition result of block 2
The cryptographic Hash of block 2 is taken, and the cryptographic Hash of block 2 can be converted to the pre-prepare for being added to block 3 after preset format
In the third storage field of packet, to obtain the target pre-prepare packet of block 3, and then can be by the target pre- of block 3
Prepare packet is sent to node 101, node 102 and node 103.
In the embodiment of the present invention, after I wheel block is known together successfully, pass through M to be known together during I wheel block is known together
The cryptographic Hash addition of block is taken turns in I+1 in M+1 block to be known together in block common recognition, can take turns block common recognition in I+1
The middle complete M+1 block of assembling guarantees that block was known together to accurately establish the incidence relation of M block and M+1 block
The sequence of journey carries out and the integrality of block chain.
Correspondingly, node 104 is if it is determined that the common recognition failure of block 2, then can repeat to block 2 as follows
Common recognition process: node 104 can determine that the block of maximum history block (i.e. block 1) is high from memory, and can be from node 104
The first transaction data is obtained in trading pit, in this way, node 104 can be high according to the block of the block high setting block 2 of block 1, and can
With the block head of the high, cryptographic Hash of block 1 according to the block of block 2 and current time stamp assembling block 2, according to the first transaction data
The block body of block 2 is assembled, and then the pre- of block 2 can be generated according to the block head of block 2 and the block body of block 2
Prepare packet, and the pre-prepare packet of block 2 can be sent to node 101, node 102 and node 103, so that block
Each node in catenary system executes the prepare stage and the commit stage completes the common recognition to block 2.
In the embodiment of the present invention, after the common recognition failure of I wheel block, re-assemblied by using first node to be known together
M block and to M onblock executing know together process, can to avoid parallel processing two-wheeled block know together process when due to last round of
The problem of block to be known together in last round of block common recognition is omitted caused by block common recognition failure, guarantees the standard of block catenary system common recognition
True property.
Based on block catenary system illustrated in Figure 1 and common recognition method illustrated in Figure 3, Fig. 4 provides for the embodiment of the present invention
A kind of execution block common recognition flow diagram, this method comprises:
Step 401, in first round block common recognition, host node 101 is packaged block 0.
In specific implementation, in first round block common recognition, since history block being not present in block catenary system, to altogether
The block of knowledge is block 0;It is 4 accordingly, due to the number of blocks in block catenary system, form numerical value v is 0, therefore using public
Formula leader=(h+v)/n determines that the number of host node is 0;The corresponding node of host node for determining that number is 0 based on table 1 is section
Point 101, i.e. node 101 are the host node of first round block common recognition.
It knows together transaction to be processed in this way, host node 101 can obtain first round block from the trading pit of host node 101
Data, and can according to the block height and current time stamp of block 0 assemble block 0 block head, according to the first round block common recognition to
The block body of the transaction data assembling block 0 of processing, and then can be generated according to the block head of block 0 and the block body of block 0
The pre-prepare packet of block 0 is sent to 102~node of node 104 by the pre-prepare packet of block 0.
Step 402,102~node of node 104 receives the pre-prepare packet of the block 0 of the transmission of node 101;
In one wheel block common recognition, node 101, node 103 and node 104 determine the host node for not taking turns block common recognition for second, then directly
The common recognition process of block 0 is participated in, i.e., successively executes prepare stage and commit stage;Correspondingly, node 102 determines node
102 host nodes known together for the second wheel block, therefore node 102 can be when participating in the common recognition process of block 0, parallel generation area
The pre-prepare packet of block 1.
Block counts by taking node 102 as an example, due to the block a height of 0 of block 0 in first round block common recognition, in block catenary system
Amount is 4, therefore node 102 uses formula leaderI+1=(hM+ 1)/n determines that the number of host node is 1;It is determined and is compiled based on table 1
It number is node 102 for the 1 corresponding node of host node, i.e. the host node that is the second wheel block common recognition of node 102.
Further, node 102 can be high according to the block of the block high setting block 1 of block 0, and can obtain from trading pit
The second wheel block is taken to know together transaction data to be processed, wherein the second wheel block transaction data to be processed of knowing together is different from the
One wheel block is known together transaction data to be processed;Node 102 can be according to the block height of block 1, current time stamp and the second wheel area
The transaction data that block is known together to be processed generates the pre-prepare packet of block 1.
Step 403, after first round block common recognition, since block 0 is known together successfully, area is can be used in node 102
The pre-prepare packet of the cryptographic Hash of block 0 more new block 1, and the pre-prepare packet of updated block 1 is sent to section
Point 101, node 103 and node 104, starting the second wheel block common recognition.
Correspondingly, node 101, node 103 and node 104 receive the pre-prepare of the block 1 of the transmission of node 102
Packet, in the second wheel block common recognition, determining node 101, node 102 and node 104 are not the host node of third round block common recognition,
The common recognition process for then directly participating in block 1, i.e., successively execute prepare stage and commit stage.Correspondingly, node 103 is true
Determine node 103 be third round block common recognition host node, therefore node 103 can participate in block 1 common recognition process when, according to
The pre- for the transaction data parallel generation block 2 that block height, current time stamp and the third round block of block 2 are known together to be processed
Prepare packet.
Step 404, after the second wheel block common recognition, since block 1 is known together successfully, area is can be used in node 103
The pre-prepare packet of the cryptographic Hash of block 1 more new block 2, and the pre-prepare packet of updated block 2 is sent to section
Point 101, node 102 and node 104, starting third round block common recognition.
Correspondingly, node 101, node 102 and node 104 receive the pre-prepare of the block 2 of the transmission of node 103
Packet, in third round block common recognition, node 101, node 102 and node 103 determine the host node that do not know together for fourth round block,
The common recognition process for then directly participating in block 2, i.e., successively execute prepare stage and commit stage.Correspondingly, node 104 is true
Determine node 104 be fourth round block common recognition host node, therefore node 104 can participate in block 2 common recognition process when, according to
The pre- for the transaction data parallel generation block 3 that block height, current time stamp and the fourth round block of block 3 are known together to be processed
Prepare packet.
Step 405, it after third round block common recognition, is known together and is failed due to block 2, in 101~node of node 104
The value of form numerical value v is incremented by 1, and history maximum block is 1, and the number of host node is determined according to formula leader=(h+v)/n
It is 3;The corresponding node of host node for determining that number is 3 based on table 1 is node 104, i.e., node 104 is fourth round block common recognition
Host node.
In specific implementation, node 104 can delete block 3 stored in memory, and can repack block 2, such as
Host node 104 can obtain third round block from the trading pit of host node 104 and know together transaction data to be processed, and can root
The block head of the high, cryptographic Hash of block 1 and current time stamp assembling block 2 according to the block of block 2, according to third round block common recognition to
The block body of the transaction data assembling block 2 of processing, and then can be generated according to the block head of block 2 and the block body of block 2
The pre-prepare packet of block 2 is sent to 101~node of node 103 by the pre-prepare packet of block 2.
Step 406, node 101, node 102 and node 103 receive the pre-prepare of the block 2 of the transmission of node 104
Packet, in fourth round block common recognition, node 102, node 103 and node 104 determine the host node for not taking turns block common recognition for the 5th,
The common recognition process of block 2 then can be directly participated in, i.e., successively executes prepare stage and commit stage.Correspondingly, node
101 determine that node 101 is the host node of the 5th wheel block common recognition, therefore node 101 can be in the common recognition process for participating in block 2
When, the transaction data parallel generation block 3 that block is known together to be processed is taken turns according to the block of block 2 height, current time stamp and the 5th
Pre-prepare packet.
Step 407, after fourth round block common recognition, since block 2 is known together successfully, area is can be used in node 101
The pre-prepare packet of the cryptographic Hash of block 2 more new block 3, and the pre-prepare packet of updated block 3 is sent to section
Point 102, node 103 and node 104, the 5th wheel block common recognition of starting.
Correspondingly, node 102, node 103 and node 104 receive the pre-prepare of the block 3 of the transmission of node 101
Packet, in the 5th wheel block common recognition, determining node 101, node 103 and node 104 are not the host node of the 6th wheel block common recognition,
The common recognition process for then directly participating in block 3, i.e., successively execute prepare stage and commit stage.Correspondingly, node 102 is true
Determine node 102 be the 6th wheel block common recognition host node, therefore node 102 can participate in block 3 common recognition process when, according to
The pre- for the transaction data parallel generation block 4 that block height, current time stamp and the 6th wheel block of block 4 are known together to be processed
Prepare packet.
The process anticipated based on shown in Fig. 4 compared to existing block catenary system it was determined that directly use PBFT common recognition to calculate
Method successively executes for each round block common recognition process, and the block common recognition method in the embodiment of the present invention can greatly shorten altogether
Know the time, improves the common recognition efficiency of block catenary system.
In the above embodiment of the present invention, I wheel block common recognition in, first node receive second node send to altogether
The consensus information for the M block known, the consensus information of the M block include to be processed the in I wheel block common recognition
One transaction data, the second node are the host node of I wheel block common recognition;Further, if the first node is true
The fixed first node is the host node that I+1 takes turns block common recognition, then according to the consensus information of the M block to described the
When M block is known together, the consensus information of parallel generation M+1 block to be known together;The consensus information packet of the M+1 block
It includes the I+1 and takes turns the second transaction data to be processed in block common recognition;Second transaction data and first number of deals
According to difference.In the embodiment of the present invention, the master that block is known together is taken turns by starting I+1 in the implementation procedure that I wheel block is known together
Node makes I+1 take turns the host node automatic packaging block that block was known together, and realizes the common recognition process to I wheel block common recognition
The parallel execution that the block packing process of block common recognition is taken turns with I+1 reduces the operating time that I+1 takes turns block common recognition, from
And the common recognition efficiency of block catenary system can be improved.
For above method process, the embodiment of the present invention also provides a kind of common recognition device based on block catenary system, the dress
The particular content set is referred to above method implementation.
Fig. 5 is a kind of structural schematic diagram of common recognition device based on block catenary system provided in an embodiment of the present invention, comprising:
Transceiver module 501, for receiving the M block to be known together that second node is sent in I wheel block common recognition
Consensus information, the consensus information of the M block include the first transaction data to be processed in the I wheel block common recognition, institute
State the host node that second node is I wheel block common recognition;Wherein, I, M are positive integer;
Generation module 502, for if it is determined that first node is the host node that I+1 takes turns block common recognition, then according to
When the consensus information of M block knows together to the M block, the consensus information of parallel generation M+1 block to be known together;
The consensus information of the M+1 block includes that the I+1 takes turns the second transaction data to be processed in block common recognition;Described second
Transaction data is different from first transaction data.
Optionally, the generation module 502 is specifically used for:
The second transaction data in addition to first transaction data, and root are obtained from the trading pit of the first node
The block of M+1 block described in block high setting according to the M block is high;
According to second transaction data, the block height of the M+1 block and current time stamp, the area the M+1 is generated
The consensus information of block.
Optionally, described after the consensus information of 502 parallel generation of generation module M+1 block to be known together
Transceiver module 501 is also used to:
If it is determined that the common recognition result of the I wheel block common recognition is to know together successfully, then the cryptographic Hash of the M block is added
It is added in the consensus information of the M+1 block, and the consensus information of the M+1 block is sent to the block catenary system
In other nodes.
Optionally, the generation module 502 is also used to:
If it is determined that the common recognition result of the I wheel block common recognition is common recognition failure, then from the trading pit of the first node
It is middle to obtain first transaction data, and the block of the M block according to the block high setting of history maximum block is high;
According to the cryptographic Hash of high, the described history maximum block of the block of first transaction data, the M block and currently
Timestamp generates the consensus information of the M block;
The consensus information of the M block is sent to other nodes in the block catenary system.
Optionally, the generation module 502 is specifically used for:
It is total to determine that the I+1 takes turns block according to the number of nodes of the block height of the M block and the block catenary system
The number of the host node of knowledge, if the mark of the first node is matched with the number of the host node of the I+1 wheel block common recognition,
Then determine that the first node is the host node that the I+1 takes turns block common recognition.
It can be seen from the above: in the above embodiment of the present invention, in I wheel block common recognition, first node is connect
The consensus information for the M block to be known together that second node is sent is received, the consensus information of the M block includes the I wheel
First transaction data to be processed in block common recognition, the second node are the host node of I wheel block common recognition;Further
Ground, the first node is if it is determined that the first node is the host node that I+1 takes turns block common recognition, then according to the area the M
When the consensus information of block knows together to the M block, the consensus information of parallel generation M+1 block to be known together;It is described
The consensus information of M+1 block includes that the I+1 takes turns the second transaction data to be processed in block common recognition;Second transaction
Data are different from first transaction data.In the embodiment of the present invention, by starting in the implementation procedure that I wheel block is known together
I+1 takes turns the host node of block common recognition, so that I+1 is taken turns the host node automatic packaging block that block was known together, realizes to I wheel
The common recognition process and I+1 of block common recognition take turns the parallel execution of the block packing process of block common recognition, reduce I+1 and take turns block
The operating time of common recognition, so as to improve the common recognition efficiency of block catenary system.
Based on the same inventive concept, the embodiment of the invention also provides a kind of calculating equipment, including at least one processing is single
Member and at least one storage unit, wherein the storage unit is stored with computer program, when described program is by the processing
When unit executes, so that the processing unit executes the common recognition method based on block catenary system as described in Fig. 3 or Fig. 4 is any.
Based on the same inventive concept, the embodiment of the present invention also provides a kind of computer readable storage medium, and being stored with can
The computer program executed by calculating equipment, when described program is run on said computing device, so that the calculating equipment
Execute the common recognition method based on block catenary system as described in Fig. 3 or Fig. 4 is any.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the present invention
Form.It is deposited moreover, the present invention can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.
Claims (12)
1. a kind of common recognition method based on block catenary system, which is characterized in that the described method includes:
In I wheel block common recognition, first node receives the consensus information for the M block to be known together that second node is sent, institute
The consensus information for stating M block includes the first transaction data to be processed in the I wheel block common recognition, and the second node is
The host node of the I wheel block common recognition;
The first node is if it is determined that the first node is the host node that I+1 takes turns block common recognition, then according to the area the M
When the consensus information of block knows together to the M block, the consensus information of parallel generation M+1 block to be known together;It is described
The consensus information of M+1 block includes that the I+1 takes turns the second transaction data to be processed in block common recognition;Second transaction
Data are different from first transaction data;
Wherein, I, M are positive integer.
2. the method according to claim 1, wherein the area M+1 that the first node parallel generation is to be known together
The consensus information of block, comprising:
The first node obtains the second transaction in addition to first transaction data from the trading pit of the first node
Data, and the block of the M+1 block according to the block high setting of the M block is high;
The first node is according to the block of second transaction data, the M+1 block is high and current time stamp, described in generation
The consensus information of M+1 block.
3. according to the method described in claim 2, it is characterized in that, the first node parallel generation area M+1 to be known together
After the consensus information of block, further includes:
The first node is if it is determined that the common recognition result of I wheel block common recognition is to know together successfully, then by the M block
Cryptographic Hash addition is sent to the area in the consensus information of the M+1 block, and by the consensus information of the M+1 block
Other nodes in block catenary system.
4. according to the method described in claim 3, it is characterized in that, the method also includes:
The first node is if it is determined that the common recognition result of I wheel block common recognition is common recognition failure, then from the first node
Trading pit in obtain first transaction data, and the block of the M block according to the block high setting of history maximum block is high;
The first node is according to the Hash of high, the described history maximum block of block of first transaction data, the M block
Value and current time stamp generate the consensus information of the M block;
The consensus information of the M block is sent to other nodes in the block catenary system by the first node.
5. method according to claim 1 to 4, which is characterized in that the first node is in the following way
Determine that the first node is the host node that the I+1 takes turns block common recognition:
The first node determines the I+1 according to the block height of the M block and the number of nodes of the block catenary system
The number of the host node of block common recognition is taken turns, if the mark of the first node and the host node of the I+1 wheel block common recognition
Number matching, it is determined that the first node is the host node that the I+1 takes turns block common recognition.
6. a kind of common recognition device based on block catenary system, which is characterized in that described device includes:
Transceiver module, in I wheel block common recognition, receiving the common recognition letter for the M block to be known together that second node is sent
Breath, the consensus information of the M block include the first transaction data to be processed in I wheel block common recognition, and described second
Node is the host node of I wheel block common recognition;Wherein, I, M are positive integer;
Generation module, for if it is determined that first node is the host node that I+1 takes turns block common recognition, then according to the M block
Consensus information when knowing together to the M block, the consensus information of parallel generation M+1 block to be known together;The M
The consensus information of+1 block includes that the I+1 takes turns the second transaction data to be processed in block common recognition;Second number of deals
According to different from first transaction data.
7. device according to claim 6, which is characterized in that the generation module is specifically used for:
The second transaction data in addition to first transaction data is obtained from the trading pit of the first node, and according to institute
The block for stating M+1 block described in the block high setting of M block is high;
According to second transaction data, the block height of the M+1 block and current time stamp, the M+1 block is generated
Consensus information.
8. device according to claim 7, which is characterized in that in generation module parallel generation M+1 to be known together
After the consensus information of block, the transceiver module is also used to:
If it is determined that the common recognition result of the I wheel block common recognition is to know together successfully, then the cryptographic Hash addition of the M block is existed
In the consensus information of the M+1 block, and the consensus information of the M+1 block is sent in the block catenary system
Other nodes.
9. device according to claim 8, which is characterized in that the generation module is also used to:
If it is determined that the common recognition result of the I wheel block common recognition is common recognition failure, then obtained from the trading pit of the first node
First transaction data is taken, and the block of the M block according to the block high setting of history maximum block is high;
According to the cryptographic Hash and current time of high, the described history maximum block of the block of first transaction data, the M block
Stamp generates the consensus information of the M block;
The consensus information of the M block is sent to other nodes in the block catenary system.
10. device according to any one of claims 6 to 9, which is characterized in that the generation module is specifically used for:
Determine that the I+1 takes turns block common recognition according to the number of nodes of the block height of the M block and the block catenary system
The number of host node, if the mark of the first node is matched with the number of the host node of the I+1 wheel block common recognition, really
The fixed first node is the host node that the I+1 takes turns block common recognition.
11. a kind of calculating equipment, which is characterized in that including at least one processing unit and at least one storage unit, wherein
The storage unit is stored with computer program, when described program is executed by the processing unit, so that the processing unit
Perform claim requires method described in 1~5 any claim.
12. a kind of computer readable storage medium, which is characterized in that it is stored with can be by computer journey that calculating equipment executes
Sequence, when described program is run on said computing device, so that the calculating equipment perform claim requires 1~5 any right
It is required that the method.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910798196.6A CN110517141B (en) | 2019-08-27 | 2019-08-27 | Consensus method and device based on block chain system |
PCT/CN2020/106623 WO2021036702A1 (en) | 2019-08-27 | 2020-08-03 | Consensus method and device employing blockchain system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910798196.6A CN110517141B (en) | 2019-08-27 | 2019-08-27 | Consensus method and device based on block chain system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110517141A true CN110517141A (en) | 2019-11-29 |
CN110517141B CN110517141B (en) | 2023-06-13 |
Family
ID=68628154
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910798196.6A Active CN110517141B (en) | 2019-08-27 | 2019-08-27 | Consensus method and device based on block chain system |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110517141B (en) |
WO (1) | WO2021036702A1 (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110708171A (en) * | 2019-12-13 | 2020-01-17 | 腾讯科技(深圳)有限公司 | Block chain consensus voting method, device, equipment and storage medium |
CN111369358A (en) * | 2020-02-10 | 2020-07-03 | 杭州溪塔科技有限公司 | Block chain consensus method and device and electronic equipment |
CN111522648A (en) * | 2020-07-03 | 2020-08-11 | 支付宝(杭州)信息技术有限公司 | Transaction processing method and device for block chain and electronic equipment |
CN111556120A (en) * | 2020-04-23 | 2020-08-18 | 财付通支付科技有限公司 | Data processing method and device based on block chain, storage medium and equipment |
CN111698094A (en) * | 2020-06-12 | 2020-09-22 | 深圳前海微众银行股份有限公司 | Consensus method based on block chain system and block chain system |
CN111711526A (en) * | 2020-06-16 | 2020-09-25 | 深圳前海微众银行股份有限公司 | Consensus method and system for block chain nodes |
CN111768288A (en) * | 2020-06-02 | 2020-10-13 | 北京同邦卓益科技有限公司 | Service processing method and device, electronic equipment and storage medium |
CN112256476A (en) * | 2020-09-27 | 2021-01-22 | 陕西医链区块链集团有限公司 | Data operation method, device, equipment and medium based on block chain |
WO2021036702A1 (en) * | 2019-08-27 | 2021-03-04 | 深圳前海微众银行股份有限公司 | Consensus method and device employing blockchain system |
CN112506671A (en) * | 2021-02-03 | 2021-03-16 | 支付宝(杭州)信息技术有限公司 | Transaction processing method and device in block chain and electronic equipment |
CN112511312A (en) * | 2020-11-23 | 2021-03-16 | 北京微芯区块链与边缘计算研究院 | Assembled consensus method and system |
CN116737810A (en) * | 2023-05-06 | 2023-09-12 | 清华大学 | Consensus service interface for distributed time sequence database |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113379542B (en) * | 2021-05-28 | 2024-01-09 | 中邮信息科技(北京)有限公司 | Block chain transaction query method, device, medium and electronic equipment |
CN113486118B (en) * | 2021-07-21 | 2023-09-22 | 银清科技有限公司 | Consensus node selection method and device |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109064328A (en) * | 2018-07-09 | 2018-12-21 | 夸克链科技(深圳)有限公司 | A kind of construction and its common recognition algorithm of novel block chain |
CN109831425A (en) * | 2019-01-25 | 2019-05-31 | 中国联合网络通信集团有限公司 | Block chain common recognition method, apparatus, equipment and computer readable storage medium |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10839379B2 (en) * | 2017-07-20 | 2020-11-17 | Chicago Mercantile Exchange Inc. | Blockchain including linked digital assets |
KR102417067B1 (en) * | 2017-12-08 | 2022-07-05 | 한국전자통신연구원 | Method and apparatus for generating blocks in node on a block-chain network |
CN109978516A (en) * | 2019-03-06 | 2019-07-05 | 西安电子科技大学 | The manufacture of block and synchronous method, information data processing terminal in block chain network |
CN109993647B (en) * | 2019-03-08 | 2023-12-22 | 西安电子科技大学 | Tax collection system based on blockchain and processing method |
CN109889397B (en) * | 2019-03-31 | 2021-08-31 | 杭州复杂美科技有限公司 | Lottery method, block generation method, equipment and storage medium |
CN110517141B (en) * | 2019-08-27 | 2023-06-13 | 深圳前海微众银行股份有限公司 | Consensus method and device based on block chain system |
-
2019
- 2019-08-27 CN CN201910798196.6A patent/CN110517141B/en active Active
-
2020
- 2020-08-03 WO PCT/CN2020/106623 patent/WO2021036702A1/en active Application Filing
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109064328A (en) * | 2018-07-09 | 2018-12-21 | 夸克链科技(深圳)有限公司 | A kind of construction and its common recognition algorithm of novel block chain |
CN109831425A (en) * | 2019-01-25 | 2019-05-31 | 中国联合网络通信集团有限公司 | Block chain common recognition method, apparatus, equipment and computer readable storage medium |
Cited By (22)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2021036702A1 (en) * | 2019-08-27 | 2021-03-04 | 深圳前海微众银行股份有限公司 | Consensus method and device employing blockchain system |
CN110708171B (en) * | 2019-12-13 | 2020-06-12 | 腾讯科技(深圳)有限公司 | Block chain consensus voting method, device, equipment and storage medium |
CN110708171A (en) * | 2019-12-13 | 2020-01-17 | 腾讯科技(深圳)有限公司 | Block chain consensus voting method, device, equipment and storage medium |
CN111369358A (en) * | 2020-02-10 | 2020-07-03 | 杭州溪塔科技有限公司 | Block chain consensus method and device and electronic equipment |
CN111369358B (en) * | 2020-02-10 | 2023-09-12 | 杭州溪塔科技有限公司 | Block chain consensus method and device and electronic equipment |
CN111556120A (en) * | 2020-04-23 | 2020-08-18 | 财付通支付科技有限公司 | Data processing method and device based on block chain, storage medium and equipment |
CN111556120B (en) * | 2020-04-23 | 2023-04-07 | 财付通支付科技有限公司 | Data processing method and device based on block chain, storage medium and equipment |
CN111768288B (en) * | 2020-06-02 | 2023-12-08 | 北京同邦卓益科技有限公司 | Service processing method, device, electronic equipment and storage medium |
CN111768288A (en) * | 2020-06-02 | 2020-10-13 | 北京同邦卓益科技有限公司 | Service processing method and device, electronic equipment and storage medium |
CN111698094A (en) * | 2020-06-12 | 2020-09-22 | 深圳前海微众银行股份有限公司 | Consensus method based on block chain system and block chain system |
CN111698094B (en) * | 2020-06-12 | 2023-06-09 | 深圳前海微众银行股份有限公司 | Common identification method based on block chain system and block chain system |
CN111711526A (en) * | 2020-06-16 | 2020-09-25 | 深圳前海微众银行股份有限公司 | Consensus method and system for block chain nodes |
CN111711526B (en) * | 2020-06-16 | 2024-03-26 | 深圳前海微众银行股份有限公司 | Method and system for consensus of block chain nodes |
US11803447B2 (en) | 2020-07-03 | 2023-10-31 | Alipay (Hangzhou) Information Technology Co., Ltd. | Transaction processing method, apparatus, and electronic device for blockchain |
CN111522648A (en) * | 2020-07-03 | 2020-08-11 | 支付宝(杭州)信息技术有限公司 | Transaction processing method and device for block chain and electronic equipment |
CN112256476A (en) * | 2020-09-27 | 2021-01-22 | 陕西医链区块链集团有限公司 | Data operation method, device, equipment and medium based on block chain |
CN112256476B (en) * | 2020-09-27 | 2024-04-16 | 陕西医链区块链集团有限公司 | Data operation method, device, equipment and medium based on block chain |
CN112511312A (en) * | 2020-11-23 | 2021-03-16 | 北京微芯区块链与边缘计算研究院 | Assembled consensus method and system |
CN112511312B (en) * | 2020-11-23 | 2023-10-17 | 北京微芯区块链与边缘计算研究院 | Assembled consensus method and system |
CN112506671A (en) * | 2021-02-03 | 2021-03-16 | 支付宝(杭州)信息技术有限公司 | Transaction processing method and device in block chain and electronic equipment |
CN112506671B (en) * | 2021-02-03 | 2021-05-07 | 支付宝(杭州)信息技术有限公司 | Transaction processing method and device in block chain and electronic equipment |
CN116737810A (en) * | 2023-05-06 | 2023-09-12 | 清华大学 | Consensus service interface for distributed time sequence database |
Also Published As
Publication number | Publication date |
---|---|
CN110517141B (en) | 2023-06-13 |
WO2021036702A1 (en) | 2021-03-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110517141A (en) | A kind of common recognition method and device based on block catenary system | |
CN110474986A (en) | A kind of common recognition method, apparatus and system based on block catenary system | |
CN110602148B (en) | Method and device for generating state tree of block and verifying data on chain | |
CN107169865B (en) | Asset data processing system based on block chain technology | |
JP7184959B2 (en) | Method and apparatus for distributed database in network | |
CN105573828B (en) | A kind of operation processing method and device | |
KR102050129B1 (en) | Block chain supporting multiple one-way functions used for verification of blocks | |
CN111382456B (en) | Proposal message processing method, device, equipment and storage medium | |
JP5230645B2 (en) | System and method for optimizing data set changes | |
CN109242500A (en) | Block chain transaction validation verification method, apparatus and storage medium | |
CN108009811A (en) | Inter-cloud computing environment value exchange-oriented cross-chain communication method | |
CN104809199B (en) | A kind of method and apparatus of database synchronization | |
CN110737664A (en) | block link point synchronization method and device | |
US20240163121A1 (en) | Blockchain consensus method, apparatus, and device, and storage medium | |
KR102133886B1 (en) | Method and system for predicting cryptographic price using artificial intelligence | |
Skidanov et al. | Nightshade: Near protocol sharding design | |
CN109410043B (en) | Block chain information efficient storage method and device based on hierarchical tree structure | |
US11475025B2 (en) | Blockchain system comprising consensus protocol using search for good approximate solutions to any optimization problem and its computor program | |
CN112348518B (en) | Block chain transaction certification method and device | |
CN109743346A (en) | Session process configuration method, device and computer readable storage medium | |
CN111698094A (en) | Consensus method based on block chain system and block chain system | |
CN106910065A (en) | Data processing method, the apparatus and system of the settlement of exchange amount of money are calculated based on many transactions | |
CN110264358A (en) | A kind of transaction processing method and device | |
CN111488396A (en) | Data synchronization method and device for service data block chain | |
CN109474691A (en) | A kind of method and device of internet of things equipment identification |
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 |