Blockchain-based data processing method, device, equipment, and readable storage medium

By generating the world state of the initial block in the blockchain network and building a world state chain, the problem of state data inconsistency caused by the simultaneous consensus of multiple blocks is solved, and the state data consistency of the blockchain system is achieved.

CN116701414BActive Publication Date: 2025-08-26TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
CN202210174690.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-24
Publication Date
2025-08-26
Estimated Expiration
2042-02-24

AI Technical Summary

Technical Problem

In the existing blockchain network, the consistency of state data cannot be guaranteed when multiple blocks agree at the same time.

Method used

By generating the world state of the initial block and establishing a world state chain, we ensure that the state data of each block is submitted step by step to the latest on-chain world state through a chain relationship, and the consistency of the state data is achieved.

Benefits of technology

When multiple blocks agree at the same time, ensure the consistency of state data of the blockchain system and avoid the problem of data inconsistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116701414B_ABST
    Figure CN116701414B_ABST
Patent Text Reader

Abstract

The present invention discloses a data processing method, apparatus, device, and readable storage medium based on blockchain. The method includes: creating a first world state corresponding to an initial block; updating the first world state according to transactions in the initial block to obtain a target first world state; constructing a clean state tree for the target first world state according to a world state chain to obtain an updated target first world state including a clean current world state tree; writing the first world state root corresponding to the clean current world state tree into the initial block to obtain a block to be chained; if the consensus of the block to be chained is passed, writing the block to be chained into the blockchain; submitting the updated target first world state to the latest chained world state step by step through the world state chain; and determining the updated target first world state as the new consensus root world state. The present invention can maintain the world states of multiple blocks and ensure the consistency of state data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a blockchain-based data processing method, apparatus, device, and readable storage medium. Background Art

[0002] The blockchain system is a blockchain network composed of multiple blockchain nodes. Each blockchain node stores the latest on-chain world state corresponding to the blockchain network. That is, the world state composed of the state data owned by each account in the blockchain network after the block with the maximum block height in the blockchain is chained.

[0003] In existing blockchain networks, the execution of transactions within a block modifies some of the state data held by several accounts. Therefore, each time a block is uploaded to the blockchain, a new, updated, and updated world state is generated. During consensus, a new block relies on the updated, updated world state of its parent block to determine its own updated, updated world state. Therefore, existing consensus mechanisms often only allow for a single block to reach consensus. Consensus mechanisms that require multiple blocks to reach consensus simultaneously often fail to guarantee the consistency of the blockchain system's state data. Summary of the Invention

[0004] The embodiments of the present application provide a data processing method, apparatus, device, and readable storage medium, which can maintain the world state of multiple blocks to be chained and ensure the consistency of the state data of the blockchain system.

[0005] On the one hand, an embodiment of the present application provides a data processing method based on blockchain, including:

[0006] Generate an initial block and create the first world state corresponding to the initial block. The first world state has a chain relationship pointing to the second world state corresponding to the parent block of the initial block. The first and second world states exist in the world state chain. If the parent block is the block with the largest block height among the on-chain blocks, the second world state is the consensus root world state. The first world state in the world state chain is the latest on-chain world state. The consensus root world state has a chain relationship pointing to the latest on-chain world state. The latest on-chain world state is used to record the latest world state corresponding to the on-chain block.

[0007] Update the first world state according to the transactions in the initial block to obtain the target first world state, and construct a clean state tree for the target first world state according to the world state chain to obtain an updated target first world state containing a clean current world state tree;

[0008] Write the first world state root corresponding to the clean current world state tree into the initial block to obtain the block to be chained, and send the consensus block to the consensus node so that the consensus node can perform consensus processing on the block to be chained based on the first world state root to obtain the consensus result;

[0009] If the consensus result is a consensus-passing result, the block to be chained will be written into the blockchain, and the updated target first world state will be submitted to the latest chained world state step by step through the world state chain. The updated target first world state will be determined as the new consensus root world state. The new consensus root world state has a chain relationship pointing to the latest chained world state after submission.

[0010] On the one hand, an embodiment of the present application provides a data processing device based on blockchain, including:

[0011] Initialization module, used to generate the initial block;

[0012] The state creation module is used to create the first world state corresponding to the initial block; the first world state has a chain relationship pointing to the second world state corresponding to the parent block of the initial block; the first world state and the second world state exist in the world state chain; if the parent block is the block with the largest block height among the on-chain blocks, the second world state is the consensus root world state; the first world state in the world state chain is the latest on-chain world state; the consensus root world state has a chain relationship pointing to the latest on-chain world state; the latest on-chain world state is used to record the latest world state corresponding to the on-chain block;

[0013] A first state update module, configured to update the first world state according to the transactions in the initial block to obtain a target first world state;

[0014] The second state update module is used to construct a clean state tree for the target first world state according to the world state chain to obtain an updated target first world state including the clean current world state tree;

[0015] The consensus module is used to write the first world state root corresponding to the clean current world state tree into the initial block to obtain the block to be chained, and send the consensus block to the consensus node so that the consensus node can perform consensus processing on the block to be chained based on the first world state root to obtain the consensus result;

[0016] The state submission module is used to write the block to be on-chain into the blockchain if the consensus result is a consensus-passing result, submit the updated target first world state to the latest on-chain world state step by step through the world state chain, and determine the updated target first world state as the new consensus root world state. The new consensus root world state has a chain relationship pointing to the latest on-chain world state after submission.

[0017] Among them, the state creation module includes:

[0018] A creation unit, configured to create an initial world state corresponding to the initial block; the initial world state includes a first previous world state pointer and a first tree node cache; the first tree node cache includes a first previous tree node cache pointer;

[0019] The pointing unit is used to point the first previous world state pointer to the second world state corresponding to the parent block of the initial block, and point the first previous tree node cache pointer to the second tree node cache included in the second world state to obtain the first world state corresponding to the initial block.

[0020] The first status update module includes:

[0021] A transaction acquisition unit is used to sequentially traverse the transactions in the initial block and obtain the kth transaction in the initial block; k is a positive integer less than or equal to H; H is the total number of transactions in the initial block;

[0022] The transaction state creation unit is used to create the k-th transaction world state corresponding to the k-th transaction; the k-th transaction world state has a chain relationship pointing to the k-1-th submitted world state; when k is 1, the k-1-th submitted world state is the first world state;

[0023] A transaction state updating unit is used to execute the kth transaction and update the kth transaction world state during the execution of the kth transaction to obtain the kth updated transaction world state;

[0024] The transaction state submission unit is used to submit the kth updated transaction world state to the k-1th submitted world state if the kth transaction is successfully executed, thereby obtaining the kth submitted world state;

[0025] The world state determination unit is configured to, when k is equal to H, use the Hth submitted world state as the target first world state.

[0026] Among them, the kth transaction world state contains the account state mapping and the dirty account address set;

[0027] Transaction status update unit, including:

[0028] The execution subunit is used to execute the kth transaction and determine the data to be updated corresponding to the kth transaction during the execution of the kth transaction; the data to be updated includes the account address to be updated, the status data key to be updated, and the status data value to be updated;

[0029] The account status acquisition subunit is used to obtain the account status corresponding to the account address to be updated according to the kth transaction world state as the account status to be updated; the account status to be updated includes the state data mapping to be updated and the dirty state data key set to be updated;

[0030] The first mapping update subunit is configured to update the mapping relationship between the to-be-updated state data key and the to-be-updated state data value into the to-be-updated state data map, insert the to-be-updated state data key into the to-be-updated dirty state data key set, and obtain the current account state;

[0031] The second mapping update unit is used to update the mapping relationship between the account address to be updated and the current account state into the account state mapping contained in the k-th transaction world state, and insert the account address to be updated into the dirty account address set contained in the k-th transaction world state to obtain the k-th updated transaction world state.

[0032] Among them, the account status acquisition subunit is specifically used to perform an account status mapping sequence retrieval from the kth transaction world state to the latest on-chain world state according to the account address to be updated; if an account status with a mapping relationship with the account address to be updated is retrieved during the account status mapping sequence retrieval process, the account status with a mapping relationship with the account address to be updated that is first retrieved is used as the account status to be updated; if an account status with a mapping relationship with the account address to be updated is not retrieved during the account status mapping sequence retrieval process, the state tree root to be updated corresponding to the account address to be updated is obtained according to the world state tree in the latest on-chain world state, and the account status to be updated is established according to the account address to be updated and the state tree root to be updated.

[0033] The transaction status submission unit includes:

[0034] The address acquisition subunit is used to traverse the account addresses in the dirty account address set included in the k-th updated transaction world state and sequentially obtain the j-th account address; j is a positive integer less than or equal to I; I is the total number of account addresses in the dirty account address set included in the k-th updated transaction world state;

[0035] The current account status acquisition subunit is used to obtain the current account status corresponding to the j-th account address from the account status mapping contained in the k-th updated transaction world state;

[0036] The previous account status acquisition subunit is used to obtain the previous account status of the j-th account address based on the k-1-th submitted world state;

[0037] The world state submission subunit is used to submit the current account state corresponding to the j-th account address to the previous account state of the j-th account address, insert the j-th account address into the set of dirty account addresses included in the k-1-th submitted world state, and obtain the j-th transition submitted world state;

[0038] The world state determination subunit is used to clear the dirty account address set and account state mapping contained in the k-th updated transaction world state when j is equal to I, and use the I-th transition submitted world state as the k-th submitted world state.

[0039] Among them, the world state submission sub-unit is specifically used to update the mapping relationship between the state data key and the state data value in the state data map contained in the current account state corresponding to the j-th account address to the state data map contained in the previous account state of the j-th account address; insert the state data key in the state data map contained in the current account state corresponding to the j-th account address into the dirty state data key set contained in the previous account state of the j-th account address, and obtain the j-th transition submitted world state.

[0040] The second status update module includes:

[0041] A tree query unit, configured to perform a world state tree query on a target first world state;

[0042] A first query processing unit is configured to, if the target first world state includes a first world state tree, perform full-chain dirty account state submission processing on the target first world state including the first world state tree to obtain an updated target first world state including a clean current world state tree;

[0043] a second query processing unit, configured to search for a second world state according to the first previous world state pointer if the target first world state does not include the first world state tree;

[0044] The first tree construction unit is used to construct a clean state tree for the second world state according to the world state chain to obtain a clean pre-world state tree;

[0045] A second tree construction unit is configured to use a previous state tree root of the clean previous world state tree as a current state tree root;

[0046] The second tree construction unit is further configured to construct a second world state tree corresponding to the target first world state based on the first tree node cache and the current state tree root, and add the second world state tree to the target first world state to obtain a transition target first world state;

[0047] The dirty state submission unit is used to perform full-chain dirty account state submission processing on the transition target first world state to obtain an updated target first world state containing a clean current world state tree.

[0048] The dirty state submission unit includes:

[0049] The dirty data submission sub-unit is used to submit the dirty state data of the transition target first world state to the entire chain, and obtain the submitted transition target first world state and the set of dirty account addresses of the entire chain;

[0050] The root acquisition sub-unit is used to obtain the account state root corresponding to each full-chain dirty account address in the full-chain dirty account address set according to the submitted transition target first-world state;

[0051] The tree update subunit is used to update each full-chain dirty account address and the account state root corresponding to each full-chain dirty account address to the second world state tree to obtain a clean current world state tree;

[0052] The tree submission sub-unit is used to store the updated tree node hash of the clean current world state tree and the association relationship between the updated tree nodes in the tree node mapping of the tree node cache in the transition target first world state after submission, and obtain the updated target first world state containing the clean current world state tree.

