Receipt data storage method, node, and blockchain system

By executing multiple transaction packets in parallel and submitting results independently in the blockchain system, the problem of low data storage efficiency in transaction receipts in the blockchain system is solved, and efficient data storage and processing is achieved.

WO2024244344A1PCT designated stage expired Publication Date: 2024-12-05ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD

Patent Information

Application Number
PCT/CN2023/135234
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-31
Filing Date
2023-11-29
Publication Date
2024-12-05

AI Technical Summary

Technical Problem

In the blockchain system, the receipt data of each transaction in the same block needs to be concentrated in the control process for storage, resulting in multiple computing processes being unable to be executed and completed at the same time, which affects the efficiency of receipt data storage and when the data volume is large, it affects the At the same time, the data processing burden of the control process is too heavy and it is difficult to achieve efficient storage.

Method used

By grouping multiple transactions in the block in parallel, each computing process independently submits its execution results to the stored process. The stored process stores data in the preset storage space respectively, avoiding the burden of waiting and data processing of control processes.

Benefits of technology

It realizes multi-party parallel submission of different transaction groups in the same block, saving submission time, reducing the data processing burden of the control process, and improving the storage efficiency of receipt data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023135234_05122024_PF_FP_ABST
    Figure CN2023135234_05122024_PF_FP_ABST
Patent Text Reader

Abstract

A receipt data storage method, a node, and a blockchain system. The receipt data storage method is applied to a first node in a blockchain system, wherein the first node comprises a control process, a storage process, and N calculation processes. The receipt data storage method comprises: the control process sends acquired M transaction groups to corresponding calculation processes among the N calculation processes, respectively, wherein the M transaction groups are obtained by grouping multiple transactions on the basis of respective pre-execution read-write sets of multiple transactions in a first block, and N and M are both greater than 1 (202); upon receiving any transaction group, any calculation process executes each transaction in said transaction group, and submits receipt data of each transaction to the storage process (204); and the storage process stores the received receipt data to a preset storage space of the first node (206).
Need to check novelty before this filing date? Find Prior Art

Description

Receipt data storage method, node and blockchain system Technical Field

[0001] The embodiments of this specification belong to the field of blockchain technology, and more particularly to a receipt data storage method, node, and blockchain system. Background Art

[0002] Blockchain is a novel application model for computer technologies, including distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. In a blockchain system, data blocks are linked sequentially in chronological order to form a chain-like data structure, cryptographically guaranteeing that the distributed ledger is tamper-proof and unforgeable. Users can participate in blockchain-related transactions through blockchain nodes. For example, multiple blockchain nodes corresponding to different users in a blockchain system can perform secure multi-party computation (SMPC) on a node's private data using privacy technologies such as homomorphic encryption and zero-knowledge proofs. Another example is that blockchain networks can facilitate transfers between different user accounts. Furthermore, blockchain networks can also be used to issue NFTs (non-fungible tokens) corresponding to digital collectibles such as digital paintings, digital avatars, and GIFs. This allows the ownership of the digital collectibles carried by the NFTs to circulate among users on the blockchain network, thereby generating corresponding value for the digital collectibles.

[0003] In related technologies, when executing transactions within a block, nodes in a blockchain system group the transactions into multiple transaction groups to speed up the overall execution of the block (i.e., reduce the overall execution time of all transactions within the block). A control process then dispatches each transaction group to a corresponding computation process for parallel execution. The receipt data generated from executing each transaction must be submitted to a storage process for storage. Specifically, each computation process sends the receipt data generated from its own transaction to the storage process, which then collectively submits all the receipt data for the block to complete the storage process.

[0004] In the above storage scheme, the receipt data for each transaction in the same block needs to be centralized to the control process, which then submits it for storage after collecting the receipt data for all transactions. It is understandable that different computing processes receive different transactions, and the execution time of different transactions may also vary. Considering that the available resources of different computing processes may also vary, the above reasons may result in multiple computing processes being unable to complete their received transactions at the same time. As a result, the control process needs to wait for each computing process to complete its execution before collecting all the receipt data, affecting the overall efficiency of the receipt data storage process. In addition, since all receipt data to be stored needs to be centralized to the control process, if the amount of receipt data is large, it will result in a heavy data processing burden on the control process, which is not conducive to the efficient storage of receipt data.

[0005] Summary of the Invention

[0006] The purpose of the present invention is to provide a storage method, node and blockchain system for receipt data.

[0007] In a first aspect, a method is provided for storing receipt data, which is applied to a first node in a blockchain system, the first node including a control process, a storage process, and N computing processes. The method comprises: the control process sending M acquired transaction groups to corresponding computing processes among the N computing processes, the M transaction groups being obtained by grouping multiple transactions in a first block based on their respective pre-execution read-write sets, where N and M are both greater than 1; any computing process, upon receiving any transaction group, executing each transaction in the transaction group and submitting receipt data for each transaction to the storage process; and the storage process storing the received receipt data in a preset storage space of the first node.

[0008] In a second aspect, a first node in a blockchain system is provided, the first node including a control process, a storage process and N computing processes, wherein: the control process is used to send M acquired transaction groups to corresponding computing processes among the N computing processes respectively, the M transaction groups are obtained by grouping multiple transactions in a first block based on their respective pre-execution read-write sets, and N and M are both greater than 1; any computing process is used to execute each transaction in any transaction group upon receiving the transaction group, and submit receipt data of each transaction to the storage process; the storage process is used to store the received receipt data in a preset storage space of the first node.

[0009] In a third aspect, a blockchain system is provided, which includes a first node and a second node, the first node including a control process, a storage process and N computing processes, wherein: the second node is used to pre-execute multiple transactions in the first block to obtain pre-execution read-write sets for each of the multiple transactions; and, grouping the multiple transactions according to the pre-execution read-write sets to obtain M transaction groups, and sending the M transaction groups to the first node, or sending the multiple transactions and the pre-execution read-write sets to the first node, so that the first node groups the multiple transactions according to the pre-execution read-write sets to obtain M transaction groups, where N and M are both greater than 1; the control process in the first node is used to send the M transaction groups to corresponding computing processes in the N computing processes respectively; any computing process is used to, upon receiving any transaction group, execute each transaction in the any transaction group and submit the receipt data of each transaction to the storage process; the storage process is used to store the received receipt data in a preset storage space of the first node.

[0010] According to a fourth aspect of one or more embodiments of this specification, an electronic device is proposed, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements a method as described in any one of the first aspects by running the executable instructions.

[0011] According to a fifth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any one of the first aspects are implemented.

