Method for executing transaction in block chain, block chain and slave node
A blockchain and transaction technology, applied in the blockchain field, can solve the problems of variables that cannot be executed in parallel and cannot be accessed predictably, and achieve the effect of improving execution speed and transaction execution speed.
Active Publication Date: 2021-12-03
ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
8 Cites 0 Cited by
AI-Extracted Technical Summary
Problems solved by technology
However, since the variables accessed cannot be predicted before the transaction ...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View moreMethod used
[0113] Through the process as described above, the slave node can immediately start executing transactions in multiple transaction groups in parallel based on the grouping result sent by the master node. In addition, by comparing the execution read-write set and the pre-execution read-write set of the transaction, determine the transaction whose variable state is inconsistent between the execution and the pre-execution, roll back the execution of the transaction, and re-execute the transaction after all transactions are processed, ensuring It ensures the state consistency of each node after executing multiple transactions. Through this solution, when the probability of different transactions accessing the same variable is small, the number of transactions rolled back is small, thereby improving the transaction execution speed.
[0115] Wherein, the...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View moreAbstract
A method for executing a transaction in a block chain, a block chain and a slave node, the method comprising: a master node pre-executes a plurality of received transactions to obtain a first pre-execution read-write set of each transaction; the slave node pre-executes the received transactions to obtain a second pre-execution read-write set of each transaction; the master node sends the first pre-execution read-write set of each transaction to the slave node; the slave node groups the plurality of transactions based on the first pre-execution read-write set of each transaction; and the slave node executes the plurality of transactions in parallel based on the first pre-execution read-write set, the second pre-execution read-write set and the grouping result of the plurality of transactions.
Application Domain
Technology Topic
Image
Examples
- Experimental program(1)
Example Embodiment
[0051] In order to better understand the technical solution in the present specification, it will be described in conjunction with the drawings in the present specification, and will be described in conjunction with the drawings in the present specification. The embodiment is merely a part of the embodiments of the present specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by those of ordinary skill in the art without creative labor should belong to the scope of this specification.
[0052] figure 1 The block chain architecture diagram applied by an embodiment of the present specification is shown. like figure 1 In the block chain, for example, a primary node 1 contains 6 nodes from the node 2 to the node 5. The connection between the node is schematically representing the P2P (Peer to Peer, point-to-point) connection. All of these nodes are stored in full books, namely the state of all blocks and all accounts. Where each node in the block chain generates the same state in the block chain by performing the same transaction, each node in the block chain stores the same status database. Different, the master node 1 can be responsible for receiving transactions from the client, and launching a conform to each from the node, including, for example, a plurality of transactions in blocks (e.g., block B1) to be blocking blocks (e.g., block B1). The order of the transaction is submitted. After the node in the block chain is successful, each node can perform the plurality of transactions based on the submission order in consensus proposals to generate block B1.
[0053] It can be understood that figure 1 The block chains shown are merely exemplary, and the embodiments of this specification are not limited to applications. figure 1 The block chain shown, for example, can be applied to a block chain system including a fragmentation.
[0054] in addition, figure 1 Although the block chain is shown in the block chain, the present specification embodiment is not limited thereto, but may include other numbers of nodes. Specifically, the node contained in the block chain can meet the requirements of Byzantinefault Tolerance, BFT. The Byzantian fault tolerance can be understood that there may be a Byzantine node inside the block chain, and the block chain is not reflected in Byzantine behavior. In general, some of the number of nodes are required to be greater than 3F + 1, f is the number of Byzantine nodes, such as practical ByzantineFault Tolerance.
[0055] In the related art, in order to improve the execution of the transaction (TPS) indicator in the block chain, it is necessary to speed up the execution speed of the transaction. To this end, the block chain node can accelerate the execution speed of the transaction through parallel execution transactions. In one embodiment, the block chain node can perform transactions in parallel through a plurality of processes in a single machine, in another embodiment, the block link node can be deployed in the server cluster, performing transactions in parallel with multiple servers. Typically, for transfer transactions, the block link node first divides multiple transactions into multiple trading groups according to the account of the transaction, and the same accounts are not accessed between the various trading groups, so that each trading group can be performed in parallel. However, when the intelligent contract is called in the transaction, the variables accessed in the transaction cannot be presented before the transaction is executed, so that multiple transactions are not effective, and the transaction cannot be executed in parallel.
[0056] This specification provides a kind of figure 1 A scheduled schedule as shown in parallel in the block chain can effectively improve the TPS in the block chain.
[0057] figure 2 The main node 1 of the block chain provided by the present specification is shown and the configuration diagram of the slave node (e.g., from node 2) is shown. like figure 2 As shown, the main node 1 includes a pre-execution module 11, a consensus module 12, a computing module 21, a consensus module 22, and a computing module 23, from node 2. The master node 1 can be connected to the client, so that multiple transactions can be received from the client. The main node 1 After receiving multiple transactions, the pre-implementation module 11 is pre-implemented, and the pre-implemented read and write sets of each transaction are obtained. The pre-execution read and write set generated by the main node 1 pre-executed transaction is expressed as the first pre-executed read and write set, and the pre-executed read and write set generated from the node 2 is expressed as the second pre-execution read and write set. To distinguish. Among them, the first pre-execution read and write set includes the first pre-execution read and the first pre-execution write set, and the first pre-executed read collector can be the read variables generated during the pre-execution transaction process. The key value pair, the first pre-execution write set can specifically, the key value pair of the written variable generated in the process of pre-executive transactions. The consensus module 12 initiates consensus to each consensus module (e.g., consensus module 22) from the receiving transaction, the consensus proposal includes a plurality of transactions, the multiple transactions submitted and the first pre-transaction Perform a read and write set to determine the multiple transactions included in the generated block and the submission order of the plurality of transactions.
[0058] The master node 1 can transmit the plurality of transactions to other consensus nodes (e.g., from node 2) at receiving multiple transactions. After receiving the plurality of transactions from node 2, the plurality of transactions can be pre-executed by the pre-execution module 21, and the second pre-execution read and write set of each transaction is obtained. The second pre-execution read and write set includes a second pre-execution read and the second pre-execution write set. It will be appreciated that the slave node 2 can also be connected to the client, receive multiple transactions from the client, and transmit the plurality of transactions to other consensus nodes (including the primary node or slave node), or from the node 2 can also be from other The plurality of transactions are received from the node.
[0059] After successful of the plurality of consensus nodes in the block chain, the primary node and the computing modules in each slave node can begin executing the plurality of transactions. Wherein, the calculation module 13 of the main node 1 includes a packet sub-module 131, a plurality of execution sub-modules (shown in the figure, the execution sub-module 132, the sub-module 133, and the execution sub-module 134) and the sub-module 135 are re-executed. A grouping sub-module 231, a plurality of execution sub-modules (shown, executing sub-module 233, and execution sub-module 234) and the sub-module 235 are executed, and sub-module 233, and execution sub-module 234 are shown in FIG. 234.
[0060] Specifically, in the primary node 1, the group sub-module 131 first divides multiple transactions into multiple trading groups according to the first pre-execution read and write set of the primary node, and there is no conflict transaction between the various trading groups. Among them, there is a case where there is a conflict transaction between the two trading groups. The first variable; the first trading group is written to the first variable, the second trading group writes the first variable; the first transaction group reads the first variable and writes the first variable, the second trading group writes the first variable; The first trading group reads the first variable and writes the first variable, and the second trading group reads the first variable and writes the first variable. Among them, if the two trading groups read the same variables, they can be considered that there is no conflict transaction. Typically, for a simplified scheme, the group sub-module 131 can packet multiple transactions in accordance with the requirements of the same variables between the respective trading groups.
[0061] Thereafter, the plurality of execution sub-modules in the main node 1 can perform the plurality of trading groups in parallel. In the process of executing the transaction, each execution sub-module generates the execution read and write set of the transaction, where the read and write set includes performing a read and execution writing, and the execution read specifically can be generated during the execution of the transaction. The key value pair of variables, performs the write set specifically to the key value pair of the variables generated during the execution of the transaction. If it is determined that the execution read of the transaction is inconsistent with the pre-implemented read set, the execution of the transaction rolls back, and the restoring sub-module 135 re-executes the retransmission after each execution sub-module processing completed all transactions. Transaction to ensure the correctness of the group.
[0062]In the node 2, the packet according to a first sub-module 231 first pre-set the master node performs reading and writing the transaction into a plurality of multiple transaction groups. Thereafter, a plurality of sub-modules may be executed concurrently execute the plurality of transaction sets. Each sub-module executed during the execution of the transaction, if the set of read and write transactions with the reader performs a first pre-determined set of inconsistencies, the rollback of the transaction performed by the re-execution in each execution sub-module 235 by re-executing a rollback transaction processing module is completed after all of the sub-plurality of transactions to ensure the correctness of the packet. Wherein the pre-performs the read current during the execution of the transaction, after the same pre-execution read set determine the transaction is performed the read set the master node may determine the local cache from the execution submodule node of the transaction and performs the read set whether pre-execution agreement, if consistent, you can directly use the cached write transaction set as a write set, thereby increasing the speed of execution from the node.
[0063] Further, by performing a first set of read and write pre-set and the master node performs reading and writing of the transaction comparison, when determining the master node and performs pre-execution state variables inconsistent transaction rollback execution of the transaction, and the transaction processing unit complete after the re-execution of the transaction to ensure the consistency of each node in the state after the execution of multiple transactions. By this scheme, in the case where the same variables of different transactions are small, the number of returning transactions is small, thereby improving the transaction execution speed.
[0064] Reference will hereinafter be image 3 The method of performing transactions shown in the flowchart described in detail above process. exist image 3 Shows only the processes performed from the master node and node 2, it is understood that other node from the node 2 performs the same process from a chain block.
[0065] First, at step S301, the master node performs a plurality of pre-trading, to give a first pre-set command for each transaction.
[0066] In one embodiment, the master node 1 can be received after each transaction, immediately pre perform the transaction, after completion of the plurality of received pre-execution, the plurality of transaction agreement to determine to be generated block includes the plurality of transactions, and determines that the plurality of transaction commit order. In this case, the master node 1 can be pre-execute each transaction based on the latest state of the world trading blocks corresponding to each. The pre-set to perform read and write are not visible to other transactions, and to read and write the set pre-execution does not change the state of the world.
[0067] Since the master node receives each transaction at different times, at different times of the new block is likely to be different blocks, so the more transactions likely to correspond to the state of the world in different blocks. For example, in the case of the master node 1 of a pipeline to execute a plurality of blocks, the master node 1 belongs to the pre-execution of the transaction also performs block B2 blocks B1 (assuming block before the blocks B1 to blocks B2) so, the transaction prior to execution of pre-generated blocks B1 corresponding to the world based on the block B0 state (assuming blocks of the block before the block B0 B1) pre-execution, the transaction after the blocks B1 generated based on the pre-execution region blocks B1 corresponding to the pre-execution state of the world.
[0068] In another embodiment, the master node 1 may after receiving a plurality of transaction, and then execute the plurality of pre-transaction each transaction based on the same state of the world's most current block corresponds. In this case, each of the plurality of pre-transaction execution based on the same state of the world.
[0069] Since the world does not change during the pre-execution state of each transaction, i.e. each transaction performed pre-transaction conflict does not exist, therefore, a plurality of pre-pre-execution module execution unit 11 may include, for parallel execution of a plurality of pre-execution of the transaction to accelerate the implementation of the pre-transaction speed.
[0070] The master node 1 after the plurality of pre-execution of the transaction each transaction, to give a first pre-set command for each transaction. In one embodiment, the first pre-command for performing pre-set includes a first set of read and write a first pre-set, wherein the first set comprises a read variable pre-read at the pre-execution of the transaction key values (key-value), a first set of pre-write variables includes a pre-written when executing the transaction pairs. In another embodiment, the first pre-set to perform a read write focus can includes the version number read variable pre-execution of the transaction, the first pre-write focus can includes the version number of the variable write, wherein, in the state database stores, for example, and the respective values of each write is written version number corresponding to the value of the variable, so that by performing the first pre-reader comprising a variable focus version number which can read and write transactions to determine value.
[0071] In the case of a contract in the transaction, the block chain node is in the process of performing the contract of the transaction call, there is a possibility of writing different variables based on the value of the read variables. For example, when the value of the variable read is 1, the variable A is written to 10, and when the value of the read variable is 2, the variable B is written to 20 or the like. Therefore, for the transaction of the call contract, the block chain node must determine the variables read and the variable written by the transaction can be determined by executing the transaction. To this end, the master node 1 through the plurality of pre-execution of the transaction in each transaction, to give a first pre-set for each read or write transaction, the pre-process performed by the transaction execution process is basically the same, except that, in the pre-execution the state of the world in the course of the transaction described above is based on pre-determined according to the rules, not necessarily the state of the world at the time of execution of transactions, in addition, does not update the status of the world according to the results of a pre-execution trading after the pre-execution transaction.
[0072] As the world pre-execution state when the transaction is based on the master node 1 is not necessarily the state when performing transactions world, so that the first may be pre-set to perform read and write transactions of read and write transactions is performed to obtain a set of rear inconsistent. Further, in another case, there may be deliberately evil master node causes the first pre-set to perform read and write transactions is performed to obtain a set of read and write transaction later is inconsistent.
[0073] In step S303, the master node 1 of the first pre-set command for each transaction transmitted from node 2.
[0074] In one embodiment, the master node 1 may transmit only when a plurality of transactions consensus respective first pre-set to perform read and write from the node 2, so that the two may be based on a first plurality of the pre-write transaction execution node set the multi-group transactions. In this embodiment, the node from the master node can not verify whether the evil, it may be chosen by the subsequent steps of the transaction evil master node to a plurality of nodes in the chain blocks can still reach the same execution result.
[0075] In another embodiment, a transaction may be a plurality of respective first pre-set and each read and write to read or write a first set of pre-master node associated tile from the node 2 to a height. Is the height of the associated block of the first pre-execution state of the world is based on the corresponding set of read block height. By performing the respective first pre-set associated write block from the height of each node to a slave node may be based on the first read and write pre-set height for each tile associated read and write a first set of pre-verify, thereby determining whether the master node evil. In the case where the master node is determined evil, the block chain may be re-determined master node, and a plurality of re-execute the transaction.
[0076] In step S305, 1 a first set of read and write transactions based on a plurality of pre-master nodes of the plurality of transaction packets.
[0077] The master node 1 based on a first pre Variables individual transaction set includes read and write read and write key key, a plurality of transaction packets. As described above, the packet transaction may be such that different groups of transactions does not access the same variable, the access operation comprises a read operation and write operation. In the case where the grouping condition is reached, there will be no conflict between individual trading transactions groups, therefore, each group of transactions may be performed in parallel.
[0078] In step S307, the master node 1 according to the grouping result of parallel execution of multiple transactions, wherein for the first set and a read pre-set to perform a read transaction rollback inconsistent.
[0079] refer to figure 2 , The master node 1 via a plurality of sub-modules perform a plurality of transactions performed in parallel groups of transactions. Suppose sub-grouping module 131 groups the plurality of transactions divided into six groups g1 ~ G6, grouping sub-module 131 may group g1 and g2 to a group performing sub-module 132, the group g3 and g4 to a set of execution sub-module 133, group g5 and g6 the group sent to the execution sub-module 134, so that each sub-module performs its assigned group of parallel execution of transactions.
[0080] Sub-module 132 to perform, for example, performing sub-module 132 may be performed in parallel or serially group g1 and its assigned group g2. Since there is a conflict between a group of transactions may be performed serially sub-module 132 performs a single group of transactions. After the execution sub-module 132 performs a transaction group g1 (e.g. transaction Tx1), only the need to perform a read transaction Tx1 is set. Execution sub-module 132 may compare the transaction Tx1 is performed whether the read set coincide with the first set of read and write pre-read set, if consistent, since trust the master node 1 itself performs pre perform pre-set write transaction Tx1 obtained, therefore, performing sub-module 132 may direct the transaction Tx1 of pre-written set of execution as the execution of the transaction by writing, union status update cache of each variable according to the write buffer to maintain the state also is the current date the state of the world.
[0081] If the transaction Tx1 execution is inconsistent with the first set of pre-reading literacy focused on the implementation of reading set, indicating that the transaction Tx1 world in the implementation of its state of the world's pre-execution state has changed, the first pre-Tx1 of the transaction read and write set is set to read and write errors. In particular, as described above, in the case of performing the read set of first pre-read set inconsistent Tx1 transaction execution, the transaction Tx1 variable written in the pre-write execution is possible variable is performed at different variable, so that the packet 131 based on a first sub-module pre-set command for grouping the results obtained packet as an error packet results. In order to perform such sub-module 132, execution module 133 and execution of sub-sub-module 134 may continue to perform various transactions according to the existing set of parallel grouping result, execution sub-module 132 to roll back the transaction Tx1 is specifically deleted may be performed the reading obtained Tx1 transaction set, and the transaction group g1 is removed from Tx1 group placed in g7, g7 for collecting the set of execution of the read set of different first pre-set to perform a read transaction. In other words, by performing a rollback transaction Tx1, making the transaction Tx1 not affect the current state of the world, there would be no other cause to roll back the transaction by transaction Tx1 out of the group g1, making the transaction Tx1 variables are not accessible It affects other transactions on the packet, so that each sub-module may continue to perform parallel execution of transactions group.
[0082] Optionally, in step S309, the master node 1 to re-execute the rollback of the transaction.
[0083] After the master node 1 in the full portion of the plurality of transaction execution (after execution including rollback transaction), to re-execute the transaction in accordance with the group g7 cache state variable maintained, i.e. removed from the group of the plurality of transaction It has been rolled back one or more transactions. Among them, the variable state maintained in the cache is a variable state obtained from the write set of the transaction that has not rolled back in multiple transactions. The execution order of the plurality of transactions in the group G7 can be determined according to the preset rules. For example, the plurality of transactions can be executed serially depending on the order of transaction numbers in group G7 transactions.
[0084] In another embodiment, the master node 1 after the transaction is rolled back, can be directly returned to the client transaction fails, without re-execute the transaction.
[0085] In step S311, the master node 1 after completion of the execution of multiple transactions, generating blocks.
[0086] After the master node 1 after completion of the execution of multiple transactions, the master node 1 or the completion of execution and re-execution of the plurality of transaction rollback transaction, according to the state of the cache data update state database, and generates the block . The block includes a zone head and a block body. Among them, the blocks include, for example, the various transactions, receipts, etc. of the plurality of transactions. The block can include data such as state root, receipt root, trading root.
[0087]In one embodiment, the block may also include the first pre-execution read and write set of the plurality of transactions, by including a plurality of transactions including multiple transactions, when other nodes are When the data is lost, the data may be re-executed based on the first pre-execution read and write set in the main node 1, thereby obtaining the world state consistent with the primary node 1.
[0088] In step S313, the plurality of transactions are prevised from node 2 to obtain a second pre-execution read and write set of each transaction.
[0089] As mentioned earlier, the primary node 1 can send the plurality of transactions to the slave node 2 after receiving multiple transactions from the client, thereby creating the number of transactions from node 2 to obtain second pre-execution of each transaction. Read and write set. It will be appreciated that the slave node 2 is not limited to receiving the plurality of transactions from the primary node 1, or the plurality of transactions can also be received directly from the client, or can receive the plurality of transactions from other slaves. After the second pre-execution read and write set from each transaction, the second pre-execution read and write set of the plurality of transactions is stored in memory for use in executing transactions.
[0090] In step S315, after the first pre-execution read and write set based on the respective transactions, the first pre-execution read and write set based on each transaction is set to multiple transaction packets.
[0091] This step can be refer to the description of step S305 above, and details are not described herein.
[0092] At step S317, the slave node 2 performs multiple transactions in parallel according to the packet outfit, wherein the transaction that is inconsistent with the first pre-execution read / write set is rolled back to the execution read and write set.
[0093] Similarly to step S307, after the plurality of transaction packets are set to group G1 to group G6, the execution sub-module 233, and the execution sub-module 234 can perform transactions in parallel to execute groups G1 to G6.
[0094] The execution sub-module 232 is an example, and the execution sub-module 232 obtains the execution read and write set of the transaction after either transaction of the group G1. The execution sub-module 232 compares whether the execution read and write set of the transaction is consistent with the first pre-execution read and write set. like image 3 As shown, transactions in which the execution read and write set in group G1 and the first pre-executed read / write set may be any of the following transactions: first transaction, execution reading, first pre-execution reading, and second pre- The execution read is consistent, the second pre-execution write set is inconsistent with the first pre-execution writing; the second transaction, the execution reading is consistent with the first pre-execution reading, and the execution read is inconsistent with the second pre-execution reading. The write set is inconsistent with the first pre-execution writing; the third transaction, the execution read is inconsistent with the first pre-execution reading. Each execution sub-module can similarly perform transactions in other groups similarly to transactions in the execution group G1.
[0095] The process of performing the above first transaction, second transaction, and third transactions is described below, respectively.
[0096] After the first transaction is started from the beginning, the read operation of the variable in the first transaction is first performed to obtain the execution read of the first transaction. From Node 2 to compare the execution read of the first transaction with the first pre-execution read set of the first transaction, determine the execution read set of the first transaction is consistent with the first transaction pre-execution. Thereafter, from the node 2 to perform the first transaction reading comparison of the execution reading of the first transaction with the first transaction of the local cache, after determining the execution reading of the first transaction, after the second pre-execution read set is consistent, In this case, the execution write set of the first transaction must be the same, and therefore, the second pre-execution write set of the first transaction that can be cached from the node 2 can be written as an execution writing, and You can end the execution of the first transaction. After that, from the node 2 compare the second pre-execution write set (ie, the write set) is consistent with the first pre-execution write set, after determining inconsistency, it is determined that the primary node is written to the first pre-execution write set. Set, so rollback to the implementation of the first transaction. Specifically, from node 2 can delete the execution read and write set, the transaction is removed from the group G1, and the group G7 is used to bring together the execution of read and write sets and first pre-execution. Read different deals. That is, the execution of the first transaction is not updated to the world state maintained in the cache, avoiding the implementation of subsequent transactions. Alternatively, after determining the master node after determining the master node, the execution of the block can end to wait for re-determination of the master node.
[0097] After starting the second transaction from the node 2, after determining the execution read of the second transaction, the execution read of the first pre-execution read is inconsistent with the second pre-execution reading, based on the second The execution of the transaction reads the execution of the second transaction to obtain the execution of the second transaction. Thereafter, the execution write set of the second transaction is consistent from the first pre-execution write set of the second transaction. In the inconsistent case, it is possible to determine the first pre-execution write set of the main node 1 to cause the error. Similarly, from node 2 can roll back to the second transaction.
[0098] After starting the third transaction from node 2, after determining that the execution read of the third transaction is inconsistent with the first pre-execution reading, the third transaction can be determined that the world state is performed compared to the main node 1. The world status of execution changes, so the process of rollback from the node 2 roll back to the third transaction.
[0099] If the execution read and write set of the transaction in the group G1 executed by the sub-module 232 is consistent with the first pre-execution read and write set, the execution sub-module 232 can perform the state of the various variables in the cache according to the execution of the transaction (ie World status).
[0100] Alternatively, in step S319, the rollback transaction is re-executed from the node 2, that is, the transaction in group G7.
[0101] This step can be refer to the description of step S309 above, and details are not described herein.
[0102] By performing transactions as described above, each from the node and the primary node roll back in the same transaction during execution of the transaction, and performs rollback transactions in the same order based on the same world state, so that each node finally The same execution result of the transaction and obtains the same world state corresponding to the blocks including the plurality of transactions. In the case where the transaction conflict is less, the number of returns of the rollback transaction is small, and the individual nodes improve the transaction performance speed through parallel execution transactions.
[0103] In step S319, a block is generated from the node 2, optionally, can include a plurality of transactions in the block including a plurality of transactions.
[0104] The execution of this step can be refer to the description of step S311 above. By including a plurality of transactions in the block, when the data is lost due to the cause of the failure, the data can be re-executed based on the first pre-execution read and write set of the block 2 in the nephew 2. Multiple transactions in this block are obtained from the world state that is consistent with the node 2.
[0105] pass through image 3 The method shown, each node in the block chain is based on the same first pre-executed read and write set, based on the same world state, performing the transaction of multiple trading groups, and performs the results of the transaction and pre- Different transactions are used in the same way, and the world states obtained by each node are consistent. There is less transaction in multiple transactions, and the main node is not evil, and the transaction performance in the block chain can be improved.
[0106] Figure 4 Another configuration diagram of the primary node 1 and the slave chain of the block chain provided in the present specification are shown. like Figure 4 As shown, the main node 1 includes a pre-execution module 11, a consensus module 12, a computing module 21, a consensus module 22, and a computing module 23, from node 2. Main Node 1 After receiving multiple transactions from the client, the pre-execution module 11 is pre-implemented, and the first pre-execution read and write set of each transaction is obtained.
[0107] The consensus module 12 includes a packet sub-module 121, and the group sub-module 121 can divide multiple transactions into a plurality of trading groups according to the first pre-execution read and write set of each transaction, and there is no conflict transaction between the various trading groups.
[0108] The consensus module 12 also initiates consensus to each consensus on each of the consensus modules (e.g., consensus module 22) received from the node, in accordance with the received plurality of transactions, including the identification of multiple transactions, submission order, packet results, and various transactions. Ready and write sets are pre-implemented to determine that the generated block includes the plurality of transactions and the submission order of the plurality of transactions.
[0109] After successful success, the main node and the calculation modules in each slave node can begin executing the plurality of transactions. Wherein, the computing module 13 of the master node 1 includes a plurality of execution sub-modules (shown in the figure, the sub-module 132, the execution sub-module 133, and the execution sub-module 134) and the re-execute sub-module 135 are re-executed. A plurality of execution sub-modules (shown schematically showing the sub-module 232, executing sub-module 233, and execution sub-module 234) and the re-execute sub-module 235 are manually shown in the calculation module 23 of the node 2.
[0110] Specifically, in the main node 1, a plurality of execution sub-modules can perform the plurality of trading groups parallel. Each execution sub-module is executing the transaction's execution read and write set during the execution of the transaction. If it is determined that the execution read of the transaction is inconsistent with the pre-implemented read set, the execution of the transaction rolls back, and the restoring sub-module 135 re-executes the retransmission after each execution sub-module processing completed all transactions. Transaction to ensure the correctness of the group.
[0111] The master node 1 can send the plurality of transactions to the slave node 2 after receiving multiple transactions from the client. After receiving the plurality of transactions after receiving the multiple transactions, the second pre-execution read and write set of each transaction is obtained by pre-execution module 21.
[0112] After receiving the transaction group information from the primary node and the first pre-execution read and write set of each transaction, the plurality of execution sub-modules in node 2 can perform the plurality of trading groups in parallel. During the execution of the transaction, each execution sub-module is determined that the execution read and write set of the transaction is inconsistent with the pre-executed read and write set, the execution of the transaction rolls back. Among them, from the process of executing the sub-module in the execution of the transaction, after determining the execution reading of the transaction is consistent with the pre-execution read set of the primary node, the pre-execution reading and execution reading of the transaction of the local cache can be determined. Consistency, if consistency, the pre-execution write set of the cache can be used directly as the execution of the display, thereby increasing the execution speed from the node.
[0113] By the procedure as described above, the slave node can be implemented based on the packet transmitted by the primary node, and the transaction in multiple trading groups will be implemented immediately. In addition, by comparative transaction execution read and write set, the transaction is determined, the transaction is not consistent, and the implementation of the variable state is inconsistent, the execution of the transaction is rolled back, and the transaction is re-executed after processing the full transaction, guarantee The status consistency of each node after performing multiple transactions. By this scheme, in the case where the same variables of different transactions are small, the number of returning transactions is small, thereby improving the transaction execution speed.
[0114] Reference below Figure 5 The method flow diagram shown in detail by the method of executing the transaction is described in detail Figure 4 The process described is described. exist image 3 Only the flow of the primary node 1 and the process executed from node 2 can be understood that other slave nodes in the block chain are executed with the same flow as from node 2.
[0115] in, Figure 5 The process shown is compared to image 3As shown in different processes that, after the master node based on a first plurality of pre-set read and write transaction of the plurality of transaction packets, step S505 will be sent together by a first pre-group results and perform read and write transactions each set from other nodes, the node which can execute directly from individual transaction group transaction, without the need to perform a transaction after the start of a plurality of transactions are grouped, thus improving the execution speed of the transaction. Wherein, the step S501 ~ step S511 described hereinabove may refer to the steps S301 ~ S311, step S513 may be described with reference to the above step S313, the step S515 is described with reference to the above step S317. Step S517 and S519 described above may be reference to the step S319 and S321.
[0116] Image 6 It provided one kind of block chain architecture diagram from node, including embodiments of the present Description:
[0117] Pre-execution unit 61 for performing pre plurality of received transactions, to give a second pre-set command for each transaction, the second pre-command for performing pre-set includes a second set of read and write a second set of pre- ;
[0118] A receiving unit 62 for receiving from the master node of the first pre-command for each set of transaction, the first pre-command for performing pre-set comprises a first set of read and write a first pre-set;
[0119] Packet means 63 for grouping the plurality of individual transaction of the transaction based on a first set of pre perform read and write;
[0120] Parallel execution unit 64, for performing a packet based on a result of the plurality of the plurality of parallel transaction transaction, wherein, upon execution of the transaction by the first plurality, obtaining the first performing a read transaction set; determining whether the execution of the first pre-set to perform a read transaction with the first set of read coincide, in the same case, said performing a second pre-determined set of read set to perform a read transaction if the first consistent, determining that the execution of the first set and the read transaction reads a second set of pre-execution same case, the execution of the second pre-set with a first write transaction as a write transaction to execute the first set.
[0121] Figure 7 It provided one kind of block chain architecture diagram from node, including embodiments of the present Description:
[0122] Pre-execution unit 71 for performing pre plurality of received transactions, to give a second pre-set command for each transaction, the second pre-command for performing pre-set includes a second set of read and write a second set of pre- ;
[0123] Receiving unit 72, for receiving the plurality of transaction packet from the master node and the first results set pre-command for each transaction, wherein the first set comprises a first pre-command for performing a read pre-set and writing the first set of pre-execution of the first packet based on the results obtained set of pre-write execution;
[0124] Parallel execution unit 73, for performing a plurality of transactions based on a result of the plurality of transaction packets in parallel, wherein, upon execution of the transaction by the first plurality, obtaining from the node of the first performing a read transaction set; determining whether the execution of the first set of pre-reading performs the read first set of transaction agreement, in the same case, determining the execution of the first set and read a second pre-transaction whether consistent set of read, in determining the consistent execution of the second set and the first prefetch transaction is set to perform a read case, the execution of the second pre-set with a first write transaction as the first the execution of transactions writing set.
[0125] The present specification further embodiment provides a computer-readable storage medium, having stored thereon a computer program, said computer program when executed in a computer, cause the computer to perform the image 3 or Figure 5 The method shown.
[0126] When the present specification further provides a computing apparatus comprising a processor and a memory, the executable code stored in memory, the processor executing the executable code to achieve such image 3 or Figure 5 The method shown.
[0127] In the 1990s, a technique for improving the apparent distinction can be improved in hardware (e.g., an improved circuit configuration of a diode, a transistor, switch, etc.) (Method for Improved process) or software improvements. However, with the development of technology, many ways to improve the flow of today can already be considered a direct improvement of the hardware circuit structure. Designers are almost all by programming improved methods to the hardware circuit structure. Therefore, it is not possible to say that the improvement of a method process cannot be implemented with a hardware entity module. For example, programmable logic devices (Programmable Logic Device, PLD) (e.g. field programmable gate array (Field Programmable GateArray, FPGA)) is one such integrated circuit, which logic function is determined by a user to program the device. The designer is programmed by self-programming a digital system "integration" on a PLD without the need to ask chip makers to design and make special integrated circuit chips. And, now, instead of manually fabricating an integrated circuit chip, this program also mostly use "logic compiler (logic compiler)" implemented in software, and application developers to write it used similar software compiler, and to compile before original code have to use a specific programming language to write, this is called a hardware description language (hardware description language, HDL), while HDL is not only one, but there are many kinds, such as ABEL (Advanced Boolean Expression language) , AHDL (Altera Hardware DescriptionLanguage), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, rHDL (RubyHardware Description Language), etc., the most commonly used is VHDL (Very-High-SpeedIntegrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also clear, only need to slightly logically programming the method flow with the above-described hardware description language and programmed into the integrated circuit, and the hardware circuit that implements the logic method can be easily obtained.
[0128] The controller may be implemented in any suitable manner, for example, the controller can take the computer readable program code (e.g., software or firmware), such as a microprocessor or processor and a memory by the (micro) processor executing the computer readable medium , logic gates, switches, an example ASIC (Application Specific Integrated Circuit, ASIC), a programmable logic controller and the form of the embedded microcontroller, a controller including but not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to the controller in a pure computer readable program code, it is possible to make the controller to logically programming the method steps to logic, switches, dedicated integrated circuits, programmable logic controllers and embedded The form of a microcontroller or the like is the same function. Thus such a controller can be considered a hardware component, while the means for implementing various functions included therein can also be considered as a structure within the hardware component. Alternatively, the device for implementing various functions can be regarded as a software module that can only implement a method, and may be a structure within a hardware component.
[0129] The system, apparatus, module, or unit of the above embodiment may be implemented by a computer chip or entity or by a product having some function. A typical device is a server system implemented. Of course, this does not preclude the application with the future development of computer technology, and computer functions of the embodiments described above may for example be a personal computer, a laptop computer, on-board computer interaction devices, cell phones, camera phones, smart phones, personal digital assistants , a media player, a navigation device, an email device, a game console, a tablet computer, wearable device, or a combination of any of these devices in a device.
[0130] Although one or more embodiments of this specification provide a method of operation as described in Examples or Flowcharts, more or less operational steps can include based on conventional or uncost-free means. The sequence of steps listed in the examples is only one way in which a number of steps is performed, and does not mean unique execution order. When executed in the actual device or end product, it can be performed in the order shown in the method or the method shown in the drawings (e.g., a parallel processor or multi-threaded environment, even a distributed data processing environment). The terms "including", "inclusive" or any other variable is intended to cover non-exclusive containe, so that the process, method, product, or device comprising a series of elements include not only those elements, but also other than clearly listed. Features, or elements inherent to this process, method, product, or device. In the absence of more restrictions, there is no other same or equivalent element in the process, method, product, or apparatus including the elements. For example, if the first, second words are used to represent the name, and does not represent any particular order.
[0131] For the convenience of the description, the above-described device is described in various modules to be described in terms of functions. Of course, the functionality of each module can be implemented in the same or more software and / or hardware, or the module that implements the same function can be implemented by a plurality of sub-modules or subunits, etc. . The device embodiment described above is merely schematic, for example, the division of the unit, only one logic function division, can have additional division mode, such as a plurality of units or components, can be combined or integrated. To another system, or some features can be ignored, or not executed. Another point, the coupling or direct coupling or communication between the displayed or discussed may be an electrical, mechanical or other form.
[0132] The present invention is described with reference to a method, apparatus (system), and a flowchart and / or block diagram of the computer program product, in accordance with an embodiment of the present invention. It should be understood that each of the flowcharts and / or blocks in the flowchart and / or block diagram can be implemented by a computer program command, and the binding of the flow and / or box in the flowchart and / or block diagram. These computer program instructions can be provided to generic computers, dedicated computers, embedded processes, or other programmable data processing devices to generate a machine such that instructions executed by the processor of the computer or other programmable data processing device. Implementation in the process Figure one Process or multiple processes and / or boxes Figure one Apparatus specified in a plurality of boxes or multiple boxes.
[0133] These computer program instructions can also be stored in a computer readable memory capable of booting a computer or other programmable data processing device in a particular manner, making the instructions stored in the computer readable memory generate a manufacturing product of the instruction device, which Device is implemented in the process Figure one Process or multiple processes and / or boxes Figure one The function specified in the box or multiple boxes.
[0134] These computer program instructions can also be loaded on a computer or other programmable data processing device such that a series of steps are performed on a computer or other programmable device to generate a computer implemented process, thereby executing on a computer or other programmable device. The instruction is provided for implementation Figure oneProcess or multiple processes and / or boxes Figure one The step of the function specified in multiple boxes or multiple boxes.
[0135] In a typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0136] Memory may include a non-permanent memory, random access memory (RAM), and / or non-volatile memory (ROM) or flash memory (Flash Ram) in a computer readable medium. Memory is an example of a computer readable medium.
[0137] Computer readable media includes permanent and non-permanent, movable and non-removable media to be stored by any method or technology. The information can be a computer readable instruction, data structure, program module or other data. Examples of the computer's storage medium include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrical erasure programmable read-only memory (EEPROM), flash memory or other memory technology, read-only disc read only memory (CD-ROM), digital multi-function CD (DVD) or other optical storage, Magnetic cassettes, tape magnetic disk storage, graphene storage, or other magnetic storage devices or any other non-transmission medium, can be used to store information that can be accessed by computing devices. According to the definition in this article, the computer readable medium does not include a temporary computer readable medium such as a modulated data signal and carrier.
[0138] Those skilled in the art will appreciate that one or more embodiments of the present specification can be provided as a method, a system, a computer program product. Thus, one or more embodiments of the present specification may employ a full hardware embodiment, a fully software embodiment, or an embodiment of the combined software and hardware. Moreover, one or more embodiments of the present specification may employ computer programs that include storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) in one or more computers. The form of the product.
[0139] One or more embodiments of the present specification may be described in general contexts of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like to perform a particular task or implement a particular abstract data type. Below one or more embodiments of the specification can also be practiced in a distributed computing environment, in which a remote processing device connected by a communication network is performed by a communication network. In a distributed computing environment, the program module can be located in a local and remote computer storage medium including a storage device.
[0140] The various embodiments in this specification are described in the process, and the same components are described with each other, and each of the embodiments are respectively illustrated. In particular, for system embodiments, since it is substantially similar to method embodiments, the relatively simple, relevant, referring to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some example", etc., meant to conjunction with the specific characteristics described in connection with this embodiment. , Structures, materials or features are included in at least one embodiment or example of the present specification. In the present specification, the schematic representation of the above terms should not be directed to the same embodiments or examples. Moreover, the specific features, structures, materials or features described may be combined in any one or more embodiments or examples. In addition, those skilled in the art can combine and combine different embodiments or examples of the present specification, and different embodiments of the features or examples of the present specification.
[0141] It is not intended to limit the one or more embodiments of the present specification as described above. One or more embodiments of the present specification may have various changes and variations in one or more embodiments of the present specification. Any modification, equivalent replacement, improvement, etc. according to the spirit and principles of this specification shall be included within the scope of the claims.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more PUM


