Method and device for executing transactions in blockchain system

By dividing the blockchain system into execution sharding and consensus sharding, and using the functions of consensus sharding and execution sharding, the problem of insufficient scalability of the blockchain system is solved, and the fault tolerance rate and transaction execution efficiency are improved.

CN113656508BActive Publication Date: 2025-03-25ALIPAY (HANGZHOU) INFORMATION TECH CO LTD +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110989740.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-26
Publication Date
2025-03-25
Estimated Expiration
2041-08-26

AI Technical Summary

Technical Problem

Blockchain systems have weak scalability in computing and storage, resulting in insufficient throughput and difficult to meet the needs of applications.

Method used

By dividing the blockchain system into execution sharding and consensus sharding, and using consensus sharding to consensus on the received transactions, and using execution sharding to execute transactions that have been consensus by consensus sharding, decoupling the consensus and execution functions of the blockchain system.

Benefits of technology

It improves the fault tolerance rate and transaction execution efficiency of the blockchain system, can handle cross-shash transactions, and reduces communication cost and blocking time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113656508B_ABST
    Figure CN113656508B_ABST
Patent Text Reader

Abstract

The present specification provides a method and device for executing transactions in a blockchain system, wherein the blockchain system includes an execution shard and a consensus shard, wherein the execution shard includes a first execution shard and a second execution shard, and the method includes: the nodes of the consensus shard reach a consensus on the received transactions, and send the consensus result after the consensus to the nodes of the first execution shard and the nodes of the second execution shard, wherein the consensus result includes multiple transactions to be executed; the multiple transactions include a first transaction, and the account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the node of the second execution shard sends the status value of the account status corresponding to the at least part of the parameters to the node of the first execution shard according to the first transaction; the node of the first execution shard executes the operation corresponding to the first transaction based on the status value; the operation corresponding to the first transaction includes a read and / or write operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of blockchain technology, and more particularly, to a method and device for executing transactions in a blockchain system. Background Art

[0002] Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is a chain data structure that combines data blocks in a sequential manner in chronological order, and a distributed ledger that is tamper-proof and unforgeable by cryptography. Due to the characteristics of blockchain such as decentralization, information immutability, and autonomy, blockchain has also received more and more attention and application.

[0003] At present, among the related technologies, the scalability of blockchain systems in computing and storage is relatively weak, which restricts the throughput of blockchain systems and makes it difficult to meet the needs of applications. Therefore, it is necessary to provide a method for executing transactions in a blockchain system. Summary of the invention

[0004] One or more embodiments of the present specification provide a method and device for executing transactions in a blockchain system.

[0005] According to a first aspect, a method for executing a transaction in a blockchain system is provided, wherein the blockchain system includes an execution shard and a consensus shard, wherein the execution shard includes a first execution shard and a second execution shard, and the method includes:

[0006] The nodes of the consensus shard perform consensus on the received transactions, and send the consensus result after the consensus to the nodes of the first execution shard and the nodes of the second execution shard, wherein the consensus result includes multiple transactions to be executed; the multiple transactions include the first transaction, and the account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the parameters accessed by the first transaction include the target parameters; the account status corresponding to the target parameters is stored in the first execution shard;

[0007] The node of the second execution shard sends, according to the first transaction, a state value of the account state corresponding to the at least part of the parameters to the node of the first execution shard;

[0008] The node of the first execution shard executes the operation corresponding to the first transaction based on the state value; wherein the operation corresponding to the first transaction includes a read and / or write operation.

[0009] According to a second aspect, a method for executing a transaction in a blockchain system is provided, wherein the blockchain system includes an execution shard and a consensus shard, wherein the execution shard includes a first execution shard and a second execution shard, and the method is executed by a node of the first execution shard, and the method includes:

[0010] Receive the consensus result sent by the node of the consensus shard; the consensus result is obtained by the consensus shard on the transaction; the consensus result includes multiple transactions to be executed; the multiple transactions include a first transaction, and the account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the parameters accessed by the first transaction include a target parameter; the account status corresponding to the target parameter is stored in the first execution shard;

[0011] Receiving a state value corresponding to at least part of the parameters sent by the node executing the second shard;

[0012] An operation corresponding to the first transaction is performed based on the status value; wherein the operation corresponding to the first transaction includes a read and / or write operation.

[0013] According to a third aspect, a method for executing a transaction in a blockchain system is provided, wherein the blockchain system includes an execution shard and a consensus shard, the execution shard includes a first execution shard and a second execution shard, the method is executed by a node of the second execution shard, and the method includes:

[0014] Receive the consensus result sent by the node of the consensus shard; the consensus result is obtained by the consensus shard on the transaction; the consensus result includes multiple transactions to be executed; the multiple transactions include a first transaction, and the account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the parameters accessed by the first transaction include a target parameter; the account status corresponding to the target parameter is stored in the first execution shard;

[0015] Sending the state value corresponding to at least part of the parameters to the node of the first execution shard according to the first transaction.

[0016] According to a fourth aspect, a device for executing transactions in a blockchain system is provided, wherein the blockchain system includes an execution shard and a consensus shard, the execution shard includes a first execution shard and a second execution shard, the device is deployed on a node of the first execution shard, and the device includes:

[0017] A first receiving module is configured to receive a consensus result sent by a node of the consensus shard; the consensus result is obtained by the consensus shard on the transaction; the consensus result includes multiple transactions to be executed; the multiple transactions include a first transaction, and the account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the parameters accessed by the first transaction include a target parameter; the account status corresponding to the target parameter is stored in the first execution shard;

[0018] A second receiving module, configured to receive a state value corresponding to at least part of the parameters sent by the node executing the second shard;

[0019] An execution module is used to execute the operation corresponding to the first transaction based on the state value; wherein the operation corresponding to the first transaction includes a read and / or write operation.

[0020] According to a fifth aspect, a device for executing transactions in a blockchain system is provided, wherein the blockchain system includes an execution shard and a consensus shard, the execution shard includes a first execution shard and a second execution shard, the device is deployed on a node of the second execution shard, and the device includes:

