WO2023160085A1 - Procédé d'exécution de transaction, chaîne de blocs, nœud maître et nœud esclave - Google Patents

Procédé d'exécution de transaction, chaîne de blocs, nœud maître et nœud esclave Download PDF

Info

Publication number
WO2023160085A1
WO2023160085A1 PCT/CN2022/135338 CN2022135338W WO2023160085A1 WO 2023160085 A1 WO2023160085 A1 WO 2023160085A1 CN 2022135338 W CN2022135338 W CN 2022135338W WO 2023160085 A1 WO2023160085 A1 WO 2023160085A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
dag
execution
variable
master node
Prior art date
Application number
PCT/CN2022/135338
Other languages
English (en)
Chinese (zh)
Inventor
刘晓建
张兆勇
Original Assignee
蚂蚁区块链科技(上海)有限公司
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 蚂蚁区块链科技(上海)有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2023160085A1 publication Critical patent/WO2023160085A1/fr

Links

Images

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
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06311Scheduling, planning or task assignment for a person or group
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • G06Q10/06316Sequencing of tasks or work
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0633Workflow analysis
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management

Definitions

  • the embodiments of this specification belong to the technical field of block chain, and in particular relate to a method for executing transactions in the block chain, the block chain, a master node and a slave node.
  • Blockchain is a new application model of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • the data blocks are combined into a chained data structure in a sequentially connected manner in chronological order, and a non-tamperable and unforgeable distributed ledger is cryptographically guaranteed. Due to the characteristics of decentralization, non-tamperable information, and autonomy, the blockchain has also received more and more attention and application. However, since the variables accessed cannot be predicted before the transactions calling smart contracts are executed, they usually cannot be executed in parallel.
  • the purpose of the present invention is to provide a method for executing transactions in the block chain, so that the slave nodes in the block chain can execute transactions in parallel according to the consensus proposal of the master node.
  • the first aspect of this specification provides a method for executing a transaction in a blockchain, the blockchain includes a master node and a slave node, and the method includes:
  • the master node pre-executes the received first transaction, and generates a pre-execution read-write set of the first transaction, and the pre-execution read-write set includes access to the first variable;
  • the master node generates DAG data according to the pre-execution read-write set of the first transaction and the identifier of the previously recorded second transaction that most recently updated the first variable, and the second transaction is the The most recent transaction before the first transaction updates the pre-execution state of the first variable after pre-execution, and the DAG data indicates the time sequence in which the first transaction and the second transaction access the first variable;
  • the master node sends the DAG data to the slave node;
  • the slave node executes the first transaction and the second transaction based on the DAG data.
  • the second aspect of this specification provides a blockchain, the blockchain includes a master node and a slave node,
  • the master node is used to: pre-execute the received first transaction, generate a pre-execution read-write set of the first transaction, and the pre-execution read-write set includes access to the first variable;
  • the pre-execution read-write set the identification of the second transaction that most recently updated the first variable recorded earlier, generates DAG data, and the second transaction is the most recent post-pre-execution update before the pre-execution of the first transaction
  • the slave node is configured to execute the first transaction and the second transaction based on the DAG data.
  • the third aspect of this specification provides a block chain master node, including:
  • a pre-execution unit configured to pre-execute the received first transaction, and generate a pre-execution read-write set of the first transaction, the pre-execution read-write set includes access to the first variable;
  • a generation unit configured to generate DAG data according to the pre-execution read-write set of the first transaction and the identifier of the previously recorded second transaction that most recently updated the first variable, and the second transaction is the pre-execution A transaction that updates the pre-execution state of the first variable after pre-execution, the most recent before the first transaction, and the DAG data indicates the time sequence in which the first transaction and the second transaction access the first variable;
  • a sending unit configured to send the DAG data to the slave nodes of the block chain.
  • the fourth aspect of this specification provides a blockchain slave node, including:
  • a receiving unit configured to receive DAG data from the master node of the blockchain, the DAG data indicating the time sequence in which the first transaction and the second transaction access the first variable;
  • An execution unit configured to execute the first transaction and the second transaction based on the DAG data.
  • the slave node can execute the transactions without conflicts in parallel according to the DAG data generated by the master node, and the transactions with conflicts can be executed according to the order in the DAG data Execution, thereby improving the efficiency of transaction execution.
  • FIG. 1 is a block chain architecture diagram applied in the embodiment of this specification
  • FIG. 2 is a flow chart of a method for executing a transaction in a blockchain in an embodiment of this specification
  • Fig. 3 is a DAG diagram in an embodiment of this specification.
  • FIG. 4 is an architecture diagram of a block chain master node in an embodiment of this specification.
  • Fig. 5 is an architecture diagram of a block chain slave node in an embodiment of this specification.
  • Fig. 1 shows a block chain architecture diagram applied in the embodiment of this specification.
  • the blockchain includes, for example, 6 nodes including a master node 1, a slave node 2 to a slave node 6.
  • the connection between nodes schematically represents a P2P (Peer to Peer, point-to-point) connection.
  • P2P Peer to Peer, point-to-point
  • These nodes store a full amount of books, that is, store the status of all blocks and all accounts.
  • each node in the blockchain generates the same state in the blockchain by executing the same transaction, and each node in the blockchain stores the same state database.
  • the master node 1 can be responsible for receiving transactions from the client, and initiate a consensus proposal to each slave node.
  • the consensus proposal includes, for example, multiple transactions in the block to be formed (such as block B1) and each Information such as the order in which transactions are submitted. After the nodes in the blockchain successfully reach consensus on the consensus proposal, each node can execute the multiple transactions according to the order of submission in the consensus proposal, thereby generating block B1.
  • block chain shown in FIG. 1 is only exemplary, and the embodiment of this description is not limited to be applied to the block chain shown in FIG. 1 , for example, it can also be applied to a block chain system including sharding.
  • the block chain includes 6 nodes
  • the embodiment of this specification is not limited thereto, but may include other numbers of nodes.
  • the nodes contained in the blockchain can meet Byzantine Fault Tolerance (BFT) requirements.
  • BFT Byzantine Fault Tolerance
  • the Byzantine fault tolerance requirement can be understood as that there may be Byzantine nodes inside the blockchain, but the blockchain does not reflect Byzantine behavior externally.
  • some Byzantine fault-tolerant algorithms require the number of nodes to be greater than 3f+1, where f is the number of Byzantine nodes, such as the practical Byzantine fault-tolerant algorithm PBFT (Practical Byzantine Fault Tolerance).
  • a transaction in the blockchain field may refer to a unit of tasks performed and recorded in the blockchain.
  • a transaction usually includes a sending field (From), a receiving field (To) and a data field (Data).
  • the From field indicates the account address that initiated the transaction (that is, initiates a transfer task to another account)
  • the To field indicates the account address that received the transaction (that is, received the transfer)
  • the Data field Include the transfer amount.
  • the From field indicates the account address that initiated the transaction
  • the To field indicates the account address of the contract called by the transaction
  • the Data field includes the function name in the calling contract
  • the Data such as the incoming parameters of the function are used to obtain the code of the function from the blockchain and execute the code of the function when the transaction is executed.
  • Smart contracts on the blockchain are contracts that can be triggered by transactions on the blockchain system. Smart contracts can be defined in the form of code. Calling a smart contract in Ethereum is to initiate a transaction pointing to the address of the smart contract, so that each node in the Ethereum network runs the smart contract code in a distributed manner. It should be noted that in addition to creating smart contracts by users, smart contracts can also be set by the system in the genesis block. This type of contract is generally called a genesis contract. Generally, some blockchain data structures, parameters, attributes and methods can be set in the genesis contract. In addition, accounts with system administrator privileges can create system-level contracts or modify system-level contracts (referred to as system contracts). Wherein, the system contract can be used to add data structures of different business data in the blockchain.
  • Bob sends a transaction containing information about creating a smart contract (that is, deploying a contract) to the blockchain shown in Figure 1, and the data field of the transaction includes the code of the contract to be created (such as bytecode or machine code), the to field of the transaction is empty to indicate that the transaction is used to deploy the contract.
  • the nodes After the nodes reach an agreement through the consensus mechanism, determine the contract address "0x6f8ae93", each node adds the contract account corresponding to the contract address of the smart contract in the state database, allocates the state storage corresponding to the contract account, and The contract code is saved in the state storage of the contract, so the contract is created successfully.
  • the from field of the transaction is the address of the account of the transaction initiator (ie Bob), "0x6f8ae93" in the to field represents the address of the called smart contract, and the data field of the transaction includes the method and parameters of calling the smart contract.
  • each node in the blockchain can respectively execute the transaction, thereby respectively executing the contract, and updating the state database based on the execution of the contract.
  • transactions can be executed in parallel in blockchain nodes to speed up transaction execution.
  • the blockchain node can execute transactions in parallel through multiple processes in a single machine.
  • the blockchain node can be deployed in a server cluster and execute transactions in parallel through multiple servers.
  • blockchain nodes first divide multiple transactions into multiple transaction groups according to the accounts accessed by the transactions, and each transaction group does not access the same account, so that each transaction group can be executed in parallel.
  • a smart contract is called in a transaction, the variables accessed in the transaction cannot be predicted before the transaction is executed, so multiple transactions cannot be effectively grouped, and transactions cannot be executed in parallel.
  • the master node can execute the transaction and send the execution result to the slave node for verification.
  • the master node will only package non-conflicting transactions during execution and postpone conflicting transactions to The next block is packed so that slave nodes can achieve concurrent verification.
  • this method when the conflict rate between transactions is high, these transactions will be placed in different blocks, which reduces system performance and increases storage costs.
  • Fig. 2 is a flow chart of a method for executing a transaction in a block chain in an embodiment of this specification, the method can be executed by the master node and each slave node shown in Fig. 1, and master node 1 and slave node 2 are shown in Fig. 2 As an example, it is understood that other slave nodes in the blockchain perform the same operations as slave node 2.
  • step S201 the master node pre-executes the received transaction and generates a pre-execution read-write set of the transaction.
  • the pre-execution refers to the execution of the transaction by the master node before making a consensus proposal.
  • the master node 1 Before the consensus proposal, the master node 1 has not set the submission order of each transaction, and the master node 1 can pre-execute the transactions in any order.
  • the master node 1 may pre-execute the received transactions in the order in which they are received, or the master node 1 may also pre-execute the multiple transactions in parallel after receiving multiple transactions at the same time.
  • the master node 1 maintains the latest state set of variables (identified as the pre-execution state set hereinafter) according to the read and write operations of each transaction on the variable, and pre-executes the transaction according to the pre-execution state set.
  • a transaction Txi includes a read operation on variable A and a write operation on variable B.
  • the master node 1 pre-executes the transaction Txi and executes the read operation on the variable A, it determines whether the pre-execution state set has the value of the variable A, if not, reads the value of the variable A from the state database, and in the transaction Txi
  • the key-value pair of variable A is recorded in the pre-execution read set, and the read value of variable A is stored in the pre-execution state set.
  • variable A If the value of variable A is included in the pre-execution state set, variable A is directly read from the pre-execution state set The value of , record the key-value pair of variable A in the pre-execution read set of transaction Txi.
  • the master node 1 executes the write operation on the variable B, it records the key-value pair of the variable B in the pre-execution write set of the transaction Txi.
  • the pre-executed read-write set of the transaction Txi is obtained.
  • the master node 1 After the master node 1 completes the pre-execution of the transaction Txi, it judges whether the pre-execution read set of the transaction Txi is consistent with the variable values in the pre-execution state set. If the pre-execution transaction Txi is consistent, update the pre-execution state set according to the pre-execution read-write set of the transaction Txi, that is, update the key-value pair of variable B in the pre-execution read-write set to the pre-execution state set.
  • step S203 the master node identifies according to the pre-execution read-write set of the transaction, the previously recorded transaction (hereinafter referred to as the latest transaction) that recently updated the transaction access variable (the pre-execution state) through pre-execution before the transaction pre-execution , to generate Directed Acyclic Graph (DAG) data between transactions, indicating the chronological order in which transactions access variables.
  • DAG Directed Acyclic Graph
  • the DAG data is data used to indicate the DAG relationship between transactions, which may be in the form of graphs, tables, data, etc., which is not limited.
  • the DAG data includes the DAG table of each transaction
  • the DAG table of the transaction Txi includes the subsequent transactions and the in-degrees of the transaction Txi, wherein the subsequent transaction refers to a variable accessed through pre-execution (this variable is also a variable accessed by the transaction Txi)
  • the transaction whose chronological order is after transaction Txi is the transaction directly pointed to from transaction Txi in the DAG graph.
  • the in-degree refers to the number of transactions pointing to the transaction TXi in the DAG graph.
  • master node 1 can determine the transaction that most recently updated variable A before the pre-execution of transaction Txi according to the latest transaction index of variable A, assuming that the latest transaction is transaction Txj, then the master node 1 can record the transaction Txi as a subsequent transaction in the DAG table of the transaction Txj, and add 1 to the in-degree of the transaction Txi in the DAG table of the transaction Txi.
  • the master node 1 determines that there is no transaction to update the variable A before the pre-execution of the transaction Txi according to the latest transaction index of the variable A, the master node 1 can bind the latest transaction index of the variable A to the empty transaction and associate with the empty transaction Record the transaction Txi for recording that the transaction Txi reads the variable A.
  • master node 1 can determine the transaction that updated variable B before the pre-execution of transaction Txi according to the latest transaction index of variable B. Assuming that the latest transaction is Txk, master node 1 can determine Txk according to the DAG table of transaction Txk Whether there is a subsequent transaction, if there is a subsequent transaction Txm, the master node 1 can record the transaction Txi as a subsequent transaction in the DAG table of the transaction Txm, add 1 to the in-degree of the transaction Txi in the DAG table of the transaction Txi, and set The latest transaction index of variable B is bound to transaction Txi.
  • the master node 1 can record the transaction Txi as a subsequent transaction in the DAG table of the transaction Txk, and add the in-degree of the transaction Txi to the DAG table of the transaction Txk 1, and bind the latest transaction index of variable B to transaction Txi.
  • master node 1 first pre-executes transaction Tx1, which includes a read operation on variable A. After pre-executing transaction Tx1, the master node 1 sets the latest transaction of variable A as an empty transaction, and sets transaction Tx1 as the associated record of the empty transaction. Based on this, it can be concluded that the in-degree of transaction Tx1 is 0, and as shown in Table 1 Show the DAG table that records transaction Tx1:
  • the master node 1 pre-executes the transaction Tx2, and the transaction Tx2 includes a read operation on variable A and a write operation on variable B.
  • the master node 1 pre-executes and completes the transaction Tx2, according to the recent transaction indexes of variable A and variable B, it can be concluded that the latest transactions of variable A and variable B are all empty transactions, and the in-degree of transaction Tx2 can be concluded as 0.
  • master node 1 pre-executes transaction Tx3, and transaction Tx3 includes a read operation on variable A and a read operation on variable B.
  • transaction Tx3 After the master node 1 pre-executes and completes transaction Tx3, according to the latest transaction index of variable A and variable B, it can be concluded that the latest transaction of variable B is transaction Tx2. That is to say, during the pre-execution process, transaction Tx3 accesses variable B after transaction Tx2 writes variable B, so that the DAG relationship of transaction Tx2 pointing to transaction Tx3 can be recorded.
  • transaction Tx3 is recorded as a subsequent transaction, and the in-degree is added to the DAG table of transaction Tx3 by 1 to indicate the execution order of transaction Tx3 and transaction Tx2, that is, transaction Tx3 is executed after transaction Tx2.
  • master node 1 can record the DAG table of the currently pre-executed transactions as shown in Table 3:
  • the master node 1 also associates transaction Tx3 with the most recent empty transaction of the above-mentioned variable A.
  • the master node 1 pre-executes the transaction Tx4, and the transaction Tx4 includes a write operation to variable A and a read operation to variable B.
  • the related transactions of variable A’s recent empty transaction include transactions Tx1, Tx2 and Tx3, so transaction Tx4 is recorded as Tx1, Tx2 and Tx3 respectively Subsequent transactions to indicate that transaction Tx4 is executed after the execution of Tx1, Tx2 and Tx3 is completed, so as to avoid the execution results of each transaction being different from the pre-execution results due to read-write conflicts.
  • master node 1 can conclude that the latest transaction of variable B is transaction Tx2, so it records transaction Tx4 as the successor transaction of transaction Tx2. Master node 1 can record the DAG table of the currently pre-executed transactions as shown in Table 4:
  • master node 1 also binds the latest transaction index of variable A to transaction Tx4.
  • master node 1 pre-executes transaction Tx5, and transaction Tx4 includes a write operation to variable B.
  • transaction Tx5 can be recorded as the subsequent transaction of transaction Tx2 (transaction Tx3 and transaction Tx4) .
  • Master node 1 can record the DAG table of the currently pre-executed transactions as shown in Table 5:
  • master node 1 also binds the latest transaction index of variable B with transaction Tx5.
  • a DAG diagram as shown in FIG. 3 can be drawn, and the DAG diagram corresponds to the DAG data shown in Table 5.
  • step S205 the master node 1 sends the DAG data of multiple transactions to each slave node.
  • the master node 1 may pre-execute multiple transactions as described above, generate DAG data among the multiple transactions, and send the DAG data of the multiple transactions to each slave node as a consensus proposal. Master node 1 can also send multiple received transactions to each slave node. It can be understood that each slave node may also receive multiple transactions from other slave nodes or clients. Each slave node may also receive the DAG data of the plurality of transactions from other slave nodes.
  • the master node 1 can also generate an executable transaction set with an in-degree of 0 according to the DAG data, and send the transaction set to each slave node together.
  • master node 1 sends the DAG data shown in Table 5 to each slave node
  • master node 1 can obtain an executable transaction set including transaction Tx1 and transaction Tx2 according to the DAG data, and send the executable transaction set to each slave node slave node.
  • the master node 1 can also only send the DAG data of multiple transactions to each slave node, and each slave node can generate an executable transaction set according to the DAG data.
  • step S207 the slave node executes the transaction based on the DAG data.
  • the slave node 2 After the slave node 2 obtains the executable transaction set based on the DAG data, it first executes the transactions in the executable transaction set. Since the in-degrees of the transactions in the executable transaction set are all zero, that is, their execution will not conflict with other transactions, therefore, the master node 1 can execute multiple transactions in the executable transaction set in parallel.
  • the executable transaction set initially includes transaction Tx1 and transaction Tx2 .
  • Slave node 2 can execute transaction Tx1 and transaction Tx2 in parallel. After the slave node 2 completes the execution of the transaction Tx1, it can subtract 1 from the in-degree in the DAG table of the transaction Tx4. After the slave node 2 completes the execution of the transaction Tx2, the in-degrees of the transaction Tx3 and the transaction Tx4 can be respectively reduced by 1 in the DAG table, so that the in-degrees of the transaction Tx3 become 0. At this time, the slave node 2 can The transaction Tx3 is put into the executable transaction set, that is, the slave node 2 can execute the transaction Tx3.
  • slave node 2 After completing the execution of transaction Tx3, slave node 2 will decrease the in-degrees of transaction Tx4 and transaction Tx5 by 1, so that the in-degrees of transaction Tx4 will become 0. Similarly, slave node 2 can put transaction Tx4 into the executable transaction set middle.
  • Fig. 4 is an architecture diagram of a block chain master node in an embodiment of this specification, including:
  • the pre-execution unit 41 is configured to pre-execute the received first transaction, generate a pre-execution read-write set of the first transaction, and the pre-execution read-write set includes access to the first variable;
  • the generation unit 42 is configured to generate DAG data according to the pre-execution read-write set of the first transaction and the identifier of the previously recorded second transaction that most recently updated the first variable, and the second transaction is the pre-execution The most recent transaction before the first transaction that updates the pre-execution state of the first variable after pre-execution, and the DAG data indicates the chronological order in which the first transaction and the second transaction access the first variable ;
  • a sending unit 43 configured to send the DAG data to the slave nodes of the block chain.
  • the pre-execution unit is specifically configured to pre-execute the received first transaction based on the pre-execution state set, and after the pre-execution completes the first transaction, based on the pre-execution read of the first transaction A write set updates the pre-execution state set.
  • the DAG data includes DAG tables of multiple transactions that have been pre-executed, and the DAG table of each transaction includes the number of subsequent transactions and inbound transactions of the transaction in the DAG graph.
  • the pre-execution read-write set includes a read operation on the first variable
  • the generation unit 42 is specifically configured to: add the first transaction to the DAG table of the second transaction Recording as a subsequent transaction of the second transaction, adding 1 to the in-degree of the first transaction in the DAG table of the first transaction.
  • the pre-execution read-write set includes a write operation on the first variable
  • the generating unit 42 is specifically configured to: read the DAG table of the second transaction, and in the second Where the transaction has a subsequent fourth transaction, record the first transaction as the successor transaction of the fourth transaction in the DAG table of the fourth transaction, and record all the subsequent transactions in the DAG table of the first transaction
  • the in-degree of the first transaction is increased by 1, and the first transaction is recorded as the transaction for which the first variable is updated most recently.
  • the generating unit 42 is specifically configured to: record the first transaction as the second transaction in the DAG table of the second transaction when the second transaction has no subsequent transaction For the subsequent transaction of the second transaction, add 1 to the in-degree of the first transaction in the DAG table of the first transaction, and record the first transaction as the transaction that most recently updated the first variable.
  • the master node further includes: an acquisition unit (not shown), configured to acquire a first set according to the respective DAG tables of the multiple transactions, and the first set includes the multiple transactions with zero in-degree,
  • the sending unit 43 is further configured to send the first set to the slave node.
  • Fig. 5 is an architecture diagram of a block chain slave node in an embodiment of this specification, including:
  • a receiving unit 51 configured to receive DAG data from the master node of the blockchain, the DAG data indicating the time sequence in which the first transaction and the second transaction access the first variable;
  • An execution unit 52 configured to execute the first transaction and the second transaction based on the DAG data.
  • the slave node can execute the transactions without conflicts in parallel according to the DAG data generated by the master node, and the transactions with conflicts can be executed according to the order in the DAG data Execution, thereby improving the efficiency of transaction execution.
  • the improvement of a technology can be clearly distinguished as an improvement in hardware (for example, improvements in circuit structures such as diodes, transistors, and switches) or improvements in software (improvement in method flow).
  • improvements in circuit structures such as diodes, transistors, and switches
  • improvements in software improvement in method flow
  • the improvement of many current method flows can be regarded as the direct improvement of the hardware circuit structure.
  • Designers almost always get the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that the improvement of a method flow cannot be realized by hardware physical modules.
  • a programmable logic device Programmable Logic Device, PLD
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • ABEL Advanced Boolean Expression Language
  • AHDL Altera Hardware Description Language
  • HDCal JHDL
  • Lava Lava
  • Lola MyHDL
  • PALASM RHDL
  • VHDL Very-High-Speed Integrated Circuit Hardware Description Language
  • Verilog Verilog
  • the controller may be implemented in any suitable way, for example the controller may take the form of a microprocessor or processor and a computer readable medium storing computer readable program code (such as software or firmware) executable by the (micro)processor , logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers and embedded microcontrollers, examples of controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the control logic of the memory.
  • controller in addition to realizing the controller in a purely computer-readable program code mode, it is entirely possible to make the controller use logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded The same function can be realized in the form of a microcontroller or the like. Therefore, such a controller can be regarded as a hardware component, and the devices included in it for realizing various functions can also be regarded as structures within the hardware component. Or even, means for realizing various functions can be regarded as a structure within both a software module realizing a method and a hardware component.
  • the systems, devices, modules, or units described in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions.
  • a typical implementation device is a server system.
  • the computer that realizes the functions of the above embodiments can be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, a personal digital assistant , media players, navigation devices, email devices, game consoles, tablet computers, wearable devices, or any combination of these devices.
  • one or more embodiments of the present specification provide the operation steps of the method described in the embodiment or the flowchart, more or fewer operation steps may be included based on conventional or non-inventive means.
  • the sequence of steps enumerated in the embodiments is only one of the execution sequences of many steps, and does not represent the only execution sequence.
  • the methods shown in the embodiments or drawings can be executed sequentially or in parallel (such as a parallel processor or multi-thread processing environment, or even a distributed data processing environment).
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the instructions
  • the device realizes the function specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer readable media, in the form of random access memory (RAM) and/or nonvolatile memory such as read-only memory (ROM) or flash RAM. Memory is an example of computer readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash random access memory
  • Computer-readable media including both permanent and non-permanent, removable and non-removable media, can be implemented by any method or technology for storage of information.
  • Information may be computer readable instructions, data structures, modules of a program, or other data.
  • Examples of computer storage media 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), Electrically Erasable Programmable Read-Only Memory (EEPROM), Flash memory or other memory technology, Compact Disc Read-Only Memory (CD-ROM), Digital Versatile Disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by computing devices.
  • computer-readable media excludes transitory computer-readable media, such as modulated data signals and carrier waves.
  • one or more embodiments of this specification may be provided as a method, system or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. The form of the product.
  • program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types.
  • program modules may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network.
  • program modules may be located in both local and remote computer storage media including storage devices.

