A method and apparatus for parallel execution of blockchain transactions based on read-write sets.

By generating read/write sets and constructing a transaction dependency graph during blockchain transaction construction, and dynamically adjusting dependencies, the problem of serial execution of blockchain transactions is solved, parallel execution is achieved, and transaction efficiency and success rate are improved.

CN117709957BActive Publication Date: 2026-07-17DAREWAY SOFTWARE

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DAREWAY SOFTWARE
Filing Date
2023-12-28
Publication Date
2026-07-17

Smart Images

  • Figure CN117709957B_ABST
    Figure CN117709957B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of blockchain technology and provides a method and apparatus for parallel execution of blockchain transactions based on read-write sets. It improves transaction execution efficiency and performance by invoking smart contracts for pre-execution during transaction construction, maintaining a temporary world state, and generating read-write sets. During block construction, it directly constructs a transaction dependency graph based on the read-write sets, transforming a sequential transaction execution sequence into a parallel one. This parallel execution method, which dynamically adjusts dependencies based on read-write sets, enhances transaction execution efficiency. Furthermore, by maintaining the temporary state and pre-executing during construction, it filters out invalid transaction requests, improves the accuracy of read-write sets, and further improves performance and transaction execution success rate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain technology, and in particular relates to a method and apparatus for parallel execution of blockchain transactions based on read-write sets. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] In traditional smart contract transaction models, to avoid conflicts between transactions and ensure consistency of execution results, transactions are executed and verified sequentially during block construction and consensus verification. This process is time-consuming and cannot fully utilize the parallel processing capabilities of multi-core processors. While maintaining consistency, parallel execution of transactions is an important method to improve the performance of blockchain smart contract transactions. However, this requires addressing several issues, including conflicts between transactions, the complex operations and computations inherent in Turing-complete languages, the generation and analysis of read / write dependencies, and the potential for conflict relationships to change with the execution order.

[0004] The inventors discovered that the patent publication number [CN 112150163 A] "Method and Apparatus for Parallel Execution of Contract Transactions in Blockchain" provides a method for generating and analyzing read / write dependencies by performing multiple rounds of pre-execution of transactions through a block building node, and then executing the transactions in parallel based on the generated dependencies. However, this method has the following problems: first, the block building node has a performance bottleneck; second, repeated analysis and repeated parallel execution also affect efficiency. Summary of the Invention

[0005] To address at least one of the technical problems mentioned above, this invention provides a method and apparatus for parallel execution of blockchain transactions based on read-write sets. This method pre-executes a smart contract during transaction construction, maintains a temporary world state, and generates a read-write set. During block construction, it directly constructs a transaction dependency graph based on the read-write set, transforming a sequential transaction execution sequence into a parallel one. This parallel execution approach, dynamically adjusting dependencies based on the read-write set, improves transaction execution efficiency and performance. Furthermore, by maintaining the temporary state and pre-executing during construction, invalid transaction requests can be filtered out, improving the accuracy of the read-write set and further enhancing performance and increasing the transaction execution success rate.

[0006] To achieve the above objectives, the present invention adopts the following technical solution:

[0007] A first aspect of the present invention provides a method for parallel execution of blockchain transactions based on read-write sets, comprising the following steps:

[0008] Receive a transaction construction request, invoke the smart contract to pre-execute, maintain the pre-execution result in the temporary world state, generate a read-write set based on the pre-execution result, and construct the transaction;

[0009] For the transaction sequence packaged into a block, a transaction dependency graph is established based on the read / write set and the sorting relationship;

[0010] Based on the transaction dependency graph, each transaction is verified and executed in parallel. During execution, the transaction dependency graph is dynamically adjusted based on read-write relationships. After all transactions have been executed, the executed transactions are packaged into a block, and the block and the final transaction dependency graph are broadcast. The step of dynamically adjusting the transaction dependency graph based on read-write relationships during execution includes:

[0011] When executing each transaction in parallel, if there are dependency conflicts in the execution result, the original transaction dependency graph is updated, the affected transactions are rolled back and re-added to the dependency graph to be executed, and other added dependencies are synchronously updated to the dependency graph to be executed, so as to realize the dynamic adjustment of dependencies based on the read and write sets during the execution process.