[0021] A receiving module, configured to receive a consensus result sent by a node of the consensus shard; the consensus result is obtained by the consensus shard on the transaction; the consensus result includes multiple transactions to be executed; the multiple transactions include a first transaction, and the account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the parameters accessed by the first transaction include a target parameter; the account status corresponding to the target parameter is stored in the first execution shard;

[0022] A sending module is used to send the state value corresponding to at least part of the parameters to the node of the first execution shard according to the first transaction.

[0023] According to a sixth aspect, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the first aspect, the second aspect, or the third aspect is implemented.

[0024] According to the seventh aspect, a computing device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method described in any one of the first aspect, the second aspect, or the third aspect is implemented.

[0025] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0026] The transaction execution method and device in the blockchain system provided by the embodiments of this specification divide the blockchain system into execution shards and consensus shards, and use the consensus shards to reach consensus on the received transactions, and use the execution shards to execute the transactions that have been agreed upon by the consensus shards, thereby decoupling the consensus and execution functions of the blockchain system, improving the fault tolerance of the blockchain system and the execution efficiency of transactions. In addition, the blockchain system can handle cross-shard transactions. After any execution shard completes the operations corresponding to the cross-shard transactions, it does not need to wait for other execution shards to complete the operations corresponding to any transaction, thereby reducing the communication cost and blocking time.

[0027] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0029] Figure 1 This is an architecture diagram of a blockchain system shown in this specification according to an exemplary embodiment;

[0030] Figure 2 This is an interactive flow chart of a method for executing transactions in a blockchain system according to an exemplary embodiment of this specification;

[0031] Figure 3 is a flowchart of another method for executing a transaction in a blockchain system according to an exemplary embodiment of the present specification;

[0032] Figure 4a is a schematic diagram of a sorting lock queue according to an exemplary embodiment of the present specification;

[0033] Figure 4b is a schematic diagram of another sorting lock queue shown in this specification according to an exemplary embodiment;

[0034] Figure 5 It is a block diagram of a device for executing transactions in a blockchain system according to an exemplary embodiment of the present specification;

[0035] Figure 6 It is a block diagram of another device for executing transactions in a blockchain system shown in this specification according to an exemplary embodiment. DETAILED DESCRIPTION

[0036] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.

[0037] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the present application. The singular forms "a", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0038] It should be understood that although the terms first, second, third, etc. may be used in the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0039] like Figure 1 , which is an architecture diagram of a blockchain system according to an exemplary embodiment.

[0040] exist Figure 1 In the blockchain system, the blockchain system may include execution shards and consensus shards, wherein the consensus shards may include n consensus shards such as shard AS1, shard AS2, ... shard ASn, etc. The execution shards may include m execution shards such as shard ES1, shard ES2, ... shard ESm, etc. Different shards each include multiple nodes, and each node may be implemented as any device, server or device cluster with computing and processing capabilities. It can be understood that Figure 1 The n consensus shards and m execution shards are shown for example only. In fact, the blockchain system can include any number of consensus shards and execution shards. For example, the number of consensus shards can be one or more, the number of execution shards can be any number, and the number of consensus shards can be the same as or different from the number of execution shards.

[0041] Specifically, first, the consensus shard can connect with the client, receive transactions from the client, and reach consensus on the received transactions. Different consensus shards can receive and reach consensus on different transactions. Then, each consensus shard can send the consensus results obtained by each consensus to the nodes of each execution shard. The consensus results can include multiple transactions to be executed (i.e., multiple transactions that have successfully reached consensus) and the execution order of the multiple transactions. The nodes of the execution shard complete the execution of the multiple transactions.

[0042] It should be noted that among the multiple execution shards included in the blockchain system, different execution shards can store the status of different accounts. The node of any execution shard can determine the transaction associated with the execution shard among the multiple transactions included in the received consensus result, and perform the operation corresponding to the transaction, which may include a read operation and / or a write operation. Among them, the parameters accessed by the transaction associated with the execution shard include at least one target parameter, and the status of the account corresponding to the target parameter is stored in the execution shard. In addition, the node of the execution shard can ignore the transactions in the multiple transactions except the transactions associated with the execution shard.

[0043] For example, shard AS1 receives transactions a and b, and reaches consensus on transactions a and b. Shard AS2 receives transactions c and d, and reaches consensus on transactions c and d. Shard ASn receives transactions x and y, and reaches consensus on transactions x and y. After consensus, shard AS1 can send transactions a and b that have been successfully agreed upon, as well as their order, to shard ES1, shard ES2, ... shard ESm, respectively. Shard AS2 can send transactions c and d that have been successfully agreed upon, as well as their order, to shard ES1, shard ES2, ... shard ESm, respectively. ... Shard ASn can send transactions x that have been successfully agreed upon, as well as their order, to shard ES1, shard ES2, ... shard ESm, respectively.

[0044] It should be noted that in order to ensure that the execution order of different execution shards is consistent when executing operations corresponding to transactions, each execution shard can sort the transactions received from the consensus shard according to preset rules. For example, transactions are sorted according to the source of the transaction. For example, shard AS1 obtains multiple groups of transactions (a group of transactions is a transaction included in a consensus result) through consensus, and sends them to each execution shard. The multiple groups of transactions are C11, C12, and C13. Shard AS2 obtains multiple groups of transactions (a group of transactions is a transaction included in a consensus result) through consensus, and sends them to each execution shard. The multiple groups of transactions are C21, C22, and C23. ... Shard ASn obtains multiple groups of transactions through consensus and sends them to each execution shard. The multiple groups of transactions are Cn1, Cn2, and Cn3. After each execution shard receives multiple groups of transactions sent by each consensus shard, it sorts the multiple groups of transactions in the order of C11 (source is shard AS1), C21 (source is shard AS2), ... Cn1 (source is shard ASn), C12 (source is shard AS1), C22 (source is shard AS2), ... Cn2 (source is shard ASn), C13 (source is shard AS1), C23 (source is shard AS2), ... Cn3 (source is shard ASn).