[0053] Among them, the dirty data submission subunit is specifically used to sequentially traverse the world state chain, obtain the dirty account address set contained in the x-th world state, as the x-th target dirty account address set; x is a positive integer less than or equal to Z; Z is the sequential ordinal number of the transition target first world state in the world state chain; traverse the account addresses in the x-th target dirty account address set, and sequentially obtain the m-th account address; m is a positive integer less than or equal to the total number of account addresses in the x-th target dirty account address set; obtain the target current account state and the target previous account state corresponding to the m-th account address; and perform the dirty data submission on the m-th account address according to the previous account state of the m-th account address. The current account status of the user address is submitted for account dirty status data processing; when the current account status of each dirty account address in the x-th target dirty account address set is submitted for account dirty status data processing, the x-th submitted world state is obtained; the target dirty account address is added to the x-1th on-chain target dirty account address set to obtain the x-th on-chain target dirty account address set; when x is 1, the x-1th on-chain target dirty account address set is an empty set; when x is equal to Z, the x-th on-chain target dirty account address set is used as the full-chain dirty account address set, and the x-th submitted world state is used as the first transition target world state after submission.

[0054] Among them, the dirty data submission subunit is specifically used to perform an account state tree query on the current account state of the mth account address; if the current account state of the mth account address does not contain an account state tree, or the account state root of the current account state of the mth account address is not equal to the account state root of the previous account state of the mth account address, then a specified account state tree is established based on the tree node cache of the current account state of the mth account address and the account state root of the previous account state of the mth account address, the account state tree is added to the current account state of the mth account address, and the account state root of the current account state of the mth account address is updated to the account state root of the previous account state of the mth account address to obtain the specified account state; if the current account state of the mth account address contains an account state tree, and the account state root of the current account state of the mth account address is equal to the account state root of the previous account state of the mth account address account state root, then the current account state of the mth account address is used as the specified account state; if the dirty state data key set of the specified account state is not empty, then obtain the state data value corresponding to the dirty state data key in the dirty state data key set of the specified account state from the state data mapping of the specified account state, and update the dirty state data key in the dirty state data key set of the specified account state and the state data value corresponding to the dirty state data key in the dirty state data key set of the specified account state to the account state tree of the specified account state, and obtain the specified account state containing the updated account state tree; update the account state root of the specified account state containing the updated account state tree to the state tree root of the account state tree to be updated; clear the dirty state data key set of the specified account state containing the updated account state tree; store the updated tree node hash of the updated account state tree and the association relationship between the updated tree nodes to the xth world state.

[0055] The data processing device further includes:

[0056] The submission module is used to process the dirty account status of the entire chain after the latest on-chain world state is submitted, and obtain the clean and latest on-chain world state;

[0057] An update module, used to update the tree node hash and tree node contained in the tree node mapping in the tree node cache in the clean and latest on-chain world state to the tree node database;

[0058] The clearing module is used to clear the dirty account address set, account state mapping, and tree node mapping in the clean and latest on-chain world state.

[0059] On one hand, an embodiment of the present application provides a computer device, including: a processor, a memory, and a network interface;

[0060] The above-mentioned processor is connected to the above-mentioned memory and the above-mentioned network interface, wherein the above-mentioned network interface is used to provide a data communication network element, the above-mentioned memory is used to store a computer program, and the above-mentioned processor is used to call the above-mentioned computer program to execute the method in the embodiment of the present application.

[0061] On one hand, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded by a processor and executing the method in the embodiment of the present application.

[0062] On the one hand, an embodiment of the present application provides a computer program product or a computer program, which includes computer instructions, which are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method in the embodiment of the present application.

[0063] In an embodiment of the present application, by constructing a world state chain, it is possible to support the simultaneous maintenance of world states of different block heights or different branches of the same block height, that is, each time a new block is created, a world state is created for the new block, and the world state is added to the world state chain. The first world state in the world state chain is the latest on-chain world state after the execution of the transactions in the latest block that has been on the chain. The second world state in the world state chain is the consensus root world state that was last confirmed by consensus. The subsequent world states are the world states corresponding to the blocks that are being consensused. The consensus root world state has a chain relationship pointing to the latest on-chain world state. The world state corresponding to the block that is being consensus has a chain relationship pointing to the world state corresponding to its parent block. If its parent block is a block that has been on the chain, it has a chain relationship pointing to the consensus root world state. Through the chain relationship of each world state, a chain structure of the world state chain is formed. Therefore, it can be guaranteed that no matter how many blocks are agreed upon at the same time, after the block consensus is passed, the corresponding world state will be submitted to the latest on-chain world state step by step according to the chain structure of the world state chain, ensuring the consistency of the state data of the blockchain system. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.

[0065] Figure 1 This is a structural diagram of a blockchain node system provided by an embodiment of the present application;

[0066] Figure 2a This is a structural diagram of a world state provided by an embodiment of the present application;

[0067] Figure 2b This is a structural diagram of an account status provided by an embodiment of the present application;

[0068] Figure 2c This is a schematic diagram of a world state management scenario provided by an embodiment of the present application;

[0069] Figure 2d This is a schematic diagram of the structure of a world state chain provided by an embodiment of the present application;

[0070] Figure 3 This is a flowchart of a blockchain-based data processing method provided in an embodiment of the present application;

[0071] Figure 4a-4c This is a schematic diagram of a blockchain-based data processing scenario provided by an embodiment of the present application;

[0072] Figure 5 This is a flowchart of a transaction-based first world state update method provided in an embodiment of the present application;

[0073] Figure 6 This is a flow chart of a method for constructing a clean world state tree provided in an embodiment of the present application;

[0074] Figure 7 This is a schematic diagram of the structure of a blockchain-based data processing device provided in an embodiment of the present application;

[0075] Figure 8 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0076] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0077] Blockchain is the carrier and organizational method for running blockchain technology. Blockchain technology (BT), also known as distributed ledger technology, is an internet database technology characterized by decentralization, openness, and transparency, allowing everyone to participate in database records. Blockchain technology is a distributed infrastructure and computing method that uses a block chain data structure to verify and store data, a distributed node consensus algorithm to generate and update data, cryptography to ensure the security of data transmission and access, and smart contracts composed of automated script code to program and operate data.

[0078] To facilitate understanding, the following will explain blockchain and its related concepts:

[0079] Blockchain: Blockchain is a novel application model of computer technologies, integrating distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. It primarily organizes data in chronological order and encrypts it into a ledger, rendering it tamper-proof and forgery-proof. It also enables data verification, storage, and updates. Blockchain is essentially a decentralized database, in which every node stores an identical blockchain. A blockchain network can categorize nodes as consensus nodes and business nodes, with consensus nodes responsible for network-wide consensus. The process by which transaction data is written to the ledger in a blockchain network can be described as follows: a client sends transaction data to a business node, which then relays it between business nodes in the blockchain network until a consensus node receives the transaction data. The consensus node then packages the transaction data into a block, reaches consensus with other consensus nodes, and, upon reaching consensus, writes the block containing the transaction data into the ledger.

[0080] Block: A data packet that carries transaction data (i.e., transaction business) on a blockchain network. It is a data structure marked with a timestamp and a hash value of the previous block. The block is verified by the network's consensus mechanism and the transactions in the block are confirmed.

[0081] Hash value: Also known as an information characteristic value or eigenvalue, a hash value is generated by converting input data of any length into a cipher and producing a fixed output through a hashing algorithm. The original input data cannot be retrieved by decrypting the hash value; it is a one-way encryption function. In a blockchain, each block (except the initial block) contains the hash value of the previous block, which is called the parent block of the current block. Hash values ​​are the core foundation and most important aspect of the potential of blockchain technology, preserving the authenticity of recorded and viewed data and the integrity of the blockchain as a whole.

[0082] Transaction: A transaction sent by a blockchain account, which contains a transaction hash as a unique identifier and an account address identifying the blockchain account that sent the transaction.

[0083] State snapshot: A snapshot of all state data within a certain range, a fixed-length hash value. Whenever any state data changes, the state snapshot changes, allowing the integrity of all state data to be determined.

[0084] Account: A blockchain account with an account address as its unique identifier and a balance as the digital asset of the account in the current world. Each account has some state data, and the account contains an account state root as a state snapshot of all its state data.

[0085] State data: data about accounts stored in the blockchain, such as how much assets an account has, or data that other smart contracts need to read or update. Each state data is represented as a key-value pair.

[0086] On-chain: Each block contains several transactions. The process of inserting a block into the blockchain data structure within each blockchain node through consensus is called on-chain.

[0087] World state: A view of the persistent data held by each account within a blockchain. Because transactions modify some of the persistent data of several accounts, each transaction within each block generates a new world state. Each block's inclusion on the blockchain further updates the world state of each blockchain node. Once the same block is included on the blockchain, the world state of each blockchain node is guaranteed to be consistent.

[0088] MPT: Merkle Patricia Trie, a tree structure for organizing state data, consists of three types of nodes: data nodes, extension nodes, and branch nodes. State data consists of state data keys and state data values. Data nodes are leaf nodes in the tree structure, appearing only at the bottom of the MPT and storing the actual state data values. Extension nodes are parent nodes with only one child node, containing a string of arbitrary length representing part of the state data key and a tree node hash pointing to the child node. Branch nodes, which can have 1 to 16 child nodes, have a 16-byte hash value array. These 16 positions in the array correspond to the hexadecimal digits 0-9-af and can each potentially serve as a tree node hash pointing to a child node. The tree node hash is the hash value of the child node in the MPT and is stored in the parent node.

[0089] State Tree: This embodiment of the application includes an account state tree and a world state tree, both of which use MPT as a data structure for organizing blockchain state data and can provide the following operations:

[0090] (1) Query: The state data value can be queried from the state tree based on the state data key. In this case, a tree node query source needs to be provided to the state tree. The tree node query source is a data structure that helps the state tree quickly find tree nodes based on the tree node hash. Each tree node in the state tree is stored in the database as a key-value pair, where the storage key is the hash value of the tree node and the storage value is the tree node. Therefore, the tree node can be quickly found from the database based on the tree node hash. Because each parent node in the state tree contains the tree node hash of all its child nodes, all its child nodes can be expanded from the database by the parent node.

[0091] (2) Update: The state data value can be updated to the state tree according to the state data key.

[0092] (3) Get the state tree root: Calculate and get the hash value of the state tree root.

[0093] (4) Submit: Submit each tree node of the state tree to the tree node update cache. Because each tree node in the state tree is stored in the database as a key-value pair, the storage key is the hash value of the tree node, and the storage value is the tree node. Therefore, when the state tree is submitted, a data structure with the tree node hash as the key and the tree node as the value is required to receive and store the key-value pair. This data structure is called the tree node update cache.

[0094] See Figure 1 , Figure 1 This is a schematic diagram of the structure of a blockchain node system provided by an embodiment of the present application. Figure 1 The illustrated blockchain node system may correspond to a blockchain network, which may include, but is not limited to, a blockchain network corresponding to a consortium chain. A blockchain node system refers to a system for data sharing between blockchain nodes. The blockchain node system may include multiple blockchain nodes, specifically including blockchain node 10a, blockchain node 10b, blockchain node 10c, blockchain node 10d, ..., and blockchain node 10n. During normal operation, each blockchain node may receive data sent from the outside world and perform block chain processing based on the received data. It may also transmit data to the outside world. To ensure data interoperability between blockchain nodes, data connections may exist between each blockchain node, for example, between blockchain node 10a and blockchain node 10b, between blockchain node 10a and blockchain node 10c, and between blockchain node 10b and blockchain node 10c.

[0095] It is understandable that data or blocks can be transferred between blockchain nodes through the above-mentioned data connection. The blockchain network can realize data connection between blockchain nodes based on node identification. Each blockchain node in the blockchain network has a corresponding node identification, and each of the above-mentioned blockchain nodes can store the node identifications of other blockchain nodes with which it is connected, so that the acquired data or generated blocks can be broadcast to other blockchain nodes based on the node identifications of other blockchain nodes. For example, the blockchain node 10a can maintain a node identification list as shown in Table 1, which stores the node names and node identifications of other nodes:

[0096] Table 1

[0097] Node Name Node ID Node 10a 117.114.151.174 Node 10b 117.116.189.145 Node 10c 117.114.151.183 Node 10d 117.117.125.169 … … Node 10n 117.116.189.125