[0012] In the above embodiment, the control process in the first node sends the M transaction groups obtained by grouping the multiple transactions in the first block based on the pre-execution read-write sets of each of the multiple transactions to the corresponding computing processes among the N computing processes respectively; upon receiving any transaction group, any computing process executes each transaction in the any transaction group and submits the receipt data of each transaction to the storage process, so that the latter stores it in the preset storage space of the first node.

[0013] As can be seen, this solution dispatches each transaction group to its corresponding computation process for execution. After each computation process completes its transactions within the transaction group, it independently submits the receipt data it obtains. Clearly, compared to related art storage solutions where central submission is performed by the control process, this solution enables multi-party concurrent submission of receipt data corresponding to different transaction groups within the same block. This eliminates the need for the control process to wait for receipt data to be returned by the computation process, saving submission time and alleviating the data processing burden on the control process. This effectively improves the efficiency of both the submission and storage of receipt data corresponding to each block. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0015] FIG1 is a schematic diagram of a blockchain system provided by an exemplary embodiment.

[0016] FIG2 is a flowchart of a method for storing receipt data provided by an exemplary embodiment.

[0017] FIG3 is a schematic diagram of the structure of any two nodes in a blockchain system provided by an exemplary embodiment.

[0018] FIG4 is a schematic diagram of a dependency relationship between transactions provided by an exemplary embodiment.

[0019] FIG5 is a schematic structural diagram of a first node in a blockchain system provided by an exemplary embodiment.

[0020] FIG6 is a schematic structural diagram of a device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0021] To help those skilled in the art better understand the technical solutions in this specification, the following will provide a clear and complete description of the technical solutions in the embodiments of this specification, in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of this specification, not all of them. All other embodiments derived by those skilled in the art based on the embodiments in this specification without creative effort shall fall within the scope of protection of this specification.

[0022] Figure 1 is a schematic diagram of a blockchain system provided by an exemplary embodiment. As shown in Figure 1, a blockchain system is a distributed network built with multiple nodes. Any two nodes can communicate at the application layer through a peer-to-peer (P2P) network. For example, any two nodes from nodes n1 to n5 can communicate at the application layer through a P2P network. The blockchain system utilizes a chained block structure to construct a decentralized (or multi-centralized) distributed ledger, which is stored on each node (or most nodes, such as consensus nodes) in the distributed blockchain system. Therefore, the blockchain system needs to address the consistency and correctness of the ledger data on each of the multiple nodes in the decentralized (or multi-centralized) system. To address this, each node in the blockchain system runs a blockchain program. Under certain fault-tolerance requirements, a consensus mechanism is used to ensure that all loyal nodes have the same transactions, thereby ensuring that all loyal nodes have consistent execution results for the same transactions. Transactions are then packaged into blocks, and the world state is updated based on the execution results of the same transactions. The current mainstream consensus mechanisms include but are not limited to: Proof of Work (POW), Proof of Stake (POS), Practical Byzantine Fault Tolerance (PBFT) algorithm, Honey Badger BFT algorithm, etc.

[0023] In related technologies, when executing transactions within a block, nodes in a blockchain system group the transactions into multiple transaction groups to speed up the overall execution of the block (i.e., reduce the overall execution time of all transactions within the block). A control process then dispatches each transaction group to a corresponding computation process for parallel execution. The receipt data generated from executing each transaction must be submitted to a storage process for storage. Specifically, each computation process sends the receipt data generated from its own transaction to the storage process, which then collectively submits all the receipt data for the block to complete the storage process.

[0024] In the above storage scheme, the receipt data for each transaction in the same block needs to be centralized to the control process, which then submits it for storage after collecting the receipt data for all transactions. It is understandable that different computing processes receive different transactions, and the execution time of different transactions may also vary. Considering that the available resources of different computing processes may also vary, the above reasons may result in multiple computing processes being unable to complete their received transactions at the same time. As a result, the control process needs to wait for each computing process to complete its execution before collecting all the receipt data, affecting the overall efficiency of the receipt data storage process. In addition, since all receipt data to be stored needs to be centralized to the control process, if the amount of receipt data is large, it will result in a heavy data processing burden on the control process, which is not conducive to the efficient storage of receipt data.

[0025] To address the aforementioned issues in related technologies, this specification proposes a receipt data storage method. This method eliminates the storage logic in which a control process collects and centrally submits receipt data returned by each computing process. Instead, each computing process independently submits corresponding receipt data to a storage process after completing transactions in a parallel transaction group. The storage process then stores each received receipt data in a pre-set storage space on the first node. This method reduces submission time and reduces the data processing burden on the control process, thereby improving the submission and storage efficiency of receipt data corresponding to each block. The receipt data storage scheme of this specification is described in detail below with reference to the accompanying figures.

[0026] FIG2 is a flowchart of a method for storing receipt data provided by an exemplary embodiment. The method is applied to a first node in a blockchain system. The first node can be any blockchain node in the blockchain system. For example, the first node can be the node that initiates the consensus proposal (such as a master node), or it can be another blockchain node other than the master node (such as a slave node). Regardless of whether it is a master node or a slave node in the blockchain system, each node can be implemented as any device, platform, device, or device cluster with computing / processing capabilities. The first node can include multiple processes, such as a control process, a storage process, and N (N is a positive integer greater than 1) computing processes. As shown in FIG2 , the method can include the following steps 202-206.

[0027] In step 202, the control process sends the obtained M transaction groups to corresponding computing processes among the N computing processes, respectively. The M transaction groups are obtained by grouping the multiple transactions in the first block based on their respective pre-execution read-write sets, and both N and M are greater than 1.

[0028] As previously mentioned, the first node may be a master node or a slave node in the blockchain system. Depending on the role played by the first node in the blockchain system, the manner in which the node obtains the multiple transactions to be executed and the pre-execution information of each transaction may also vary.

[0029] Taking any two nodes in the blockchain system shown in Figure 1, node n1 and node n2, as an example, each node can run multiple processes to provide multiple services. A schematic diagram of the structure of the two nodes can be seen in Figure 3. Node n1 and node n2 each run an access process for providing access services (such as access process 1 running in node n1 and access process 2 running in node n2. The following process numbers are similar and will not be repeated here), a cache process for providing cache services, a pre-execution process for providing pre-execution services, a network process for providing network services, a consensus process for providing consensus services, a control process for providing block management services, and a storage process for providing storage services. In addition, node n1, as a slave node, can also run multiple computing processes for providing computing services, such as computing process 11, computing process 12, and computing process 13.

[0030] The term "process" as used herein refers to the execution of a program with independent functionality within an application on a data set. Specifically, a process is a process within a computer that occurs by the CPU sequentially executing instructions within an application. Each process is assigned its own memory address space upon creation. The multiple processes within any node can be multiple computing devices or multiple processes within a virtual computing node. It should also be noted that the solutions provided in the embodiments of this specification are not limited to blockchain systems with a master-slave architecture; in other words, nodes n1 and n2 described herein can be any two blockchain nodes within the blockchain system.