[0045] Next, shard ES1 determines that the transactions associated with it include transaction a, transaction c, etc., based on the accounts corresponding to the parameters (read and / or written parameters) accessed by each received transaction. Shard ES2 determines that the transactions associated with it include transaction b, ... transaction x. ... Shard ESm determines that the transactions associated with it include transaction d, ... transaction x. Among them, transaction x is a cross-shard transaction, the status of the account corresponding to the parameters read by transaction x is stored in shard ES2, and the status of the account corresponding to the parameters written by transaction x is stored in shard ESm. Finally, shard ES1 executes the operations corresponding to transactions a, transaction c, ..., and updates the world state of shard ES1 based on the results of the execution. Shard ES2 executes the operations corresponding to transactions b, ..., transaction x, and updates the world state of shard ES2 based on the results of the execution. Among them, the operation corresponding to transaction x includes reading the status value of parameter S, so the status value corresponding to the read parameter S also needs to be sent to shard ESm. ...Shard ESm receives the state value corresponding to parameter S sent by shard ES2 (for executing the write operation of transaction x), executes the operations corresponding to transactions d, ...transaction x, and updates the world state of shard ESm based on the execution results.

[0046] The solution provided in this specification will be described in detail below in conjunction with specific embodiments.

[0047] like Figure 2 As shown, Figure 2This is an interactive flow chart of a method for executing a transaction in a blockchain system according to an exemplary embodiment. The blockchain system includes an execution shard and a consensus shard, and the execution shard includes a first execution shard and a second execution shard. The method includes the following steps:

[0048] In step 201, the client sends the transaction to be agreed upon to the node of the consensus shard.

[0049] In step 203, the nodes of the consensus shard reach consensus on the received transaction.

[0050] In this embodiment, the client can send the transaction to be agreed upon to the node of the consensus shard connected to it, and the node of the consensus shard will reach consensus on the received transaction to obtain a consensus result. The consensus result may include multiple transactions to be executed and the execution order corresponding to the multiple transactions, wherein the transaction to be executed is the transaction with successful consensus.

[0051] In step 205, the nodes of the consensus shard send the consensus results to the nodes of the first execution shard and the nodes of the second execution shard respectively.

[0052] In this embodiment, the nodes of the consensus shard can send the multiple transactions to be executed and the execution order corresponding to the multiple transactions to the nodes of the execution shard, and the nodes of the execution shard complete the execution operation of the multiple transactions. Among them, the execution shard includes a first execution shard and a second execution shard, and the nodes of the consensus shard can send the multiple transactions to be executed and the execution order corresponding to the multiple transactions to each node included in the first execution shard and the second execution shard.

[0053] In step 207, the node of the second execution shard obtains the state value corresponding to at least part of the parameters read by the first transaction among the multiple transactions included in the consensus result.

[0054] In this embodiment, the multiple transactions in the consensus result include the first transaction, the first transaction is a cross-shard transaction, the account state corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard, the parameters accessed by the first transaction include the target parameters, and the account state corresponding to the target parameters is stored in the first execution shard. The target parameters accessed by the first transaction include the parameters read and / or written by the first transaction.

[0055] For example, the parameters accessed by the first transaction include the read parameter u1 and the written parameter u2, and executing the first transaction includes reading the state value corresponding to the parameter u1, and writing the state value corresponding to the parameter u2 based on the state value corresponding to the parameter u1. The account state corresponding to the parameter u1 is stored in the second execution shard, and the account state corresponding to the parameter u2 is stored in the first execution shard. Specifically, the node of the second execution shard can read the state value corresponding to the parameter u1 and send it to the node of the first execution shard, and the node of the first execution shard can update the state value corresponding to the parameter u2 based on the state value corresponding to the parameter u1.

[0056] For another example, the parameters accessed by the first transaction include the read parameter u1 and the read parameter u3, and executing the first transaction includes reading the state value corresponding to the parameter u1, and reading the state value corresponding to the parameter u3 based on the state value corresponding to the parameter u1. The account state corresponding to the parameter u1 is stored in the second execution shard, and the account state corresponding to the parameter u3 is stored in the first execution shard. Specifically, the node of the second execution shard can read the state value corresponding to the parameter u1 and send it to the node of the first execution shard, and the node of the first execution shard can read the state value corresponding to the parameter u3 based on the state value corresponding to the parameter u1.

[0057] It should be noted that for any cross-shard transaction, among the multiple execution shards corresponding to the cross-shard transaction, the execution shard involved in the read parameters will send the status value of the read parameters to each execution shard corresponding to the cross-shard transaction. For example, the parameters accessed by cross-shard transaction 1 include the read parameter t1, the read parameter t2, the written parameter t3, and the written parameter t4. Among them, the status value of the account status corresponding to the read parameter t1 is stored in the execution shard 1, the status value of the account status corresponding to the read parameter t2 is stored in the execution shard 2, the status value of the account status corresponding to the written parameter t3 is stored in the execution shard 3, and the status value of the account status corresponding to the written parameter t4 is stored in the execution shard 4. Execution shard 1 will send the status value of the read parameter t1 to execution shard 2, execution shard 3, and execution shard 4 respectively. Execution shard 2 will send the status value of the read parameter t2 to execution shard 1, execution shard 3, and execution shard 4 respectively.

[0058] Specifically, obtaining the status value corresponding to at least part of the parameters read by the first transaction in the multiple transactions included in the consensus result may include: sub-step 2071, obtaining the parameters accessed by each transaction in the multiple transactions, and determining the first transaction based on the parameters accessed by each transaction; and sub-step 2073, determining that the account status corresponding to the part of the parameters accessed by the first transaction is stored in the first execution shard, and reading the above status value.

