CN110336677A - Block packing, broadcasting method and system, equipment and storage medium - Google Patents

Block packing, broadcasting method and system, equipment and storage medium Download PDF

Info

Publication number
CN110336677A
CN110336677A CN201910633127.XA CN201910633127A CN110336677A CN 110336677 A CN110336677 A CN 110336677A CN 201910633127 A CN201910633127 A CN 201910633127A CN 110336677 A CN110336677 A CN 110336677A
Authority
CN
China
Prior art keywords
block
transaction
node
block chain
chain node
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910633127.XA
Other languages
Chinese (zh)
Other versions
CN110336677B (en
Inventor
何玉斌
王志文
吴思进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Fuzamei Technology Co Ltd
Original Assignee
Hangzhou Fuzamei Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Fuzamei Technology Co Ltd filed Critical Hangzhou Fuzamei Technology Co Ltd
Priority to CN201910633127.XA priority Critical patent/CN110336677B/en
Publication of CN110336677A publication Critical patent/CN110336677A/en
Application granted granted Critical
Publication of CN110336677B publication Critical patent/CN110336677B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Computer Security & Cryptography (AREA)
  • Technology Law (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Development Economics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses block packing, broadcasting method and system, equipment and storage mediums, belong to block chain technical field.After the first block chain link point receives the first block, the first block of record and the first block of transmission are to the node of the first block chain node;The first block chain node is detected with the presence or absence of the first block;If it exists, then the first block is broadcasted at least one the second block chain node in addition to sending the first block to the node of the first block chain node, connecting with the first block chain node;If it does not exist, then it caches the second block and verifies, if being verified, broadcast the first block at least one the second block chain node in addition to sending the first block to the node of the first block chain node, connecting with the first block chain node;It is broadcasted for prior art kind block and occupies block chain network bandwidth resources, influence the stability of block chain network;The technical solution of the application can reduce block broadcast to the occupancy of block chain network bandwidth resources.

Description

Block packing, broadcasting method and system, equipment and storage medium
Technical field
The present invention relates to block chain technical fields more particularly to block to be packaged, broadcasting method and system, equipment and storage are situated between Matter.
Background technique
Which kind of common recognition algorithm no matter existing block chain project kind use, after the completion of block is packaged, be intended to carry out area Block broadcast, and the block content of block broadcast includes the transaction original information content in block head and block;And transaction content It relatively takes up space, then occupied space is bigger for including the block of more transactions.Such as complicated beauty of existing block chain project It joined trading group in the bottom block chain of chain33 framework and (be detailed in that application No. is 201810695527.9 Chinese invention is special Benefit application) concept.Trading group is that more transactions are assembled into a special transaction to be buffered in Mempool module, because of one The size of transaction at least 250 bytes, so for the trading group for containing more transactions, size is up to 500 bytes More than.So for including the block of multiple trading groups and more transactions, occupied space is bigger.
A block chain node in existing block chain project alternative can at most configure 25 block chain nodes of connection, This connection relationship when block is broadcasted, broadcast be block entire content, each block chain node may receive 25 The same block content come from different block chain node broadcasts, one includes the larger block of trading group by repeatedly wide It broadcasts, block occupied space is bigger, can undoubtedly occupy more block chain network bandwidth resources during block broadcast, can be into One step occupies block chain network bandwidth resources, influences the stability of block chain network.
Summary of the invention
1. technical problems to be solved by the inivention
In order to overcome the above technical problems, the present invention provides blocks to be packaged, broadcasting method and system, equipment and storage are situated between Matter.The occupancy to block chain network bandwidth resources can be reduced.
2. technical solution
To solve the above problems, technical solution provided by the invention are as follows:
In a first aspect, the present invention proposes a kind of block packaging method, comprising: by block head, the institute of at least one trading group There is the block size of sub- transaction and the first block to be packaged into the first block;Merkel's root vertex cryptographic Hash of the block head by All sub- transaction and digging mine transaction of at least one trading group are calculated.
Further improving is, first block further includes at least one transaction in addition to including at least one trading group, The method are as follows: the block of block head, at least one transaction, all sub- transaction of at least one trading group and the first block is big It is small to be packaged into the first block;Merkel's root vertex of the block head is by least one transaction, the institute of at least one trading group There is sub- transaction and dig mine transaction and is calculated.
Further improving is that first block further includes transaction counter;By block head, transaction counter, at least One trading group and the block size of the first block are packaged into the first block.
Further improving is, the block head includes being breathed out by father's block cryptographic Hash, timestamp and Merkel's root vertex Uncommon value construction is formed.
Further improving is, the trading group include son transaction number, every sub- trading signature, the transaction of every height and Its cryptographic Hash, the transaction fee of every height transaction.
Further improving is, as the block size SI > block size threshold value TH of the first block, by block head, transaction Organize identification list, the block size of the first block is packaged into the second block;Wherein, trading group identification list includes digging mine transaction, And it is enough the mark of unique identification trading group.
Further improving is, the trading group cryptographic Hash is the son transaction number and every height transaction Hash of trading group Value;The mark for being enough unique identification trading group includes: All Activity cryptographic Hash or part thereof byte in trading group, or transaction Any friendship in the ID number or title or trading group respectively traded in any trade cryptographic Hash or part thereof byte or trading group in group Easy ID number or title or trading group ID number, or transaction group name.
Second aspect, the present invention propose a kind of block broadcasting method, according to a kind of above-described block packaging method, fit For digging mine node, the first block of broadcast gives at least one the first block chain node for digging the connection of mine node.
Further improving is to judge whether block size SI≤block size threshold value TH of the first block is true;If so, It then broadcasts the first block and gives at least one the first block chain node for digging the connection of mine node;If it is not, then broadcast the second block to At least one the first block chain node being connect with digging mine node.
The third aspect, the present invention propose a kind of block broadcasting method, are suitable for non-digging mine node, according to above-described one Kind of block packaging method and a kind of above-described block broadcasting method, comprising: receive the in the first block chain link point After one block, the first block of record and the first block of transmission are to the node of the first block chain node;Detect the first block chain node With the presence or absence of the first block;If it exists, then the first block is broadcasted to except the first block of transmission is to the node of the first block chain node In addition, at least one the second block chain node being connect with the first block chain node;If it does not exist, then the second block is cached simultaneously Verifying is broadcasted the first block and is arrived in addition to the first block of transmission is to the node of the first block chain node, with the if being verified At least one second block chain node of one block chain node connection;Or,
After first block chain link point receives the second block, the second block of record and the second block of transmission are to the first block chain link The node of point, the first block chain node of detection whether there is the second block;If it exists, then the second block is broadcasted to except transmission second Block is given other than the node of the first block chain node, at least one the second block chain node connecting with the first block chain node; If it does not exist, then trading group identification list is compared with the transaction of the first block chain nodal cache;Judge the first block chain Whether node lacks the transaction in the second block trading group identification list;If so, to the second block is sent to the first block chain The node request of node includes the transaction in the second block trading group identification list lacked, with the first block chain node The transaction of the second block cached together, verifies the second block, if being verified, broadcasts the first block to except transmission first Block is given other than the node of the first block chain node, at least one the second block chain link connecting with the first block chain node Point;If it is not, then verifying the second block, if being verified, the first block is broadcasted to except the first block of transmission is to the first block chain Other than the node of node, at least one second block chain node for being connect with the first block chain node;Wherein, trading group identifies It include digging mine transaction and each trading group cryptographic Hash or its several byte in first block in list.
Further improving is, the node for recording the first block with the first block of transmission to the first block chain node, Further improvement is, comprising: record is enough the mark of the first block of unique identification;Record sends the first block to the first block chain The nodename of node;The second block of the record and the second block of transmission further change to the node of the first block chain node Into for, comprising: record is enough the mark of the second block of unique identification;Record sends the second block to the section of the first block chain node Point title.
Further improving is, the trading group include son transaction number, every sub- trading signature, the transaction of every height and Its cryptographic Hash, the transaction fee of every height transaction.
Further improving is, the trading group cryptographic Hash is the son transaction number and every height transaction Hash of trading group Value.
Further improving is, first block further includes at least one transaction, the transaction in addition to including trading group It include digging mine transaction, and be enough the mark of unique identification trading group in group identification list, it is sufficient to the mark of unique identification transaction.
Further improving is, described to include to the node request of the first block chain node to the second block of transmission Before the transaction in the second block trading group identification list lacked, judge the first block chain node lack the second block hand over After transaction easily in group identification list, comprising: judge whether transaction missing quantity is more than transaction missing accounting threshold value TR-TH; If so, being cached to the second block is sent to the transaction of entire second block of node request of the first block chain node First block chain node verifies the second block, if being verified, broadcasts the first block to except the first block of transmission is to the firstth area Other than the node of block chain node, at least one second block chain node for being connect with the first block chain node;If it is not, then to hair The transaction in the second block trading group identification list for sending the second block to lack to the node request of the first block chain node, It is cached to the first block chain node, together with the transaction of the second block cached with the first block chain node, verifies the second block, If being verified, broadcast the first block to except send the first block to the node of the first block chain node in addition to, with the firstth area At least one second block chain node of block chain node connection.
Further improving is, described to lack to the node request of the first block chain node to sending the second block Transaction in second block trading group identification list is cached to the first block chain node, has cached with the first block chain node The transaction of second block together, verifies the second block;If verifying does not pass through, to the second block of transmission to the first block chain node Entire second block of node request transaction, be cached to the first block chain node, verify the second block;If verifying is logical Cross, then broadcast the first block to except send the first block to the node of the first block chain node in addition to, with the first block chain node At least one second block chain node of connection;If verifying does not pass through, do not deal with.
Further improving is, is suitable for the non-digging mine node of block chain, and a kind of block according to claim 10 is wide Broadcasting method, comprising: receiving module for the first block of reception or the second block, or is received from the second block is sent to the firstth area The transaction and/or trading group that the node of block chain node is sent;Block judgment module, for detect the first block chain node be It is no there are the first block or the second block;It is also used to judge whether the first block chain node lacks the second block transaction received Transaction in group identification list;Request module, for the node request to the second block of transmission to the first block chain node It include the transaction and/or trading group in the second block trading group identification list lacked;Authentication module is for verifying the firstth area Block or the second block;Broadcast module, for broadcast the first block or the second block arrive except the first block of transmission or the second block to Other than the node of first block chain node, at least one the second block chain node being connect with the first block chain node, and use In transmission transaction and/or trading group.
Further improving is, when the block chain node is to generate the digging mine node of the first block or the second block, Further include: block packetization module is used for a kind of block packaging method according to claim 1, is packed into the first block, Or, the second block;After block packetization module is packed into the first block, block judgment module is also used to judge the first block Block size SI and block size threshold value TH between relationship, so as to determine the need for be packaged the second block.
Further improve be further include cache module, for caching the first block or the second block and its transaction, and/ Or trading group.
Further improve be further include logging modle, for record the first block and send the first block to the firstth area The node of block chain node;Or, the second block of record and the second block of transmission are to the node of the first block chain node.
Further improving is, the block judgment module is also used to judge whether transaction missing quantity is more than transaction missing Accounting threshold value TR-TH.
Fourth aspect, the present invention propose that a kind of equipment, the equipment include: one or more processors;Memory is used for One or more programs are stored, when one or more of programs are executed by one or more of processors, so that described One or more processors execute method as described above.
5th aspect, the present invention propose a kind of storage medium for being stored with computer program, which is executed by processor Method of the Shi Shixian as described in any of the above item.
3. beneficial effect
Using technical solution provided by the invention, compared with prior art, have the following beneficial effects:
It is broadcasted for prior art kind block and occupies block chain network bandwidth resources, influence the stability of block chain network; The technical solution of the application can reduce block broadcast to the occupancy of block chain network bandwidth resources, provide the steady of block chain network It is qualitative.
Detailed description of the invention
Fig. 1 is the broadcasting method flow chart for the block containing trading group that embodiment 2 provides.
Fig. 2 is the Merkel's State Tree schematic diagram for the block containing trading group that embodiment 1 provides.
Fig. 3 is the broadcasting method flow chart for the block containing trading group that embodiment 2 provides.
Fig. 4 is the flow chart for the preferred embodiment that Fig. 3 is provided.
Fig. 5 is the flow chart that a preferred embodiment of Fig. 1 provides.
Fig. 6 is the flow chart that a preferred embodiment of Fig. 5 provides.
Fig. 7 is a kind of structural schematic diagram for block broadcast system that embodiment 4 provides.
Fig. 8 is the structural schematic diagram that Fig. 7 first preferred embodiment provides.
Fig. 9 is the structural schematic diagram that the second preferred embodiment of Fig. 7 provides.
Figure 10 is the structural schematic diagram that Fig. 7 third preferred embodiment provides.
Figure 11 is a kind of device structure schematic diagram of the invention.
Specific embodiment
To further appreciate that the contents of the present invention, in conjunction with accompanying drawings and embodiments, the present invention is described in detail.
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The specific embodiment stated is used only for explaining related invention, rather than the restriction to the invention.It also should be noted that in order to Convenient for description, part relevant to invention is illustrated only in attached drawing.
Heretofore described first, second equal words are convenient and be arranged in order to describe technical solution of the present invention, and There is no specific restriction effect, be to refer to, restriction effect is not constituted to technical solution of the present invention.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Embodiment 1
The present embodiment proposes a kind of block packaging method containing trading group, comprising:
The block size of block head, all sub- transaction of at least one trading group and the first block is packaged into the firstth area Block;Merkel's root vertex cryptographic Hash of the block head is calculated by all sub- transaction and digging mine transaction of at least one trading group It obtains.The trading group includes that son transaction number, every sub- trading signature, the transaction of every height and its cryptographic Hash, every height are handed over Easy transaction fee.
For shown in the following code of content of each son transaction and trading group itself in trading group:
In view of existing block chain project is when carrying out packing block using technical solution described in the present embodiment, for as far as possible The transformation constructed to existing block chain project is reduced, on the basis of existing block chain project, first block further includes handing over Easy counter;The block size of block head, transaction counter, at least one trading group and the first block is packaged into the firstth area Block.
First block further includes at least one transaction, the method in addition to including at least one trading group are as follows:
By block head, the block size of at least one transaction, all sub- transaction and the first block of at least one trading group It is packaged into the first block;Merkel's root vertex of the block head by least one transaction, at least one trading group it is all Son transaction and digging mine transaction are calculated, R1 as shown in Figure 2.
Wherein the block head includes being constructed to be formed by the cryptographic Hash of father's block cryptographic Hash, timestamp and Merkel's tree root; The leaf node of the Merkel tree is transaction or the son transaction of trading group, as illustrated in fig. 2, it is assumed that being the area of a certain block height Merkel's State Tree of block, then, L1 is a transaction, and L2, L3, L4, L5, L6, L7 and L8 are a friendship containing 7 transactions Easy group;R1 is Merkel's root vertex.
Further include the block size of the first block in first block in addition to comprising the block head, includes transaction L1, to hand over The trading group of easy L2, L3, L4, L5, L6, L7 and L8.
For the block size for being further reduced broadcast, it is further reduced the occupancy to block chain network bandwidth, to the firstth area Block is further transformed, as the block size SI > block size threshold value TH of the first block, by block head, trading group identity column Table, the first block block size be packaged into the second block;Wherein, the trading group identification list includes digging mine transaction, and It is enough the mark of unique identification trading group, is enough the mark of unique identification transaction.
In view of the atomicity and globality of a trading group, on any one block chain node or receive in trading group It the content of All Activity or can not receive;Because trading group is broadcasted as a whole, as long as therefore in record trading group Any transaction cryptographic Hash, can unique identification go out the trading group.
In a determining block chain project, because the transmitting-receiving address of each transaction and transaction content etc. are different, institute There is the characteristic of unique identification transaction with cryptographic Hash of trading.Transaction ID number is analogous to the ID card No. that Chinese citizen uses, In one determining block chain project, Transaction Name can also be with one transaction of unique identification, but does not represent all block chain items Mesh is all, should be depending on concrete application scene in this method actual application.
The partial bytes for cryptographic Hash of trading: assuming that F (x) is the function for taking partial bytes to transaction cryptographic Hash, then function F (x), by taking F (Hash-Tm) as an example, the effect of realization is, to the cryptographic Hash Hash-Tm of transaction Tm, to take its preceding the 1-5 byte, 1-5 byte or the 1-5, middle position byte afterwards are also possible to intermediate 9 bytes, alternatively, 9, end byte, or Person, preceding 9 bytes, but no matter how value, can guarantee to be enough the cryptographic Hash Hash- that unique identification goes out the transaction Tm Tm, and then be enough to identify trading group, to further decrease the size of block broadcast.
The trading group cryptographic Hash is the son transaction number and every height transaction cryptographic Hash of trading group;The trading group Hash It is worth the son transaction number and every height transaction several bytes of cryptographic Hash that several bytes are trading group.It for example is before trading cryptographic Hash 5 bytes or preceding 8 bytes or rear 8 bytes or rear 5 bytes or the 1st, 3,5,7,8 and 9 byte etc., take in a word Several bytes for cryptographic Hash of trading, to further decrease the size of the second block.Several bytes of trading group cryptographic Hash, refer to Several bytes of every height transaction cryptographic Hash in trading group, for example be every height transaction first 5 of cryptographic Hash in trading group Byte or preceding 8 bytes or rear 8 bytes or rear 5 bytes or the 1st, 3,5,7,8 and 9 byte etc., are to take son in a word Several bytes for cryptographic Hash of trading, to further decrease the size of the second block containing trading group.
When the block size SI for the first block for including L1, L2, L3, L4, L5, L6, L7 and L8 is big less than or equal to block It further include the block size of the first block in the second block in addition to comprising the block head when small threshold value TH, L1 cryptographic Hash of trading Several bytes, several bytes of trading group cryptographic Hash, i.e., transaction L1, L2, L3, L4, L5, L6, L7 and L8 cryptographic Hash it is several Byte, transaction number (the son transaction number in trading group).
When what is saved in trading group identification list is each trading group cryptographic Hash and each transaction Hash in the first block When value, for Minertx to dig mine transaction, Hash-Minertx is to dig mine transaction cryptographic Hash;Tra1 is any pen in the first block Transaction, Hash-Tra1 are corresponding transaction cryptographic Hash;GTra is that any one trading group in the first block includes as shown in table 1 Trade Tx1, Tx2, Tx3,, Txn, Hash-Tx1, Hash-Tx2, Hash-Tx3,, Hash-Txn be corresponding transaction cryptographic Hash, As shown in table 2.
1 trading group GTra content of table
Trading group identification list of the table 2 containing transaction cryptographic Hash
Trading group identification list of the table 3 containing transaction several bytes of cryptographic Hash
When saved in trading group identification list be several bytes of each trading group cryptographic Hash in the first block and it is each When several bytes of cryptographic Hash of trading, as shown in table 3, for example function F (x) from trading group cryptographic Hash for realizing taking several bytes Effect, which byte specifically taken, can be determined according to actual needs;Because digging outside the digging mine node of mine transaction Except block chain, Other non-digging mine nodes are traded there is no mine is dug, so the whether transaction Hash value list containing transaction cryptographic Hash in table 2, Or the transaction Hash value list containing transaction several bytes of cryptographic Hash in table 3, it is necessary to be dug in mine transaction comprising complete Appearance and its cryptographic Hash.
Embodiment 2
The present embodiment proposes a kind of block broadcasting method, according to a kind of block described in technical solution any in embodiment 1 Packaging method, digging mine node or block suitable for block are packaged node, and the first block of broadcast, which gives, digs the connection of mine node extremely A few first block chain node.
For the block size for being further reduced broadcast, it is further reduced the occupancy to block chain network bandwidth, is digging mine section Point judges block size SI≤block size threshold value TH of the first block to the first block is further transformed before block broadcast It is whether true;
If so, the first block of broadcast gives at least one the first block chain node for digging the connection of mine node;
If it is not, then broadcasting the second block gives at least one the first block chain node for digging the connection of mine node.
A kind of block broadcasting method for being suitable for digging mine node that the present embodiment proposes, implementation method includes following two, First method, as shown in figure 3, digging a kind of mine node block packaging method according to technical solution any in embodiment 1 After being packaged the first block or the second block, judge whether block size SI≤block size threshold value TH of the first block is true;
If so, the first block of broadcast gives at least one the first block chain node for digging the connection of mine node;
If it is not, then broadcasting the second block gives at least one the first block chain node for digging the connection of mine node.
Second method can also be to be further reduced to the occupancy for digging itself computing resource of mine node such as Fig. 4 institute Show:
Dig a kind of mine node first block of block packaging method packing according to technical solution any in embodiment 1 Afterwards, judge whether block size SI≤block size threshold value TH of the first block is true;
If so, the first block of broadcast gives at least one the first block chain node for digging the connection of mine node;
If it is not, then a kind of block packaging method according to technical solution any in embodiment 1 is packaged the second block, extensively It broadcasts the second block and gives at least one the first block chain node for digging the connection of mine node.
Correspondingly, the present embodiment also proposes a kind of block broadcasting method, suitable for the non-digging mine node of block chain, root According to a kind of block packaging method described in any one of embodiment 1 technical solution, and according to a kind of above-described block broadcast Method, as shown in Figure 1, comprising:
S101, the first block chain link point receive the first block;
The node of S102, the first block of record and the first block of transmission to the first block chain node;
S103, the first block chain node of detection whether there is the first block;
If it exists, then S104, broadcast the first block arrive except transmission the first block to the node of the first block chain node in addition to, At least one the second block chain node being connect with the first block chain node;
If it does not exist, then S105, caching and verify the second block;
S106, verify whether to pass through?
It is then to execute S104;It is no, then S107, do not deal with, or to send the first block to the first block chain node section Point sends the message that the first block is not verified.
Wherein, the first block of the record and the first block of transmission are further improved to the node of the first block chain node For, comprising: record is enough the mark of the first block of unique identification;Record sends the first block to the node of the first block chain node Title.
The block height for being identified as the first block for being enough the first block of unique identification or block cryptographic Hash or area The partial bytes of block cryptographic Hash or the digging mine of the first block transaction cryptographic Hash are dug the partial bytes of mine transaction cryptographic Hash or are dug Mine transaction id digs mine Transaction Name.
Or, as shown in figure 5,
S201, the first block chain link point receive the second block;
The node of S202, the second block of record and the second block of transmission to the first block chain node;
S203, the first block chain node of detection whether there is the second block;
If it exists, then S204, the second block of broadcast are given in addition to sending the second block to the node of the first block chain node, At least one the second block chain node being connect with the first block chain node;
If it does not exist, then S205, trading group identification list is compared with the transaction of the first block chain nodal cache;
S206, judge whether the first block chain node lacks the transaction in the second block trading group identification list;
If so, S207, to the second block is sent to the node request of the first block chain node including to lack Transaction in second block trading group identification list, together with the transaction of the second block cached with the first block chain node;
S208, the second block of verifying, if being verified;Then follow the steps S204;
If it is not, thening follow the steps S208 and S204;
Wherein, the second block of the record and the second block of transmission are further improved to the node of the first block chain node For, comprising: record is enough the mark of the second block of unique identification;Record sends the second block to the node of the first block chain node Title.
It include digging mine transaction, and be enough the mark of unique identification trading group, and be enough unique in trading group identification list Identify the mark of transaction.
The block height for being identified as the second block for being enough the second block of unique identification or block cryptographic Hash or area The partial bytes of block cryptographic Hash or the digging mine of the second block transaction cryptographic Hash are dug the partial bytes of mine transaction cryptographic Hash or are dug Mine transaction id digs mine Transaction Name.
For POW common recognition algorithm, when the block height of the second block is as the mark for being enough the second block of unique identification, and Unreliable, because of the characteristic of POW, all digging mine nodes both participate in digging mine, are packaged block, and same block height might have multiple areas Block exists, and finally remain block as the block height is that difficulty in computation is maximum.But those are not retained Block can also be broadcasted in block chain network, then block height can not distinguish them at this time.But for POS, DPOS etc. knows together algorithm there is no this problem, and the block height that the second block can be used, which is used as, is enough the secondth area of unique identification The mark of block.
Block cryptographic Hash is uniquely that the partial bytes of block cryptographic Hash are then the cryptographic Hash such as to block BLOCK256 Hash-BLOCK256 takes its preceding the 1-5 byte, rear 1-5 byte or the 1-5, middle position byte, can also be with It is intermediate 9 bytes, alternatively, 9, end byte, alternatively, preceding 9 bytes, is indicated with function F (x), then F (Hash- BLOCK256) be block cryptographic Hash partial bytes, but no matter how value, can guarantee that being enough unique identification goes out the area The cryptographic Hash Hash-BLOCK256 of block BLOCK256.
The digging mine transaction cryptographic Hash of second block digs the partial bytes of mine transaction cryptographic Hash or digs mine transaction id or dig Mine Transaction Name.It digs mine transaction to certainly exist in a block and only one, trades cryptographic Hash as being enough only to dig mine The mark of one the second block of identification, undoubtedly, the partial bytes for digging mine transaction cryptographic Hash are analogous to the part of block cryptographic Hash Byte and feasible, when digging mine transaction id, when to dig mine Transaction Name be unique in a determining block chain network, That is a transaction corresponds to a Transaction Name, and an ID when one-to-one relationship, digs mine transaction id, it is also equal to dig mine Transaction Name It can be used as and be enough the mark that unique identification goes out the block BLOCK256.
Judge that the second block chain node with the presence or absence of the second block includes: to inquire the mode that whether there is of the second block to have very A variety of, the present embodiment is by being enough the mark of the second block of unique identification, including carries out inquiry contrast judgement, such as block Hash Value, or retrodicted according to function F (x), cryptographic Hash that the partial bytes through block cryptographic Hash differentiate or the corresponding digging mine of block is traded, Or the partial bytes of mine transaction cryptographic Hash are dug, or dig mine transaction id, dig mine Transaction Name.Other can also be used in practical application Mode judges.
The trading group include as described in a kind of embodiment son transaction number, every sub- trading signature, the transaction of every height and Its cryptographic Hash, the transaction fee of every height transaction.The trading group cryptographic Hash is the son transaction number and the transaction of every height of trading group Cryptographic Hash.Several bytes of trading group cryptographic Hash are the son transaction number and every height transaction several words of cryptographic Hash of trading group Section.
First block further includes at least one transaction, wraps in the trading group identification list in addition to including trading group It includes and digs mine transaction, and be enough the mark of unique identification trading group, and be enough the mark of unique identification transaction.
It to the second block is sent to the node request of the first block chain node include to lack as shown in fig. 6, described The second block trading group identification list in transaction before, judging that the first block chain node lacks the second block trading group After transaction in identification list, comprising:
S301, judge whether transaction missing quantity is more than transaction missing accounting threshold value TR-TH;
If so, S302, to send the second block to the first block chain node entire second block of node request Transaction, be cached to the first block chain node;
S303, the second block of verifying;
S304, verify whether to pass through?
If being verified, S305, the second block of broadcast are to except the second block of transmission is to the node of the first block chain node In addition, at least one the second block chain node being connect with the first block chain node;If verifying does not pass through, S306, do not make Processing, and/or the unacceptable message of the second block verifying is sent to node of second block to the first block chain node is sent;
If it is not, then S307, to sending the secondth area for lacking to the node request of the first block chain node of the second block Transaction in block trading group identification list is cached to the first block chain node, the secondth area cached with the first block chain node The transaction of block is together;Execute step S303, S304, S305 and S306.
The step S307, the secondth area lacked to the second block of transmission to the node request of the first block chain node Transaction in block trading group identification list is cached to the first block chain node, the secondth area cached with the first block chain node The transaction of block together, verifies the second block;
If verifying does not pass through, to the second block of transmission to entire secondth area of node request of the first block chain node The transaction of block is cached to the first block chain node, executes step S303, S304, S305 and S306.
Embodiment 3
A kind of block broadcast system is packaged node suitable for the digging mine node of block chain, non-digging mine node and/or non-beats Packet node, as shown in fig. 7, a kind of block broadcasting method according to any technical solution of embodiment 1, comprising:
Receiving module for the first block of reception or the second block, or is received from the second block is sent to the first block chain The transaction and/or trading group that the node of node is sent;
Block judgment module whether there is the first block or the second block for detecting the first block chain node;
It is also used to judge whether the first block chain node lacks the transaction in the second block trading group identification list received;
Request module, for including to lack to the second block is sent to the node request of the first block chain node Transaction and/or trading group in second block trading group identification list;
Authentication module is for verifying the first block or the second block;
Broadcast module is arrived for broadcasting the first block or the second block except the first block of transmission or the second block are to the firstth area Other than the node of block chain node, at least one the second block chain node being connect with the first block chain node, and for sending Transaction and/or trading group.
As shown in figure 8, also being wrapped when the block chain node is to generate the digging mine node of the first block or the second block It includes:
Block packetization module is used for a kind of block packaging method according to claim 1, is packed into the firstth area Block, or, the second block;
After block packetization module is packed into the first block, block judgment module is also used to judge the area of the first block Relationship between block size SI and block size threshold value TH, to determine the need for being packaged the second block.
As shown in figure 9, further improve be further include cache module, for cache the first block or the second block and It is traded and/or trading group.
It as shown in Figure 10, further include logging modle, for recording the first block and sending the first block to the first block chain The node of node;Or, the second block of record and the second block of transmission are to the node of the first block chain node.Recording method is the same as implementation Described in example 2 or embodiment 4.
The block judgment module is also used to judge whether transaction missing quantity is more than transaction missing accounting threshold value TR-TH.
Embodiment 4
Hangzhou complexity 33 public affairs chain --- Chain33 of U.S., have the characteristics that the core technology of low delay, high concurrent, are further Improve public chain Chain33 performance, it is proposed that a kind of block packaging method, a kind of block broadcasting method and its corresponding system are fitted For the digging mine node of Chain33, i.e. block is packaged node, because of the compatible a variety of blocks common recognition algorithms of Chain33, but no matter adopts With which kind of common recognition algorithm, the packing and broadcast of block are all referred to, for the technical solution that the present embodiment proposes, is not known together The restriction of algorithm can promote the use of.
Node W1, W2, W3 are any three diggings mine nodes on public chain Chain33, node M 1, M2, M3,, M26 be public Any 26 non-digging mine nodes on chain Chain33, these three dig between mine node and non-digging mine node and interconnect.
GTx1, GTx2, GT3, GTx4 and GTx5 are five trading groups in the block that block height is 367, wherein transaction Group GTx1 include 9 transaction Tx11, Tx12, Tx13, Tx14,, Tx18;Trading group GTx2 include 8 transaction Tx21, Tx22, Tx23,Tx24,,,Tx29;Trading group GTx3 include 15 transaction Tx31, Tx32, Tx33, Tx34,, Tx315;Trading group GTx4 Including 20 transaction Tx41, Tx42, Tx43, Tx44,, Tx420;Trading group GTx5 include 17 transaction Tx51, Tx52, Tx53, Tx54,,,Tx517;Transaction Tx1, Tx2, Tx3, Tx4,, Tx8 be 8 transactions in block that block height is 367.
For digging mine node W1, the block packaging method for illustrating that block height is 367 is as follows: being 366 by block height Block cryptographic Hash, the cryptographic Hash of timestamp and Merkel's tree root constructs to form block head;The wherein construction of Merkel tree such as Fig. 2 It is shown, by include in trading group GTx1, GTx2, GT3, GTx4 and GTx5 son transaction, dig mine transaction MiW1 and transaction Tx1, Tx2, Tx3, Tx4,, Tx8 as leaf node calculate the cryptographic Hash of Merkel's tree root for constructing Merkel tree.
Then the institute that will include in block head, block size SI and trading group GTx1, GTx2, GT3, GTx4 and GTx5 There are sub- transaction, transaction number (the son transaction including trading group, dig the transaction in mine transaction and block) 78, each transaction (packet The son transaction for including trading group, digs the transaction in mine transaction and block) signature, each transaction and its cryptographic Hash, each transaction Transaction fee is packaged into the first block.
Assuming that broadcast block size threshold value TH be set as 100M, when block size SI be greater than 100M when, to the first block into Row transformation, construct the second block, the second block include the block head of the first block, further include block size SI, transaction number 78, Trading group identification list, containing transaction cryptographic Hash transaction Hash value list i.e.: dig mine trade cryptographic Hash Hash-MiW1, transaction Group cryptographic Hash Hash-GTx1, Hash-GTx2, Hash-GT3, Hash-GTx4 and Hash-GTx5 correspond to every height transaction Cryptographic Hash, i.e. trading group cryptographic Hash Hash-GTx1 include Hash-Tx11, Hash-Tx12, Hash-Tx13, Hash-Tx14,, Hash-Tx18;Trading group cryptographic Hash Hash-GTx2 includes 8 transaction cryptographic Hash Hash-Tx21, Hash-Tx22, Hash- Tx23,Hash-Tx24,,,Hash-Tx29;Trading group cryptographic Hash Hash-GTx3 includes 15 transaction Hash-Tx31, Hash- Tx32,Hash-Tx33,Hash-Tx34,,,Hash-Tx315;Trading group cryptographic Hash Hash-GTx4 includes 20 transaction Hash- Tx41,Hash-Tx42,Hash-Tx43,Hash-Tx44,,,Hash-Tx420;Trading group cryptographic Hash Hash-GTx5 includes 17 Trade Hash-Tx51, Hash-Tx52, Hash-Tx53, Hash-Tx54,, Hash-Tx517;Transaction cryptographic Hash Hash-Tx1, Hash-Tx2、Hash-Tx3、Hash-Tx4、、、Hash-Tx8。
It digs the first block that mine node W1 is 367 to block height to broadcast, the first block of broadcast, which gives, digs mine node The digging mine node W2 and W3 and node M 1 of W1 connection, M2, M3,, M26.These nodes (this sentences node M 3 to illustrate) are received After the first block for being 367 to block height, records the first block cryptographic Hash and dig mine node W1;Because this is block height After degree is packaged for 367 the first block by digging mine node W1, it is broadcast to other nodes for the first time, so in node M 3 certainly not There are the blocks;So node M 3 is cached and the block and is verified, and if the verification passes, node M 3 is by that block height is 367 One block is broadcast to other block chain nodes connecting in addition to digging mine node W1 with node M 3, for example, digging mine node M 2, M3; Node M 1, M2, M4,, M26.If verifying does not pass through, do not deal with, or send block height to mine node W1 is dug as 367 The message that first block is not verified.
Assuming that node M 2 is having received the firstth area that digging mine node W1 transmission block height is 367 with the same time of node M 3 Block, and be verified;At this point, block M2, which is received, digs the block that mine node W1 is sent again, the block cryptographic Hash, Yi Jijie are recorded Point M3;Node M 2 detects the existing block, then the block is broadcast in addition to digging mine node W1 and node M 3, with node The node of M2 connection.
For the size for further decreasing broadcast block, trading group identification list is transformed, trading group identification list is protected When what is deposited is several bytes of each trading group cryptographic Hash in the first block and several bytes of each transaction cryptographic Hash, similar table 3 It is shown, for example which byte function F (x) specifically take for realizing the effect for taking several bytes from trading group cryptographic Hash, it can It determines according to actual needs;Because digging outside the digging mine node of mine transaction Except block chain, other non-digging mine nodes are handed over there is no mine is dug Easily, no matter so the transaction Hash value list containing transaction cryptographic Hash, or the transaction containing transaction several bytes of cryptographic Hash are breathed out Uncommon value list, it is necessary to dig mine transaction content and its cryptographic Hash comprising complete.
Containing transaction several bytes of cryptographic Hash transaction Hash value list i.e.: dig mine trade cryptographic Hash Hash-MiW1, transaction Group cryptographic Hash F (Hash-GTx1), F (Hash-GTx2), F (Hash-GT3), F (Hash-GTx4) and F (Hash-GTx5), it is corresponding For every height transaction cryptographic Hash, i.e. trading group cryptographic Hash F (Hash-GTx1) include F (Hash-Tx11), F (Hash-Tx12), F(Hash-Tx13),F(Hash-Tx14),,,F(Hash-Tx18);Trading group cryptographic Hash F (Hash-GTx2) includes 8 transactions Cryptographic Hash F (Hash-Tx21), F (Hash-Tx22), F (Hash-Tx23), F (Hash-Tx24),, F (Hash-Tx29);Transaction Group cryptographic Hash F (Hash-GTx3) includes 15 transaction F (Hash-Tx31), F (Hash-Tx32), F (Hash-Tx33), F (Hash-Tx34),,,F(Hash-Tx315);(Hash-GTx4 includes 20 transaction F (Hash-Tx41), F to trading group cryptographic Hash F (Hash-Tx42),F(Hash-Tx43),F(Hash-Tx44),,,F(Hash-Tx420);Trading group cryptographic Hash F (Hash- GTx5) include 17 transaction F (Hash-Tx51), F (Hash-Tx52), F (Hash-Tx53), F (Hash-Tx54),, F (Hash-Tx517);Trade cryptographic Hash F (Hash-Tx1), F (Hash-Tx2), F (Hash-Tx3), F (Hash-Tx4),, F (Hash-Tx8)。
The repeated broadcast of block in order to prevent is dug the second block that mine node W1 is 367 to block height and is broadcasted, extensively Broadcast the second block give dig mine node W1 connection digging mine node W2 and W3 and node M 1, M2, M3,, M26.These nodes After (this sentences node M 3 to illustrate) receives the second block that block height is 367, records the second block cryptographic Hash and dig mine Node W1;Because this is after the second block that block height is 367 is packaged by digging mine node W1, to be broadcast to other sections for the first time Point, so the block is not present in node M 3 certainly;So node M 3 caches the block.Divide 2 kinds of situation explanations.
One, what is broadcasted is the second block of the transaction Hash value list containing transaction cryptographic Hash
Node M 3 judges whether to lack the transaction in the transaction Hash value list containing transaction cryptographic Hash;If not, The second block is then verified, if being verified, to other second blocks of node broadcasts in addition to digging mine node W1;If verifying obstructed It crosses, does not deal with, or send the message that the second block that block height is 367 is not verified to mine node W1 is dug.
If node M 3 judges to lack the transaction in the transaction Hash value list containing transaction cryptographic Hash;Assuming that transaction Lacking accounting threshold value TR-TH is 3/4, and there are two kinds of situations to need to illustrate respectively again herein:
The first situation, if lacking trading group GTx5 in node M 3, and transaction Tx1-Tx5, i.e. transaction lacks quantity Accounting 0.28 is not above transaction missing accounting threshold value 3/4, to the trading group for digging the second block that mine node W1 acquisition lacks GTx5, and transaction Tx1-Tx5, are cached in node M 3, repeat the above process and verified.In this case if verifying Not over, then the Transaction Information content of entire second block is obtained to digging mine node W1, is cached in node M 3, it is repeatedly above-mentioned Process is verified.
Second situation, if lacking trading group GTx1-GTx4 in node M 3, and transaction Tx1-Tx8, i.e. transaction lacks Quantity accounting 0.77 is more than that transaction lacks accounting threshold value 3/4, in the Transaction Information for obtaining entire second block to digging mine node W1 Hold, is cached in node M 3, repeats the above process and verified.
Two, when broadcast be containing transaction Hash value part or several bytes transaction Hash value list the second block, So with the above process the difference is that, judge node M 3 whether lack the second block transaction Hash value list in listed transaction When, it needs according to the rule of function F (x) to institute in the local transaction cryptographic Hash of node M 3 and the second block transaction Hash value list Column transaction is compared, to judge whether node M 3 lacks transaction listed in the second block.
Assuming that node M 2 is having received the secondth area that digging mine node W1 transmission block height is 367 with the same time of node M 3 Block, and be verified;At this point, block M2, which is received, digs the block that mine node W1 is sent again, the block cryptographic Hash, Yi Jijie are recorded Point M3;Node M 2 detects the existing block, then the block is broadcast in addition to digging mine node W1 and node M 3, with node The node of M2 connection.
Embodiment 5
A kind of equipment, the equipment include: one or more processors;Memory, for storing one or more programs, When one or more of programs are executed by one or more of processors, so that one or more of processors execute Method as described above.
A kind of storage medium being stored with computer program realizes such as above embodiments 1 when the program is executed by processor The method.
Fig. 5 is a kind of structural schematic diagram for equipment that one embodiment of the invention provides.
As shown in figure 5, present invention also provides a kind of equipment 500, including one or more centres as on the other hand Unit (CPU) 501 is managed, can be added according to the program being stored in read-only memory (ROM) 502 or from storage section 508 The program that is downloaded in random access storage device (RAM) 503 and execute various movements appropriate and processing.In RAM503, also deposit It contains equipment 500 and operates required various programs and data.CPU501, ROM502 and RAM503 pass through the phase each other of bus 504 Even.Input/output (I/O) interface 505 is also connected to bus 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, according to disclosed embodiments, the method for any of the above-described embodiment description may be implemented as counting Calculation machine software program.For example, disclosed embodiments include a kind of computer program product comprising be tangibly embodied in Computer program on machine readable media, the computer program include the method for executing any of the above-described embodiment description Program code.In such embodiments, which can be downloaded and be pacified from network by communications portion 509 Dress, and/or be mounted from detachable media 511.
As another aspect, present invention also provides a kind of computer readable storage medium, the computer-readable storage mediums Matter can be computer readable storage medium included in the device of above-described embodiment;It is also possible to individualism, it is unassembled Enter the computer readable storage medium in equipment.Computer-readable recording medium storage has one or more than one program, should Program is used to execute by one or more than one processor is described in the present processes.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, this is depending on related function.Also it wants It is noted that the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart, Ke Yitong The dedicated hardware based system of functions or operations as defined in executing is crossed to realize, or by specialized hardware and can be calculated The combination of machine instruction is realized.
Being described in the embodiment of the present application involved unit or module can be realized by way of software, can also be with It is realized by way of hardware.Described unit or module also can be set in the processor, for example, each unit can To be the software program being arranged in computer or intelligent movable equipment, it is also possible to the hardware device being separately configured.Wherein, this The title of a little units or module does not constitute the restriction to the unit or module itself under certain conditions.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from the application design, appointed by above-mentioned technical characteristic or its equivalent feature Other technical solutions of meaning combination and formation.Such as features described above and (but being not limited to) disclosed herein have similar functions Technical characteristic replaced mutually and the technical solution that is formed.

Claims (23)

1. a kind of block packaging method characterized by comprising
The block size of block head, all sub- transaction of at least one trading group and the first block is packaged into the first block;Institute The Merkel's root vertex cryptographic Hash for stating block head is calculated by all sub- transaction and digging mine transaction of at least one trading group.
2. the method according to claim 1, wherein first block except include at least one trading group in addition to, It further include at least one transaction, the method are as follows:
The block size of block head, at least one transaction, all sub- transaction of at least one trading group and the first block is packaged At the first block;Merkel's root vertex of the block head is by least one transaction, all sub- friendships of at least one trading group Easily it is calculated with digging mine transaction.
3. method according to claim 1 or 2, which is characterized in that first block further includes transaction counter;By area Build, transaction counter, at least one trading group and the first block block size be packaged into the first block.
4. method according to claim 1 or 2, which is characterized in that the block head includes by father's block cryptographic Hash, time Stamp and Merkel's root vertex cryptographic Hash construct to be formed.
5. the method according to claim 1, wherein the trading group includes son transaction number, the friendship of every height The easily transaction fee of signature, the transaction of every height and its cryptographic Hash, the transaction of every height.
6. according to the method described in claim 2, it is characterized in that, working as the block size SI > block size threshold value of the first block When TH, the block size of block head, trading group identification list, the first block is packaged into the second block;
Wherein, trading group identification list includes digging mine transaction, and be enough the mark of unique identification trading group.
7. according to the method described in claim 6, it is characterized in that, the mark for being enough unique identification trading group includes: to hand over Any transaction cryptographic Hash or part thereof byte in Yi Zuzhong All Activity cryptographic Hash or part thereof byte or trading group, or transaction The ID number or title or trading group ID number of any transaction in the ID number or title or trading group respectively traded in group, or transaction group name Claim.
8. a kind of block broadcasting method, which is characterized in that a kind of block packaging method according to claim 1 is suitable for Mine node is dug, the first block of broadcast gives at least one the first block chain node for digging the connection of mine node.
9. according to the method described in claim 8, it is characterized in that, judging block size SI≤block size threshold of the first block Whether value TH is true;
If so, the first block of broadcast gives at least one the first block chain node for digging the connection of mine node;
If it is not, then broadcasting the second block gives at least one the first block chain node for digging the connection of mine node.
10. a kind of block broadcasting method, which is characterized in that be suitable for non-digging mine node, a kind of area according to claim 1 Block packaging method and a kind of block broadcasting method according to claim 8, comprising:
After the first block chain link point receives the first block, the first block of record and the first block of transmission are to the first block chain The node of node;The first block chain node is detected with the presence or absence of the first block;
If it exists, then broadcast the first block to except send the first block to the node of the first block chain node in addition to, with the firstth area At least one second block chain node of block chain node connection;
If it does not exist, then cache the second block and verify, if being verified, broadcast the first block to except send the first block to Other than the node of first block chain node, at least one second block chain node for being connect with the first block chain node;
Or,
After first block chain link point receives the second block, the second block of record and the second block of transmission are to the first block chain node Node, the first block chain node of detection whether there is the second block;
If it exists, then broadcast the second block give except send the second block to the node of the first block chain node in addition to, with the firstth area At least one second block chain node of block chain node connection;
If it does not exist, then trading group identification list is compared with the transaction of the first block chain nodal cache;
Judge whether the first block chain node lacks the transaction in the second block trading group identification list;
If so, including that the second block lacked is handed over to the second block is sent to the node request of the first block chain node Transaction easily in group identification list, together with the transaction of the second block cached with the first block chain node, verifies the second block, If being verified, broadcast the first block to except send the first block to the node of the first block chain node in addition to, with the firstth area At least one second block chain node of block chain node connection;
If it is not, then verifying the second block, if being verified, the first block is broadcasted to except the first block of transmission is to the first block chain Other than the node of node, at least one second block chain node for being connect with the first block chain node;
Wherein, trading group identification list includes digging mine transaction, and be enough the mark of unique identification trading group.
11. according to the method described in claim 10, it is characterized in that, the first block of the record and sending the first block to the The node of one block chain node, is further improved and is, comprising: record is enough the mark of the first block of unique identification;Record is sent First block gives the nodename of the first block chain node;
The second block of the record and the second block is sent to the node of the first block chain node, be further improved and be, comprising: note Record is enough the mark of the second block of unique identification;Record sends the second block to the nodename of the first block chain node.
12. according to the method described in claim 10, it is characterized in that, the trading group includes son transaction number, every height The transaction fee of trading signature, the transaction of every height and its cryptographic Hash, the transaction of every height.
13. according to the method described in claim 10, it is characterized in that: the mark for being enough unique identification trading group includes: Any transaction cryptographic Hash or part thereof byte in All Activity cryptographic Hash or part thereof byte or trading group in trading group, or hand over The ID number or title or trading group ID number or trading group of any transaction in the ID number or title or trading group that Yi Zuzhong respectively trades Title.
14. according to the method described in claim 10, it is characterized in that, first block further includes in addition to including trading group At least one transaction, the trading group identification list include digging mine transaction, and be enough the mark of unique identification trading group, it is sufficient to The mark of unique identification transaction.
15. the described in any item methods of 0-14 according to claim 1, which is characterized in that it is described to send the second block to first Before the node request of block chain node includes the transaction in the second block trading group identification list lacked, judging After the first block chain node lacks the transaction in the second block trading group identification list out, comprising:
Judge whether transaction missing quantity is more than transaction missing accounting threshold value TR-TH;
If so, delaying to the second block is sent to the transaction of entire second block of node request of the first block chain node It is stored to the first block chain node, verifies the second block, if being verified, broadcast the first block and arrive except the first block of transmission is to the Other than the node of one block chain node, at least one second block chain node for being connect with the first block chain node;
If it is not, the second block trading group mark then lacked to the second block of transmission to the node request of the first block chain node Know the transaction in list, is cached to the first block chain node, the transaction one of the second block cached with the first block chain node It rises, verifies the second block, if being verified, broadcast the first block to except the first block of transmission is to the section of the first block chain node Other than point, at least one second block chain node for being connect with the first block chain node.
16. according to the method for claim 15, which is characterized in that it is described to send the second block to the first block chain node The second block trading group identification list for lacking of node request in transaction, the first block chain node is cached to, with The transaction for the second block that one block chain node has cached together, verifies the second block;
If verifying does not pass through, to sending the second block to node request entire second block of the first block chain node Transaction is cached to the first block chain node, verifies the second block;
If being verified, the first block is broadcasted in addition to sending the first block to the node of the first block chain node, with the At least one second block chain node of one block chain node connection;
If verifying does not pass through, do not deal with.
17. a kind of block broadcast system, which is characterized in that be suitable for the non-digging mine node of block chain, according to claim 10 A kind of block broadcasting method, comprising:
Receiving module for the first block of reception or the second block, or is received from the second block is sent to the first block chain node The node transaction and/or trading group that send;
Block judgment module whether there is the first block or the second block for detecting the first block chain node;
It is also used to judge whether the first block chain node lacks the transaction in the second block trading group identification list received;
Request module, for including second lacked to the second block is sent to the node request of the first block chain node Transaction and/or trading group in block trading group identification list;
Authentication module is for verifying the first block or the second block;
Broadcast module is arrived for broadcasting the first block or the second block except the first block of transmission or the second block are to the first block chain Other than the node of node, at least one the second block chain node being connect with the first block chain node, and for sending transaction, And/or trading group.
18. system according to claim 17, which is characterized in that when the block chain node is to generate the first block or the When the digging mine node of two blocks, further includes:
Block packetization module is used for a kind of block packaging method according to claim 1, is packed into the first block, or, Second block;
After block packetization module is packed into the first block, block judgment module is also used to judge that the block of the first block is big Relationship between small SI and block size threshold value TH, to determine the need for being packaged the second block.
19. system according to claim 17, which is characterized in that further include cache module, for cache the first block or Second block and its transaction and/or trading group.
20. system according to claim 17, which is characterized in that further include logging modle, be used for
It records the first block and sends the first block to the node of the first block chain node;Or,
It records the second block and sends the second block to the node of the first block chain node.
21. system according to claim 17, which is characterized in that the block judgment module is also used to judge transaction missing Whether quantity is more than transaction missing accounting threshold value TR-TH.
22. a kind of equipment, which is characterized in that the equipment includes:
One or more processors;
Memory, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors Execute the method as described in any one of claim 1-16.
23. a kind of storage medium for being stored with computer program, which is characterized in that realize when the program is executed by processor as weighed Benefit requires method described in any one of 1-16.
CN201910633127.XA 2019-07-15 2019-07-15 Block packing and broadcasting method and system, equipment and storage medium Active CN110336677B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910633127.XA CN110336677B (en) 2019-07-15 2019-07-15 Block packing and broadcasting method and system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910633127.XA CN110336677B (en) 2019-07-15 2019-07-15 Block packing and broadcasting method and system, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110336677A true CN110336677A (en) 2019-10-15
CN110336677B CN110336677B (en) 2022-02-11

Family

ID=68145019

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910633127.XA Active CN110336677B (en) 2019-07-15 2019-07-15 Block packing and broadcasting method and system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110336677B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110838924A (en) * 2019-11-19 2020-02-25 北京沃东天骏信息技术有限公司 Block transmission method and device
CN111638963A (en) * 2020-06-08 2020-09-08 杭州复杂美科技有限公司 Transaction pool dynamic control method, device and storage medium
WO2021240147A1 (en) * 2020-05-26 2021-12-02 The University Of Manchester Multispectral electro-optical ion-intercalated graphene electrochrome cells

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108182635A (en) * 2017-12-18 2018-06-19 深圳前海微众银行股份有限公司 Block chain common recognition method, system and computer readable storage medium
CN108234470A (en) * 2017-12-28 2018-06-29 江苏通付盾科技有限公司 Block packaging method and system, electronic equipment, storage medium in block chain network
CN109345388A (en) * 2018-09-20 2019-02-15 百度在线网络技术(北京)有限公司 Block chain intelligence contract verification method, device and storage medium
CN109474682A (en) * 2018-11-12 2019-03-15 杭州秘猿科技有限公司 A kind of block chain network transmission method, device and electronic equipment
CN109586934A (en) * 2018-12-27 2019-04-05 链极智能科技(上海)有限公司 A kind of block chain bottom-layer network transaction Synchronous fluorimetry method
WO2019093574A1 (en) * 2017-11-10 2019-05-16 부산대학교 산학협력단 Block chain system and method employing hash-based signature scheme

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019093574A1 (en) * 2017-11-10 2019-05-16 부산대학교 산학협력단 Block chain system and method employing hash-based signature scheme
CN108182635A (en) * 2017-12-18 2018-06-19 深圳前海微众银行股份有限公司 Block chain common recognition method, system and computer readable storage medium
CN108234470A (en) * 2017-12-28 2018-06-29 江苏通付盾科技有限公司 Block packaging method and system, electronic equipment, storage medium in block chain network
CN109345388A (en) * 2018-09-20 2019-02-15 百度在线网络技术(北京)有限公司 Block chain intelligence contract verification method, device and storage medium
CN109474682A (en) * 2018-11-12 2019-03-15 杭州秘猿科技有限公司 A kind of block chain network transmission method, device and electronic equipment
CN109586934A (en) * 2018-12-27 2019-04-05 链极智能科技(上海)有限公司 A kind of block chain bottom-layer network transaction Synchronous fluorimetry method

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110838924A (en) * 2019-11-19 2020-02-25 北京沃东天骏信息技术有限公司 Block transmission method and device
CN110838924B (en) * 2019-11-19 2022-04-12 北京沃东天骏信息技术有限公司 Block transmission method and device
WO2021240147A1 (en) * 2020-05-26 2021-12-02 The University Of Manchester Multispectral electro-optical ion-intercalated graphene electrochrome cells
CN111638963A (en) * 2020-06-08 2020-09-08 杭州复杂美科技有限公司 Transaction pool dynamic control method, device and storage medium

Also Published As

Publication number Publication date
CN110336677B (en) 2022-02-11

Similar Documents

Publication Publication Date Title
JP6686209B2 (en) Method and apparatus for distributed database in a network
CN110336677A (en) Block packing, broadcasting method and system, equipment and storage medium
CN110430067A (en) For reducing method and system, equipment and the storage medium of block repeated broadcast
CN108062672A (en) A kind of process dispatch method based on block chain intelligence contract
CN110430066A (en) For reducing method, equipment and the storage medium of block chain transaction repeated broadcast
CN110445626A (en) Block packing, broadcasting method and system, equipment and storage medium
CN109522362A (en) Incomplete markets synchronous method, system and equipment based on block chain data
CN110443610A (en) For reducing method and system, equipment and the storage medium of trading group repeated broadcast
US20070239420A1 (en) Simulation of distributed networks
CN109741060A (en) Information inquiry system, method, device, electronic equipment and storage medium
CN109508334B (en) For the data compression method of block chain database, access method and system
WO2019024780A1 (en) Light-weight processing method for blockchain, and blockchain node and storage medium
CN110336676A (en) A kind of block chain transaction broadcasting method and system, equipment and storage medium
CN109447641A (en) To the method and apparatus of block chain browser transport block chain data
KR102455870B1 (en) Clustering method for cryptocurrency wallet addresses
CN109816362A (en) Red packet processing method, equipment and storage medium
CN109903050A (en) Transaction De-weight method, transaction building method, equipment and storage medium
CN109299334A (en) A kind of data processing method and device of knowledge mapping
CN113259478B (en) Method and device for executing transaction in blockchain system and blockchain system
CN110084594A (en) A kind of block chain method of commerce and device by lightning network
CN109542908B (en) Data compression method, storage method, access method and system in key-value database
CN112965985A (en) Data consistency maintenance method for realizing cross-chain interoperation
CN109493027A (en) A kind of method and device realized across chain transactional operation
CN108764902A (en) Method, node and block catenary system for storing data
CN110784501B (en) Method, system, device and storage medium for packaging and broadcasting transaction group containing block

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