[0031] Assume that node n2 and node n1 are the master node and slave node, respectively, in the blockchain system. The access process in either node can be used to receive transactions from user devices and call the cache process to add the received transactions to the pending transaction queue for caching.

[0032] Node n2's pre-execution process 2 can call cache process 2 to sequentially read its cached transactions from the pending transaction queue and verify them, such as verifying the user device's signature on the transaction, and returning the verified transactions to cache process 2. Furthermore, node n2 can also broadcast the verified transactions stored in its cache process 2 to the network processes of other nodes through its network process 2; thus, transactions received from node n2 by node n1 through its network process 1 can be cached by its cache process 1 and added to the pending transaction queue. Thus, the pending transaction queue cached by node n1's cache process 1 in its memory includes not only transactions received through its access process 1, but also transactions received from other nodes (such as node n2) through its network process 1.

[0033] The pre-execution process 2 of node n2 can also call the cache process 2 to read its cached transactions in sequence from the transaction queue to be processed, and at least verify the transactions from the user device connected to node n2. In addition, the pre-execution process 2 of node n2 can also pre-execute the transactions it receives in sequence from the cache process 2 to obtain the pre-execution information of the transaction, wherein the pre-execution information of any transaction can include a pre-execution read set (corresponding to the data read operations involved in the transaction execution process), a pre-execution write set (corresponding to the data write operations involved in the transaction execution process), transaction time (used to characterize the time consumed in pre-execution of the transaction, which can be regarded as the time required to actually execute the transaction), resource consumption information (used to characterize the amount of digital resources / computing resources consumed to execute the transaction), etc. Among them, the pre-execution read and write set described in this specification may include the pre-execution read set and / or the pre-execution write set. Furthermore, the pre-execution process 2 of node n2 can also return the pre-execution information of the batch of transactions to the cache process 2 after completing the pre-execution of each batch of transactions to be cached in the transaction queue to be agreed upon.

[0034] As shown in Figure 3, control process 1 and storage process 1 in node n1 are each connected to N computation processes (i.e., computation process 11, computation process 12, and computation process 13). Control process 1 can send (i.e., schedule, distribute) M transaction groups to corresponding computation processes among the N computation processes for execution. For example, it can send all transaction groups to computation process 1, send some transaction groups to computation process 11 and send them along with transaction groups to computation process 12, or evenly distribute all transaction groups to the three computation processes. After executing any transaction group, any computation process can submit the corresponding receipt data to storage process 1 for storage.

[0035] It should be noted that the control process and the N computing processes can be separate concepts, and these processes logically belong to the first node. Among them, the node program of the first node (used to implement the control logic of the node) can be deployed in any physical device, and the control process and any of the N computing processes can be deployed in the physical device or in other physical devices different from the physical device (such as each process can be deployed in different cloud servers in the form of a cluster). Regardless of the deployment method, the above-mentioned different processes can be regarded as "remote", and information and data interaction can be achieved between different processes through corresponding inter-process communication technologies, such as RPC (Remote Procedure Call, remote procedure call) technology, PIPE (pipeline) technology, message queue (Message Queue) technology, etc., and this manual does not limit this.

[0036] In the embodiments of this specification, the first block can be any block that has reached consensus but has not yet been executed, and the block contains multiple pending transactions. Furthermore, N and M are both integers greater than 1. In other words, the first node contains multiple computing processes, and the multiple pending transactions in the first block are divided into multiple transaction groups. The M transaction groups each contain a different transaction, meaning that any transaction in the first block belongs to only one transaction group to prevent duplicate execution of the same transaction.

[0037] In one embodiment, a second node may pre-execute multiple transactions in a first block to obtain pre-execution read-write sets for each of the multiple transactions. The pre-execution read-write set for any transaction may include a pre-execution read set and a pre-execution write set. The pre-execution read set includes key-value pairs for variables read by the transaction during pre-execution, and the pre-execution write set includes key-value pairs for variables written by the transaction during pre-execution. The variables may include, for example, external accounts in the blockchain or variables defined in a contract account. It can be understood that if the pre-execution write set of a transaction Tx1 does not intersect with the pre-execution write set and pre-execution read set of another transaction Tx2, it means that the variables written during the execution of Tx2 will neither be read nor written during the execution of Tx1. In this case, it can be considered that Tx1 does not depend on Tx2. Similarly, if the pre-execution write set of Tx2 does not intersect with the pre-execution write set and pre-execution read set of Tx1, it can be considered that Tx2 does not depend on Tx1. If Tx1 does not depend on Tx2 and Tx2 does not depend on Tx1, it can be considered that Tx1 and Tx2 do not depend on each other.

[0038] It can be seen that the dependencies between multiple transactions in the first block can be determined based on the above-mentioned pre-execution read-write set. Based on this, the control process can obtain the M transaction groups in various ways. For example, after the second node pre-executes the multiple transactions to obtain the corresponding pre-execution read-write set, it can group the multiple transactions (i.e., all transactions in the first block) according to their respective pre-execution read-write sets to obtain M transaction groups, and send these transaction groups to the first node. It is understandable that at this time, the second node, as the master node, can send the M transaction groups obtained by its own grouping to each slave node in the blockchain network (including the first node), thereby simplifying the transaction grouping burden of the entire blockchain network (especially each slave node). For another example, after the second node pre-executes the multiple transactions to obtain the corresponding pre-execution read-write set, it can also send the multiple transactions and their respective pre-execution read-write sets to the first node (actually, they can be sent to each slave node separately, which will not be repeated here), so that the first node can group the multiple transactions according to the received pre-execution read-write set to obtain the M transaction groups.

[0039] Regardless of whether the M transaction groups are grouped by the first or second node, the node can determine the dependencies between the multiple transactions based on their respective pre-execution read / write sets and group the multiple transactions according to these dependencies. Furthermore, within the M transaction groups obtained through the grouping process, there is a continuous dependency between the transactions included in any transaction group, and no dependencies exist between the transactions in that transaction group and any other transaction group within the M transaction groups. In other words, among the multiple transactions included in the first block, transactions that have a continuous dependency are grouped together in the same transaction group, while transactions that do not have a continuous dependency are grouped together in different transaction groups. Thus, any transaction group may contain one or more transactions. For example, if Tx1 depends on Tx2 and Tx2 does not depend on Tx1, or if Tx2 depends on Tx2 and Tx1 does not depend on Tx2, then Tx1 and Tx2 will be grouped together in the same transaction group. If Tx1 and Tx2 do not depend on each other, they will be grouped together in different transaction groups. It should also be noted that the so-called "continuous dependency" can be understood as the dependency between multiple transactions being continuously transmitted. As shown in Figure 4, transaction B depends on transaction A, and transaction C depends on transaction B. In this case, it can be regarded as C indirectly depending on A, that is, there is a continuous dependency between transaction C and transaction A.