[0098] The node identifier can be an Internet Protocol (IP) address or any other information that can be used to identify a node in a blockchain network. Table 1 uses IP addresses as an example. For example, blockchain node 10a can send information (e.g., a block) to blockchain node 10b using node identifier 117.116.189.145, and blockchain node 10b can determine that the information was sent by blockchain node 10a using node identifier 117.114.151.174.

[0099] In the blockchain, before a block is put on the chain, it must pass the consensus of the consensus nodes in the blockchain network. Only after the consensus is passed can the block be added to the blockchain. It is understandable that when the blockchain is used in some scenarios of government or commercial organizations, not all participating nodes in the blockchain (i.e., the blockchain nodes in the above blockchain node system) have sufficient resources and necessity to become consensus nodes of the blockchain. For example, in Figure 1 In the blockchain node system shown, blockchain nodes 10a, 10b, 10c, and 10d can be used as consensus nodes within the blockchain node system. Consensus nodes within the blockchain node system participate in consensus, i.e., reaching consensus on blocks (containing a batch of transactions), including generating blocks and voting on blocks. Non-consensus nodes, on the other hand, do not participate in consensus, but help propagate block and voting information, and synchronize status with each other.

[0100] Among them, the blockchain node can include the following modules:

[0101] Transaction pool: Each blockchain node receives transactions sent by users and caches them in the transaction pool. When a blockchain node is selected as a block-producing node according to the consensus mechanism, the blockchain node creates a new block in memory and packages the transactions in the transaction pool into the new block.

[0102] Consensus module: packages transactions to generate candidate blocks, and reaches consensus among various blockchain nodes based on the consensus mechanism to generate new blocks.

[0103] Smart contract container: During the consensus mechanism execution process, each transaction in the block needs to be executed. In essence, it is the process of executing the smart contract in the transaction. The execution of the smart contract may require reading or updating state data. This module provides an execution environment for the smart contract execution.

[0104] World state management: responsible for maintaining and managing the world state of each consensus block.

[0105] Key-value database: It stores data persistently in the form of key-value pairs, and can quickly find values ​​based on the key. In this invention, it is responsible for persistently storing the data of each block and tree node storage. The tree node storage means that the hash value of each tree node of the state tree is the key, and each tree node is the value, so the tree node can be quickly found based on the tree node hash.

[0106] It can be understood that the above-mentioned data connection does not limit the connection method. It can be directly or indirectly connected through wired communication, directly or indirectly connected through wireless communication, or through other connection methods. This application does not limit it here.

[0107] It is understood that the data processing method provided in the embodiments of the present application can be executed by a computer device, including but not limited to the above-mentioned blockchain node (which can be a server or a terminal). The above-mentioned server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The above-mentioned terminal can be a smart phone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, etc., but is not limited to this.

[0108] It is understandable that the embodiments of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving and other scenarios.

[0109] It is understandable that in the specific implementation of this application, the status data and other related data involved, when the above embodiments of this application are applied to specific products or technologies, need to obtain user permission or consent, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of relevant countries and regions.

[0110] like Figure 1 As shown, a block-producing node in a blockchain network, for example, the blockchain node 10a in the above-mentioned blockchain node system, can create a first world state corresponding to the initial block after generating an initial block. The first world state has a chain relationship pointing to the second world state corresponding to the parent block of the initial block. At this time, the first world state and the second world state exist in the world state chain. If the parent block is the block with the largest block height among the on-chain blocks, the second world state is the consensus root world state. The consensus root world state has a chain relationship pointing to the latest on-chain world state. The latest on-chain world state is the first world state in the world state chain. The latest on-chain world state is used to record the latest world state corresponding to the on-chain block. Then, the first world state is updated according to the transactions in the initial block. state, obtain the target first world state, construct a clean state tree for the target first world state according to the world state chain, and obtain an updated target first world state including the clean current world state tree; write the first world state root corresponding to the clean current world state tree into the initial block to obtain the block to be chained, send the consensus block to the consensus node, so that the consensus node performs consensus processing on the block to be chained based on the first world state root to obtain a consensus result; if the consensus result is a consensus passed result, write the block to be chained into the blockchain, submit the updated target first world state step by step to the latest chained world state through the world state chain, and determine the updated target first world state as the new consensus root world state. The new consensus root world state has a chain relationship pointing to the latest chained world state after submission.

[0111] To better understand the above process of world state management, please refer to Figure 2a , Figure 2a This is a structural diagram of a world state provided by an embodiment of the present application, such as Figure 2aAs shown, world state 20 may include a previous world state pointer 201, a dirty account address set 202, an account state map 203, a world state tree 204, and a tree node cache 205. Previous world state pointer 201 points to the previous world state of world state 20, and can be used to locate the previous world state of world state 20 in memory. The previous world state pointer for the latest on-chain world state is empty. Dirty account address set 202 refers to the set of account addresses within world state 20 that have been updated but not yet updated to the account state in world state tree 204. Account state map 203 is a mapping structure that maps account addresses to account states. Account state map 203 allows for quick lookup of account states based on account addresses. World state tree 204 is an MPT data structure organized with account addresses as keys and account state roots as values. The account state root refers to the hash value of the root of the account state tree contained in the account state corresponding to the account address. Among them, the tree node cache 205 includes a previous tree node cache pointer 2051 and a tree node mapping 2052. The previous tree node cache pointer 2051 points to the tree node cache of the previous world state of the world state 20, and the previous tree node cache pointer of the tree node cache of the latest on-chain world state points to the tree node storage in the key-value database; the tree node mapping 2052 is a mapping structure from the tree node hash to the tree node, and the tree node can be quickly found in the tree node mapping 2052 according to the tree node hash. The tree node cache 205 serves as the source of tree node queries for the world state tree 204 of the world state 20 and the account state tree for each account state in the account state map 203. The world state tree 204 and the account state tree for each account state can search for a tree node from the tree node map in the tree node cache based on the tree node hash. If the tree node cannot be found, the previous tree node cache is located in memory based on the previous tree node cache pointer, and the tree node is searched from the tree node map in the previous tree node cache based on the tree node hash. If the tree node is still not found, the previous tree node cache is located in memory based on the previous tree node cache pointer, and the tree node is searched from the tree node map in the previous tree node cache based on the tree node hash. If the tree node is still not found, the previous tree node cache is located in memory based on the previous tree node cache pointer, and the tree node is searched from the tree node store based on the tree node hash. The tree node cache 205 also serves as the tree node update cache for the world state tree 204 of the world state 20 and the account state tree for each account state in the account state map 203. The world state tree 204 and the account state tree can perform commit operations, i.e., update the tree node map in the tree node cache using the tree node hash as the key and the tree node as the value.

[0112] Please also see Figure 2b , Figure 2b This is a structural diagram of an account status provided by an embodiment of the present application. Figure 2bAs shown, account state 21 may include an account address 211, an account state root 212, a dirty state data key set 213, a state data map 214, and an account state tree 215. Account address 211 is the unique identifier of an account. Account state root 212 is the state tree root of account state tree 215, i.e., the hash value of its root. Dirty state data key set 213 refers to the set of keys for state data in account state 21 that have been updated but not yet updated to account state tree 215. State data map 214 is a mapping structure that maps state data keys to state data values. In state data map 214, state data values ​​can be quickly searched based on the state data keys. Account state tree 214 is an MPT data structure organized with state data keys as keys and state data values ​​as values.