[0059] In sub-step 2071, the node of the second execution shard may determine the parameters accessed by each transaction by obtaining the identifiers of the parameters accessed by each transaction in the multiple transactions. The parameters accessed by any transaction may include only the parameters read by the transaction, or only the parameters written by the transaction, or both the parameters read by the transaction and the parameters written by the transaction.

[0060] In one implementation, the client may pre-acquire the identifiers of the parameters accessed by the transaction to be sent, and send the transaction and the identifiers of the parameters accessed by the transaction to the node executing the shard. In another implementation, the node of the second execution shard may obtain the identifiers of the parameters accessed by pre-executing the transaction or by using static analysis based on the parameters of the smart contract.

[0061] Next, the parameters accessed by each transaction in the multiple transactions can be traversed, and the accounts corresponding to the parameters can be determined. If the state of the account corresponding to at least one parameter read by any transaction is stored in the second execution shard, and the state of the account corresponding to other parameters accessed by the transaction is stored in other execution shards, then the transaction can be determined to be the first transaction (i.e., a cross-shard transaction).

[0062] In sub-step 2073, the node of the second execution shard may further determine that the state of the account corresponding to the other partial parameters accessed by the first transaction is stored in the first execution shard. For example, the execution shard storing the state of the account may be determined to be the first execution shard based on a preset state storage rule. The execution shard storing the state of the account may also be found to be the first execution shard based on a correspondence table (a table recording the correspondence between accounts and execution shards in a blockchain system). It is to be understood that the node of the second execution shard may also determine the execution shard storing the state of the account by any other achievable method, and this embodiment is not limited in this respect.

[0063] In step 209, the node executing the second shard sends the state value corresponding to at least part of the parameters read above to the node executing the first shard.

[0064] In this embodiment, the node of the second execution shard can send the above-mentioned status value to the node of the first execution shard, so that the node of the first execution shard can execute the operation corresponding to the first transaction based on the status value.

[0065] Optionally, in step 211, the first node executing the shard obtains parameters accessed by each transaction in the plurality of transactions.

[0066] In this embodiment, the node of the first execution shard can determine the parameters accessed by each transaction by obtaining the identifiers of the parameters accessed by each transaction in the multiple transactions. The parameters accessed by any transaction may include only the parameters read by the transaction, or only the parameters written by the transaction, or both the parameters read by the transaction and the parameters written by the transaction.

[0067] In one implementation, the client may pre-acquire the identifiers of the parameters accessed by the transaction to be sent, and send the transaction and the identifiers of the parameters accessed by the transaction to the node executing the shard. In another implementation, the node executing the first shard may obtain the identifiers of the parameters accessed by pre-executing the transaction or by using static analysis based on the parameters of the smart contract.

[0068] In step 213, the node of the first execution shard executes the operation corresponding to the first transaction based on the state value.

[0069] In this embodiment, the node of the first execution shard can perform the operation corresponding to the first transaction based on the state value. Among them, the operation corresponding to any transaction may include only read operations (for example, a transaction to query an account balance may only involve read operations), or only write operations (for example, a transaction to store evidence may only involve read operations), or both read operations and write operations (for example, a transaction to update a certain state of an account may involve both read operations and write operations).

[0070] Specifically, executing the operation corresponding to the first transaction based on the state value may include: sub-step 2131, executing the operation corresponding to the first transaction based on the parameters accessed by each transaction and the state value.

[0071] In sub-step 2131, the operation corresponding to the first transaction may be performed based on the parameters accessed by each transaction and the state value received from the node of the second execution shard. In one implementation, the first transaction among the multiple transactions may be determined based on the parameters accessed by each transaction, and the identifier of the first transaction may be recorded, and then the first transaction may be executed in sequence using the state value according to the recorded identifier.

[0072] In another implementation, the first transaction can also be determined based on the parameters accessed by each transaction, and the target parameters accessed by the first transaction (the corresponding account status is stored in the first execution shard) and the order corresponding to the first transaction are determined. Then, the sorting lock queues corresponding to the target parameters accessed by the first transaction are searched, and the target information for the first transaction is added to the above-mentioned sorting lock queues according to the order corresponding to the first transaction. Based on the above-mentioned sorting lock queues, it is determined that the trigger condition is met. If the trigger condition is met, the operation corresponding to the first transaction is executed based on the state value (the detailed process of this implementation method can be specifically referred to below). Figure 3 Description of the embodiments).

[0073] In step 215, the node that first executes the shard updates its world state according to the result of the execution.

[0074] In this embodiment, after the operation corresponding to the first transaction is executed, the world state of the first execution shard may be updated according to the result of the execution. Specifically, after the operation corresponding to the first transaction is executed, if it is determined according to the execution result that the operation corresponding to the first transaction includes a write operation, the world state of the first execution shard may be updated based on the result of the write operation.

[0075] The method for executing transactions in a blockchain system provided by the above-mentioned embodiments of this specification divides the blockchain system into execution shards and consensus shards, and uses the consensus shards to reach consensus on received transactions, and uses the execution shards to execute transactions that have been agreed upon by the consensus shards, thereby decoupling the consensus and execution functions of the blockchain system, improving the fault tolerance of the blockchain system and the execution efficiency of transactions. In addition, the blockchain system can handle cross-shard transactions. After any execution shard completes the operations corresponding to the cross-shard transactions, it does not need to wait for other execution shards to complete the operations corresponding to any transaction, thereby reducing the communication cost and blocking time.

[0076] like Figure 3 As shown, Figure 3 According to a flowchart of a method for executing transactions in a blockchain system shown in an exemplary embodiment, the embodiment describes a process of executing an operation corresponding to a first transaction based on parameters accessed by each transaction and a state value received from a node of a second execution shard. The method can be executed by a node of a first execution shard, and includes the following steps:

[0077] In step 301 , a first transaction is determined based on parameters accessed by each transaction in a plurality of transactions.