[0040] After obtaining the M transaction groups, according to the relative magnitude relationship between the number of transaction groups (i.e., M) and the number of computing processes (i.e., N) within the first node (available), the control process can adopt a corresponding scheduling method to send the M transaction groups to the corresponding computing processes among the N computing processes respectively. For example, when M is not greater than N (i.e., M < N or M = N), the control process can send the M transaction groups to different computing processes respectively, so that each different computing process executes a transaction group (the transactions in it) respectively, thereby maximizing the execution speed of all transaction groups and improving the overall execution efficiency of the first block.

[0041] When M is greater than N (i.e., M > N), the control process can send the M transaction groups to the corresponding computing processes among the N computing processes respectively according to the grouping expected time-consuming indicators of the M transaction groups, so as to make the task expected time-consuming indicators of the N computing processes tend to be consistent. Among them, the transaction groups received by each computing process are different from each other. The grouping expected time-consuming indicator of any transaction group is used to represent the total duration required to execute all the transactions in this transaction group, and the task expected time-consuming indicator of any computing process is used to represent the total duration required for this computing process to execute all the transactions in the transaction group it receives. Among them, for any computing process that receives a transaction group, it can receive at least one transaction group, and all the transaction groups received by this computing process constitute a transaction task that the computing process needs to execute. After this computing process finishes executing all the at least one transaction group, it can be regarded that the transaction task it receives is completed - the corresponding total execution duration corresponds to the task expected time-consuming indicator. Through this method, in the scenario where M > N, it can be ensured that the computing processes that receive transaction groups complete the transaction groups they receive at the same time as much as possible, or the moments when they complete the transaction groups they receive are as close as possible. It can be seen that this method also helps to accelerate the overall execution speed of the first block.

[0042] Specifically, the control process can determine the expected time consumption index of each transaction group based on the transaction time consumption index of each transaction in the first block (obtained through statistics during the pre-execution process) and the dependency relationship between each transaction. For any transaction group, the control process can use different methods to determine the expected time consumption index of the transaction group depending on the number of transactions contained in the transaction group. For example, when any transaction group contains only one transaction, the transaction time or transaction fee of the transaction can be used as the expected time consumption index of the transaction group. For another example, when any transaction group contains multiple transactions, the expected time consumption index of the transaction group can be determined based on the dependency relationship between the multiple transactions in the transaction group and the transaction time of each transaction. For another example, when any transaction group contains multiple transactions, the expected time consumption index of the transaction group can be determined based on the dependency relationship between the multiple transactions in the transaction group and the transaction fee of each transaction.

[0043] It can be seen that in the process of calculating the expected time consumption index of a group of transactions, the transaction time consumption or transaction fee of each transaction contained in the transaction group in the pre-execution stage can be used as the corresponding expected transaction time consumption index. It is understandable that, given that the specific operations in the pre-execution stage and the execution stage of any transaction are usually the same, the time consumption is usually the same or close, so the transaction time consumption of the transaction in the pre-execution stage can be used as its expected transaction time consumption index. And given that both the transaction time consumption in the pre-execution stage and the transaction time consumption in the actual execution stage are usually related to the instructions executed in the execution stage of the transaction, and the total execution time of the instructions is usually positively correlated with the transaction fee (i.e., gas), the expected transaction time consumption index of any transaction can also be the transaction fee of the transaction (the fee can be obtained by statistics during the pre-execution process).

[0044] Taking transaction duration as an example, if any transaction group contains multiple transactions, the dependencies between these multiple transactions can be used to determine at least one unidirectional execution link formed by these multiple transactions. Furthermore, the expected single-link duration of each unidirectional execution link can be determined, and the largest expected single-link duration can be used as the expected group duration of the transaction group. The transactions in any unidirectional execution link are executed serially, and the expected single-link duration of any unidirectional execution link is the sum of the transaction durations of each transaction in that unidirectional execution link. In this way, the expected group duration can be accurately determined by comparing the expected single-link durations of each unidirectional execution link.

[0045] As shown in Figure 4, transaction group Tx_group i contains seven dependent transactions (i.e., transactions A through G). Each transaction can form two unidirectional execution links: L1 {A→B→C→F→G} and L2 {A→B→D→E→F→G}. Since transactions in a unidirectional execution link are executed serially, the expected single-link duration T1 of unidirectional execution link L1 is the sum of the transaction durations of each transaction in L1, i.e., T1 = 20us + 30us + 80us + 10us + 60us = 200us. The expected single-link duration T2 of unidirectional execution link L2 is the sum of the transaction durations of each transaction in L2, i.e., T2 = 20us + 30us + 50us + 15us + 10us + 60us = 185us. Clearly, T1 > T2, so T1 can be used as the group expected duration for Tx_group i.

[0046] Alternatively, in the case where any transaction group contains multiple transactions, the serial transaction segments and / or parallel transaction segments constituted by the multiple transactions can also be determined based on the dependency relationship between the multiple transactions, and the expected grouping time of any transaction group can be determined based on the determined transaction times of the transactions contained in each transaction segment; wherein, any transaction segment contains at least one transaction, and each transaction in any transaction segment containing multiple transactions is executed serially, and the transactions respectively contained in the serial transaction segment and the parallel transaction segment are executed serially, so that the transactions respectively contained in multiple parallel transaction segments with the same starting point and / or the same end point are executed in parallel, and the sum of the transaction times of all transactions contained in the longest parallel transaction segment among the multiple parallel transaction segments is the largest, and the expected grouping time of any transaction group is the sum of the following: the transaction times of all transactions respectively contained in each serial transaction segment and the transaction times of all transactions respectively contained in each longest parallel transaction segment in the parallel transaction segment.

[0047] As shown in Figure 4, each transaction can be composed of two serial transaction segments, LS1 {A→B} and LS2 {F→G}, and two parallel transaction segments, LP1 {C} and LP2 {D→E}. It can be understood that transactions within any transaction segment are executed serially, LS1 and LS2 are executed serially, and LS1 and LS2 are executed serially with any transaction segment within LP1 and LP2. For parallel transaction segments LP1 and LP2, the sum of the transaction durations of all transactions in LP1 (i.e., transaction B) is 80us, and the sum of the transaction durations of all transactions in LP1 (i.e., transactions D and E) is 65us. Therefore, LP1 is the longest parallel transaction segment in Tx_group i. Based on this, the expected group duration of Tx_group i can be calculated as: the transaction duration of all transactions in LS1 and LS2 plus the transaction duration of all transactions in LP1. In other words, the expected group duration of Tx_group i is (20us + 30us) + (10us + 60us) + (80us) = 200us.