[0113] The method provided in the embodiment of the present application can be Figure 2a The structure shown above is used to construct the world state. Figure 2b The structure shown is used to build the account state, and then manage the constructed account state and world state. For ease of understanding, please refer to Figure 2c , Figure 2c This is a schematic diagram of a world state management scenario provided by an embodiment of the present application. Figure 2a As shown, the block node 22 (which can be the above Figure 1 The key-value database 23 of any blockchain node in the illustrated blockchain node system, such as blockchain node 10b, stores an on-chain blockchain data structure 231. This blockchain data structure 231 contains all on-chain blocks. Furthermore, the key-value database 23 also includes a tree node storage 232. Tree node storage 232 stores each tree node and its hash value in the account state tree corresponding to each account in the blockchain network, as well as in the world state tree corresponding to the latest on-chain world state, using the tree node hash value as the key and the tree node as the value. The latest on-chain world state refers to the world state after the execution of transactions in the latest on-chain block.

[0114] like Figure 2cAs shown, the block-producing node can maintain several blocks of different heights that are in consensus in the memory 24, such as block n+1 with a block height of n+1, block (n+2)a with a block height of n+2, and so on. Of course, according to the execution of the consensus mechanism, there may also be different block branches at the same height, for example, block (n+2)a and block (n+2)b with a block height of n+2, but in the end only one of the branches will form a consensus in the blockchain node of the blockchain network and complete the chain operation to enter the key-value database 21. In addition, different world states are also maintained in the memory 21. In addition to the latest chain world state, the consensus root world state and the world state corresponding to the block in consensus are also maintained. Among them, the consensus root world state refers to the world state corresponding to the block that was last confirmed by consensus; the world state corresponding to the block in consensus, as the name implies, is that for each block in the consensus, a corresponding world state will be created for it, representing the query source and update cache of the status data during and after the execution of the transaction in the block. By Figure 2c It can be seen that the world states corresponding to the blocks being consensused all have a chain relationship pointing to the world state corresponding to their parent blocks. Block producers can obtain the world state corresponding to the parent block through the chain relationship of the world state corresponding to a block being consensused. Then, based on the chain relationship of the world state corresponding to the parent block, they can continue to obtain the world state corresponding to the parent block of the parent block. For example, the world state (n+2)a corresponding to block (n+2)a has a chain relationship pointing to the world state n+1 corresponding to its parent block n+1. After obtaining the world state (n+2)a corresponding to block (n+2)a, the block producer 20 can obtain the chain relationship of world state (n+2)a and then obtain world state n+1 based on this chain relationship. When the parent block of the block being consensused is a block that passed the previous round of consensus, the chain relationship of the world state of the block being consensused will point to the consensus root world state. Therefore, the world state of the block being consensused must be directly or indirectly extended and created from the consensus root world state. The consensus root world state, on the other hand, has a chain relationship pointing to the latest on-chain world state. It's understandable that once a new block is agreed upon, the world state corresponding to the new block is determined as the consensus root world state, and the original consensus root world state can be cleared. However, once a new block is on-chain, only the latest on-chain world state needs to be updated to obtain the new latest on-chain world state, and its storage address in memory does not need to be changed.

[0115] It can be understood that the chain relationship of the world state can be reflected by its previous tree world state pointer and previous tree node cache pointer. Each world state points to the previous world state through the previous world state pointer, and points to the tree node cache of the previous world state through the previous tree node cache pointer. The previous world state pointer of the previous world state is empty and the previous tree node cache pointer of the tree node cache points to the tree node storage of the key-value database, thus forming a world state chain. For ease of understanding, you can also refer to Figure 2d , Figure 2d This is a schematic diagram of the structure of a world state chain provided by an embodiment of the present application. Figure 2d As shown, in the world state chain, the first world state is the latest on-chain world state. The latest on-chain world state has no previous world state, so the previous world state pointer of the latest on-chain world state is empty. In addition, the previous tree node cache pointer of the latest on-chain world state cannot point to the tree node cache of the previous world state, but the previous tree node cache pointer of the latest on-chain world state will point to the tree node storage (for example, the above Figure 2c (See tree node storage 232 for details.) The second world state in the world state chain is the consensus root world state. The previous world state of the consensus root world state is the latest on-chain world state. The previous tree node cache pointer of its tree node cache points to the tree node cache of the latest on-chain world state. The world state chain begins with the third world state, which is the world state corresponding to the consensus block. Its previous world state pointer and the previous tree node cache pointer of the tree node cache point to the world state of the parent block of the block and the tree node cache of the parent block's world state, respectively. Of course, it is also possible for the previous world state pointers and previous tree node cache pointers of the world states of two different consensus blocks to point to the same previous world state and the tree node cache within it. In other words, the world state chain can branch after the consensus root world state.

[0116] The world state corresponding to the block under consensus will eventually be submitted to the latest on-chain world state. When the block under consensus completes the consensus, its corresponding world state will become the new consensus root world state, with a chain relationship pointing to the latest on-chain world state. To facilitate understanding of the specific process of world state management in the embodiment of this application, please refer to Figure 3 , Figure 3 This is a flowchart of a data processing method based on blockchain provided by an embodiment of the present application. Figure 1 The method is executed by any blockchain node in the blockchain node system 10 in the corresponding embodiment. The following will be described as an example of the method being executed by a block-producing node, wherein the blockchain-based data processing method may include at least the following steps S101-S104:

[0117] Step S101: Generate an initial block and create a first world state corresponding to the initial block.

[0118] Specifically, each blockchain node can receive transactions and then cache the transactions in the transaction pool. In the blockchain network, block-producing nodes can be selected based on the consensus mechanism. When a blockchain node is selected as a block-producing node, a new block will be created in the memory. The new block contains the hash value of its parent block. Through the hash value of the parent block, its parent block can be found. Then the block-producing node can package the transactions in the transaction pool into the new block to obtain the initial block. At this time, the block-producing node can create the first world state corresponding to the initial block. The block-producing node can first obtain the second world state corresponding to its parent block, and then initialize the world state based on the second world state of its parent block to obtain the first world state. It should be noted that if the parent block of the initial block has been written into the blockchain data structure, the parent block of the initial block can only be the latest block on the blockchain. The second world state corresponding to the parent block is the world state passed by the previous round of consensus, that is, the second world state corresponding to the parent block at this time is the above Figure 2c The consensus root world state shown in Figure 1 is as follows; if the parent block of the initial block has not yet been written into the blockchain data structure, then the parent block of the initial block should be in consensus, and the corresponding world state is as shown above. Figure 2c The world state corresponding to the block undergoing consensus is shown, for example, world state n+1. It can be understood that both the first and second world states are located in the world state chain. The first world state in the world state chain is the latest on-chain world state, which is used to record the latest world state corresponding to the on-chain block. The second consensus root world state is the consensus root world state, which has a chain relationship pointing to the latest on-chain world state. In other words, the second world state may be the second world state in the world state chain, or it may be the world state after the second world state. The first world state is located after the second world state in the world state chain.

[0119] Specifically, a feasible implementation method for creating the first world state corresponding to the initial block is: create the initial world state corresponding to the initial block, the initial world state includes a first previous world state pointer and a first tree node cache, the first tree node cache includes a first previous tree node cache pointer; then, point the first previous world state pointer to the second world state corresponding to the parent block of the initial block, and point the first previous tree node cache pointer to the second tree node cache included in the second world state, to obtain the first world state corresponding to the initial block. It should be noted that the structural composition of the first world state at this time can still refer to the above Figure 2aThe world state 20 shown in the figure, at this time, the block node only initializes the first previous world state pointer and the first previous tree node cache pointer of the first world state. The dirty account address set, account state mapping, world state tree and tree node mapping structures can be initialized to empty sets first, or added to the first world state when used later. This embodiment of the application does not limit this. However, the subsequent unified world state will be created as follows Figure 2a The world state structure shown is used to generate the world state. If there is no corresponding data, an empty collection is created by default as an example.

[0120] Step S102: Update the first world state according to the transactions in the initial block to obtain a target first world state, and construct a clean state tree for the target first world state according to the world state chain to obtain an updated target first world state including a clean current world state tree.

[0121] Specifically, the execution of transactions in the initial block will modify some state data contained in several accounts in the blockchain. Block producers can progressively execute each transaction in the initial block, identifying the state data that needs to be modified after each transaction is executed as the pending data. They then update the first-world state based on the pending data, ultimately achieving the target first-world state. The target first-world state's account state mapping will now contain the account addresses of the accounts that need to be updated and the updated account states. A mapping relationship exists between the account addresses and their updated account states. Subsequent block producers can quickly retrieve the updated account states corresponding to the accounts in the account state mapping based on their addresses when accessing the first-world state. Furthermore, the target first-world state's dirty account address set will contain the account addresses of accounts whose state data was updated after the execution of transactions in the initial block. With the dirty account address set and account state mapping for the target first-world state, a clean, live-world state tree corresponding to the target first-world state can be constructed.

[0122] Specifically, the world state tree in the target first world state is empty at this time, that is, the world state tree in the target first world state has not been constructed. At this time, the block-producing node will find the second world state according to the first previous world state pointer in the target first world state, first obtain the clean world state tree of the second world state as the clean previous world state tree, and then build the second world state tree corresponding to the target first world state according to the first tree node cache and the current state tree root, and add the second world state tree to the target first world state to obtain the transition target first world state; perform full-chain dirty account state submission processing on the transition target first world state to obtain an updated target first world state containing a clean current world state tree.

[0123] Step S103: Write the first world state root corresponding to the clean current world state tree into the initial block to obtain the block to be chained, and send the consensus block to the consensus node so that the consensus node performs consensus processing on the block to be chained based on the first world state root to obtain a consensus result.

[0124] Specifically, the first world state root corresponding to the clean, live world state tree refers to the hash value of the root of the clean, live world state tree. This first world state root can serve as a snapshot of the state data contained in all accounts in the blockchain network after the initial block is executed. After the first world state root is written into the initial block, the block-producing node completes the block packaging process, resulting in the block to be included in the chain. Subsequently, the block-producing node transmits the block to be included in the chain via the P2P (Peer to Peer) network to the consensus node in the blockchain network. The consensus node then constructs the world state corresponding to the block to be included in the chain, then performs steps S102 to S103 on the constructed world state to obtain the clean, live world state tree corresponding to the constructed world state. The hash value of the root of the clean, live world state tree is then obtained as the verification world state root. The consensus node compares the verification world state root with the first world state root in the block to be included in the chain. If they are identical, verification passes; if they are different, verification fails, and consensus on the block to be included fails.

[0125] Step S104: If the consensus result is a consensus passing result, the block to be on-chain is written into the blockchain, and the updated target first world state is submitted to the latest on-chain world state step by step through the world state chain. The updated target first world state is determined as the new consensus root world state, and the new consensus root world state has a chain relationship pointing to the latest on-chain world state after submission.

[0126] Specifically, if the consensus of the block to be chained is passed, the block-producing node and other blockchain nodes in the blockchain network will write the block to be chained into the blockchain. As mentioned above, after the new block is chained, the latest chained world state will also be updated. At this time, the block-producing node needs to submit the updated target first world state to the latest chained world state step by step in the order of the world state chain. After the submission is completed, the updated target first world state will be determined as the new consensus root world state. At this time, the first previous world state pointer in the new consensus root world state will point from the world state corresponding to its parent block to the latest chained world state, and the first previous tree node cache pointer in the new consensus root world state will also point to the previous tree node cache in the latest chained world state. For example, the above Figure 2cIn the world state chain shown, the block-producing node 22 can submit world state n+1 to the consensus root world state after the consensus of block n+1 is passed, and then submit the submitted consensus root world state to the latest on-chain world state to obtain the latest on-chain world state after submission. After the submission is completed, world state n+1 will be confirmed as the new consensus root world state, and the original chain relationship pointing to the consensus root world state will be updated to a chain relationship pointing to the latest on-chain world state after submission. The storage address of the latest on-chain world state after submission is still the same as the latest on-chain world state. The latest on-chain world state after submission is used to represent the world state after the execution of transactions in block n+1. Optionally, the original consensus root world state can be deleted.

[0127] Optionally, after the updated target first world state is finally submitted to the latest on-chain world state, the block-producing node also needs to submit the submitted latest on-chain world state to the tree node storage. Since the tree node storage belongs to a key-value database, it can also be considered as submitting it to the tree node database. The specific process can be: submitting the dirty account state of the entire chain to the submitted latest on-chain world state to obtain a clean latest on-chain world state; updating the tree node hash and tree node contained in the tree node mapping in the tree node cache in the clean latest on-chain world state to the tree node database; clearing the dirty account address set, account status mapping and tree node mapping in the tree node cache in the clean latest on-chain world state.

[0128] To understand the above process, please refer to Figure 4a-4c , Figure 4a-4c This is a schematic diagram of a data processing scenario based on blockchain provided by an embodiment of the present application. Figure 4a As shown, in the block node 40 (which can be the above Figure 2c In the block-producing node 22 shown, block 41 is the latest block on the chain in the blockchain 42. The latest on-chain world state 400 records the view of the state data corresponding to all accounts in the blockchain network after block 42 is on the chain. At this time, in the latest on-chain world state 400, except that the previous world state pointer is empty, the dirty account address set, account state mapping and tree node mapping are all empty sets. The world state tree in the latest on-chain world state 400 is the world state tree corresponding to all state data of the blockchain at this time. The previous tree node cache pointer of the latest on-chain world state 400 points to the tree node storage 43. It can be understood that each tree node in the world state tree of the latest on-chain world state 400 and the tree node hash corresponding to the tree node are all stored in the tree node storage 43. In addition, the memory of the block-producing node 40 also contains the consensus root world state 402. The consensus root world state 402 is actually the world state corresponding to the consensus submission of block 41. Its previous world state is the latest on-chain world state 400. Figure 4aIt can be seen that the previous world state pointer of the consensus root world state 402 points to the latest on-chain world state 400, and the previous tree node cache pointer of the consensus root world state 402 points to the tree node cache 4005.

[0129] To better illustrate this method, please refer to Figure 4b . Assume that there is no block being consensus at this time. After receiving the block generation command, the block generating node 40 will generate a new block 420 with block 41 as the parent block. The parent hash contained in the new block 420 is the hash value of block 41. Then, the block generating node 40 will pack some transactions in the transaction pool into the new block 420 in sequence to obtain the initial block 421. Subsequently, the block generating node 40 can construct the first world state 402 corresponding to the initial block 421. The first world state in the first world state 402 will point to the second world state corresponding to the parent block of the initial block 421. Because the parent block of the initial block 421 is an on-chain block, its corresponding second world state is actually the consensus root world state 401. Therefore, the first previous world state pointer of the first world state 402 points to the consensus root world state 401, and the first previous tree node cache pointer points to the tree node cache of the consensus root world state 401. At this time, other components of the first world state 402, such as the dirty account address set and the world state tree, are all empty sets. Then, block producer node 40 executes the transactions in initial block 421. During the execution of the transactions in initial block 421, block producer node 40 updates first world state 402 to obtain target first world state 403. Updating refers to writing the account address of the account to be updated and the updated account status to the account status map of first world state 402, and adding the account address of the account to be updated to the dirty account address set of first world state 402. For example, after transaction 1 is executed, the status data of account A will be changed, so the account status of account A will be updated accordingly. Assuming that the updated account status is account status A, block producer node 40 will write account address A corresponding to account A to the dirty account address set of first world state 402, and then add the mapping relationship between account address A and account status A to the account status map of first world state 402. After all transactions in initial block 421 are executed, target first world state 403 is obtained. At this point, the world state tree for the target first world state 403 has not yet been constructed. The block-producing node 40 then constructs the target first world state 403 and performs a clean world state tree construction process to obtain a clean current world state tree. Finally, the block-producing node uses the state tree root corresponding to the clean current world state tree as the first world state root and adds it to the initial block 421, resulting in the pending block 422. The block-producing node then sends the pending block 422 to the consensus nodes in the blockchain network, allowing them to reach a consensus on the pending block 22 based on the first world state root, resulting in a consensus result.

[0130] Further, please see Figure 4c . Figure 4c As shown, when the consensus result is a consensus passing result, the world state corresponding to the block 422 to be chained in the block-producing node 40 is the updated target first world state 404 containing a clean current world state tree. The block-producing node 40 will gradually submit the updated target first world state 404 to the latest chained world state, that is, first submit the updated target first world state 404 to the consensus root world state 401, and then submit the submitted consensus root world state to the latest chained world state 400, and finally submit the submitted latest chained world state to the tree node storage 43. The block 422 to be chained will also be written into the blockchain 42 and become the latest chained block. At this time, the updated first target time state 404 will be used as the new consensus root world state. The block-producing node 40 will point its first previous world state pointer to the latest chained world state after submission, and its first previous tree node cache pointer to the tree node cache of the latest chained world state after submission.

[0131] By adopting the method provided in the embodiment of the present application, when updating the status data during the block execution process, there is no need to record the old value of the status data change, and there is no need to roll back the status data for transactions that fail to execute, thereby saving system overhead.

[0132] Further, see Figure 5 , Figure 5 This is a flow chart of a transaction-based first world state update method provided by an embodiment of the present application. Figure 3 A feasible implementation method for obtaining the target first world state by updating the first world state according to the transactions in the initial block as described in step S102 of the corresponding embodiment. Figure 1 The method is executed by any blockchain node in the blockchain node system 10 in the corresponding embodiment. The following will be described as an example of this method being executed by a block-producing node, wherein the first world state update method may at least include the following steps S201-S205:

[0133] Step S201, sequentially traverse the transactions in the initial block to obtain the kth transaction in the initial block; k is a positive integer less than or equal to H; H is the total number of transactions in the initial block.

[0134] Specifically, when the initial block contains multiple transactions, the block-producing node will traverse the initial block, sequentially obtain the first transaction, execute the first transaction, and then update the first world state based on the execution result of the first transaction, obtaining the first submitted world state. It then obtains the second transaction, executes the second transaction, and then updates the first submitted world state based on the execution result of the second transaction, obtaining the second submitted world state. This process continues in this order until all transactions in the initial block are processed, resulting in the target first world state. For ease of understanding, the processing of the kth transaction is used as an example.

[0135] Step S202: Create a k-th transaction world state corresponding to the k-th transaction; the k-th transaction world state has a chain relationship pointing to the k-1-th submitted world state; when k is 1, the k-1-th submitted world state is the first world state.

[0136] Specifically, the block producer will first create the kth transaction world state corresponding to the kth transaction. For the kth transaction world state, its previous world state is the k-1th submitted world state. The creation of the kth transaction world state can be seen in the creation process of the first world state in step S101 above, and will not be repeated here. The kth transaction world state has a chain relationship pointing to the k-1th submitted world state. It can be understood that for the first transaction, its previous world state is the first world state.

[0137] Step S203: execute the kth transaction, and during the execution of the kth transaction, perform state update processing on the kth transaction world state to obtain the kth updated transaction world state.

[0138] Specifically, from the above Figure 2b As shown in the account state structure, the kth transaction world state can include an account state mapping and a dirty account address set. However, at this point, both the account state mapping and dirty account address set for the kth transaction world state are empty. During the execution of the kth transaction, the block producer may need to read or update the state data of a certain account when executing the smart contract in the transaction. At this time, the block producer determines the data to be queried or updated. The data to be queried may include the account address to be queried and the key of the state data to be queried; the data to be updated may include the account address to be updated, the key of the state data to be updated, and the value of the state data to be updated. The block producer can then update the kth transaction world state based on the data to be updated, or query the kth transaction world state based on the data to be queried.

[0139] Specifically, a feasible implementation process for executing the kth transaction and performing state update processing on the kth transaction world state during the execution of the kth transaction to obtain the kth updated transaction world state is as follows: executing the kth transaction and determining the to-be-updated data corresponding to the kth transaction during the execution of the kth transaction, namely, the to-be-updated account address, the to-be-updated state data key, and the to-be-updated state data value mentioned above, and then obtaining the account state corresponding to the to-be-updated account address according to the kth transaction world state as the to-be-updated account state; updating the mapping relationship between the to-be-updated state data key and the to-be-updated state data value into the to-be-updated state data map, inserting the to-be-updated state data key into the to-be-updated dirty state data key set, and obtaining the current account state; updating the mapping relationship between the to-be-updated account address and the current account state into the account state map contained in the kth transaction world state, inserting the to-be-updated account address into the dirty account address set contained in the kth transaction world state, and obtaining the kth updated transaction world state.

[0140] Specifically, the account state corresponding to the account address to be updated is obtained according to the k-th transaction world state. A feasible implementation process for the account state to be updated is: according to the account address to be updated, the account state mapping sequence is retrieved from the k-th transaction world state to the latest on-chain world state; if an account state with a mapping relationship with the account address to be updated is retrieved during the account state mapping sequence retrieval process, the account state with a mapping relationship with the account address to be updated that is first retrieved is used as the account state to be updated; if an account state with a mapping relationship with the account address to be updated is not retrieved during the account state mapping sequence retrieval process, the state tree root to be updated corresponding to the account address to be updated is obtained according to the world state tree in the latest on-chain world state, and the account state to be updated is established according to the account address to be updated and the state tree root to be updated. Specifically, the method by which the block-producing node can obtain the account status to be updated based on the k-th transaction world state is to first search in the account status mapping of the k-th transaction world state whether there is an account status with a mapping relationship with the account address to be updated. If so, the account status is used as the account status to be updated and subsequent queries and retrievals are stopped; if not, the previous world state pointer of the k-th transaction world state is used to obtain the previous world state of the k-th transaction world state, that is, the k-1th submitted world state, and then the block-producing node continues to search the account status mapping of the k-1th submitted world state to see if there is an account status with a mapping relationship with the account address to be updated. If so, it is directly obtained and subsequent queries and retrievals are stopped; if not, Continue to obtain the previous world state, and so on, until the block-producing node has found the account state mapping of the latest on-chain world state. If the account state mapping of the latest on-chain world state does not contain an account state with a mapping relationship with the account address to be updated, it can be seen from the above that the latest on-chain world state has no previous world state. At this time, the block-producing node can retrieve the account state root corresponding to the address to be updated from the world state tree of the latest on-chain world state according to the account address to be updated, and then create a new account state in the memory, and initialize the account address of the new account state to the account address to be updated, and initialize the account state root of the new account state to the retrieved account state root, and then use the initialized new account state as the account state to be updated.

[0141] Specifically, a feasible implementation process for executing the kth transaction and querying the kth transaction world state during the execution of the kth transaction is as follows: executing the kth transaction, determining the to-be-queried data corresponding to the kth transaction during the execution of the kth transaction, i.e., the to-be-queried account address and the to-be-queried state data key mentioned above; then, searching the account state mapping of the kth transaction world state based on the to-be-queried account address; if the account state corresponding to the to-be-queried account address is retrieved, further searching is performed in the retrieved account state based on the to-be-queried state data key; if the state data value corresponding to the to-be-queried state data key is retrieved, the state data value is returned as the result, and no further search is performed; if the state data value corresponding to the to-be-queried state data key is retrieved, or the account state corresponding to the to-be-queried account address is not retrieved in the account state mapping of the kth transaction world state, determining whether the previous world state exists based on the previous world state pointer of the kth transaction world state. If the previous world state pointer for the kth transaction world state exists, the kth transaction world state, i.e., the k-1th submitted world state, is retrieved based on the previous world state pointer. The k-1th submitted world state is then searched based on the address to be queried and the state data key to be queried. If the state data value corresponding to the state data key to be queried is found in the k-1th submitted world state, the subsequent search is terminated. If the state data value corresponding to the state data key to be queried is not found in the k-1th submitted world state, the previous world state pointer for the k-1th submitted world state is used to determine whether the previous world state exists. Similarly, if the latest on-chain world state is retrieved and the state data value corresponding to the state data key to be queried is still not found in the account state mapping in the latest on-chain world state, the account state root corresponding to the address to be updated is retrieved from the world state tree of the latest on-chain world state. A new account state is then created in memory, and the account address of the new account state is initialized to the address to be updated. The account state root of the new account state is initialized to the retrieved account state root, and the initialized new account state is used as the account state to be queried. If the account status root of the account status to be queried is empty, the status data value corresponding to the status data key to be queried is determined to be empty, and subsequent searches are terminated. If the account status root of the account status to be queried is not empty, but the account status tree of the account status to be queried is empty, the tree node cache of the latest on-chain world state is used as the tree node query source, and the account status root of the account status to be queried is used as the state tree root. A new account status tree is created in memory and added to the account status to be queried; then, the status data value is retrieved from the account status tree of the account status to be queried based on the status data key to be queried, and the search ends.

[0142] Step S204: If the k-th transaction is successfully executed, the k-th updated transaction world state is submitted to the k-1-th submitted world state to obtain the k-th submitted world state.

[0143] Specifically, if the kth transaction is successfully executed, the kth updated transaction world state is submitted to the k-1th submitted world state. A feasible implementation process for obtaining the kth submitted world state is as follows: traverse the account addresses in the dirty account address set contained in the kth updated transaction world state, and sequentially obtain the jth account address; j is a positive integer less than or equal to 1; I is the total number of account addresses in the dirty account address set contained in the kth updated transaction world state; obtain the current account state corresponding to the jth account address from the account state mapping contained in the kth updated transaction world state; obtain the previous account state of the jth account address based on the k-1th submitted world state; submit the current account state corresponding to the jth account address to the previous account state of the jth account address, insert the jth account address into the dirty account address set contained in the k-1th submitted world state, and obtain the jth transition submitted world state; when j is equal to 1, clear the dirty account address set and account state mapping contained in the kth updated transaction world state, and use the 1th transition submitted world state as the kth submitted world state. Among them, the process of obtaining the previous account state of the j-th account address based on the k-1-th submitted world state can be as follows: searching the account state mapping in the k-1-th submitted world state according to the j-th account address; if an account state with a mapping relationship with the j-th account address is retrieved, it is used as the reference account state, and then a new account state is created in the memory, and the account address and account state root of the newly created account state are initialized based on the account address and account state root of the reference account state, and the newly created account state is used as the previous account state of the j-th account address; if no account state with a mapping relationship with the j-th account address is retrieved , continue to search the account state mapping of the previous world state submitted to the k-1th world state, and continue the above search process. If the account state mapping of the latest on-chain world state is retrieved and no account state with a mapping relationship with the j-th account address is retrieved, search the world state tree of the latest on-chain world state to obtain the account state root corresponding to the j-th account address, and then create a new account state in memory. Based on the j-th account address and the account state root obtained from the world state tree, initialize the account address and account state root of the newly created account state, and use the newly created account state as the previous account state of the j-th account address.

[0144] Specifically, submitting the current account state corresponding to the j-th account address to the previous account state of the j-th account address, inserting the j-th account address into the dirty account address set contained in the k-1-th submitted world state, and obtaining the j-th transition submitted world state can be achieved through the following feasible implementation process: updating the mapping relationship between the state data key and the state data value in the state data map contained in the current account state corresponding to the j-th account address into the state data map contained in the previous account state of the j-th account address; inserting the state data key in the state data map contained in the current account state corresponding to the j-th account address into the dirty state data key set contained in the previous account state of the j-th account address, and obtaining the j-th transition submitted world state.

[0145] Step S205: When k is equal to H, the Hth submitted world state is used as the target first world state.

[0146] Specifically, the target first-world state will include the account addresses that need to be updated after all transactions in the initial block are executed, as well as the account states after the account addresses are updated. The dirty account address set of the target first-world state will include all account addresses that need to be updated.

[0147] Further, see Figure 6 , Figure 6 This is a flow chart of a method for constructing a clean world state tree provided by an embodiment of the present application. Figure 3 The step S102 of the corresponding embodiment is to construct a clean state tree for the target first world state according to the world state chain to obtain a feasible implementation method for updating the target first world state including the clean current world state tree. Figure 1 The method is executed by any blockchain node in the blockchain node system 10 in the corresponding embodiment. The following will be described as an example of this method being executed by a block-producing node, wherein the clean world state tree construction method may include at least the following steps S301-S306:

[0148] Step S301: perform a world state tree query on the target first world state.

[0149] Specifically, a clean world state tree can be constructed for all world states managed by the block-producing node. This clean world state tree construction method is applicable to all world states, and some world states may already contain a world state tree. Therefore, in this clean world state tree construction method, it is necessary to first determine whether the world state for which a clean world state tree is to be constructed contains a world state tree. When the block-producing node constructs a clean world state tree for the target first world state, it will query the world state tree for the target first world state.

[0150] Step S302: If the target first world state includes a first world state tree, a full-chain dirty account state submission process is performed on the target first world state including the first world state tree to obtain an updated target first world state including a clean current world state tree.

[0151] Specifically, if the target first-world state contains the first-world state tree, the block-producing node will directly submit the dirty account state of the target first-world state containing the first-world state tree to obtain an updated target first-world state containing the clean current-world state tree. This submission process can be referred to in step S306 below and will not be described in detail here.

[0152] Step S303: If the target first world state does not include the first world state tree, search for the second world state according to the first previous world state pointer.

[0153] Specifically, if the target first world state does not contain the first world state tree, the block producing node can query forward one by one according to the world state chain, relying on the clean world state of the previous world state in the world state chain to construct the second world state tree of the target first world state. First, the block producing node will first obtain the previous world state of the target first world state based on the first previous world state pointer, that is, the second world state, and then obtain the clean current world state tree corresponding to the second world state and use it as the clean previous world state tree.

[0154] Step S304: construct a clean state tree for the second world state according to the world state chain to obtain a clean previous world state tree, and use the previous state tree root of the clean previous world state tree as the current state tree root.

[0155] Specifically, the block-producing node constructs a clean state tree for the second world state. This involves performing steps S301 through S306 on the second world state to obtain a clean current world state tree corresponding to the second world state. This tree is then used as the clean previous world state tree for the target first world state. The block-producing node then uses the previous state tree root of the clean previous world state tree as the current state tree root.

[0156] Step S305: construct a second world state tree corresponding to the target first world state based on the first tree node cache and the current state tree root, add the second world state tree to the target first world state, and obtain a transition target first world state.

[0157] Specifically, the block-producing node will use the first tree node cache as the tree node query source, and then build the second world state tree corresponding to the target first world state based on the current state tree root. At this time, the updated account state corresponding to the account address in the dirty account address set of the target first world state has not been submitted, so it needs to be submitted to obtain a clean second world state tree, that is, a clean current world state tree.

[0158] Step S306: Perform full-chain dirty account state submission processing on the transition target first world state to obtain an updated target first world state containing a clean current world state tree.

[0159] Specifically, no matter whether the first world state tree or the second world state tree corresponding to the target first world state is obtained, the block-producing node will perform the dirty account state submission process for the entire chain. Taking the transition target first world state containing the second world state tree as an example, the block-producing node will sequentially traverse the world state chain, obtain the dirty account address set contained in the x-th world state, as the x-th target dirty account address set; x is a positive integer less than or equal to Z; Z is the sequential ordinal number of the transition target first world state in the world state chain; traverse the account addresses in the x-th target dirty account address set, and sequentially obtain the m-th account address; m is a positive integer less than or equal to the total number of account addresses in the x-th target dirty account address set; obtain the target current account state and target previous account state corresponding to the m-th account address; according to the previous account of the m-th account address The state submits the account dirty state data to the current account state of the mth account address; when the current account state of each dirty account address in the xth target dirty account address set is submitted to the account dirty state data, the xth submitted world state is obtained; the target dirty account address is added to the x-1th on-chain target dirty account address set to obtain the xth on-chain target dirty account address set; when x is 1, the x-1th on-chain target dirty account address set is an empty set; when x is equal to Z, the xth on-chain target dirty account address set is used as the full-chain dirty account address set, and the xth submitted world state is used as the first transition target world state after submission.

[0160] Specifically, a feasible implementation process for submitting dirty account status data for the current account status of the mth account address based on the previous account status of the mth account address is as follows: performing an account status tree query on the current account status of the mth account address; if the current account status of the mth account address does not contain an account status tree, or the account status root of the current account status of the mth account address is not equal to the account status root of the previous account status of the mth account address, then establishing a designated account status tree based on the tree node cache of the current account status of the mth account address and the account status root of the previous account status of the mth account address, adding the account status tree to the current account status of the mth account address, and updating the account status root of the current account status of the mth account address to the account status root of the previous account status of the mth account address to obtain the designated account status; if the current account status of the mth account address contains an account status tree, and the current account status of the mth account address is equal to the account status root of the previous account status of the mth account address, If the account state root is equal to the account state root of the previous account state of the m-th account address, the current account state of the m-th account address is used as the specified account state; if the dirty state data key set of the specified account state is not empty, the state data value corresponding to the dirty state data key in the dirty state data key set of the specified account state is obtained from the state data map of the specified account state, and the dirty state data key in the dirty state data key set of the specified account state and the state data value corresponding to the dirty state data key in the dirty state data key set of the specified account state are updated to the account state tree of the specified account state to obtain the specified account state containing the updated account state tree; the account state root of the specified account state containing the updated account state tree is updated to the state tree root of the account state tree to be updated; the dirty state data key set of the specified account state containing the updated account state tree is cleared; the updated tree node hash of the updated account state tree and the association relationship between the updated tree nodes are stored in the x-th world state.

[0161] Specifically, the actual implementation of the above process can be: the block-producing node can use the transition target first world state as the current world state, and then execute the method of "submitting the status data of dirty accounts in the entire chain" for the current world state. The specific steps of this method are: judging whether the previous world state exists based on the previous world state pointer of the current world state; if the previous world state exists, the previous world state is regarded as the current world state and the method of "submitting the status data of dirty accounts in the entire chain" is continued to be executed, and the obtained set of dirty account addresses in the entire chain is used as the initial set of dirty account addresses in the entire chain; if the previous world state does not exist, a new empty initial set of dirty account addresses in the entire chain is created in the memory. After obtaining the initial full-chain dirty account address set, the block-producing node can traverse the dirty account address set of the current world state, and perform the following operations for each account address: retrieve the account state from the account state map according to the account address as the current account state; determine whether there is a previous world state based on the previous world state pointer of the current world state. If there is a previous world state, obtain the previous account state in the previous world state according to the account address. If there is no previous world state, use the current account state as the previous account state; use the account state root of the previous account state as the previous account state root, and according to the tree node cache of the current world state, use the current account state as the specified account state to execute the "submit status data of a single account" method; then insert the account address into the full-chain dirty account address set; when all account addresses in the dirty account address set have completed the above operations, the full-chain dirty account address set and the submitted transition target first world state are obtained.

[0162] Specifically, the account state root of the previous account state is used as the previous account state root, and according to the tree node cache of the current world state, the current account state is used as the specified account state to execute the method of "submitting the state data of a single account" as follows: if the account state tree of the specified account state is not empty and the account state root of the specified account state is equal to the previous account state root, then skip this step; otherwise, use the tree node cache as the tree node query source, use the previous account state root as the state tree root, create a new account state tree in memory, add it to the specified account state, and then update the account state root of the specified account state to the previous account state root, and continue with the following steps; if the dirty state data key set of the specified account state is If the set is empty, it returns and the process ends. If the dirty state data key set of the specified account state is not empty, continue with the following steps: traverse the dirty state data key set of the specified account state, retrieve the state data value from the state data map of the specified account state according to each state data key, update each pair of state data key and state data value to the account state tree of the specified account state, and continue with the following steps; use the tree node cache as the tree node update cache, submit the account state tree of the specified account state, and continue with the following steps; obtain the state root of the account state tree of the specified account state, and update it to the account state root of the specified account state; clear the dirty state data key set of the specified account state.

[0163] The method provided in the embodiment of the present application simultaneously maintains the world state of different block heights or different branches of the same block height by constructing a world state chain, and is compatible with the consensus mechanism that requires simultaneous consensus of multiple blocks, which can ensure the consistency of the state data of the blockchain system.

[0164] See Figure 7 , Figure 7 This is a schematic diagram of the structure of a data processing device based on blockchain provided in an embodiment of the present application. The data processing device can be a computer program (including program code) running on a computer device, for example, the data processing device is an application software; the device can be used to execute the corresponding steps in the data processing method provided in an embodiment of the present application. Figure 7 As shown, the data processing device 1 may include: an initialization module 11, a state creation module 12, a first state update module 13, a second state update module 14, a consensus module 15 and a state submission module 16.

[0165] Initialization module 11, used to generate the initial block;

[0166] The state creation module 12 is used to create a first world state corresponding to the initial block; the first world state has a chain relationship pointing to the second world state corresponding to the parent block of the initial block; the first world state and the second world state exist in the world state chain; if the parent block is the block with the maximum block height among the on-chain blocks, the second world state is the consensus root world state; the first world state in the world state chain is the latest on-chain world state; the consensus root world state has a chain relationship pointing to the latest on-chain world state; the latest on-chain world state is used to record the latest world state corresponding to the on-chain block;

[0167] A first state updating module 13 is configured to update the first world state according to the transactions in the initial block to obtain a target first world state;

[0168] The second state updating module 14 is configured to construct a clean state tree for the target first world state according to the world state chain, and obtain an updated target first world state including the clean current world state tree;

[0169] Consensus module 15 is used to write the first world state root corresponding to the clean current world state tree into the initial block to obtain the block to be chained, and send the consensus block to the consensus node so that the consensus node can perform consensus processing on the block to be chained based on the first world state root to obtain a consensus result;

[0170] The state submission module 16 is used to write the block to be on-chain into the blockchain if the consensus result is a consensus passing result, submit the updated target first world state to the latest on-chain world state step by step through the world state chain, and determine the updated target first world state as the new consensus root world state. The new consensus root world state has a chain relationship pointing to the latest on-chain world state after submission.

[0171] The specific implementation of the initialization module 11, the state creation module 12, the first state update module 13, the second state update module 14, the consensus module 15 and the state submission module 16 can be found in the above Figure 3 The description of steps S101 to S104 in the corresponding embodiment will not be repeated here.

[0172] The state creation module 12 includes a creation unit 121 and a pointing unit 122 .

[0173] The creation unit 121 is configured to create an initial world state corresponding to the initial block; the initial world state includes a first previous world state pointer and a first tree node cache; the first tree node cache includes a first previous tree node cache pointer;

[0174] The pointing unit 122 is used to point the first previous world state pointer to the second world state corresponding to the parent block of the initial block, and point the first previous tree node cache pointer to the second tree node cache included in the second world state to obtain the first world state corresponding to the initial block.

[0175] The specific implementation of the creation unit 121 and the pointing unit 122 can be found in the above Figure 3 The description of step S101 in the corresponding embodiment will not be repeated here.

[0176] The first state updating module 13 includes: a first transaction acquiring unit 131 , a transaction state creating unit 132 , a transaction state updating unit 133 , a transaction state submitting unit 134 and a world state determining unit 135 .

[0177] The first transaction acquisition unit 131 is configured to sequentially traverse the transactions in the initial block and acquire the kth transaction in the initial block, where k is a positive integer less than or equal to H, and H is the total number of transactions in the initial block.

[0178] The transaction state creation unit 132 is configured to create the kth transaction world state corresponding to the kth transaction; the kth transaction world state has a chain relationship pointing to the k-1th submission world state; when k is 1, the k-1th submission world state is the first world state;

[0179] The transaction state updating unit 133 is configured to execute the kth transaction and perform a state update process on the kth transaction world state during the execution of the kth transaction to obtain the kth updated transaction world state;

[0180] The transaction state submission unit 134 is configured to submit the kth updated transaction world state to the k-1th submitted world state to obtain the kth submitted world state if the kth transaction is successfully executed;

[0181] The world state determining unit 135 is configured to, when k is equal to H, use the Hth submitted world state as the target first world state.

[0182] The specific implementation of the first transaction acquisition unit 131, the transaction status creation unit 132, the transaction status update unit 133, the transaction status submission unit 134 and the world state determination unit 135 can be found in the above Figure 5 The description of steps S201 to S205 in the corresponding embodiment will not be repeated here.

[0183] Among them, the kth transaction world state contains the account state mapping and the dirty account address set;

[0184] The transaction status updating unit 133 includes an executing subunit 1331 , an account status acquiring subunit 1332 , a first mapping updating subunit 1333 , and a second mapping updating subunit 1334 .

[0185] The execution subunit 1331 is configured to execute the kth transaction and determine the data to be updated corresponding to the kth transaction during the execution of the kth transaction; the data to be updated includes the account address to be updated, the status data key to be updated, and the status data value to be updated;

[0186] The account status acquisition subunit 1332 is used to acquire the account status corresponding to the to-be-updated account address according to the kth transaction world state as the to-be-updated account status; the to-be-updated account status includes a to-be-updated state data mapping and a to-be-updated dirty state data key set;

[0187] The first mapping update subunit 1333 is used to update the mapping relationship between the state data key to be updated and the state data value to be updated into the state data map to be updated, insert the state data key to be updated into the dirty state data key set to be updated, and obtain the current account state;

[0188] The second mapping updating unit 1334 is configured to update the mapping relationship between the account address to be updated and the current account state into the account state mapping included in the k-th transaction world state, and insert the account address to be updated into the set of dirty account addresses included in the k-th transaction world state to obtain the k-th updated transaction world state.

[0189] Among them, the account status acquisition subunit 1332 is specifically used to perform an account status mapping sequence retrieval from the kth transaction world state to the latest on-chain world state according to the account address to be updated; if an account status with a mapping relationship with the account address to be updated is retrieved during the account status mapping sequence retrieval process, the account status with a mapping relationship with the account address to be updated that is first retrieved is used as the account status to be updated; if an account status with a mapping relationship with the account address to be updated is not retrieved during the account status mapping sequence retrieval process, the state tree root to be updated corresponding to the account address to be updated is obtained according to the world state tree in the latest on-chain world state, and the account status to be updated is established according to the account address to be updated and the state tree root to be updated.

[0190] The specific implementation of the execution subunit 1331, the account status acquisition subunit 1332, the first mapping update subunit 1333 and the second mapping update subunit 1334 can be found in the above Figure 5 The description of step S203 in the corresponding embodiment will not be repeated here.

[0191] The transaction status submission unit 134 includes an address acquisition subunit 1341 , a current account status acquisition subunit 1342 , a previous account status acquisition subunit 1343 , a world status submission subunit 1344 , and a world status determination subunit 1345 .

[0192] The address acquisition subunit 1341 is used to traverse the account addresses in the dirty account address set included in the k-th updated transaction world state and sequentially acquire the j-th account address; j is a positive integer less than or equal to 1; I is the total number of account addresses in the dirty account address set included in the k-th updated transaction world state;

[0193] The current account status acquisition subunit 1342 is used to obtain the current account status corresponding to the j-th account address from the account status mapping included in the k-th updated transaction world state;

[0194] The previous account status acquisition subunit 1343 is used to acquire the previous account status of the j-th account address based on the k-1-th submitted world state;

[0195] The world state submission subunit 1344 is used to submit the current account state corresponding to the j-th account address to the previous account state of the j-th account address, insert the j-th account address into the set of dirty account addresses included in the k-1-th submitted world state, and obtain the j-th transitional submitted world state;

[0196] The world state determination subunit 1345 is used to, when j is equal to 1, clear the dirty account address set and account state mapping contained in the k-th updated transaction world state, and use the I-th transition submission world state as the k-th submission world state.

[0197] The world state submission subunit 1345 is specifically configured to update the mapping relationship between the state data key and the state data value in the state data map contained in the current account state corresponding to the j-th account address to the state data map contained in the previous account state of the j-th account address; and insert the state data key in the state data map contained in the current account state corresponding to the j-th account address into the dirty state data key set contained in the previous account state of the j-th account address, thereby obtaining the j-th transitional submitted world state.

[0198] The specific implementation of the address acquisition subunit 1341, the current account status acquisition subunit 1342, the previous account status acquisition subunit 1343, the world status submission subunit 1344 and the world status determination subunit 1345 can be found in the above Figure 5 The description of step S204 in the corresponding embodiment will not be repeated here.

[0199] The second state updating module 14 includes a tree query unit 141 , a first query processing unit 142 , a second query processing unit 143 , a first tree construction unit 144 and a second tree construction unit 145 .

[0200] A tree query unit 141 is configured to perform a world state tree query on the target first world state;

[0201] The first query processing unit 142 is configured to, if the target first world state includes a first world state tree, perform full-chain dirty account state submission processing on the target first world state including the first world state tree to obtain an updated target first world state including a clean current world state tree;

[0202] A second query processing unit 143 is configured to search for a second world state according to the first previous world state pointer if the target first world state does not include the first world state tree;

[0203] A first tree construction unit 144 is configured to construct a clean state tree for the second world state according to the world state chain to obtain a clean pre-world state tree;

[0204] The second tree construction unit 145 is configured to use the previous state tree root of the clean previous world state tree as the current state tree root;

[0205] The second tree construction unit 145 is further configured to construct a second world state tree corresponding to the target first world state based on the first tree node cache and the current state tree root, and add the second world state tree to the target first world state to obtain a transition target first world state;

[0206] The dirty state submission unit 146 is used to perform full-chain dirty account state submission processing on the transition target first world state to obtain an updated target first world state including a clean current world state tree.

[0207] The specific implementation of the tree query unit 141, the first query processing unit 142, the second query processing unit 143, the first tree construction unit 144 and the second tree construction unit 145 can be found in the above Figure 6 The description of steps S301 to S306 in the corresponding embodiment will not be repeated here.

[0208] The dirty state submission unit 146 includes a dirty data submission sub-unit 1461 , a root acquisition sub-unit 1462 , a tree update sub-unit 1463 and a tree submission sub-unit 1464 .

[0209] The dirty data submission sub-unit 1461 is used to submit the dirty state data of the transition target first world state to the entire chain, and obtain the submitted transition target first world state and the set of dirty account addresses of the entire chain;

[0210] The root acquisition subunit 1462 is used to obtain the account state root corresponding to each full-chain dirty account address in the full-chain dirty account address set according to the submitted transition target first world state;

[0211] The tree update subunit 1463 is used to update each full-chain dirty account address and the account state root corresponding to each full-chain dirty account address to the second world state tree to obtain a clean current world state tree;

[0212] The tree submission sub-unit 1464 is used to store the updated tree node hash of the clean current world state tree and the association relationship of the updated tree node into the tree node mapping of the tree node cache in the submitted transition target first world state, and obtain the updated target first world state containing the clean current world state tree.

[0213] Among them, the dirty data submission subunit 1461 is specifically used to sequentially traverse the world state chain, obtain the dirty account address set contained in the x-th world state, as the x-th target dirty account address set; x is a positive integer less than or equal to Z; Z is the sequential ordinal number of the transition target first world state in the world state chain; traverse the account addresses in the x-th target dirty account address set, and sequentially obtain the m-th account address; m is a positive integer less than or equal to the total number of account addresses in the x-th target dirty account address set; obtain the target current account state and the target previous account state corresponding to the m-th account address; and perform the dirty account submission on the m-th account address according to the previous account state of the m-th account address. The current account status of each dirty account address in the x-th target dirty account address set is subjected to account dirty status data submission processing, and the x-th submitted world state is obtained; the target dirty account address is added to the x-1th on-chain target dirty account address set to obtain the x-th on-chain target dirty account address set; when x is 1, the x-1th on-chain target dirty account address set is an empty set; when x is equal to Z, the x-th on-chain target dirty account address set is used as the full-chain dirty account address set, and the x-th submitted world state is used as the first transition target world state after submission.

[0214] Among them, the dirty data submission subunit 1461 is specifically further used to perform an account status tree query on the current account status of the m-th account address; if the current account status of the m-th account address does not contain an account status tree, or the account status root of the current account status of the m-th account address is not equal to the account status root of the previous account status of the m-th account address, then a designated account status tree is established based on the tree node cache of the current account status of the m-th account address and the account status root of the previous account status of the m-th account address, the account status tree is added to the current account status of the m-th account address, and the account status root of the current account status of the m-th account address is updated to the account status root of the previous account status of the m-th account address to obtain the designated account status; if the current account status of the m-th account address contains an account status tree, and the account status root of the current account status of the m-th account address is equal to the previous account status of the m-th account address, state, the current account state of the mth account address is used as the specified account state; if the dirty state data key set of the specified account state is not empty, the state data value corresponding to the dirty state data key in the dirty state data key set of the specified account state is obtained from the state data mapping of the specified account state, and the dirty state data key in the dirty state data key set of the specified account state and the state data value corresponding to the dirty state data key in the dirty state data key set of the specified account state are updated to the account state tree of the specified account state to obtain the specified account state containing the updated account state tree; the account state root of the specified account state containing the updated account state tree is updated to the state tree root of the account state tree to be updated; the dirty state data key set of the specified account state containing the updated account state tree is cleared; the updated tree node hash of the updated account state tree and the association relationship between the updated tree nodes are stored in the xth world state.

[0215] The specific implementation of the dirty data submission subunit 1461, the root acquisition subunit 1462, the tree update subunit 1463 and the tree submission subunit 1464 can be found in the above Figure 3 The description of step S306 in the corresponding embodiment will not be repeated here.

[0216] The data processing device 1 further includes a submitting module 17 , an updating module 18 and a clearing module 19 .

[0217] The submission module 17 is used to process the dirty account status of the entire chain on the latest on-chain world state after submission, and obtain the clean latest on-chain world state;

[0218] An update module 18 is configured to update the tree node hash and tree node contained in the tree node mapping in the tree node cache in the clean and latest on-chain world state to the tree node database;

[0219] The clearing module 19 is used to clear the dirty account address set, account state mapping and tree node mapping in the clean latest on-chain world state.

[0220] The specific implementation of the submit module 17, the update module 18 and the clear module 19 can be found in the above Figure 3 The optional descriptions in the corresponding embodiments will not be repeated here.

[0221] See Figure 8 , Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 8 As shown above Figure 7 The data processing device 1 in the corresponding embodiment can be applied to a computer device 1000, which may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Figure 8 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application.

[0222] In such Figure 8 In the computer device 1000 shown, the network interface 1004 can provide a network communication element; the user interface 1003 is mainly used to provide an interface for user input; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0223] Generate an initial block and create the first world state corresponding to the initial block. The first world state has a chain relationship pointing to the second world state corresponding to the parent block of the initial block. The first and second world states exist in the world state chain. If the parent block is the block with the largest block height among the on-chain blocks, the second world state is the consensus root world state. The first world state in the world state chain is the latest on-chain world state. The consensus root world state has a chain relationship pointing to the latest on-chain world state. The latest on-chain world state is used to record the latest world state corresponding to the on-chain block.

[0224] Update the first world state according to the transactions in the initial block to obtain the target first world state, and construct a clean state tree for the target first world state according to the world state chain to obtain an updated target first world state containing a clean current world state tree;

[0225] Write the first world state root corresponding to the clean current world state tree into the initial block to obtain the block to be chained, and send the consensus block to the consensus node so that the consensus node can perform consensus processing on the block to be chained based on the first world state root to obtain the consensus result;

[0226] If the consensus result is a consensus-passing result, the block to be chained will be written into the blockchain, and the updated target first world state will be submitted to the latest chained world state step by step through the world state chain. The updated target first world state will be determined as the new consensus root world state. The new consensus root world state has a chain relationship pointing to the latest chained world state after submission.

[0227] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 3 The description of the data processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here either.

[0228] In addition, it should be noted that: the embodiment of the present application further provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the data processing device 1 mentioned above, and the computer program includes program instructions. When the processor executes the program instructions, the computer program can execute the above-mentioned data processing device 1. Figure 3 The description of the above-mentioned data processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.

[0229] The computer-readable storage medium may be the data processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Furthermore, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0230] In addition, it should be noted that embodiments of the present application also provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method provided in any of the corresponding embodiments described above.

[0231] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device comprising a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0232] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example in terms of network elements. Whether these network elements are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described network elements for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0233] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A data processing method based on blockchain, characterized in that: include: Generate an initial block and create a first world state corresponding to the initial block; The first world state has a chain relationship pointing to the second world state corresponding to the parent block of the initial block; the first world state and the second world state exist in the world state chain; if the parent block is the block with the largest block height among the on-chain blocks, then the second world state is the consensus root world state; the first world state in the world state chain is the latest on-chain world state; the consensus root world state has a chain relationship pointing to the latest on-chain world state; the latest on-chain world state is used to record the latest world state corresponding to the on-chain block; Updating the first world state according to the transactions in the initial block to obtain a target first world state, and constructing a clean state tree for the target first world state according to the world state chain to obtain an updated target first world state including a clean current world state tree; Writing the first world state root corresponding to the clean current world state tree into the initial block to obtain a block to be chained, and sending the block to be chained to a consensus node so that the consensus node performs consensus processing on the block to be chained based on the first world state root to obtain a consensus result; If the consensus result is a consensus passing result, the block to be on-chain is written into the blockchain, and the updated target first world state is submitted step by step to the latest on-chain world state through the world state chain, and the updated target first world state is determined as the new consensus root world state. The new consensus root world state has a chain relationship pointing to the latest on-chain world state after submission.