[0078] In this embodiment, each parameter accessed by each transaction in multiple transactions can be traversed, and the account corresponding to each parameter can be determined. If the state of the account corresponding to at least one parameter read by any transaction is stored in the second execution shard, and the state of the account corresponding to some other parameters accessed by the transaction is stored in the first execution shard, then the transaction can be determined to be the first transaction.

[0079] In step 303, each target parameter accessed by the first transaction and the ranking corresponding to the first transaction are determined.

[0080] In this embodiment, the parameters accessed by the first transaction include at least one target parameter, and the account status corresponding to the target parameter is stored in the first execution shard. The target parameters accessed by the first transaction can be determined, and the order corresponding to the first transaction can be determined. Specifically, the nodes of the consensus shard reach a consensus on the received transactions and obtain a consensus result. The consensus result may include multiple transactions to be executed and the order corresponding to each transaction in the multiple transactions. The nodes of the consensus shard send the consensus result to the nodes of the first execution shard, and the nodes of the first execution shard can obtain the order corresponding to each transaction from the consensus result. It should be noted that the order corresponding to each transaction received by the nodes of different execution shards is also the same.

[0081] In step 305, target information for the first transaction is added to each of the sorting lock queues corresponding to each of the target parameters according to the sorting.

[0082] In this embodiment, a preset index list is stored in the node of the first execution shard, and the corresponding relationship between the parameters and the addresses of the sorting lock queues is recorded in the index list. The sorting lock queues corresponding to the target parameters accessed by the first transaction can be found from the index list, and then the target information for the first transaction is added to the sorting lock queues according to the sorting corresponding to the first transaction.

[0083] The target information for the first transaction added to the sort lock queue corresponding to any target parameter accessed by the first transaction includes the identifier of the first transaction and the read / write properties of the target parameter in the first transaction. The identifier of the first transaction may include but is not limited to the ID of the first transaction, the hash value obtained by hashing the ID of the first transaction, the hash value obtained by hashing the transaction data of the first transaction, etc.

[0084] In step 307, based on each sort lock queue, it is determined whether the trigger condition is satisfied.

[0085] In this embodiment, whether the trigger condition is satisfied can be determined based on the position of the target information for the first transaction in each sorting lock queue. Specifically, first, the number of target parameters accessed by the first transaction can be determined as the initial value of the count value. When it is determined that the target information for the first transaction in at least any sorting lock queue is located at the first position, the count value is reduced by 1.

[0086] Optionally, in the sorting lock queue corresponding to the target parameter written by the first transaction, if the target information for the first transaction is at the first place, the count value is reduced by 1. In the sorting lock queue corresponding to the target parameter read by the first transaction, if the target information for the first transaction is at the first place, or there is no information including the write attribute before the target information for the first transaction, the count value is reduced by 1. Finally, when the count value is 0, it is determined that the trigger condition is met.

[0087] In step 309, when the trigger condition is met, the operation corresponding to the first transaction is executed based on the state value received from the node of the second execution shard.

[0088] In this embodiment, when the trigger condition is met, the execution of the operation corresponding to the first transaction is triggered. The operation corresponding to the first transaction can be directly executed based on the state value, or the first transaction can be put into the execution pool and randomly taken out from the execution pool, and the corresponding operation can be executed based on the state value.

[0089] In step 311, a dequeue operation is performed on the target information for each sort lock queue.

[0090] In this embodiment, after the operation corresponding to the first transaction is completed, the dequeue operation of the target information can be performed for each sorting lock queue. For any sorting lock queue, the target information can be deleted, and the target information for other transactions after the target information can be moved forward by one position.

[0091] For ease of understanding, a complete application example is provided below to schematically illustrate the solution of this embodiment. Specifically, the blockchain system includes execution shard A and execution shard B, and the account states corresponding to parameters k1, k2, ..., km are stored in execution shard A. The account state corresponding to parameter v1 is stored in execution shard B. The node of execution shard A stores a preset index list A, which includes the address of sorting lock queue 1 corresponding to parameter k1, the address of sorting lock queue 2 corresponding to parameter k2, ..., the address of sorting lock queue m corresponding to parameter km.

[0092] The node executing shard A and the node executing shard B receive multiple transactions, which are arranged in order as transaction 1, transaction 2, and transaction 3. Among them, transaction 1 is a cross-shard transaction. The parameters accessed by transaction 1 include the read parameter v1, the read parameter k1, and the written parameter k2. The number of target parameters accessed is 2, and 2 is used as the initial value of the count value corresponding to transaction 1. The parameters accessed by transaction 2 include the read parameter k1 and the read parameter k2. The number of target parameters accessed is 2, and 2 is used as the initial value of the count value corresponding to transaction 2. The parameters accessed by transaction 3 include the read parameter k1 and the written parameter k2. The number of target parameters accessed is 2, and 2 is used as the initial value of the count value corresponding to transaction 3.

[0093] First, based on the preset index list, the address of the sorting lock queue 1 corresponding to the parameter k1 and the address of the sorting lock queue 2 corresponding to the parameter k2 can be found. And according to the order of the transactions, the first target information for transaction 1, the second target information for transaction 2, and the third target information for transaction 3 are added to the sorting lock queue 1 and the sorting lock queue 2 respectively.

[0094] like Figure 4a As shown, in the sorting lock queue 1, the first target information for transaction 1 is located at the first position, including the identifier TX1 of transaction 1 and the read-write attribute "read" of parameter k1 in transaction 1. The second target information for transaction 2 is located at the second position, including the identifier TX2 of transaction 2 and the read-write attribute "read" of parameter k1 in transaction 2. The third target information for transaction 3 is located at the third position, including the identifier TX3 of transaction 3 and the read-write attribute "read" of parameter k1 in transaction 3. In the sorting lock queue 2, the first target information for transaction 1 is located at the first position, including the identifier TX1 of transaction 1 and the read-write attribute "write" of parameter k2 in transaction 1. The second target information for transaction 2 is located at the second position, including the identifier TX2 of transaction 2 and the read-write attribute "read" of parameter k2 in transaction 2. The third target information for transaction 3 is located at the third position, including the identifier TX3 of transaction 3 and the read-write attribute "write" of parameter k2 in transaction 3.