[0048] It should be noted that the embodiment shown in Figure 4 is merely exemplary. The embodiments of this specification do not limit the number of unidirectional execution links constituted by each transaction in any transaction group, the number of serial transaction segments and parallel transaction segments, the number of transactions in each link and transaction segment, and their specific dependencies.

[0049] In addition, the aforementioned embodiments are all described using the example of multiple transactions in the same transaction group having dependencies (hereinafter referred to as dependent transactions). In reality, multiple transactions in the same transaction group may also not have dependencies. For example, among the multiple transactions contained in the first block, there may be some transactions that have no dependencies with any other transactions (hereinafter referred to as non-dependent transactions). In this case, some (at least two) or all of these non-dependent transactions can be assigned to the same transaction group. In this way, multiple non-dependent transactions can be scheduled (i.e., distributed) and executed as a transaction group, thereby effectively reducing the number of scheduling times of the control process (when scheduling is performed in transaction groups, the number of transaction groups is the number of scheduling times) and speeding up the overall scheduling speed of all transactions in the first block. Of course, at least one non-dependent transaction can also be assigned to the same transaction group as multiple dependent transactions (with dependencies) to further reduce the number of scheduling times.

[0050] Any computing process that receives a transaction group containing at least one independent transaction can submit the receipt data corresponding to the at least one independent transaction to the storage process separately. Alternatively, if the transaction group contains multiple independent transactions, the receipt data for these independent transactions can be submitted to the storage process together. Alternatively, if the transaction group also contains multiple dependent transactions, the receipt data for the at least one independent transaction can be submitted separately or together with the receipt data for the multiple independent transactions. The various transaction group division methods, transaction execution methods, and receipt data submission methods described above can be applied to the corresponding application scenarios as needed and are not further described here.

[0051] In one embodiment, the control process may send the N transaction groups to at least two of the N computing processes, respectively, so that the at least two computing processes that received the corresponding transaction groups can execute (the transactions in) the received transaction groups in parallel, thereby accelerating the overall execution speed of the first block and improving overall execution efficiency. Of course, the control process may also send the N transaction groups to a single computing process among the N computing processes for execution. In this case, although the computing process has a heavier transaction execution burden (i.e., it receives a larger total number of transactions), due to the presence of the transaction groups, it can still execute and submit transactions on a transaction group basis (i.e., execute each transaction in a transaction group, i.e., submit the corresponding receipt data, without having to wait for the completion of all transaction groups). This enables parallel submission and storage of receipt data at the transaction group level, and can also improve the overall storage efficiency of all receipt data corresponding to the first block (i.e., the receipt data corresponding to all transactions contained in the first block) to a certain extent.

[0052] Step 204 : Upon receiving any transaction group, any computing process executes each transaction in the transaction group and submits receipt data of each transaction to the storage process.

[0053] As mentioned above, there may be one or more computing processes that receive the transaction groups. For any of the computing processes, upon receiving at least one transaction group (ie, a transaction task), any computing process may start executing each transaction group.

[0054] In one embodiment, any transaction group received by any computing process may contain one or more transactions, and multiple threads may be created within the computing process. Where any transaction group contains only one transaction, the transaction may be executed by any thread. For example, considering that the computing process may currently be executing transactions contained in other transaction groups in the first block, or executing transactions contained in transaction groups in other blocks, the computing process may use a thread that is currently idle to execute the transaction. Where any transaction group contains multiple transactions, these transactions may be executed by any thread (such as a currently idle thread); alternatively, the multiple threads may execute each transaction in the transaction group in parallel to maximize the overall execution speed of these transactions.

[0055] As previously mentioned, any transaction group received by any computing process can contain multiple transactions that have a continuous dependency relationship. Based on this, any computing process can execute these transactions according to the dependency relationship between the multiple transactions. For example, for a first transaction and the second transaction on which it depends, the first transaction can be executed after the second transaction is completed. For a third transaction and a fourth transaction that depend on the same transaction or are depended on by the same transaction, if the third and fourth transactions are independent of each other, the third and fourth transactions can be executed concurrently through different threads. This approach not only ensures that transactions with dependencies are executed in sequence, thereby guaranteeing the accuracy of the execution results of each transaction, but also improves the overall execution efficiency of transactions without dependencies by executing the third and fourth transactions concurrently.

[0056] As shown in Figure 4, the first and second transactions can be transactions B and A, respectively. In this case, the computing process that receives Tx_group i can execute transaction A first and then transaction B. Similarly, the first and second transactions can be transactions G and F, respectively. In this case, the computing process that receives Tx_group i can execute transaction F first and then transaction G. The third transaction can be transaction C, and the fourth transaction can be transactions D and E. In this case, the computing process that receives Tx_group i can execute transaction C through thread 1, and then execute transactions D and E in sequence through thread 2, and so on.

[0057] It should also be noted that the first and second transactions, which are dependent on each other, can also be transactions B and C, respectively. In this case, transaction B should be executed before transaction C. Moreover, since transaction F depends on transactions C and E, after the execution of transactions D and E is completed, it is necessary to wait for the execution of transaction C to complete (of course, it is also possible to wait for the execution of transactions D and E to complete after the execution of transaction C is completed). Transaction F can then be executed based on the execution results of transactions C and E (for example, if certain variables are updated during the execution of the two transactions). This is specially explained.

[0058] In one embodiment, any computing process that receives any transaction group can submit the receipt data to the storage process in a variety of ways. For example, in response to the completion of each transaction in any transaction group, the receipt data for each transaction in that transaction group can be submitted to the storage process. In this way, the computing process can submit its receipt data immediately after the completion of any transaction group, without having to wait for the completion of transactions in other transaction groups, thereby further accelerating the efficiency of receipt data submission. For another example, in response to the completion of each transaction in all received transaction groups (i.e., the completion of the aforementioned transaction tasks), the receipt data for each transaction in all transaction groups can be submitted to the storage process.

[0059] In addition, after executing each transaction in any transaction group, any computing process can also compare its own execution results with the execution results of other slave nodes executing the transaction group to determine whether the aforementioned grouping is normal, thereby determining whether the master node is malicious. Specifically, the proof information generated by each slave node for the transaction group can be collected, and when the number of legitimate proof information meets a quantity threshold (for example, when using the PBFT algorithm, the number of legitimate proofs is not less than (f-1) / 3), the receipt data of each transaction in the transaction group is submitted to the storage process.

[0060] In step 206 , the storage process stores the received receipt data into a preset storage space of the first node.