2. The method according to claim 1, characterized in that The step of creating the first world state corresponding to the initial block includes: Creating an initial world state corresponding to the initial block; the initial world state includes a first previous world state pointer and a first tree node cache; the first tree node cache includes a first previous tree node cache pointer; The first previous world state pointer is pointed to the second world state corresponding to the parent block of the initial block, and the first previous tree node cache pointer is pointed to the second tree node cache included in the second world state to obtain the first world state corresponding to the initial block.

3. The method according to claim 1, characterized in that The updating of the first world state according to the transactions in the initial block to obtain a target first world state includes: Sequentially traverse the transactions in the initial block to obtain the kth transaction in the initial block; k is a positive integer less than or equal to H; H is the total number of transactions in the initial block; Create a k-th transaction world state corresponding to the k-th transaction; the k-th transaction world state has a chain relationship pointing to the k-1-th submitted world state; when k is 1, the k-1-th submitted world state is the first world state; Executing the k-th transaction, and performing state updating processing on the k-th transaction world state during the execution of the k-th transaction to obtain the k-th updated transaction world state; If the k-th transaction is successfully executed, the k-th updated transaction world state is submitted to the k-1-th submitted world state to obtain the k-th submitted world state; When k is equal to H, the Hth submitted world state is taken as the target first world state.