Description & Claims & Application Information
We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more Similar technology patents
Interrupt handling method and device
ActiveCN101976206AFast executionReduced probability of interrupt lossProgram initiation/switchingOperating systemComputer science
Owner:北京中星天视科技有限公司
Stop point identification and trip chain construction system, algorithm and device, and storage medium
ActiveCN113553482AFast executionSave memory spaceOther databases queryingOther databases clustering/classificationTrip chainPoint data
Owner:SHENZHEN URBAN TRANSPORT PLANNING CENT +1
System for offer and acceptance based online classified ads
InactiveUS20160300271A1Promote exchangeFast executionAdvertisementsRelational databasesProgram planningExecution planning
Owner:SCROGGINS III WILLIAM ALEXANDER
Method and system for BitMap Analysis System for high speed testing of memories
Owner:STMICROELECTRONICS PVT LTD
Classification and recommendation of technical efficacy words
- Fast execution
- Improve transaction execution speed
Performance Evaluation System
InactiveUS20120124559A1Fast executionFast evaluationMultiple digital computer combinationsElectrical appliancesClient-sideSelf adaptive
Owner:KONDUR SHANKAR NARAYANA
Lane change assist device
ActiveUS20180350242A1Fast executionAnti-collision systemsSteering partsAngular velocitySteering angle
Owner:TOYOTA JIDOSHA KK
Practical, redundant, failure-tolerant, self-reconfiguring embedded system architecture
InactiveUS7117390B1High robustness/redundancyFast executionError detection/correctionEmbedded systemSoftware modules
Owner:NAT TECH & ENG SOLUTIONS OF SANDIA LLC
System and method to concurrently execute a plurality of object oriented platform independent programs by utilizing memory accessible by both a processor and a co-processor
InactiveUS20120216015A1Fast executionReduce dependencyProgram control using wired connectionsGeneral purpose stored program computerStandalone programMetadata
Owner:MITRA SUMANRANJAN S
Method for executing transactions in block chain, block chain, master node and slave node
Owner:ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
Method for executing transaction in block chain, block chain and main node
Owner:ALIPAY (HANGZHOU) INFORMATION TECH CO LTD