[0061] As previously described, the M transaction groups may be sent to one or more computing processes. Any computing process may submit receipt data immediately upon completing execution of a transaction group, or may submit all receipt data at once upon completing execution of all received transaction groups. Therefore, the storage process may receive receipt data corresponding to one or more transaction groups submitted by any computing process at once (wherein, the receipt data corresponding to any transaction group is the complete receipt data corresponding to each transaction in that transaction group). In response to receiving the receipt data corresponding to any transaction group, the storage process may store the receipt data in the preset storage space of the first node.

[0062] Among them, the preset storage space of the first node can be the local storage space of the node device where the first node is located, such as the local disk of the node device, and the local disk refers to a disk installed on the mainboard of the node device (physical machine) and cannot be plugged in or moved at will, and is used to store data. It can be understood that the local disk can provide local storage access capabilities for the first node, and has the advantages of low latency, high random IOPS (Input / Output Per Second, input and output per second or read and write times per second), high throughput and high cost performance. Alternatively, the preset storage space can also be a remote storage space accessible to the first node, such as a database deployed in the cloud. This method can increase or decrease the preset storage space available to the first node as needed, without being limited by the size limit of the local disk storage space of the node device. The data storage method is more flexible and can be applied to a wider range of application scenarios.

[0063] Of course, given that limited local storage space generally has better access performance than expandable remote storage space, and that receipt data corresponding to newly executed blocks is often accessed more frequently than receipt data corresponding to historical blocks, the aforementioned receipt data of the first block can be stored in the aforementioned local storage space. After a certain period of time, the receipt data corresponding to the less frequently accessed first block can be migrated to the remote storage space according to timeout rules or access popularity, thereby achieving a balance between storage space size and performance to simultaneously improve the storage efficiency and access performance of the receipt data.

[0064] In the above embodiment, the control process in the first node sends the M transaction groups obtained by grouping the multiple transactions in the first block based on the pre-execution read-write sets of each of the multiple transactions to the corresponding computing processes among the N computing processes respectively; upon receiving any transaction group, any computing process executes each transaction in the any transaction group and submits the receipt data of each transaction to the storage process, so that the latter stores it in the preset storage space of the first node.

[0065] As can be seen, this solution dispatches each transaction group to its corresponding computation process for execution. After each computation process completes its transactions within the transaction group, it independently submits the receipt data it obtains. Clearly, compared to related art storage solutions where central submission is performed by the control process, this solution enables multi-party concurrent submission of receipt data corresponding to different transaction groups within the same block. This eliminates the need for the control process to wait for receipt data to be returned by the computation process, saving submission time and alleviating the data processing burden on the control process. This effectively improves the efficiency of both the submission and storage of receipt data corresponding to each block.

[0066] For transactions executed on blockchains that employ an account model, in addition to storing the aforementioned receipt data (i.e., the transaction receipt), it is typically necessary to store the transaction content and the corresponding state data of the blockchain accounts involved in the transaction. This includes the multiple transactions contained in the first block, the transaction content, and the receipt data for each transaction, i.e., the block data belonging to that block. When storing the various blockchain data shown above, this data can typically be organized into a Merkle Tree in the form of key-value pairs and stored in the database.

[0067] Based on this, in one embodiment, any computation process may also submit the transaction content of each transaction in any transaction group and the status data obtained from executing each transaction to the storage process for storage. In practice, the transaction content, status data, and receipt data of each transaction in any transaction group may be submitted to the storage process for storage. Furthermore, the transaction hash of each transaction or its transaction identifier (number, etc.) in the first block may also be submitted. Furthermore, any computation process may also submit the grouping information of any transaction group to the storage process for storage, facilitating subsequent data query.

[0068] It is understood that the data and information submitted and stored by any of the aforementioned computing processes all belong to the block body of the first block. As can be seen, each computing process that receives a transaction group submits the aforementioned data and information separately, causing the block body of the first block to be stored by the storage process as multiple distinct copies—each copy corresponding to one or more transaction groups. In other words, in this solution, the block body of the first block is divided into multiple copies, each of which is stored independently.

[0069] In one embodiment, corresponding to the aforementioned block body, the control process may store the corresponding block header. For example, each computing process that receives the corresponding transaction group may send the execution-related data obtained by executing the corresponding transaction (i.e., all transactions in each transaction group received by itself) to the control process. The execution-related data sent by any computing process is obtained by executing all transactions contained in each received transaction group, and may include receipt data, status data, and transaction fees of these transactions. Accordingly, when the control process receives the execution-related data of all transactions in the first block (which is the complete set of execution-related data sent by each computing process that receives the transaction group), it can determine the block header of the first block based on this execution-related data and submit the block header to the storage process for storage. It can be seen that in this solution, each computing process that receives the transaction group submits the corresponding part of the block body respectively (the part submitted by each computing process constitutes the complete block body of the first block), and the control process collects the execution-related data of each transaction in the first block to determine and submit the block header of the first block, ultimately realizing the complete submission and storage of the block data corresponding to the first block (including the block body and block header).

[0070] In particular, when the control process determines the block header of the first block based on the receipt data, status data and transaction fees included in the execution-related data, it may include: calculating the receipt root hash Receipt_Root based on the receipt data of all transactions, and recording Receipt_Root in the block header; calculating the state root hash State_Root based on the status data of all transactions, and recording State_Root in the block header; calculating the total block fee Sum_gas based on the transaction fee gas of all transactions, and recording Sum_gas in the block header. In addition, the control process can also calculate the transaction root hash Transaction_Root based on each transaction in the first block, and record Transaction_Root in the block header. In particular, the calculation process of each of the above-mentioned root hashes can be implemented using the algorithm corresponding to the aforementioned Merkle Tree, which will not be repeated here.

[0071] For example, the information recorded in the block header can be found in the following header code:

[0072] Corresponding to the aforementioned embodiment, an embodiment of this specification further proposes a first node in a blockchain system, the first node including a control process, a storage process, and N computing processes, wherein: the control process is used to send the obtained M transaction groups to the corresponding computing processes among the N computing processes respectively, and the M transaction groups are obtained by grouping the multiple transactions in the first block based on the pre-execution read-write sets of the multiple transactions, and N and M are both greater than 1; any computing process is used to execute each transaction in any transaction group when receiving the transaction group, and submit the receipt data of each transaction to the storage process; the storage process is used to store the received receipt data in the preset storage space of the first node.