[0012] Other nodes verify the legality of blocks by performing parallel verification of transactions based on the received blocks and transaction dependency graph.

[0013] Furthermore, the step of parallel verification and execution of each transaction based on the transaction dependency graph includes:

[0014] Create a copy of the transaction dependency graph as the pending dependency graph. Select all nodes with an out-degree of 0 from the pending dependency graph and execute the transactions. Remove the executed transactions from the pending dependency graph and continue to select all transactions with an out-degree of 0 and execute them in parallel until all transactions are completed.

[0015] Furthermore, the verification execution steps for each transaction include:

[0016] Compare the values ​​in the read set with the values ​​in the current world state. If they match, directly update the world state with the changed state using the write set, without calling the contract execution to update the world state. If they do not match, call the contract execution, update the world state, and generate a read-write set. Analyze whether the new read-write set causes changes to the original dependency graph. If it does, return a dependency conflict.

[0017] Furthermore, the read set is the set of state kv pairs that a transaction has read, and the write set is the set of state kv pairs that a transaction has written.

[0018] Furthermore, the transaction dependency graph is a directed acyclic graph. The vertices of the dependency graph are all transactions to be packaged into a block. If at least one k exists in the write set of two transactions and also exists in the read and write set of another transaction, then there is one and only one connected path between the vertices formed by the two transactions. The direction of the connection is from the larger sequence number to the smaller sequence number, and the transaction with the larger sequence number will be executed after the transaction with the smaller sequence number.

[0019] Furthermore, the legality verification of the block includes:

[0020] If a dependency conflict exists in the execution result of each transaction during parallel verification, the parallel verification of the transaction is terminated, and the block verification fails.

[0021] Furthermore, if the state root is consistent with the state root carried in the block after all transactions have been executed, it indicates that the transaction state execution within the block is consistent.

[0022] A second aspect of the present invention provides a blockchain transaction parallel execution device based on read-write sets, comprising:

[0023] The transaction construction module is configured to receive transaction construction requests, invoke smart contract pre-execution, maintain the pre-execution results in a temporary world state, generate read-write sets based on the pre-execution results, and construct transactions.

[0024] The dependency graph construction module is configured to build a transaction dependency graph based on the read-write set and sorting relationship for the sequence of transactions to be packaged into a block;

[0025] The parallel transaction execution module is configured to verify and execute each transaction in parallel based on a transaction dependency graph. During execution, it dynamically adjusts the transaction dependency graph based on read-write relationships. After all transactions are executed, the executed transactions are packaged into a block, and the block and the final transaction dependency graph are broadcast. The step of dynamically adjusting the transaction dependency graph based on read-write relationships during execution includes:

[0026] When executing each transaction in parallel, if there are dependency conflicts in the execution result, the original transaction dependency graph is updated, the affected transactions are rolled back and re-added to the dependency graph to be executed, and other added dependencies are synchronously updated to the dependency graph to be executed, so as to realize the dynamic adjustment of dependencies based on the read and write sets during the execution process.

[0027] The verification module is configured to allow other nodes to verify and execute transactions in parallel according to the transaction dependency graph received, thereby verifying the legality of the blocks.

[0028] A third aspect of the present invention provides a computer-readable storage medium.

[0029] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a method for parallel execution of blockchain transactions based on a read-write set as described in the first aspect.

[0030] A fourth aspect of the present invention provides a computer device.

[0031] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of a method for parallel execution of blockchain transactions based on a read-write set as described in the first aspect.

[0032] Compared with the prior art, the beneficial effects of the present invention are:

[0033] 1. This invention pre-executes smart contracts during transaction construction to maintain a temporary world state and collect and generate read / write sets. Firstly, pre-execution allows for the timely detection and termination of illegitimate transaction requests, reducing illegal transactions and increasing the success rate of on-chain transactions. Secondly, maintaining the temporary world state ensures more accurate contract pre-execution results and more accurate collected read / write sets, solving previous problems such as difficulties in reading / write set collection and inaccurate results. Thirdly, by advancing the collection of read / write sets to the transaction construction stage, the pressure on block construction nodes can be distributed, preventing them from becoming bottlenecks.

[0034] 2. This invention, through the pre-analyzed read-write set, can directly use the read-write set to change the world state during execution, saving the process of calling the contract to execute and improving performance.