Abstract

L'invention concerne un procédé d'exécution d'une transaction dans une chaîne de blocs, une chaîne de blocs, un nœud maître et un nœud esclave. Le procédé comprend les étapes suivantes : un nœud principal pré-exécute une première transaction reçue pour générer un ensemble de lecture-écriture de pré-exécution de la première transaction, l'ensemble de lecture-écriture de pré-exécution comprenant un accès à une première variable ; le nœud maître génère des données DAG selon l'ensemble de lecture-écriture de pré-exécution de la première transaction et un identifiant d'une deuxième transaction enregistrée précédemment qui met à jour le plus récemment la première variable, la deuxième transaction étant la transaction qui met à jour le plus récemment un état de pré-exécution de la première variable après pré-exécution avant que la première transaction ne soit pré-exécutée, les données DAG indiquant une séquence temporelle dans laquelle la première transaction et la deuxième transaction accèdent à la première variable ; le nœud maître envoie les données DAG à un nœud esclave ; et le nœud esclave exécute la première transaction et la deuxième transaction sur la base des données DAG.
PCT/CN2022/135338 2022-02-25 2022-11-30 Procédé d'exécution de transaction, chaîne de blocs, nœud maître et nœud esclave WO2023160085A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210181705.2 2022-02-25
CN202210181705.2A CN114547203A (zh) 2022-02-25 2022-02-25 执行交易的方法、区块链、主节点和从节点