[0095] Depend on Figure 4aIt can be seen that the first target information is at the first place in both sorting lock queue 1 and sorting lock queue 2, so the count value corresponding to transaction 1 can be reduced by 1 twice. Although the second target information is not at the first place in sorting lock queue 1, the read-write attribute corresponding to the first target information before the second target information is read, so the count value corresponding to transaction 2 can be reduced by 1. The third target information is not at the first place in sorting lock queue 1, but the read-write attributes corresponding to the first target information and the second target information before the third target information are both read, so the count value corresponding to transaction 3 can be reduced by 1. At this time, the count value corresponding to transaction 1 is 0, the count value corresponding to transaction 2 is 1, and the count value corresponding to transaction 3 is 1.

[0096] Since the count value corresponding to transaction 1 is 0, transaction 1 can be put into the execution pool and wait for execution. Since the parameters read by transaction 1 also include parameter v1, the operation corresponding to transaction 1 can only be executed after receiving the status value corresponding to parameter v1 sent by the node executing shard B. After the operation corresponding to transaction 1 is executed, the dequeue operation of the first target information is performed. Specifically, the first target information in sort lock queue 1 and sort lock queue 2 is deleted, and the second target information and the third target information are moved forward one position respectively. Figure 4b As shown, the sort lock queue 1 and the sort lock queue 2 are after the dequeue operation on the first target information is performed.

[0097] Depend on Figure 4b It can be seen that the second target information is in the first place in sort lock queue 2, so the count value corresponding to transaction 2 can be reduced by 1. The third target information is not in the first place in sort lock queue 2, so the count value corresponding to transaction 3 remains unchanged. At this time, the count value corresponding to transaction 2 is 0. Transaction 2 can be put into the execution pool and wait for execution. After the operation corresponding to transaction 2 is executed, the dequeue operation of the second target information is performed. Specifically, the second target information in sort lock queue 1 and sort lock queue 2 is deleted, and the subsequent third target information is moved forward by one position.

[0098] The method for executing transactions in a blockchain system provided by the above embodiments of the present specification triggers the execution of operations corresponding to the first transaction based on the sorting lock queues corresponding to the target parameters accessed by the first transaction. This ensures that all transactions sent to the blockchain system have a globally unique order, thereby ensuring the consistency of transaction execution by different execution shards, making more effective use of computing resources, and improving the efficiency of transaction execution.

[0099] It should be noted that although the operations of the methods of the embodiments of this specification are described in a specific order in the above embodiments, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. On the contrary, the steps depicted in the flowchart can change the order of execution. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution.

[0100] Corresponding to the aforementioned method embodiment for executing transactions in a blockchain system, this specification also provides an embodiment of an apparatus for executing transactions in a blockchain system.

[0101] like Figure 5 As shown, Figure 5 This is a block diagram of a device for executing transactions in a blockchain system according to an exemplary embodiment of the present specification. The blockchain system includes an execution shard and a consensus shard. The execution shard includes a first execution shard and a second execution shard. The device is deployed on a node of the first execution shard. The device may include: a first receiving module 501, a second receiving module 502 and an execution module 503.

[0102] Among them, the first receiving module 501 is used to receive the consensus result sent by the node of the consensus shard, and the consensus result is obtained by the consensus shard on the transaction. The consensus result includes multiple transactions to be executed, and the multiple transactions include the first transaction. The account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard. The parameters accessed by the first transaction include the target parameters, and the account status corresponding to the target parameters is stored in the first execution shard.

[0103] The second receiving module 502 is used to receive a state value corresponding to at least part of the parameters sent by the node of the second execution slice.

[0104] The execution module 503 is used to execute the operation corresponding to the first transaction based on the state value, wherein the operation corresponding to the first transaction includes a read and / or write operation.

[0105] In some implementations, the device may further include: an update module (not shown in the figure).

[0106] Among them, the update module is used to update the world state of the first execution shard according to the execution result after executing the operation corresponding to the first transaction.

[0107] In some other implementations, the device may further include: an acquisition module (not shown in the figure).

[0108] The acquisition module is used to acquire parameters accessed by each transaction in the multiple transactions. The parameters accessed by any transaction include parameters read and / or written by the transaction.

[0109] The execution module 503 may include: an execution submodule (not shown in the figure).

[0110] The execution submodule is used to execute the operation corresponding to the first transaction based on the parameters accessed by each transaction and the above-mentioned state value.

[0111] In some other implementations, the execution submodule includes: a first determination submodule, a second determination submodule, an addition submodule, a triggering submodule and an operation submodule (not shown in the figure).

[0112] The first determination submodule is used to determine the first transaction based on the parameters accessed by each transaction.

[0113] The second determination submodule is used to determine each target parameter accessed by the first transaction and the corresponding sequence of the first transaction.

[0114] The adding submodule is used to add the target information for the first transaction in each sorting lock queue corresponding to each target parameter according to the above sorting.

[0115] The trigger submodule is used to determine whether the trigger condition is met based on each sort lock queue.

[0116] The operation submodule is used to execute the operation corresponding to the first transaction based on the above-mentioned state value when the trigger condition is met.

[0117] In some other implementations, the trigger submodule is configured to: determine whether the trigger condition is satisfied based on the position of the target information in each sorting lock queue.

[0118] In other embodiments, the trigger submodule determines whether the trigger condition is satisfied based on the position of the target information in each sorting lock queue in the following manner: determining the number of target parameters accessed by the first transaction as the initial value of the count value, and reducing the count value by 1 at least when it is determined that the target information is located in the first position in any sorting lock queue, and determining that the trigger condition is satisfied when the count value is reduced to 0.

[0119] In some other embodiments, the device may further include: a releasing module (not shown in the figure).

[0120] The release module is used to execute a dequeue operation on the target information for each sort lock queue.