[0035] 3. By using the pre-analyzed read / write set, this invention can complete the construction of the dependency graph before execution, transforming the globally serialized transaction sequence into a parallel execution sequence, thereby achieving parallel execution of transactions. This can fully utilize computing resources, improve transaction execution efficiency, increase transaction throughput, and enhance performance.

[0036] 4. The block verification process in this invention can directly start the parallel execution of transactions through the dependency graph during block construction. Furthermore, through the transaction dependency relationship, block construction errors can be detected early, verification can be completed, and performance can be further improved.

[0037] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0038] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0039] Figure 1 This is a flowchart of a blockchain transaction parallel execution method based on read-write sets provided in an embodiment of the present invention;

[0040] Figure 2 This is a flowchart of the parallel execution of transactions to construct blocks provided in an embodiment of the present invention;

[0041] Figure 3 These are the execution steps for each transaction provided in the embodiments of the present invention;

[0042] Figure 4 This is a flowchart of the legality verification process for blocks provided in an embodiment of the present invention;

[0043] Figure 5 This is a structural block diagram of a blockchain transaction parallel execution device based on a read-write set provided in an embodiment of the present invention;

[0044] Figure 6 It is a globally serialized transaction sequence and its read / write set according to an exemplary embodiment of the present invention;

[0045] Figure 7 It is based on the block construction time. Figure 6 The transaction dependency graph established by the serialized sequence is shown.

[0046] Figure 8 Based on Figure 7 The diagram shown illustrates the parallel execution process of transactions during block construction using the transaction dependency graph.

[0047] Figure 9 It is the final dependency graph after the blocks have been built and corrected;

[0048] Figure 10 Based on Figure 8 The final transaction dependency formed Figure 9 The diagram shows the process of performing verification in parallel with the constructed blocks. Detailed Implementation

[0049] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0050] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0051] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0052] Terminology Explanation

[0053] The read-write set consists of the read set and the write set. The read set is the set of key-value pairs of the world state that the transaction execution has read, and the write set is the set of key-value pairs of the world state that the transaction execution has written.

[0054] A transaction dependency graph is a directed acyclic graph (DAG). In the graph, each vertex represents a transaction, and each directed edge represents a starting transaction that depends on an ending transaction. The starting transaction must be executed after the ending transaction.

[0055] Example 1

[0056] like Figure 1 As shown, this embodiment of the invention provides a method for parallel execution of blockchain transactions based on read-write sets, including the following steps:

[0057] S101: Construct transactions and generate read / write sets.

[0058] Receive a transaction construction request, invoke the smart contract to pre-execute, maintain the pre-execution result in the temporary world state, generate a read-write set based on the pre-execution result, and construct the transaction.

[0059] S102: For the transaction sequence packaged into the block, establish a transaction dependency graph based on the read-write set and sorting relationship.

[0060] The vertices of the dependency graph are all transactions to be packaged into a block. If at least one 'k' exists in the write set of two transactions and also exists in the read set of another transaction, then there is one and only one connected path between the vertices formed by the two transactions. The direction of the connection is from the larger sequence number to the smaller sequence number, and the larger one must be executed after the smaller one.

[0061] S103: Parallel execution of transactions to build blocks. Create a copy of the transaction dependency graph as the dependency graph to be executed. Select all transactions with an out-degree of 0 from the dependency graph to be executed and execute each transaction in parallel. After the transaction is executed, remove the executed transactions from the dependency graph to be executed, and continue to select transactions with an out-degree of 0 from them for parallel execution and update the dependency graph after execution, until all transactions are executed.

[0062] like Figure 2 As shown, the specific steps include the following:

[0063] S301: Create a copy of the transaction dependency graph as a dependency graph to be executed;

[0064] S302: Select all transactions with an out-degree of 0 from the dependency graph to be executed and execute each transaction in parallel;

[0065] S303: Determine if there is a dependency conflict in the execution result of the parallel transaction. If so, proceed to S304; otherwise, proceed to S307.

[0066] S304: Update the original transaction dependency graph;

[0067] S305: Based on the updated transaction dependency graph, analyze and roll back the affected transactions, and re-add them to the pending execution dependency graph;