[0073] FIG5 is a schematic diagram of the structure of a first node in a blockchain system provided by an exemplary embodiment. As shown in FIG5 , the first node includes a control process 52, a storage process 54, and N computation processes 56. The control process 52 is configured to send M acquired transaction groups to corresponding computation processes 56 among the N computation processes 56. The M transaction groups are obtained by grouping multiple transactions in the first block based on their respective pre-execution read / write sets, where N and M are both greater than 1. Upon receiving any transaction group, each computation process 56 is configured to execute each transaction in the group and submit receipt data for each transaction to the storage process 54. The storage process 54 is configured to store the received receipt data in a preset storage space of the first node.

[0074] Optionally, the control process 52 sends the acquired M transaction groups to corresponding calculation processes 56 among the N calculation processes 56, including: when M is not greater than N, sending the M transaction groups to different calculation processes 56 respectively; when M is greater than N, sending the M transaction groups to corresponding calculation processes 56 among the N calculation processes 56 according to the grouping expected time consumption indicators of the M transaction groups, so that the task expected time consumption indicators of the N calculation processes 56 tend to be consistent, wherein the transaction groupings received by each calculation process 56 are different from each other, the grouping expected time consumption indicator of any transaction group is used to represent the total time required to execute all transactions in the transaction group, and the task expected time consumption indicator of any calculation process 56 is used to represent the total time required for the calculation process 56 to execute all transactions in the transaction group it receives.

[0075] Optionally, the control process 52 determines the expected time consumption index for grouping any transaction group, including one of the following: when any transaction group contains only one transaction, the transaction time or transaction fee of the transaction is used as the expected time consumption index for grouping of the transaction group; when any transaction group contains multiple transactions, the expected time consumption index for grouping of the transaction group is determined based on the dependency relationship between the multiple transactions in the transaction group and the transaction time of each transaction; when any transaction group contains multiple transactions, the expected time consumption index for grouping of the transaction group is determined based on the dependency relationship between the multiple transactions in the transaction group and the transaction fee of each transaction.

[0076] Optionally, the control process 52 obtains the M transaction groups, including: obtaining the M transaction groups sent by the second node, the M transaction groups being obtained by the second node grouping the multiple transactions according to the respective pre-execution read-write sets of the multiple transactions; or obtaining multiple transactions in the first block and the respective pre-execution read-write sets of the multiple transactions, and grouping the multiple transactions according to the pre-execution read-write sets to obtain the M transaction groups; wherein the respective pre-execution read-write sets of the multiple transactions are obtained by the second node pre-executing the multiple transactions.

[0077] Optionally, when any received transaction group contains multiple transactions, any computing process 56 executes each transaction in the transaction group, including: if any computing process 56 contains multiple threads, each transaction in the transaction group is executed in parallel by the multiple threads.

[0078] Optionally, any one of the computing processes 56 executes each transaction in any one of the transaction groups, including: any one of the computing processes 56 executes each of the transactions according to the dependency relationship between the transactions; wherein, for a first transaction and a second transaction on which it depends, the first transaction is executed after the second transaction is completed; for a third transaction and a fourth transaction that depend on the same transaction or are depended on by the same transaction, if the third transaction and the fourth transaction are not dependent on each other, the third transaction and the fourth transaction are executed concurrently through different threads.

[0079] Optionally, any one of the computing processes 56 submits the receipt data of each transaction to the storage process 54, including: in response to the completion of execution of each transaction in any one of the transaction groups, submitting the receipt data of each transaction in the transaction group to the storage process 54; or, in response to the completion of execution of each transaction in all the transaction groups received by itself, submitting the receipt data of each transaction in all the transaction groups to the storage process 54.

[0080] Optionally, it also includes: any computing process 56 submitting the transaction content of each transaction and the status data obtained by executing each transaction to the storage process 54 for storage.

[0081] Optionally, the method further includes: any calculation process 56 submitting the grouping information of any transaction group to the storage process 54 for storage.

[0082] Optionally, it also includes: each computing process 56 that receives the corresponding transaction group sends the execution-related data obtained by executing the corresponding transaction to the control process 52; when the control process 52 receives the execution-related data of all transactions in the first block, it determines the block header of the first block based on the execution-related data, and submits the block header to the storage process 54 for storage.

[0083] Optionally, the execution-related data includes receipt data, status data and transaction fees, and the storage process 54 determines the block header of the first block based on the execution-related data, including: calculating the receipt root hash based on the receipt data of all transactions, and recording the receipt root hash in the block header; calculating the status root hash based on the status data of all transactions, and recording the status root hash in the block header; calculating the total block fee based on the transaction fees of all transactions, and recording the total block fee in the block header.

[0084] Corresponding to the aforementioned embodiment, an embodiment of this specification also proposes a blockchain system, comprising a first node and a second node, the first node including a control process, a storage process and N computing processes, wherein: the second node is used to pre-execute multiple transactions in the first block to obtain pre-execution read-write sets for each of the multiple transactions; and, grouping the multiple transactions according to the pre-execution read-write sets to obtain M transaction groups, and sending the M transaction groups to the first node, or sending the multiple transactions and the pre-execution read-write sets to the first node, so that the first node groups the multiple transactions according to the pre-execution read-write sets to obtain M transaction groups, where N and M are both greater than 1; the control process in the first node is used to send the M transaction groups to corresponding computing processes in the N computing processes respectively; any computing process is used to, upon receiving any transaction group, execute each transaction in the any transaction group and submit the receipt data of each transaction to the storage process; the storage process is used to store the received receipt data in a preset storage space of the first node.

[0085] The first node and the second node may be a slave node and a master node in the blockchain system, respectively. The specific implementation of the storage process of the corresponding receipt data can be referred to the description of the aforementioned embodiment and will not be repeated here.

[0086] FIG6 is a schematic diagram of the structure of a device provided by an exemplary embodiment. Referring to FIG6 , at the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile memory 610, and may also include hardware required for other services. One or more embodiments of this specification may be implemented based on software, such as the processor 602 reading the corresponding computer program from the non-volatile memory 610 into the memory 608 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or logic devices.

[0087] Although one or more embodiments of this specification provide method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "comprise", "include" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements. For example, if the words first, second, etc. are used to represent the name, they do not represent any particular order.

[0088] The present invention is described with reference to the flowcharts and / or block diagrams of the methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more blocks in the block diagram.

[0089] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0090] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0091] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0092] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0093] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage, graphene storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0094] Those skilled in the art will appreciate that one or more embodiments of this specification may be provided as a method, system, or computer program product. Thus, one or more embodiments of this specification may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0095] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In distributed computing environments, program modules may be located in local and remote computer storage media, including storage devices.

[0096] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between the various embodiments can be referenced across them. Each embodiment focuses on the differences from the other embodiments. In particular, since the system embodiments are generally similar to the method embodiments, their description is relatively simple. For relevant parts, reference can be made to the description of the method embodiments. Throughout this specification, reference to the terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and integrate the different embodiments or examples, and features of different embodiments or examples, described in this specification, without conflict.