4. The method according to claim 3, characterized in that The kth transaction world state includes an account state mapping and a dirty account address set; The executing the kth transaction, and performing a state update process on the kth transaction world state during the execution of the kth transaction to obtain the kth updated transaction world state, including: Executing the kth transaction, and determining data to be updated corresponding to the kth transaction during the execution of the kth transaction; the data to be updated includes an account address to be updated, a status data key to be updated, and a status data value to be updated; Obtaining the account state corresponding to the to-be-updated account address according to the kth transaction world state as the to-be-updated account state; the to-be-updated account state includes a to-be-updated state data mapping and a to-be-updated dirty state data key set; Update the mapping relationship between the state data key to be updated and the state data value to be updated into the state data map to be updated, insert the state data key to be updated into the dirty state data key set to be updated, and obtain the current account state; The mapping relationship between the to-be-updated account address and the current account state is updated into the account state mapping included in the k-th transaction world state, and the to-be-updated account address is inserted into the set of dirty account addresses included in the k-th transaction world state to obtain the k-th updated transaction world state.

5. The method according to claim 4, characterized in that The acquiring, according to the kth transaction world state, the account state corresponding to the to-be-updated account address as the to-be-updated account state includes: Perform an account status mapping sequence search from the kth transaction world state to the latest on-chain world state according to the account address to be updated; If an account status having a mapping relationship with the account address to be updated is retrieved during the account status mapping sequence retrieval process, the account status having a mapping relationship with the account address to be updated that is retrieved first is used as the account status to be updated; If no account state having a mapping relationship with the account address to be updated is retrieved during the account state mapping sequence retrieval process, the state tree root to be updated corresponding to the account address to be updated is obtained according to the world state tree in the latest on-chain world state, and the account state to be updated is established according to the account address to be updated and the state tree root to be updated.