[0068] S306: Remove the completed transaction from the pending transaction dependency graph and update the added dependency relationship to the pending dependency graph synchronously, then proceed to S308;

[0069] S307: Remove completed transactions from the dependency graph of pending transactions;

[0070] S308: If the dependency graph to be executed is not empty, go to S302; otherwise, end the build process.

[0071] Specifically, the execution steps for each transaction in S302 are as follows: Figure 3 As shown, it specifically includes:

[0072] S3021: Compare the values ​​in the read set with the values ​​in the current world state. If they match, proceed to S3022; otherwise, proceed to S3023.

[0073] S3022: Directly update the changed state to the world state using the write set, without calling contract execution to update the world state;

[0074] S3023: Invoke the contract execution, update the world state and generate a read-write set;

[0075] S3024: Analyze whether the new read / write set causes changes to the original dependency graph. If it does, return the dependency conflict.

[0076] S104: Other consensus nodes verify and execute the new block.

[0077] Other nodes verify and execute transactions in parallel according to the received blocks and transaction dependency graph, and perform block validity verification.

[0078] like Figure 4 As shown, it specifically includes:

[0079] S401: Create a copy of the transaction dependency graph as a dependency graph to be executed;

[0080] S402: Select all nodes with an out-degree of 0 from the dependency graph to be executed and execute the transactions. Transaction execution S403 follows the same transaction execution steps as during block construction. Figure 3 ;

[0081] S404: Receive transaction execution result;

[0082] S405-406: Determine if there are dependency conflicts in the transaction execution result. If so, the block is invalid. End the block verification and return that the block verification failed.

[0083] S407: Remove completed transactions from the pending dependency graph;

[0084] S408: If the dependency graph is not empty, go to S402; otherwise, complete the verification.

[0085] like Figure 6 As shown, in this embodiment, the transaction sequence preferably includes 8 transactions tx0, tx1, ..., tx7. The numbers in the transactions represent the order of the transactions. The read set is the set of state kv pairs that the transaction has read, and the write set is the set of state kv pairs that the transaction has written. Different numbers of v in the same k represent different values, and the same expression of v in different k expresses different values.

[0086] like Figure 7 The diagram shows the initial dependency graph during block construction. The underlined numbers are transaction numbers, representing the corresponding transactions. The k:v below indicates the k\v value read, and the arrows indicate the values ​​written to k.

[0087] like Figure 8 As shown, it is based on Figure 7 The diagram shows the parallel execution process of transactions during block construction using the transaction dependency graph. State 0 is the initial state, and only the initial values ​​of the states involved are listed. The initial dependency graph to be executed, 0, is a copy of the initial dependency graph.

[0088] In the first round, transactions tx0, tx1, and tx2 with an out-degree of 0 are selected from the dependency graph to be executed and executed in parallel. The read set state value is consistent with state 0. All transactions are directly maintained in the world state according to the read and write sets to obtain state 1. The executed transactions tx0, tx1, and tx2 are removed from the dependency graph to obtain the first version of the dependency graph to be executed.

[0089] The second round, from pending dependencies Figure 1Transactions tx3, tx4, and tx5 with an out-degree of 0 are selected and executed in parallel. The current state value of k7, which depends on Tx4, is v1, which is inconsistent with the value read in the read-write set during construction. The contract is called to execute tx4, and the read-write of k8 is added to the new read-write set. The original transaction dependency graph is updated, and a directed edge from tx6 to tx4 is added. This does not affect the transactions that have already been executed. The executed transactions tx3, tx4, and tx5 are removed from the pending dependency graph to obtain the second version of the pending dependency graph.

[0090] The third round, from pending dependencies Figure 2 Transactions tx6 and tx7 with an out-degree of 0 are selected and executed in parallel. tx6 depends on k8, and the current state of k8 is inconsistent with that in the read set. The contract is invoked to execute tx6, while tx7 is executed directly based on the read and write sets. After the transactions tx6 and tx7 are executed, they are removed from the dependency graph to obtain version 3 of the dependency graph to be executed. The dependency graph is empty, all transactions are executed, and the state root is calculated based on state 3 to complete block construction.

[0091] like Figure 10 As shown, it is based on Figure 9 Parallel execution verification process for transactions:

[0092] At time t0, based on Figure 9 Create a replica to obtain the dependency graph to be executed. In the graph, tx0, tx1, and tx2 have an out-degree of 0. Start execution.

[0093] At time t1: after tx2 finishes execution, the dependency graph to be executed is updated, the out-degrees of tx4 and tx5 become 0, and execution begins;

[0094] At time t2: tx1 finishes execution, updates the dependency graph to be executed, tx3's out-degree becomes 0, and execution begins;

[0095] At time t3: after tx4 finishes execution, the dependency graph to be executed is refined, the out-degree of tx7 becomes 0, and execution begins;

[0096] At time t4: tx3 finishes execution, updates the dependency graph to be executed, tx6's out-degree becomes 0, and execution begins;

[0097] At time t5, the dependency graph to be executed becomes empty, and all executions are complete.

[0098] Example 2

[0099] This embodiment provides a blockchain transaction parallel execution device based on read-write sets, such as... Figure 5 As shown, it includes: a transaction construction module 501, a block construction module 502, and a block-based transaction parallel verification and execution module 503.

[0100] The transaction construction module 501 is configured to receive a transaction construction request, invoke smart contract pre-execution to maintain the temporary world state, collect the read / write set, and construct the transaction body. It includes a smart contract execution module 5011, a temporary world state maintenance module 5012, a read / write set generation module 5013, and a transaction construction module 5014.

[0101] The smart contract execution module 5011 is configured to invoke the smart contract to pre-execute the contract operation of the transaction request, and to filter illegal requests, update the temporary world state, and collect the read-write set.

[0102] The temporary world state maintenance module 5012 is configured to maintain the world state after the smart contract is successfully pre-executed during transaction construction, and to update the temporary state after the block is uploaded to the chain.

[0103] The read / write set generation module 5013 is configured to generate a state read / write set that has been invoked by the smart contract based on the temporary world state result after the pre-execution contract request.

[0104] The transaction construction module 5014 is configured to construct transactions, which include read / write sets, signatures, and other information in the chain-defined transaction structure.

[0105] The block construction module 502 is configured to execute transactions in parallel to construct blocks. It includes a dependency graph construction module 5021 and a transaction parallel execution module 5022.

[0106] The dependency graph construction module 5021 is configured to analyze the read-write dependencies between the transaction sequences to be packaged in the block and construct a transaction dependency graph. The execution method of read-write dependency analysis and dependency graph construction is as described in S102 of the embodiment of a blockchain transaction parallel execution method based on read-write sets, and will not be repeated here.

[0107] The transaction parallel execution module 5022 is configured to perform parallel execution of transactions based on the transaction dependency graph. The parallel execution method of the transactions is as described in S103 of the blockchain transaction parallel execution method based on read-write sets in Embodiment 1, and will not be repeated here.

[0108] The in-block transaction parallel execution verification module 503 is configured to verify the block by performing parallel execution of transactions on the new block. The parallel execution verification method is as described in S104 of the blockchain transaction parallel execution method based on read-write sets in Embodiment 1, and will not be repeated here.

[0109] Example 3

[0110] This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in a blockchain transaction parallel execution method based on a read-write set as described in Embodiment 1.

[0111] Example 4

[0112] This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the parallel execution method of blockchain transactions based on read-write sets as described in Embodiment 1.

[0113] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage and optical storage) containing computer-usable program code.

[0114] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0115] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0116] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0117] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0118] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for parallel execution of blockchain transactions based on read-write sets, characterized in that, Includes the following steps: Receive a transaction construction request, invoke the smart contract to pre-execute, maintain the pre-execution result in the temporary world state, generate a read-write set based on the pre-execution result, and construct the transaction; For the transaction sequence packaged into a block, a transaction dependency graph is established based on the read / write set and the sorting relationship; Based on the transaction dependency graph, each transaction is verified and executed in parallel. During execution, the transaction dependency graph is dynamically adjusted based on read-write relationships. After all transactions have been executed, the executed transactions are packaged into a block, and the block and the final transaction dependency graph are broadcast. The step of dynamically adjusting the transaction dependency graph based on read-write relationships during execution includes: When executing each transaction in parallel, if there are dependency conflicts in the execution result, the original transaction dependency graph is updated, the affected transactions are rolled back and re-added to the dependency graph to be executed, and other added dependencies are synchronously updated to the dependency graph to be executed, so as to realize the dynamic adjustment of dependencies based on the read and write sets during the execution process. Other nodes verify and execute transactions in parallel based on the received blocks and transaction dependency graph, thus verifying the legality of the blocks. The verification process for each transaction includes: Compare the values ​​in the read set with the values ​​in the current world state. If they match, directly update the world state with the changed state using the write set, without calling the contract execution to update the world state. If they do not match, call the contract execution, update the world state, and generate a read-write set. Analyze whether the new read-write set causes changes to the original dependency graph. If it does, return a dependency conflict.