[0121] In other implementations, the target information for the first transaction added to the sort lock queue corresponding to any target parameter accessed by the first transaction includes an identifier of the first transaction and a read / write property of the target parameter in the first transaction.

[0122] It should be understood that the above device can be pre-set in the node of the first execution shard, or loaded into the node of the first execution shard by downloading, etc. The corresponding modules in the above device can cooperate with the modules in the node of the first execution shard to implement the solution of executing transactions in the blockchain system.

[0123] like Figure 6 As shown, Figure 6 This is a block diagram of a device for executing transactions in a blockchain system according to an exemplary embodiment of the present specification. The blockchain system includes an execution shard and a consensus shard. The execution shard includes a first execution shard and a second execution shard. The device is deployed on a node of the second execution shard. The device may include: a receiving module 601 and a sending module 602.

[0124] Among them, the receiving module 601 is used to receive the consensus result sent by the node of the consensus shard, and the consensus result is obtained by the consensus shard on the transaction. The consensus result includes multiple transactions to be executed, and the multiple transactions include the first transaction. The account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard. The parameters accessed by the first transaction include the target parameters, and the account status corresponding to the target parameters is stored in the first execution shard.

[0125] The sending module 602 is used to send the state value corresponding to at least part of the parameters to the node of the first execution shard according to the first transaction.

[0126] In some implementations, the sending module 602 may include: an acquisition submodule, a first determination submodule, a second determination submodule and a sending submodule (not shown in the figure).

[0127] The acquisition submodule is used to acquire parameters accessed by each transaction in a plurality of transactions. The parameters accessed by any transaction include parameters read and / or written by the transaction.

[0128] The first determination submodule is used to determine the first transaction based on the parameters accessed by each transaction.

[0129] The second determination submodule is used to determine that the account state corresponding to the partial parameters accessed by the first transaction is stored in the first execution shard.

[0130] The sending submodule is used to read the status value and send the status value to the node of the first execution slice.

[0131] It should be understood that the above device can be pre-set in the node of the second execution shard, or loaded into the node of the second execution shard by downloading, etc. The corresponding modules in the above device can cooperate with the modules in the node of the second execution shard to implement the solution of executing transactions in the blockchain system.

[0132] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of one or more embodiments of the present specification. A person of ordinary skill in the art can understand and implement them without creative work.

[0133] One or more embodiments of the present specification also provide a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figures 2 to 3 A method for executing transactions in a blockchain system provided in any embodiment.

[0134] One or more embodiments of the present specification further provide a computing device, including a memory and a processor, wherein the memory stores an executable code, and when the processor executes the executable code, the above-mentioned Figures 2 to 3 A method for executing transactions in a blockchain system provided in any embodiment.

[0135] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0136] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0137] Those of ordinary skill in the art should also be further aware that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but this implementation should not be considered to be beyond the scope of the present application. Among them, the software module can be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the technical field.

[0138] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above description is only the specific implementation method of the present application and is not intended to limit the scope of protection of the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A method for executing a transaction in a blockchain system, the blockchain system comprising an execution shard and a consensus shard, the execution shard comprising a first execution shard and a second execution shard, the method comprising: The nodes of the consensus shard perform consensus on the received transactions, and send the consensus result to the nodes of the first execution shard and the nodes of the second execution shard, wherein the consensus result includes multiple transactions to be executed; the multiple transactions include the first transaction, and the account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the parameters accessed by the first transaction include the target parameters; The account state corresponding to the target parameter is stored in the first execution shard; The node of the second execution shard sends, according to the first transaction, a state value of the account state corresponding to the at least part of the parameters to the node of the first execution shard; The node of the first execution shard executes the operation corresponding to the first transaction based on the state value; wherein the operation corresponding to the first transaction includes a read and / or write operation.

2. The method according to claim 1, wherein: The method further comprises: After executing the operation corresponding to the first transaction, the node of the first execution shard updates the world state of the first execution shard according to the execution result.

3. The method according to claim 1, wherein: The first transaction is a transfer transaction or a transaction for calling a smart contract.

4. The method according to claim 1, wherein: The method further comprises: The node executing the first shard obtains the parameters accessed by each transaction in the multiple transactions; the parameters accessed by any transaction include the parameters read and / or written by the transaction; The performing an operation corresponding to the first transaction based on the state value includes: Based on the parameters accessed by each of the transactions and the state value, an operation corresponding to the first transaction is performed.

5. The method according to claim 4, wherein: The performing the operation corresponding to the first transaction based on the parameters accessed by each transaction and the state value includes: Determining the first transaction based on the parameters accessed by each of the transactions; Determining various target parameters accessed by the first transaction and the corresponding ranking of the first transaction; Adding target information for the first transaction to each sorting lock queue corresponding to each target parameter according to the sorting; Based on the various sorting lock queues, determining that a trigger condition is met; When a trigger condition is met, an operation corresponding to the first transaction is performed based on the state value.

6. The method according to claim 5, wherein: The determining, based on the respective sort lock queues, that a trigger condition is satisfied includes: Based on the position of the target information in each of the sort lock queues, it is determined that a trigger condition is satisfied.

7. The method according to claim 6, wherein: The determining, based on the position of the target information in each sort lock queue, that a trigger condition is satisfied includes: Determining the number of target parameters accessed by the first transaction as an initial value of the count value; At least when it is determined that the target information is located at the first position in any sort lock queue, the count value is reduced by 1; When the count value decreases to 0, it is determined that the trigger condition is met.

8. The method according to claim 5, wherein: After the operation corresponding to the first transaction is completed, the method further includes: For each of the sorting lock queues, a dequeue operation is performed on the target information.

9. The method according to claim 5, wherein: The target information for the first transaction added to the sort lock queue corresponding to any target parameter accessed by the first transaction includes an identifier of the first transaction and a read-write attribute of the target parameter in the first transaction.