Publications (1)

Publication Number Publication Date
WO2023160085A1 true WO2023160085A1 (fr) 2023-08-31

Family

ID=81679309

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135338 WO2023160085A1 (fr) 2022-02-25 2022-11-30 Procédé d'exécution de transaction, chaîne de blocs, nœud maître et nœud esclave

Country Status (2)

Country Link
CN (1) CN114547203A (fr)
WO (1) WO2023160085A1 (fr)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114529417A (zh) * 2022-02-25 2022-05-24 蚂蚁区块链科技(上海)有限公司 执行交易的方法、区块链、主节点和从节点
CN114547203A (zh) * 2022-02-25 2022-05-27 蚂蚁区块链科技(上海)有限公司 执行交易的方法、区块链、主节点和从节点
CN115150409A (zh) * 2022-06-29 2022-10-04 蚂蚁区块链科技(上海)有限公司 在区块链系统中执行交易的方法、区块链系统和节点

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112150163A (zh) * 2020-11-26 2020-12-29 北京微芯区块链与边缘计算研究院 区块链的合约交易并行执行方法及装置
US20210091957A1 (en) * 2019-09-25 2021-03-25 International Business Machines Corporation Consensus protocol for blockchain dag structure
CN113674095A (zh) * 2021-10-20 2021-11-19 浙商银行股份有限公司 一种基于交易dag提高区块链吞吐量的方法
CN113743941A (zh) * 2021-11-04 2021-12-03 支付宝(杭州)信息技术有限公司 一种在区块链中执行交易的方法、区块链和主节点
CN113743942A (zh) * 2021-11-04 2021-12-03 支付宝(杭州)信息技术有限公司 交易执行方法、区块链、主节点和主存储设备
CN114547203A (zh) * 2022-02-25 2022-05-27 蚂蚁区块链科技(上海)有限公司 执行交易的方法、区块链、主节点和从节点

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210091957A1 (en) * 2019-09-25 2021-03-25 International Business Machines Corporation Consensus protocol for blockchain dag structure
CN112150163A (zh) * 2020-11-26 2020-12-29 北京微芯区块链与边缘计算研究院 区块链的合约交易并行执行方法及装置
CN113674095A (zh) * 2021-10-20 2021-11-19 浙商银行股份有限公司 一种基于交易dag提高区块链吞吐量的方法
CN113743941A (zh) * 2021-11-04 2021-12-03 支付宝(杭州)信息技术有限公司 一种在区块链中执行交易的方法、区块链和主节点
CN113743942A (zh) * 2021-11-04 2021-12-03 支付宝(杭州)信息技术有限公司 交易执行方法、区块链、主节点和主存储设备
CN114547203A (zh) * 2022-02-25 2022-05-27 蚂蚁区块链科技(上海)有限公司 执行交易的方法、区块链、主节点和从节点