2. The method for parallel execution of blockchain transactions based on read-write sets as described in claim 1, characterized in that, The steps for parallel verification and execution of each transaction based on the transaction dependency graph include: Create a copy of the transaction dependency graph as the dependency graph to be executed. Select all nodes with an out-degree of 0 from the dependency graph to be executed and execute each transaction in parallel. After the transaction is executed, remove the executed transactions from the dependency graph to be executed, and continue to select nodes with an out-degree of 0 from them and execute them in parallel. Update the dependency graph after each execution until all transactions are executed.

3. The method for parallel execution of blockchain transactions based on read-write sets as described in claim 1, characterized in that, The read set is the set of key-value pairs of states that a transaction has read, and the write set is the set of key-value pairs of states that a transaction has written.

4. The method for parallel execution of blockchain transactions based on read-write sets as described in claim 1, characterized in that, The transaction dependency graph is a directed acyclic graph. The vertices of the dependency graph are all the transactions to be packaged into a block. If at least one k exists in the write set of two transactions and also exists in the read and write set of another transaction, then there is one and only one connected path between the vertices formed by the two transactions. The direction of the connection is from the larger sequence number to the smaller sequence number, and the transaction with the larger sequence number will be executed after the transaction with the smaller sequence number.

5. The method for parallel execution of blockchain transactions based on read-write sets as described in claim 1, characterized in that, The validity verification of the block includes: If a dependency conflict exists in the execution result of each transaction during parallel verification, the parallel verification of the transaction is terminated, and the block verification fails.

6. The method for parallel execution of blockchain transactions based on read-write sets as described in claim 5, characterized in that, After all transactions have been executed, if the state root is consistent with the state root carried in the block, it means that the transaction state within the block has been executed in a consistent manner.

7. A blockchain transaction parallel execution device based on read-write sets, characterized in that, include: The transaction construction module is configured to receive transaction construction requests, invoke smart contract pre-execution, maintain the pre-execution results in a temporary world state, generate read-write sets based on the pre-execution results, and construct transactions. The dependency graph construction module is configured to build a transaction dependency graph based on the read-write set and sorting relationship for the sequence of transactions to be packaged into a block; The parallel transaction execution module is configured to verify and execute each transaction in parallel based on a transaction dependency graph. During execution, it dynamically adjusts the transaction dependency graph based on read-write relationships. After all transactions are executed, the executed transactions are packaged into a block, and the block and the final transaction dependency graph are broadcast. The step of dynamically adjusting the transaction dependency graph based on read-write relationships during execution includes: When executing each transaction in parallel, if there are dependency conflicts in the execution result, the original transaction dependency graph is updated, the affected transactions are rolled back and re-added to the dependency graph to be executed, and other added dependencies are synchronously updated to the dependency graph to be executed, so as to realize the dynamic adjustment of dependencies based on the read and write sets during the execution process. The verification module is configured to allow other nodes to verify and execute transactions in parallel according to the transaction dependency graph, thereby verifying the legality of the blocks. The verification process for each transaction includes: Compare the values ​​in the read set with the values ​​in the current world state. If they match, directly update the world state with the changed state using the write set, without calling the contract execution to update the world state. If they do not match, call the contract execution, update the world state, and generate a read-write set. Analyze whether the new read-write set causes changes to the original dependency graph. If it does, return a dependency conflict.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the method for parallel execution of blockchain transactions based on a read-write set as described in any one of claims 1-6.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the method for parallel execution of blockchain transactions based on read-write sets as described in any one of claims 1-6.