10. The method according to claim 1, wherein: The sending, according to the first transaction, the state value corresponding to at least part of the parameters to the node executing the first shard, comprises: Obtaining parameters accessed by each transaction in the plurality of transactions; Determining the first transaction based on the parameters accessed by each of the transactions; Determine that the account state corresponding to the partial parameters accessed by the first transaction is stored in the first execution shard; The state value is read and sent to the node of the first execution shard.

11. A method for executing transactions in a blockchain system, the blockchain system comprising an execution shard and a consensus shard, the execution shard comprising a first execution shard and a second execution shard, the method being executed by a node of the first execution shard, the method comprising: Receive the consensus result sent by the node of the consensus shard; The consensus result is obtained by the consensus shards through consensus on the transaction; The consensus result includes multiple transactions to be executed; the multiple transactions include a first transaction, and the account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the parameters accessed by the first transaction include a target parameter; the account status corresponding to the target parameter is stored in the first execution shard; Receiving a state value corresponding to at least part of the parameters sent by the node executing the second shard; An operation corresponding to the first transaction is performed based on the status value; wherein the operation corresponding to the first transaction includes a read and / or write operation.

12. The method according to claim 11, wherein: The method further comprises: After executing the operation corresponding to the first transaction, the world state of the first execution shard is updated according to the execution result.

13. The method according to claim 11, wherein: The method further comprises: Obtaining parameters accessed by each transaction in the multiple transactions; the parameters accessed by any transaction include parameters read and / or parameters written by the transaction; The performing an operation corresponding to the first transaction based on the state value includes: Based on the parameters accessed by each of the transactions and the state value, an operation corresponding to the first transaction is performed.

14. The method according to claim 13, wherein: The performing the operation corresponding to the first transaction based on the parameters accessed by each transaction and the state value includes: Determining the first transaction based on the parameters accessed by each of the transactions; Determining various target parameters accessed by the first transaction and the corresponding ranking of the first transaction; Adding target information for the first transaction to each sorting lock queue corresponding to each target parameter according to the sorting; Based on the various sorting lock queues, determining that a trigger condition is met; When a trigger condition is met, an operation corresponding to the first transaction is performed based on the state value.

15. The method according to claim 14, wherein: The determining, based on the respective sort lock queues, that a trigger condition is satisfied includes: Based on the position of the target information in each of the sort lock queues, it is determined that a trigger condition is satisfied.

16. The method according to claim 15, wherein: The determining, based on the position of the target information in each sort lock queue, that a trigger condition is satisfied includes: Determining the number of target parameters accessed by the first transaction as an initial value of the count value; At least when it is determined that the target information is located at the first position in any sort lock queue, the count value is reduced by 1; When the count value decreases to 0, it is determined that the trigger condition is met.

17. The method according to claim 14, wherein: After the operation corresponding to the first transaction is completed, the method further includes: For each of the sorting lock queues, a dequeue operation is performed on the target information.

18. The method according to claim 14, wherein: The target information for the first transaction added to the sort lock queue corresponding to any target parameter accessed by the first transaction includes an identifier of the first transaction and a read-write attribute of the target parameter in the first transaction.

19. A method for executing transactions in a blockchain system, the blockchain system comprising an execution shard and a consensus shard, the execution shard comprising a first execution shard and a second execution shard, the method being executed by a node of the second execution shard, the method comprising: Receive the consensus result sent by the node of the consensus shard; The consensus result is obtained by the consensus shards through consensus on the transaction; The consensus result includes multiple transactions to be executed; the multiple transactions include a first transaction, and the account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the parameters accessed by the first transaction include a target parameter; the account status corresponding to the target parameter is stored in the first execution shard; Sending the state value corresponding to at least part of the parameters to the node of the first execution shard according to the first transaction.

20. The method according to claim 19, wherein: The sending, according to the first transaction, the state value corresponding to at least part of the parameters to the node executing the first shard, comprises: Obtaining parameters accessed by each transaction in the multiple transactions; the parameters accessed by any transaction include parameters read and / or parameters written by the transaction; Determining the first transaction based on the parameters accessed by each of the transactions; Determine that the account state corresponding to the partial parameters accessed by the first transaction is stored in the first execution shard; The state value is read and sent to the node of the first execution shard.

21. A device for executing transactions in a blockchain system, the blockchain system comprising an execution shard and a consensus shard, the execution shard comprising a first execution shard and a second execution shard, the device being deployed on a node of the first execution shard, the device comprising: A first receiving module, used to receive the consensus result sent by the node of the consensus shard; The consensus result is obtained by the consensus shards through consensus on the transaction; The consensus result includes multiple transactions to be executed; the multiple transactions include a first transaction, and the account status corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the parameters accessed by the first transaction include a target parameter; the account status corresponding to the target parameter is stored in the first execution shard; A second receiving module, configured to receive a state value corresponding to at least part of the parameters sent by the node executing the second shard; An execution module is used to execute the operation corresponding to the first transaction based on the state value; wherein the operation corresponding to the first transaction includes a read and / or write operation.

22. A device for executing transactions in a blockchain system, the blockchain system comprising an execution shard and a consensus shard, the execution shard comprising a first execution shard and a second execution shard, the device being deployed on a node of the second execution shard, the device comprising: A receiving module, used to receive the consensus result sent by the node of the consensus shard; The consensus result is obtained by the consensus shards through consensus on the transaction; The consensus result includes a plurality of transactions to be executed; the plurality of transactions includes a first transaction, and the account state corresponding to at least part of the parameters read by the first transaction is stored in the second execution shard; the parameters accessed by the first transaction include target parameters; The account state corresponding to the target parameter is stored in the first execution shard; A sending module is used to send the state value corresponding to at least part of the parameters to the node of the first execution shard according to the first transaction.

23. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 11 to 20.

24. A computing device comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 11 to 20 is implemented.

Citation Information

Patent Citations

  • Method and device for realizing joint consensus fragmentation in alliance chain

    CN112039860A

  • Method and device for executing block in block chain system

    CN113157450A

  • Alliance chain-oriented transaction parallel processing method and system

    CN113205417A