[0097] The foregoing is merely an example of one or more embodiments of this specification and is not intended to limit the one or more embodiments of this specification. It will be apparent to those skilled in the art that various modifications and variations may be made to one or more embodiments of this specification. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of this specification shall be included within the scope of the claims.

Claims

1. A method for storing receipt data, applied to a first node in a blockchain system, wherein the first node includes a control process, a storage process, and N computing processes, the method comprising: The control process sends the acquired M transaction groups to corresponding computing processes among the N computing processes respectively, wherein the M transaction groups are obtained by grouping the multiple transactions in the first block based on the respective pre-execution read-write sets of the multiple transactions, and both N and M are greater than 1; Upon receiving any transaction group, any computing process executes each transaction in the transaction group and submits receipt data of each transaction to the storage process; The storage process stores the received receipt data into a preset storage space of the first node.

2. According to the method of claim 1, the control process sends the acquired M transaction groups to corresponding computing processes among the N computing processes respectively, including: When M is not greater than N, the M transaction groups are sent to different computing processes respectively; When M is greater than N, the M transaction groups are respectively sent to corresponding computing processes among the N computing processes according to the expected grouping time consumption indicators of the M transaction groups, so that the expected task time consumption indicators of the N computing processes tend to be consistent, wherein the transaction groups received by each computing process are different, the expected grouping time consumption indicator of any transaction group is used to characterize the total time required to execute all transactions in the transaction group, and the expected task time consumption indicator of any computing process is used to characterize the total time required for the computing process to execute all transactions in the transaction group it receives.

3. The method according to claim 2, wherein the control process determines the expected time consumption index of grouping of any transaction group, including one of the following: When any transaction group contains only one transaction, the transaction time or transaction fee of the transaction is used as the expected time index for grouping the transaction group; When any transaction group contains multiple transactions, the expected transaction time index of the transaction group is determined according to the dependency relationship between the multiple transactions in the transaction group and the transaction time of each transaction; When any transaction group contains multiple transactions, the expected time consumption index of the transaction group is determined according to the dependency relationship between the multiple transactions in the transaction group and the transaction fee of each transaction.

4. According to the method of claim 1, the control process obtains the M transaction groups, comprising: Acquire the M transaction groups sent by the second node, where the M transaction groups are obtained by the second node grouping the multiple transactions according to the respective pre-execution read-write sets of the multiple transactions; or, Acquire multiple transactions in the first block and pre-execution read-write sets of the multiple transactions, and group the multiple transactions according to the pre-execution read-write sets to obtain the M transaction groups; The pre-execution read-write sets of each of the multiple transactions are obtained by pre-executing the multiple transactions by the second node.

5. The method according to claim 1, wherein when any received transaction group contains multiple transactions, any computing process executes each transaction in the transaction group, including: If any of the computing processes includes multiple threads, the multiple threads execute each transaction in the transaction group in parallel.

6. The method according to claim 1, wherein any one of the computing processes executes each transaction in any one of the transaction groups, comprising: Any one of the computing processes executes each of the transactions according to the dependency relationship between the transactions; Among them, for the first transaction and the second transaction on which it depends, the first transaction is executed after the second transaction is completed; for the third transaction and the fourth transaction that depend on the same transaction or are depended on by the same transaction, if the third transaction and the fourth transaction are not dependent on each other, the third transaction and the fourth transaction are executed concurrently through different threads.

7. The method according to claim 1, wherein any computing process submits the receipt data of each transaction to the storage process, comprising: In response to completion of execution of each transaction in any transaction group, submitting receipt data of each transaction in the transaction group to the storage process; or, In response to the completion of each transaction in all the transaction groups received by itself, the receipt data of each transaction in all the transaction groups are submitted to the storage process.

8. The method according to claim 1, further comprising: Any computing process submits the transaction content of each transaction and the status data obtained by executing each transaction to the storage process for storage.

9. The method according to claim 1, further comprising: Any computing process submits the grouping information of any transaction group to the storage process for storage.

10. The method according to claim 1, further comprising: Each computing process that receives the corresponding transaction group sends the execution-related data obtained by executing the corresponding transaction to the control process; When receiving the execution-related data of all transactions in the first block, the control process determines the block header of the first block according to the execution-related data, and submits the block header to the storage process for storage.

11. The method of claim 10, wherein the execution-related data comprises receipt data, status data, and transaction fees, and wherein the storage process determines a block header of the first block according to the execution-related data, comprising: Calculate a receipt root hash based on the receipt data of all transactions, and record the receipt root hash in the block header; Calculate a state root hash according to the state data of all transactions, and record the state root hash in the block header; The total block fee is calculated according to the transaction fees of all transactions, and the total block fee is recorded in the block header.

12. A first node in a blockchain system, the first node comprising a control process, a storage process and N computing processes, wherein: The control process is used to send the obtained M transaction groups to corresponding computing processes among the N computing processes respectively, wherein the M transaction groups are obtained by grouping the multiple transactions in the first block based on the pre-execution read-write sets of the multiple transactions respectively, and N and M are both greater than 1; Any computing process is used to execute each transaction in any transaction group when receiving the transaction group, and submit receipt data of each transaction to the storage process; The storage process is used to store the received receipt data into a preset storage space of the first node.

13. A blockchain system, comprising a first node and a second node, wherein the first node comprises a control process, a storage process and N computing processes, wherein: The second node is used to pre-execute multiple transactions in the first block to obtain pre-execution read-write sets of the multiple transactions; and, group the multiple transactions according to the pre-execution read-write sets to obtain M transaction groups, and send the M transaction groups to the first node, or send the multiple transactions and the pre-execution read-write sets to the first node, so that the first node groups the multiple transactions according to the pre-execution read-write sets to obtain M transaction groups, where N and M are both greater than 1; The control process in the first node is used to send the M transaction groups to corresponding computing processes in the N computing processes respectively; any computing process is used to execute each transaction in any transaction group when receiving any transaction group, and submit receipt data of each transaction to the storage process; The storage process is used to store the received receipt data into a preset storage space of the first node.

14. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 11 by running the executable instructions.

15. A computer-readable storage medium having computer instructions stored thereon, wherein the instructions are executed by a processor to implement the method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Data synchronization method and device for blockchain nodes

    CN111241593A

  • Transaction execution method in block chain system, node and block chain system

    CN114936093A

  • State data submission method, node and block chain system

    CN115129727A

  • Method and device for generating block, and block chain network

    CN116016541A

  • Receipt data storage method, node and block chain system

    CN116662293A

Cited By

  • Market supervision data exchange platform migration and security enhancement method and system based on credential environment

    CN120223429A