6. The method according to claim 4, characterized in that If the k-th transaction is successfully executed, the k-th updated transaction world state is submitted to the k-1-th submitted world state to obtain the k-th submitted world state, including: Traverse the account addresses in the dirty account address set included in the k-th updated transaction world state, and sequentially obtain the j-th account address; j is a positive integer less than or equal to 1; I is the total number of account addresses in the dirty account address set included in the k-th updated transaction world state; Obtain the current account state corresponding to the j-th account address from the account state mapping included in the k-th updated transaction world state; Obtain the previous account state of the j-th account address based on the k-1-th submitted world state; Submit the current account state corresponding to the j-th account address to the previous account state of the j-th account address, insert the j-th account address into the set of dirty account addresses included in the k-1-th submitted world state, and obtain the j-th transitional submitted world state; When j is equal to 1, the dirty account address set and account state mapping contained in the k-th updated transaction world state are cleared, and the I-th transition submitted world state is used as the k-th submitted world state.

7. The method according to claim 6, characterized in that The step of submitting the current account state corresponding to the j-th account address to the previous account state of the j-th account address, inserting the j-th account address into the set of dirty account addresses included in the k-1-th submitted world state, and obtaining the j-th transitional submitted world state includes: Update the mapping relationship between the state data key and the state data value in the state data mapping included in the current account state corresponding to the j-th account address to the state data mapping included in the previous account state of the j-th account address; Insert the state data key in the state data map contained in the current account state corresponding to the j-th account address into the dirty state data key set contained in the previous account state of the j-th account address to obtain the j-th transition committed world state.