Also Published As

Publication number Publication date
CN114547203A (zh) 2022-05-27

Similar Documents

Publication Publication Date Title
WO2023160085A1 (fr) Procédé d'exécution de transaction, chaîne de blocs, nœud maître et nœud esclave
WO2020082871A1 (fr) Procédé, dispositif et système d'exécution de transactions de chaîne de blocs en parallèle
WO2023160083A1 (fr) Procédé d'exécution de transactions, blockchain, nœud maître et nœud esclave
CN114827165B (zh) 对多个交易进行分组的方法和区块链节点
TWI719797B (zh) 區塊鏈中智能合約的儲存、執行方法及裝置和電子設備
WO2023231336A1 (fr) Procédé d'exécution de transaction et nœud de chaîne de blocs
WO2024001024A1 (fr) Procédé d'exécution d'une transaction dans un système de chaîne de blocs, et système et nœuds de chaîne de blocs
TWI679581B (zh) 任務執行的方法及裝置
CN108599973B (zh) 一种日志关联方法、装置及设备
WO2023231337A1 (fr) Procédé d'exécution d'une transaction dans une chaîne de blocs, et nœud maître et nœud esclave de chaîne de blocs
WO2023231335A1 (fr) Procédé d'exécution d'une transaction dans une chaîne de blocs, et nœud maître de chaîne de blocs
EP3779692A1 (fr) Procédé et dispositif de traitement de données, client et serveur
WO2024001025A1 (fr) Procédé de nettoyage de données en mémoire cache de pré-exécution et nœud de chaîne de blocs
WO2024001032A1 (fr) Procédé d'exécution d'une transaction dans un système de chaîne de blocs, et système et nœuds de chaîne de blocs
CN116305298B (zh) 一种算力资源管理方法、装置、存储介质及电子设备
WO2023231342A1 (fr) Procédé et appareil pour exécuter automatiquement un contrat sur la base d'un état variable
WO2023240933A1 (fr) Procédé et appareil de déploiement d'application distribuée sur la base d'une chaîne de blocs
CN116032756A (zh) 基于区块链更新应用程序的配置信息的方法和区块链节点
CN116366666A (zh) 区块链系统中的链状态更新方法和区块链节点
WO2024092932A1 (fr) Procédé d'exécution de transaction et nœud de chaîne de blocs
CN116881361A (zh) 交易的执行方法、节点和区块链系统
CN116662292A (zh) 交易的执行方法、节点和区块链系统
CN116821242A (zh) 区块同步方法、装置及区块链系统
CN116204335A (zh) 区块生成方法及装置
CN116993502A (zh) 基于区块链系统的提示词管理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22928345

Country of ref document: EP

Kind code of ref document: A1