8. The method according to claim 2, characterized in that The process of constructing a clean state tree for the target first world state according to the world state chain to obtain an updated target first world state includes: Performing a world state tree query on the target first world state; If the target first world state includes a first world state tree, then the target first world state including the first world state tree is subjected to a full-chain dirty account state submission process to obtain an updated target first world state including a clean current world state tree; If the target first world state does not include the first world state tree, searching for the second world state according to the first previous world state pointer; Constructing a clean state tree for the second world state according to the world state chain to obtain a clean pre-world state tree; Taking the previous state tree root of the clean previous world state tree as the current state tree root; Constructing a second world state tree corresponding to the target first world state according to the first tree node cache and the current state tree root, and adding the second world state tree to the target first world state to obtain a transition target first world state; The transition target first world state is subjected to full chain dirty account state submission processing to obtain an updated target first world state including a clean current world state tree.

9. The method according to claim 8, characterized in that The whole-chain dirty account state submission process is performed on the transition target first world state to obtain an updated target first world state containing a clean current world state tree, including: Performing full-chain dirty state data submission processing on the transition target first-world state to obtain the submitted transition target first-world state and a full-chain dirty account address set; Obtain the account state root corresponding to each full-chain dirty account address in the full-chain dirty account address set according to the transition target first world state after submission; Update each full-chain dirty account address and the account state root corresponding to each full-chain dirty account address to the second world state tree to obtain a clean current world state tree; The updated tree node hash of the clean current world state tree and the association relationship of the updated tree node are stored in the tree node mapping of the tree node cache in the submitted transition target first world state to obtain the updated target first world state containing the clean current world state tree.

10. The method according to claim 9, characterized in that The whole-chain dirty state data submission process is performed on the transition target first-world state to obtain the submitted transition target first-world state and the whole-chain dirty account address set, including: Sequentially traverse the world state chain and obtain the dirty account address set contained in the x-th world state as the x-th target dirty account address set; x is a positive integer less than or equal to Z; Z is the sequence number of the first world state of the transition target in the world state chain; Traverse the account addresses in the x-th target dirty account address set and sequentially obtain the m-th account address; m is a positive integer less than or equal to the total number of account addresses in the x-th target dirty account address set; Obtain the target current account status and target previous account status corresponding to the mth account address; Performing account dirty status data submission processing on the current account status of the m-th account address according to the previous account status of the m-th account address; After the current account state of each dirty account address in the x-th target dirty account address set is submitted for account dirty state data processing, the x-th submitted world state is obtained; Add the target dirty account address to the target dirty account address set on the x-1th chain to obtain the target dirty account address set on the xth chain; when x is 1, the target dirty account address set on the x-1th chain is an empty set; When x is equal to Z, the x-th target dirty account address set on the chain is used as the full-chain dirty account address set, and the x-th submitted world state is used as the first transition target world state after submission.

11. The method according to claim 10, characterized in that The performing account dirty status data submission processing on the current account status of the mth account address according to the previous account status of the mth account address includes: Perform an account status tree query on the current account status of the m-th account address; If the current account state of the m-th account address does not include an account state tree, or the account state root of the current account state of the m-th account address is not equal to the account state root of the previous account state of the m-th account address, then a designated account state tree is established based on the tree node cache of the current account state of the m-th account address and the account state root of the previous account state of the m-th account address, the account state tree is added to the current account state of the m-th account address, and the account state root of the current account state of the m-th account address is updated to the account state root of the previous account state of the m-th account address, thereby obtaining the designated account state; If the current account state of the m-th account address contains an account state tree, and the account state root of the current account state of the m-th account address is equal to the account state root of the previous account state of the m-th account address, then the current account state of the m-th account address is used as the designated account state; If the dirty state data key set of the specified account state is not empty, obtaining the state data value corresponding to the dirty state data key in the dirty state data key set of the specified account state from the state data map of the specified account state, and updating the dirty state data key in the dirty state data key set of the specified account state and the state data value corresponding to the dirty state data key in the dirty state data key set of the specified account state to the account state tree of the specified account state, to obtain the specified account state including the updated account state tree; Updating the account state root containing the specified account state of the updated account state tree to the state tree root of the updated account state tree; Clear the dirty state data key set containing the specified account state of the updated account state tree; The updated tree node hash of the updated account state tree and the association relationship between the updated tree nodes are stored in the x-th world state.

12. The method according to claim 11, characterized in that Also includes: The latest on-chain world state is submitted and the dirty account state of the entire chain is submitted to obtain the clean and latest on-chain world state; Update the tree node hash and tree node contained in the tree node mapping in the tree node cache in the clean and latest on-chain world state to the tree node database; Clear the dirty account address set, account state mapping, and tree node mapping in the tree node cache in the clean latest on-chain world state.

13. A data processing device based on blockchain, characterized in that: include: Initialization module, used to generate the initial block; A state creation module, used to create the first world state corresponding to the initial block; The first world state has a chain relationship pointing to the second world state corresponding to the parent block of the initial block; the first world state and the second world state exist in the world state chain; if the parent block is the block with the largest block height among the on-chain blocks, then the second world state is the consensus root world state; the first world state in the world state chain is the latest on-chain world state; the consensus root world state has a chain relationship pointing to the latest on-chain world state; the latest on-chain world state is used to record the latest world state corresponding to the on-chain block; A first state updating module, configured to update the first world state according to the transactions in the initial block to obtain a target first world state; A second state update module is configured to construct a clean state tree for the target first world state according to the world state chain to obtain an updated target first world state including a clean current world state tree; A consensus module is configured to write the first world state root corresponding to the clean current world state tree into the initial block to obtain a block to be on-chained, and send the block to be on-chained to a consensus node so that the consensus node performs consensus processing on the block to be on-chained based on the first world state root to obtain a consensus result; A state submission module is configured to write the block to be on-chain into the blockchain if the consensus result is a consensus passing result, submit the updated target first world state to the latest on-chain world state step by step through the world state chain, and determine the updated target first world state as a new consensus root world state. The new consensus root world state has a chain relationship pointing to the latest on-chain world state after submission.

14. A computer device, characterized in that: include: processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store program code, and the processor is used to call the program code to execute the method according to any one of claims 1 to 12.

15. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the method according to any one of claims 1 to 12.

16. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 12 can be performed.

Citation Information

Patent Citations

  • Constructing blockchain world state merkle patricia trie subtree

    CN110800008A

  • Blockchain system with efficient world state data structure

    CN113994324A

Cited By

  • Data processing method and apparatus based on blockchain, and device and readable storage medium

    EP4394619B1

  • Data processing method and apparatus based on blockchain, and device and readable storage medium

    WO2023160040A1