Blockchain data processing method and apparatus, device, medium, and product

CN117743457BActive Publication Date: 2026-08-07TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-09-15
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

默克尔树存储结果为二叉树的结构,一方面,二叉树中的节点存储的数据有限,数据存储的业务覆盖较低,不能很好地满足数据存储需求

Benefits of technology

[0009]本申请实施例中,区块链节点可以首先获取关于目标对象的交易区块,然后根据交易区块中包括的交易数据,得到目标对象的验证数据。其中,验证数据是基于树状存储结构进行存储的,该树状存储结构为基于默克尔树的存储结构,树状存储结构中包括根节点、中间节点、数据节点、以及在数据节点上关联的存储域节点。其中,在得到目标对象的验证数据的过程中,区块链节点至少执行以下步骤中的一个或者两个:将目标对象的交易数据存储在第二节点中;将目标对象的状态数据存储在第一节点中,目标对象的状态数据是根据交易数据确定的。由此可见,本申请中用于存储状态数据的树状存储结构是基于默克尔树的存储结构进行改进的,即在默克尔树的数据节点上增加存储域节点,从而可以将交易数据的内容存储在存储域节点所包括的第二节点中,根据交易数据所确定的状态数据的内容存储在存储域节点所包括的第一节点中,由于增加了存储域节点,可以使得交易数据和状态数据均可以存储在树状存储结构中,从而使得该树状存储结构可以适应于多种业务场景的交易数据的状态数据存储需求;另外,基于二叉树的结构可以扩展得到多叉的树状存储结构,从而降低了默克尔树的高度,减少了计算量,从而可以提高验证性能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117743457B_ABST
    Figure CN117743457B_ABST
Patent Text Reader

Abstract

The application provides a blockchain data processing method, device and equipment, medium and product. The method comprises the following steps: obtaining a transaction block about a target object; obtaining verification data of the target object according to transaction data included in the transaction block; the verification data is stored based on a tree-shaped storage structure, the tree-shaped storage structure is a storage structure based on a Merkle tree, the tree-shaped storage structure comprises a root node, an intermediate node, a data node and a storage domain node associated with the data node, the storage domain node comprises a first node and a second node; wherein, the data stored in the nodes of the tree-shaped storage structure at least comprises one or two of the following steps: storing the transaction data of the target object in the second node; and storing state data of the target object in the first node. The application can increase the storage domain node on the data node, and can adapt to the state data storage requirements of the transaction data of various business scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a blockchain data processing method, a blockchain data processing device, a computer device, a computer-readable storage medium, and a computer program product. Background Technology

[0002] In blockchain, the execution results of transaction data (such as the obtained state data) are mostly stored based on the Merkle tree storage structure. Currently, the Merkle tree storage structure typically includes a root node, intermediate nodes, and data nodes. The Merkle tree storage result is a binary tree structure. On the one hand, the data stored in the nodes of a binary tree is limited, resulting in low business coverage of data storage and failing to adequately meet data storage needs. Summary of the Invention

[0003] This application proposes a blockchain data processing method, apparatus, device, medium, and product that can extend the storage structure of Merkle trees and add storage domain nodes to data nodes, thus adapting to the state data storage needs of transaction data in various business scenarios.

[0004] On one hand, embodiments of this application provide a blockchain data processing method applied to a blockchain node, the method comprising: Retrieve transaction blocks related to the target object; Based on the transaction data included in the transaction block, the verification data of the target object is obtained; the verification data is stored based on a tree storage structure, which is a Merkle tree-based storage structure. The tree storage structure includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. The storage domain nodes include the first node and the second node. The process of obtaining verification data for the target object includes storing data in nodes of a tree-like storage structure to obtain the verification data. The storage of data by blockchain nodes in the tree-like storage structure includes at least one or two of the following steps: The transaction data of the target object is stored in the second node; The state data of the target object is stored in the first node, and the state data of the target object is determined based on the transaction data.

[0005] On one hand, embodiments of this application provide a blockchain data processing device applied to a blockchain node, the device comprising: The acquisition unit is used to acquire transaction blocks related to the target object; The processing unit is used to obtain the verification data of the target object based on the transaction data included in the transaction block. The verification data is stored based on a tree storage structure, which is a Merkle tree-based storage structure. The tree storage structure includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. The storage domain nodes include a first node and a second node. The process of obtaining verification data for the target object includes storing data in nodes of a tree-like storage structure to obtain the verification data. The storage of data by blockchain nodes in the tree-like storage structure includes at least one or two of the following steps: The transaction data of the target object is stored in the second node; The state data of the target object is stored in the first node, and the state data of the target object is determined based on the transaction data.

[0006] On one hand, embodiments of this application provide a computer device, which includes a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the aforementioned blockchain data processing method.

[0007] On one hand, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when read and executed by a processor of a computer device, causes the computer device to perform the aforementioned blockchain data processing method.

[0008] On one hand, embodiments of this application provide a computer program product or computer program that 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 aforementioned blockchain data processing method.

[0009] In this embodiment, the blockchain node can first obtain transaction blocks related to the target object, and then obtain verification data of the target object based on the transaction data included in the transaction blocks. The verification data is stored based on a tree-like storage structure, specifically a Merkle tree-based storage structure, which includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. During the process of obtaining the verification data of the target object, the blockchain node performs at least one or two of the following steps: storing the target object's transaction data in a second node; and storing the target object's state data in a first node, where the target object's state data is determined based on the transaction data. Therefore, the tree-like storage structure used for storing state data in this application is an improvement on the Merkle tree storage structure. Specifically, storage domain nodes are added to the data nodes of the Merkle tree, so that the content of transaction data can be stored in the second node included in the storage domain node, and the content of state data determined by the transaction data can be stored in the first node included in the storage domain node. Due to the addition of storage domain nodes, both transaction data and state data can be stored in the tree-like storage structure, thus making the tree-like storage structure adaptable to the state data storage needs of various business scenarios. In addition, the binary tree structure can be extended to obtain a multi-branch tree-like storage structure, thereby reducing the height of the Merkle tree, reducing the amount of computation, and thus improving verification performance. Attached Figure Description

[0010] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1a This is a schematic diagram of the structure of a blockchain system provided in an embodiment of this application; Figure 1b This is a schematic diagram of a blockchain structure provided in an embodiment of this application; Figure 2 This is a schematic diagram of the architecture of a blockchain data processing system provided in an embodiment of this application; Figure 3 This is a flowchart illustrating a blockchain data processing method provided in an embodiment of this application; Figure 4 This is a schematic diagram of a Merkle tree storage structure provided in an embodiment of this application; Figure 5 This is a schematic diagram of a tree-like storage structure provided in an embodiment of this application; Figure 6 This is a flowchart illustrating another blockchain data processing method provided in an embodiment of this application; Figure 7 This is a schematic diagram illustrating a scenario of a blockchain data processing method provided in an embodiment of this application; Figure 8 This is an interactive flowchart of a blockchain data processing method provided in an embodiment of this application; Figure 9 This is a schematic diagram of the structure of a blockchain data processing device provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0012] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application.

[0013] This application proposes a blockchain data processing scheme that extends a Merkle tree storage structure to obtain a tree-like storage structure. Specifically, storage domain nodes are added to data nodes, allowing the tree-like storage structure to adapt to the state data storage needs of transaction data in various business scenarios. The principle of this blockchain data processing scheme is as follows: A blockchain node first obtains transaction blocks related to a target object, and then obtains verification data for the target object based on the transaction data included in the transaction blocks. The verification data is stored based on a tree-like storage structure, specifically a Merkle tree-based storage structure, which includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. In obtaining the verification data for the target object, the blockchain node performs at least one or two of the following steps: storing the target object's transaction data in a second node; and storing the target object's state data in a first node, where the state data is determined based on the transaction data.

[0014] Therefore, the tree-like storage structure used for storing state data in this application is an improvement on the Merkle tree storage structure. Specifically, storage domain nodes are added to the data nodes of the Merkle tree, so that the content of transaction data can be stored in the second node included in the storage domain node, and the content of state data determined by the transaction data can be stored in the first node included in the storage domain node. Due to the addition of storage domain nodes, both transaction data and state data can be stored in the tree-like storage structure, thus making the tree-like storage structure adaptable to the state data storage needs of various business scenarios. In addition, the binary tree structure can be extended to obtain a multi-branch tree-like storage structure, thereby reducing the height of the Merkle tree, reducing the amount of computation, and thus improving verification performance.

[0015] The blockchain data processing solution presented in this application can be combined with blockchain technology. The following section provides a detailed introduction to the blockchain technology involved in the blockchain data processing solution provided in this application: The blockchain system involved in this application embodiment can be a distributed system formed by connecting terminal devices and multiple nodes (any form of computing device in the network, such as a server or terminal device) through network communication. The following is a reference to the appendix... Figure 1a -Appendix Figure 1b This section provides an introduction to blockchain-related technologies. I. Blockchain System: Please see Figure 1a , Figure 1a This is a schematic diagram of the structure of a blockchain system provided in an embodiment of this application. Figure 1a The blockchain system shown can be a blockchain system composed of a main chain and sub-chains. The main chain refers to the blockchain that provides basic business services to the sub-chains, and its security ensures the security of the sub-chains. Sub-chains can refer to blockchains for various business scenarios; specifically, a sub-chain can be applicable to multiple business scenarios, such as business scenario 1, business scenario 2, and business scenario 3. Furthermore, the blockchain network containing the main chain can include multiple main chain nodes 101, and the blockchain network containing the sub-chains can include multiple sub-chain nodes 102. It should be noted that in this application, main chain nodes and sub-chain nodes can be collectively referred to as blockchain nodes; additionally, this application does not impose a specific limit on the number of nodes included in the main chain and sub-chains.

[0016] It should be understood that Figure 1aThe blockchain system shown can be a data sharing system, which refers to a system used for data sharing between nodes. Specifically, the multiple main chain nodes 101 in the main chain network of the data sharing system can refer to various computer devices in the data sharing system; the multiple sub-chain nodes 102 in the sub-chain network of the data sharing system can refer to various computer devices in the data sharing system. It is understood that, in order to ensure information exchange within the data sharing system, nodes in the data sharing system (for example, between any main chain node 101 and any sub-chain node 102; or between any main chain node 101 and another main chain node 101; or between any sub-chain node 102 and another sub-chain node 102) can establish communication connections through information connections. The above-mentioned information connections are not limited to specific connection methods. For example, they can be directly or indirectly connected through wired communication, or directly or indirectly connected through wireless communication, or through other connection methods. This application does not impose any restrictions here.

[0017] Each main chain node 101 and each sub-chain node 102 can receive input information during normal operation (for example, any main chain node 101 or sub-chain node 102 can receive transaction data about a target object sent by a terminal device, and then package this transaction data to generate a transaction block; or any main chain node 101 can receive transaction data about a target object sent by a terminal device, and then package this transaction data and send it to the sub-chain node 102, which will then package it to generate a transaction block, etc.), and maintain the shared data within the data sharing system based on the received input information. For example, when any main chain node 101 in the data sharing system receives input information, other main chain nodes 101 in the main chain network obtain the input information according to the consensus algorithm and store it as data in the shared data, ensuring that the data stored on all nodes in the main chain network is consistent. Similarly, when any sub-chain node 102 in the data sharing system receives input information, other sub-chain nodes 102 in the sub-chain network obtain the input information according to the consensus algorithm and store it as data in the shared data, ensuring that the data stored on all nodes in the sub-chain network is consistent. Furthermore, when any sub-chain node 102 in the data sharing system receives input information, that sub-chain node 102 can also send the received input information to any main chain node 101 in the main chain network.

[0018] Each node in the data sharing system (main chain node 101, sub-chain node 102) has a corresponding node identifier. Furthermore, each node in the data sharing system can store the node identifiers of other nodes in the system, so that the generated block can be broadcast to other nodes in the data sharing system based on their node identifiers. Each node can maintain a node identifier list as shown in the table below, storing the node name and node identifier in this list.

[0019] The node identifier can be an IP (Internet Protocol) address or any other information that can be used to identify the node. Table 1 only uses IP address as an example.

[0020] Table 1. Node Identifier List

[0021] II. The Structure of Blockchain: In this application, the blockchain may include a main chain and sub-chains. Each main chain node 101 in the main chain stores an identical blockchain; each sub-chain node 102 in the sub-chain stores an identical blockchain. The blockchain consists of multiple blocks, see [link to relevant documentation]. Figure 1b , Figure 1b This is a schematic diagram of a blockchain structure provided in an embodiment of this application. For example... Figure 1b The blockchain consists of multiple blocks. The genesis block includes a block header and a block body. The block header stores input information feature values, version number, timestamp, and difficulty value, while the block body stores the input information. The next block after the genesis block takes the genesis block as its parent block. The next block also includes a block header and a block body. The block header stores the input information feature values ​​of the current block, the block header feature values ​​of the parent block, version number, timestamp, and difficulty value, and so on. This ensures that the block data stored in each block of the blockchain is associated with the block data stored in the parent block, guaranteeing the security of the input information in the blocks.

[0022] In one possible implementation, this application can upload the target object's transaction data, state data, etc., to the blockchain of the blockchain network for storage, so as to prevent the internal data of the blockchain node from being tampered with, thereby improving the security and reliability of the data.

[0023] III. Intelligent Transportation: In one possible implementation, the transaction block mentioned above in this application may include transaction data from one or more business scenarios. These business scenarios may include, but are not limited to, any one or more of the following: digital collectibles business scenarios, gaming business scenarios, commodity trading business scenarios, and intelligent transportation business scenarios. Specifically, taking the intelligent transportation business scenario as an example, transaction data 1 may be the transaction volume of vehicle A included in city A, transaction data 2 may be the transaction volume of vehicle B included in city A, and transaction data 3 may be the transaction volume of vehicle C included in city A. Then, transaction data 1, transaction data 2, and transaction data 3 can be packaged into a transaction block, thereby executing the verification data of the target object (vehicle) based on the transaction data included in the transaction block. The obtained verification data can be stored in an improved Merkle tree storage structure. It should be understood that transaction data 1 can be stored in second node 1, transaction data 2 can be stored in second node 2, and transaction data 3 can be stored in second node 3. These three second nodes are all associated with the same first node, which can be the node corresponding to city A. Based on this method, the total number of vehicle transactions in city A within one year (this value can be set as needed) can be determined, and this total number of vehicle transactions can be used as the status data of city A in the intelligent transportation business scenario.

[0024] Intelligent Traffic System (ITS), also known as Intelligent Transportation System, effectively integrates advanced science and technology (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) into transportation, service control, and vehicle manufacturing. It strengthens the connection between vehicles, roads, and users, thereby forming a comprehensive transportation system that ensures safety, improves efficiency, improves the environment, and saves energy.

[0025] It should be noted that in the subsequent specific embodiments of this application, data related to object information (such as the identity information of the target object) is involved. When the above embodiments of this application are applied to specific products or technologies, permission or consent from the target object is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0026] Next, the architecture diagram of the blockchain data processing system involved in this application will be described accordingly. Please refer to [link / reference]. Figure 2 , Figure 2 This is a schematic diagram of the architecture of a blockchain data processing system provided in an embodiment of this application. Figure 2As shown in the diagram, the system architecture diagram may include at least: a main chain, sub-chains, and relay devices 202. The main chain refers to a blockchain composed of multiple main chain nodes 201. Sub-chains may specifically include multiple business sub-chains, such as business sub-chain 1, business sub-chain 2, ..., business sub-chain n. Each business sub-chain can correspond to a business scenario, and each business sub-chain can be composed of multiple sub-chain nodes 202. In one possible implementation, the sub-chain nodes 202 under various business scenarios can also jointly form a sub-chain, creating a blockchain. It should be understood that relay devices 203 can be computer devices (e.g., terminal devices or servers) independent of the main chain and sub-chains. Relay devices 203 can also be any main chain node in the main chain, and relay devices 203 can also be any sub-chain node in a sub-chain. For ease of explanation, this embodiment uses the example of a relay device being a computer device independent of the main chain and sub-chains for illustration.

[0027] It is understood that the main chain node 201 and sub-chain node 202 mentioned above can both be collectively referred to as blockchain nodes. Furthermore, the number of main chain nodes 201 in the main chain and the number of sub-chain nodes 202 in the sub-chain are for illustrative purposes only; this application does not impose a specific limit on the number of blockchain nodes in the blockchain system. Additionally, the relay device 203 is directly or indirectly connected to the main chain node 201 in the main chain and the sub-chain node 202 in the sub-chain via wired or wireless communication methods; this application does not impose any restrictions on this connection.

[0028] Blockchain nodes (main chain node 201, sub chain node 202) can be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc.

[0029] Blockchain nodes (main chain node 201, sub chain node 202) can also be, but are not limited to: mobile phones, tablets, laptops, PDAs, mobile internet devices (MIDs), smart voice interaction devices, in-vehicle terminals, roadside devices, aircraft, wearable devices, smart home appliances, or wearable devices with data processing functions such as smartwatches, smart bracelets, and pedometers, etc.

[0030] In one possible implementation, the aforementioned blockchain data processing scheme is further elaborated by combining the main chain node 201, sub-chain node 202, and relay device 203 in the system architecture diagram. Specifically, the main chain node 201 can accept transaction data from various business scenarios (such as any one or more of digital collectibles, gaming, commodity trading, and intelligent transportation scenarios). The main chain node 201 then sends the transaction data from each business scenario to the relay device 203. The relay device 203 can package the transaction data from each business scenario into transaction blocks, and then send the transaction blocks to any sub-chain node 202.

[0031] Sub-chain node 202 obtains transaction blocks related to the target object. Then, sub-chain node 202 can obtain verification data for the target object based on the transaction data included in the transaction blocks. The verification data is stored using a tree-like storage structure, specifically a Merkle tree-based structure. This tree structure includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. The storage domain nodes include a first node and a second node. During the process of obtaining the verification data for the target object, the blockchain node performs at least one or two of the following steps: storing the target object's transaction data in the second node; and storing the target object's state data in the first node, where the target object's state data is determined based on the transaction data.

[0032] It is understood that the system architecture diagrams described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0033] Based on the above description of blockchain data processing schemes and systems, this application proposes a blockchain data processing method. See also... Figure 3 As shown, Figure 3 This is a flowchart illustrating a blockchain data processing method provided in an embodiment of this application. The data processing method can be derived from the above... Figure 2 The blockchain data processing system mentioned above is executed by blockchain nodes (e.g., terminal devices or servers). For ease of explanation, this application embodiment uses computer devices as an example for illustration. The blockchain data processing method may include the following steps S301-S302: S301, Obtain transaction blocks related to the target object.

[0034] In this embodiment, the transaction block may include transaction data from one or more business scenarios. Business scenarios may include, but are not limited to, any one or more of the following: digital collectibles business scenarios, gaming business scenarios, commodity trading business scenarios, and intelligent transportation business scenarios. It should be understood that the specific content of the transaction data differs for different business scenarios. For example, if the business scenario is a digital collectibles business scenario, the transaction data may be used to indicate the target amount of target resources that need to be transferred between the target object and related objects. Here, the target resources may correspond to the digital collectibles business scenario; for example, the target resources may be digital collectibles. Similarly, if the business scenario is a gaming business scenario, the transaction data may be used to indicate the traceability data of the target resources. Here, the target resources may correspond to the gaming business scenario; for example, the target resources may be game currency.

[0035] It should be understood that for a blockchain node to obtain transaction blocks about a target object, it may specifically include: first, obtaining transaction data about the target object in one or more business scenarios; and then, packaging and processing the transaction data in each business scenario to obtain transaction blocks about the target object.

[0036] In one possible implementation, the blockchain includes sub-chains and a main chain, as detailed above. Figure 2 The blockchain system shown illustrates this. A transaction block can be generated by the main chain node and sent to the sub-chain node after the main chain node receives transaction data from one or more business scenarios. Specifically, this can include: the main chain node receiving a business transaction request submitted by a user, which carries transaction data from one or more business scenarios; then the main chain node sending this request to the sub-chain node; and the sub-chain node retrieving the transaction data from the one or more business scenarios, packaging and processing this data to obtain a transaction block. In another possible implementation, the transaction block is generated by the sub-chain node after receiving transaction data from one or more business scenarios. That is, the sub-chain node can also directly receive transaction data from one or more business scenarios submitted by a user, package this data, and generate a transaction block about the target object.

[0037] S302. Based on the transaction data included in the transaction block, obtain the verification data of the target object; the verification data is stored based on a tree storage structure, which is a Merkle tree-based storage structure. The tree storage structure includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. The storage domain nodes include a first node and a second node.

[0038] The process of obtaining verification data for the target object includes storing data in nodes of a tree-like storage structure to obtain the verification data. The storage of data by blockchain nodes in the tree-like storage structure includes at least one or two of the following steps: The transaction data of the target object is stored in the second node; The state data of the target object is stored in the first node, and the state data of the target object is determined based on the transaction data.

[0039] It should be understood that obtaining the verification data of the target object can include: generating a tree-like storage structure based on the verification data, or updating an existing tree-like storage structure based on the verification data. The updating can include: updating the content stored in the corresponding nodes of the tree-like storage structure, such as performing operations like adding, deleting, or modifying content; the updating also includes: adding, deleting, or modifying existing nodes in the tree-like storage structure.

[0040] In this embodiment, the verification data may include the state data of the target object, which is determined based on transaction data. For example, the transaction data may include the transfer of resources of amount X from object A to object B. Assuming object A is the target object, the state data of object A may be the resource balance in the account corresponding to object A after the transaction is completed (i.e., the amount X is reduced from the original account resources). Assuming object B is the target object, the state data of object B may be the resource balance in the account corresponding to object B after the transaction is completed (i.e., the amount X is increased from the original account resources). Of course, the verification data may also include a Merkle root value determined based on the state data. For example, the Merkle root value may be data obtained by hashing multiple state data.

[0041] It is understood that the tree-like storage structure mentioned in the embodiments of this application can be an improved storage structure based on the Merkle tree storage structure. Please refer to [link to relevant documentation]. Figure 4 , Figure 4 This is a schematic diagram of a Merkle tree storage structure provided in an embodiment of this application. For example... Figure 4 As shown, the storage structure of this Merkle tree includes a root node (hash1234), intermediate nodes (hash12, hash34), and data nodes (hash1, hash2, hash3, hash4). The data stored in the data nodes can be determined based on the data content corresponding to each data node, for example, by performing a hash operation on the data content.

[0042] Next, based on Figure 4 The storage structure of the Merkle tree shown can be extended to obtain, for example... Figure 5For the tree-like storage structure shown, please refer to [link / reference]. Figure 5 , Figure 5 This is a schematic diagram of a tree-like storage structure provided in an embodiment of this application. For example... Figure 5 As shown, this tree-like storage structure includes a root node (hash1234), intermediate nodes (not shown in the diagram), data nodes (Publickey), and storage content nodes associated with the data nodes (Banlance). Each data node corresponds to a target object, storing the target object's public key, a random value (indicating the current position of this transaction data), and a state root (Banlance Root), calculated from the state data (Banlance). Storage content nodes can include a first node and a second node, where the first node is the parent node of the second node. The first node stores the target object's state data (Banlance) and transaction data root (Storage Root), calculated from the transaction data (Storage Content). The second node stores the specific content of the target object's transaction data (Storage Content). In summary, based on... Figure 2 The Merkle tree storage structure shown in this application provides a tree-like storage structure in which corresponding storage domain nodes are added to the data nodes. These storage domain nodes can include a first node and a second node. The first node is used to store state data (such as balance) obtained from multiple transaction data, while the second node is used to store transaction data under various business scenarios. This makes the tree-like storage structure applicable to a variety of business scenarios and improves the universality of blockchain data processing.

[0043] In one possible implementation, the transaction block includes transaction data from one or more business scenarios; a data node is associated with one or more first nodes, and each first node corresponds to a business scenario; each first node is associated with one or more second nodes; wherein, the process of obtaining verification data for the target object includes storing data in nodes of a tree-structured storage structure to obtain the verification data, and the blockchain node storing data in nodes of the tree-structured storage structure includes at least one or two of the following steps: storing the transaction data of the target object in each business scenario in the second nodes respectively, wherein the transaction data of different business scenarios are stored in different second nodes, and the second nodes storing the transaction data of the same business scenario are all associated with the same first node; determining the state data of the target object in each business scenario based on the transaction data of the target object in each business scenario, and storing the state data of different business scenarios in different first nodes.

[0044] For example, combining Figure 5 The tree-structured storage provided in this application will be explained again. Assume the target object is represented as object A, and the corresponding data node can be represented as Publickey A. Data node Publickey A can be associated with k first nodes, where k is a positive integer. The number of k depends on the number of business scenarios. That is, the transaction block of object A can include transaction data from k business scenarios. The number of transaction data in a single business scenario can be p, where p is a positive integer. It should be understood that the number of transaction data in different business scenarios can be the same or different. A first node is used to store the transaction data within the same business scenario. For example, the transaction block of object A includes (transaction data 1, transaction data 2) under business scenario a, (transaction data 3, transaction data 4) under business scenario b, and (transaction data 5, transaction data 6, transaction data 7) under business scenario c. Therefore, data node Publickey A can be associated with three first nodes (first node a, first node b, and first node c). First node a is associated with two second nodes (second node 1 and second node 2); first node b is associated with two second nodes (second node 3 and second node 4); and first node c is associated with three second nodes (second node 5, second node 6, and second node 7). Second node 1 stores transaction data 1, second node 2 stores transaction data 2, second node 3 stores transaction data 3, and so on, with each second node storing transaction data for a specific business scenario.

[0045] In one possible implementation, transaction data is used to indicate the transfer of a target amount of target resources between a target object and an associated object; that is, the transaction data refers to transfer-type transaction data. The target object's data node is associated with at least one first node. The blockchain node stores the target object's state data in the first node, which may include: first, determining the target first node associated with the data node corresponding to the target object in a tree-like storage structure; then, obtaining the updated target state data of the target object based on the target amount; next, storing the target state data in the target first node, the target state data including: state data after increasing resources according to the target amount, or state data after decreasing resources according to the target amount.

[0046] In one possible implementation, the associated data node corresponding to the associated object is determined in the tree storage structure, and the reference first node associated with the associated data node is determined; the updated reference state data of the associated object is obtained according to the target amount; the reference state data is stored in the reference first node, and the reference state data includes: state data after reducing resources according to the target amount, or state data after increasing resources according to the target amount.

[0047] It should be understood that if the state data stored in the first target node corresponding to the target object is the state data after increasing resources according to the target amount, then the state data stored in the first reference node corresponding to the associated object is the state data after decreasing resources according to the target amount; if the state data stored in the first target node corresponding to the target object is the state data after decreasing resources according to the target amount, then the state data stored in the first reference node corresponding to the associated object is the state data after increasing resources according to the target amount.

[0048] In one possible implementation, the blockchain node method further includes performing one or both of the following steps: if the target first node does not exist in the tree storage structure, then add a storage domain node to the tree storage structure and designate the added storage domain node as the target first node; if the reference first node does not exist in the tree storage structure, then add a storage domain node to the tree storage structure and designate the added storage domain node as the reference first node. That is, supporting the addition of a first node to the tree storage structure should be understood as also supporting the addition of a second node to the tree storage structure, and then updating the state data in the corresponding associated first node based on the transaction data stored in the second node in the tree storage structure.

[0049] In this embodiment, the blockchain node can first obtain transaction blocks related to the target object, and then obtain verification data of the target object based on the transaction data included in the transaction blocks. The verification data is stored based on a tree-like storage structure, specifically a Merkle tree-based storage structure, which includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. During the process of obtaining the verification data of the target object, the blockchain node performs at least one or two of the following steps: storing the target object's transaction data in a second node; and storing the target object's state data in a first node, where the target object's state data is determined based on the transaction data. Therefore, the tree-like storage structure used for storing state data in this application is an improvement on the Merkle tree storage structure. Specifically, storage domain nodes are added to the data nodes of the Merkle tree, so that the content of transaction data can be stored in the second node included in the storage domain node, and the content of state data determined by the transaction data can be stored in the first node included in the storage domain node. Due to the addition of storage domain nodes, both transaction data and state data can be stored in the tree-like storage structure, thus making the tree-like storage structure adaptable to the state data storage needs of various business scenarios. In addition, the binary tree structure can be extended to obtain a multi-branch tree-like storage structure, thereby reducing the height of the Merkle tree, reducing the amount of computation, and thus improving verification performance.

[0050] Combination Figure 3 The blockchain data processing method described in this embodiment is applicable to various business scenarios (such as any one or more of the following: digital collectibles, gaming, commodity trading, and intelligent transportation). Next, taking the digital collectibles business scenario as an example, the blockchain data processing method provided in this application embodiment will be further elaborated. Please refer to... Figure 6 , Figure 6 This is a flowchart illustrating another blockchain data processing method provided in an embodiment of this application. This blockchain data processing method can be derived from the above... Figure 2 The blockchain data processing system mentioned is executed by blockchain nodes (e.g., sub-chain nodes). The blockchain data processing method may include the following steps S601-S603: S601: Retrieve transaction blocks related to the target object.

[0051] It should be understood that the blockchain data processing method provided in this application embodiment is applied to the digital collectibles business scenario. The blockchain may include a main chain and sub-chains. The main chain refers to the blockchain that provides basic business services to the sub-chains, and its security can ensure the security of the sub-chains. The sub-chains may refer to blockchains in various business scenarios. Furthermore, the main chain includes one or more main chain nodes, and the sub-chains include one or more sub-chain nodes.

[0052] In one possible implementation, the child chain nodes can obtain transaction data about the target object, and then package the obtained transaction data into a transaction block. In another possible implementation, the main chain nodes can obtain transaction data about the target object, then package the obtained transaction data into a transaction block, and then send the transaction block to the child chain nodes.

[0053] S602: Obtain the transaction instruction information corresponding to the transaction block and send the transaction instruction information to the main chain node. The transaction instruction information is used to trigger the main chain node to update the account status stored in the smart contract and to verify the transaction block.

[0054] In one possible implementation, before the sub-chain node obtains the transaction indication information corresponding to the transaction block, it is also used to perform the following operations: verify the transaction block through a zero-knowledge proof circuit; if the verification is successful, obtain the circuit proof data corresponding to the transaction block; and send the circuit proof data to the main chain node, wherein the circuit proof data is used to trigger the main chain node to verify the transaction block according to the circuit proof data.

[0055] Specifically, after a child chain node obtains a transaction block, it can use a zero-knowledge proof circuit to verify the correctness of the transaction block's state transition process during circuit computation. If the input information of the transaction block conforms to the verification process of the zero-knowledge proof circuit, the zero-knowledge proof circuit can generate proof data (i.e., circuit proof data) for the transaction block and send the proof data to the child chain node.

[0056] In one possible implementation, the process by which a sub-chain node obtains transaction instruction information corresponding to a transaction block may include: analyzing each transaction data in the transaction block, determining the analysis result information corresponding to each transaction data, the analysis result information including any one or more of the following: target object, associated object, resource type of the resource to be transferred, and resource amount of the resource to be transferred; and generating transaction instruction information corresponding to the transaction block based on the analysis result information corresponding to each transaction data.

[0057] Specifically, the analysis results obtained after analyzing each transaction data point refer to the simplified transaction information extracted from the transaction data. For example, if the transaction data is of the transfer type, the simplified transaction information may include: the `from` field (indicating the initiating object of the transfer transaction: the target object), the `to` field (indicating the receiving object of the transfer transaction: the associated object), the `amount` field (indicating the amount of resources to be transferred), and the `tokenId` field (indicating the type of resources to be transferred), etc. The signature, block height, and transaction hash of the transaction block do not need to be submitted to the main chain node; therefore, the transaction indication information corresponding to the transaction block mentioned here refers to the simplified transaction information. Finally, the transaction indication information corresponding to the transaction block can be obtained from the simplified transaction information (from, to, tokenId, amount) of each transaction data point. Specifically, the simplified transaction information of each transaction data point can be combined to form the transaction indication information corresponding to the transaction block. For example, if a transaction block includes transaction data 1, transaction data 2, and transaction data 3, then the simplified transaction information 1 (analysis result information 1) obtained after analyzing transaction data 1 can be represented as: (from-1, to-1, tokenId-1, amount-1); the simplified transaction information 2 (analysis result information 2) obtained after analyzing transaction data 2 can be represented as: (from-2, to-2, tokenId-2, amount-2); and the simplified transaction information 3 (analysis result information 3) obtained after analyzing transaction data 3 can be represented as: (from-3, to-3, tokenId-3, amount-3). Finally, the transaction indication information of this transaction block can be represented as shown in Table 2 below: Table 2. Transaction Instruction Information for Transaction Blocks

[0058] Based on this approach, subchain nodes can extract concise transaction information from each transaction block and send the extracted transaction instructions to the main chain node. This eliminates the need to submit all the data in the entire transaction block to the main chain node, thereby improving efficiency in data processing and reducing transmission bandwidth.

[0059] Finally, the child chain nodes can package the transaction instruction information and circuit proof data corresponding to the transaction block and send them to the main chain nodes. The main chain nodes can then verify and process the transaction blocks based on the circuit proof data, and can also update the account status stored in the smart contract based on the transaction instruction information.

[0060] S603: Once it is determined that the main chain node has verified the transaction block, the execution is triggered to obtain the verification data of the target object based on the transaction data included in the transaction block.

[0061] In one possible implementation, the child chain node receives a state update notification message from the main chain node. This message is generated by the main chain node after verifying the transaction block based on the circuit proof data. Specifically, the state update notification message indicates to the main chain node that the transaction block has been verified. The circuit proof data is used to verify the security and legitimacy of the transaction block.

[0062] Specifically, when a child chain node receives a status update notification message from the main chain node, the child chain node determines that the main chain node has verified the transaction block and triggers the child chain node to execute the verification data of the target object based on the transaction data included in the transaction block.

[0063] It should be noted that the detailed process by which the child chain node obtains the verification data of the target object can be found in [reference needed]. Figure 3 The specific process described in step S302 of the embodiments will not be repeated here.

[0064] In this embodiment, by adding storage domain nodes to the data nodes of the Merkle tree, the tree-like storage structure can adapt to the storage requirements of state data in different sub-chains. Furthermore, by designing a multi-branched Merkle tree storage structure, the height of the Merkle tree is reduced, and the length of the Merkle tree verification path is shortened, thereby improving the verification performance of the Merkle tree.

[0065] Next, taking the digital collectibles business scenario as an example, the blockchain data processing method provided above in this application will be described again. Please refer to... Figure 7 , Figure 7This is a schematic diagram illustrating a scenario of a blockchain data processing method provided in an embodiment of this application. For example... Figure 7 As shown, this business scenario can be a digital collectibles business scenario, where the transaction data of the target object is generated based on the digital collectibles protocol.

[0066] in, Figure 7 The digital collectibles business scenario in this embodiment involves data interaction between sub-chain nodes and main chain nodes. Next, please refer to... Figure 8 , Figure 8 This is an interactive flowchart of a blockchain data processing method provided in an embodiment of this application. Figure 8 As shown, this interaction flowchart can be executed jointly by the main chain node and the child chain node, and may specifically include steps S801-S808: S801: The main chain node receives the transaction request submitted by the target object.

[0067] Users can submit transaction requests to the main chain nodes. These requests can be transfer-type transactions and may include one or more transaction data related to the target object.

[0068] S802: The main chain node responds to the transaction request.

[0069] The main chain node can obtain the target object's identity information and then verify the target object's identity based on that information. If the target object's identity verification passes, it can respond to the transaction request and obtain one or more transaction data related to the target object.

[0070] S803: The main chain node sends transaction data about the target object to the child chain node.

[0071] For example, such as Figure 7 As shown, the transaction data may specifically include order1: token1 A->B 1; order2: token2 A->C 10.

[0072] S804: Subchain nodes generate transaction blocks about the target object.

[0073] Specifically, a subchain node can obtain one or more transaction data about a target object, and can package them sequentially according to the generation timestamp of each transaction data to obtain a transaction block about the target object.

[0074] S805: Subchain nodes obtain transaction instruction information for transaction blocks.

[0075] In one possible implementation, the sub-chain node obtains the transaction instruction information corresponding to the transaction block, which may include: analyzing each transaction data in the transaction block, determining the analysis result information corresponding to each transaction data, the analysis result information including any one or more of the following: target object, associated object, resource type of the resource to be transferred, and resource amount of the resource to be transferred; and generating the transaction instruction information corresponding to the transaction block based on the analysis result information corresponding to each transaction data.

[0076] It should be noted that the detailed process of how child chain nodes obtain transaction instruction information from transaction blocks can be found in the above description. Figure 6 The specific steps described in step S602 of the embodiments will not be repeated here.

[0077] In one possible implementation, the sub-chain node can also verify the transaction block through a zero-knowledge proof circuit. If the verification is successful, it obtains the circuit proof data corresponding to the transaction block and sends the circuit proof data to the main chain node.

[0078] S806: Main chain node verifies transaction blocks.

[0079] The main chain nodes can update the account states stored in the smart contract based on transaction instruction information. The smart contract stores at least one contract account and at least one account state associated with each contract account; each contract account corresponds to a transaction object, which may include a target object or an associated object. The main chain nodes update the account states stored in the smart contract by: updating the account state of the contract account corresponding to each target object and updating the account state of the contract account corresponding to each associated object based on the analysis results of each transaction data in the transaction instruction information.

[0080] like Figure 7 As shown, the smart contract can store various types of resources in the target object's account before the update. Different types of resources can be represented as token1, token2, etc.; as well as the resource balance corresponding to each type of resource. The data stored in the smart contract before the update is shown in Table 3 below: Table 3. Smart Contracts Before Update

[0081] Here, account A, account B, account C, and account D each correspond to a contract account. The account status associated with each contract account can include the balance of various resources. For example, the account status associated with contract account A includes a balance of 1 for token1 and a balance of 10 for token2. The transaction indication information in the transaction block can be used to indicate the simplified transaction information (from, to, tokenId, amount) corresponding to each transaction data. For a detailed description of the simplified transaction information, please refer to [link / reference]. Figure 6 The detailed description of step S602 in the embodiment will not be repeated here. Next, after the main chain node performs state change processing on the smart contract according to the transaction instruction information, the updated smart contract storage data is shown in Table 4 below: Table 4. Updated Smart Contracts

[0082] S807: The main chain node sends a status update notification message to the child chain node.

[0083] Next, after completing the state change processing of the smart contract, the main chain node can also verify the transaction block based on the circuit proof data. If the verification is successful, a state update notification message can be generated and sent to the child chain node.

[0084] S808: Subchain nodes obtain verification data for the target object based on the transaction data included in the transaction block.

[0085] It should be noted that the detailed process by which the child chain node obtains the verification data of the target object can be found in [reference needed]. Figure 3 The specific process described in step S302 of the embodiments will not be repeated here.

[0086] For example, such as Figure 7 As shown, the verification data is stored based on a tree-like storage structure, specifically a Merkle tree-based structure. This structure includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. Each storage domain node includes a first node and a second node. Figure 7In the tree-like storage structure before the state change shown, Account A, Account B, Account C, and Account D can each correspond to a data node. It should be understood that a data node is associated with a target object. Taking Account A as an example, order1 and order2 are two transaction orders (transaction data) about the target object. These two transaction data can be stored in different second nodes. In addition, since the resource types corresponding to these two transaction data are different, namely resource token1 and resource token2, the state data corresponding to resource token1 and the state data corresponding to resource token2 can be stored in different first nodes.

[0087] Next, based on transaction data order1: token1 A->B 1; and transaction data order2: token2 A->C 10, the verification data of the target object is obtained. The process of obtaining the verification data is actually the process of updating the tree-structured storage. Specifically, the update process includes: for transaction data order1: token1 A->B 1, decreasing the balance of the first node token1 corresponding to data node Account A by 1, so the updated balance of the first node token1 is 0; and adding the first node token1 to data node Account B, and increasing the balance of the first node token1 associated with data node Account B to 1. Similarly, for transaction data order2: token2 A->C 10, decreasing the balance of the first node token2 corresponding to data node Account A by 10, so the updated balance of the first node token2 is 0; and adding the first node token2 to data node Account C, and increasing the balance of the first node token2 associated with data node Account C to 10.

[0088] In this embodiment, adding storage domain nodes to data nodes in a tree-like storage structure allows for the construction of a multi-branch Merkle tree storage structure. Since each data node can be associated with two or more storage domain nodes, compared to a traditional Merkle tree storage structure (i.e., a binary tree storage structure), this embodiment can reduce the height of the Merkle tree and shorten the length of the Merkle tree verification path, thereby improving the verification performance of the Merkle tree. This makes the tree-like storage structure adaptable to the state data storage needs of multiple service scenarios in subchains.

[0089] Please see Figure 9 , Figure 9This is a schematic diagram of the structure of a blockchain data processing device provided in an embodiment of this application. Figure 9 As shown, the blockchain data processing device 900 can be applied to the blockchain nodes mentioned in the foregoing embodiments. The blockchain data processing device 900 can be a computer program (including program code) running on a computer device; for example, the blockchain data processing device 900 is an application software. The blockchain data processing device 900 can be used to execute corresponding steps in the blockchain data processing method provided in the embodiments of this application. The blockchain data processing device 900 includes: Acquisition unit 901 is used to acquire transaction blocks related to the target object; Processing unit 902 is used to obtain verification data of the target object based on the transaction data included in the transaction block; the verification data is stored based on a tree storage structure, which is a Merkle tree-based storage structure. The tree storage structure includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. The storage domain nodes include a first node and a second node. The process of obtaining verification data for the target object includes storing data in nodes of a tree-like storage structure to obtain the verification data. The storage of data by blockchain nodes in the tree-like storage structure includes at least one or two of the following steps: The transaction data of the target object is stored in the second node; The state data of the target object is stored in the first node, and the state data of the target object is determined based on the transaction data.

[0090] In one possible implementation, the transaction block includes transaction data from one or more business scenarios; a data node is associated with one or more first nodes, and a first node corresponds to a business scenario; a first node is associated with one or more second nodes; The process of obtaining verification data for the target object includes storing data in nodes of a tree-like storage structure to obtain the verification data. The processing unit 902 stores data in nodes of the tree-like storage structure by performing at least one or two of the following steps: The transaction data of the target object under each business scenario is stored in the second node respectively. The transaction data of different business scenarios are stored in different second nodes, and the second nodes storing the transaction data of the same business scenario are all associated with the same first node. Based on the transaction data of the target object in various business scenarios, determine the status data of the target object in each business scenario, and store the status data of different business scenarios in different first nodes.

[0091] In one possible implementation, transaction data is used to indicate the transfer of a target amount of target resources between a target object and an associated object; the data node is associated with at least one first node; the processing unit 902 stores the state data of the target object in the first node for performing the following operations: In the tree-structured storage, determine the first target node associated with the data node corresponding to the target object; Based on the target amount, obtain the updated status data of the target object; The updated status data is stored in the first node of the target. The updated status data includes: status data after increasing resources for the target object according to the target amount, or status data after decreasing resources for the target object according to the target amount.

[0092] In one possible implementation, the processing unit 902 is further configured to perform the following operations: In the tree-structured storage, determine the associated data node corresponding to the associated object, and determine the reference first node associated with the associated data node; Based on the target amount, obtain the updated status data of the associated objects; The updated status data is stored in the reference first node. The reference status data includes: status data after reducing resources for associated objects according to the target amount, or status data after increasing resources for associated objects according to the target amount.

[0093] In one possible implementation, the processing unit 902 is further configured to perform one or two of the following steps: If the target first node does not exist in the tree storage structure, a storage domain node is added to the tree storage structure, and the added storage domain node is determined as the target first node. If there is no reference first node in the tree storage structure, then add a storage domain node in the tree storage structure and determine the added storage domain node as the reference first node.

[0094] In one possible implementation, before processing unit 902 obtains the verification data of the target object based on the transaction data included in the transaction block, it is further configured to perform the following steps: Obtain the transaction instruction information corresponding to the transaction block and send the transaction instruction information to the main chain node. The transaction instruction information is used to trigger the main chain node to update the account status stored in the smart contract and to verify the transaction block. Once the main chain node verifies the transaction block, it triggers the execution of obtaining the verification data of the target object based on the transaction data included in the transaction block.

[0095] In one possible implementation, before obtaining the transaction indication information corresponding to the transaction block, the processing unit 902 is further configured to perform the following steps: The transaction block is verified using a zero-knowledge proof circuit. If the verification passes, the circuit proof data corresponding to the transaction block is obtained. The circuit proof data is sent to the main chain node, whereby the circuit proof data is used to trigger the main chain node to verify the transaction block based on the circuit proof data.

[0096] In one possible implementation, the processing unit 902 is further configured to perform the following steps: Receive state update notification messages sent by the main chain node. The state update notification message is generated by the main chain node after the transaction block has been verified and approved based on the circuit proof data. Among them, the status update notification message is used to instruct the main chain nodes to verify the transaction block.

[0097] In one possible implementation, the acquisition unit 901 acquires the transaction instruction information corresponding to the transaction block, and uses it to perform the following steps: Analyze each transaction data in the transaction block and determine the analysis result information corresponding to each transaction data. The analysis result information includes one or more of the following: target object, associated object, resource type of the resource to be transferred, and resource amount of the resource to be transferred. Based on the analysis results of each transaction, transaction instruction information corresponding to the transaction block is generated.

[0098] In one possible implementation, transaction blocks are generated by the main chain node and sent to the child chain nodes after the main chain node receives transaction data from one or more business scenarios; or, A transaction block is generated by a subchain node after receiving transaction data from one or more business scenarios.

[0099] In one possible implementation, the smart contract stores at least one contract account and at least one account state associated with each contract account; wherein, one contract account corresponds to one transaction object, and the transaction object includes a target object or an associated object; The main chain nodes update the account status stored in the smart contract, including: Based on the analysis results of each transaction data in the transaction instruction information, update the account status of the contract account corresponding to each target object, and update the account status of the contract account corresponding to each associated object.

[0100] In this embodiment, the blockchain node can first obtain transaction blocks related to the target object, and then obtain verification data of the target object based on the transaction data included in the transaction blocks. The verification data is stored based on a tree-like storage structure, specifically a Merkle tree-based storage structure, which includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. During the process of obtaining the verification data of the target object, the blockchain node performs at least one or two of the following steps: storing the target object's transaction data in a second node; and storing the target object's state data in a first node, where the target object's state data is determined based on the transaction data. Therefore, the tree-like storage structure used for storing state data in this application is an improvement on the Merkle tree storage structure. Specifically, storage domain nodes are added to the data nodes of the Merkle tree, so that the content of transaction data can be stored in the second node included in the storage domain node, and the content of state data determined by the transaction data can be stored in the first node included in the storage domain node. Due to the addition of storage domain nodes, both transaction data and state data can be stored in the tree-like storage structure, thus making the tree-like storage structure adaptable to the state data storage needs of various business scenarios. In addition, the binary tree structure can be extended to obtain a multi-branch tree-like storage structure, thereby reducing the height of the Merkle tree, reducing the amount of computation, and thus improving verification performance.

[0101] Please see Figure 10 , Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 1000 is used to execute the steps performed by the blockchain node in the aforementioned method embodiment. The computer device 1000 includes: one or more processors 1010; one or more input devices 1020; one or more output devices 1030; and a memory 1040. The processors 1010, input devices 1020, output devices 1030, and memory 1040 are connected via a bus 1050. The memory 1040 is used to store a computer program, which includes program instructions. The processor 1010 is used to call the program instructions stored in the memory 1040 to perform the following operations: Retrieve transaction blocks related to the target object; Based on the transaction data included in the transaction block, the verification data of the target object is obtained; the verification data is stored based on a tree storage structure, which is a Merkle tree-based storage structure. The tree storage structure includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. The storage domain nodes include the first node and the second node. The process of obtaining verification data for the target object includes storing data in nodes of a tree-like storage structure to obtain the verification data. The storage of data by blockchain nodes in the tree-like storage structure includes at least one or two of the following steps: The transaction data of the target object is stored in the second node; The state data of the target object is stored in the first node, and the state data of the target object is determined based on the transaction data.

[0102] In one possible implementation, the transaction block includes transaction data from one or more business scenarios; a data node is associated with one or more first nodes, and a first node corresponds to a business scenario; a first node is associated with one or more second nodes; The process of obtaining verification data for the target object includes storing data in nodes of a tree-like storage structure to obtain the verification data. The processor 1010 storing data in the nodes of the tree-like storage structure includes at least one or two of the following steps: The transaction data of the target object under each business scenario is stored in the second node respectively. The transaction data of different business scenarios are stored in different second nodes, and the second nodes storing the transaction data of the same business scenario are all associated with the same first node. Based on the transaction data of the target object in various business scenarios, determine the status data of the target object in each business scenario, and store the status data of different business scenarios in different first nodes.

[0103] In one possible implementation, transaction data is used to indicate the transfer of a target amount of target resources between a target object and an associated object; the data node is associated with at least one first node; the processor 1010 stores the state data of the target object in the first node for performing the following operations: In the tree-structured storage, determine the first target node associated with the data node corresponding to the target object; Based on the target amount, obtain the updated status data of the target object; The updated status data is stored in the first node of the target. The updated status data includes: status data after increasing resources for the target object according to the target amount, or status data after decreasing resources for the target object according to the target amount.

[0104] In one possible implementation, the processor 1010 is also used to perform the following operations: In the tree-structured storage, determine the associated data node corresponding to the associated object, and determine the reference first node associated with the associated data node; Based on the target amount, obtain the updated status data of the associated objects; The updated status data is stored in the reference first node. The reference status data includes: status data after reducing resources for associated objects according to the target amount, or status data after increasing resources for associated objects according to the target amount.

[0105] In one possible implementation, the processor 1010 is also used to perform one or two of the following steps: If the target first node does not exist in the tree storage structure, a storage domain node is added to the tree storage structure, and the added storage domain node is determined as the target first node. If there is no reference first node in the tree storage structure, then add a storage domain node in the tree storage structure and determine the added storage domain node as the reference first node.

[0106] In one possible implementation, before the processor 1010 obtains the verification data of the target object based on the transaction data included in the transaction block, it is also used to perform the following steps: Obtain the transaction instruction information corresponding to the transaction block and send the transaction instruction information to the main chain node. The transaction instruction information is used to trigger the main chain node to update the account status stored in the smart contract and to verify the transaction block. Once the main chain node verifies the transaction block, it triggers the execution of obtaining the verification data of the target object based on the transaction data included in the transaction block.

[0107] In one possible implementation, before obtaining the transaction indication information corresponding to the transaction block, the processing unit 902 is further configured to perform the following steps: The transaction block is verified using a zero-knowledge proof circuit. If the verification passes, the circuit proof data corresponding to the transaction block is obtained. The circuit proof data is sent to the main chain node, whereby the circuit proof data is used to trigger the main chain node to verify the transaction block based on the circuit proof data.

[0108] In one possible implementation, the processor 1010 is also used to perform the following steps: Receive state update notification messages sent by the main chain node. The state update notification message is generated by the main chain node after the transaction block has been verified and approved based on the circuit proof data. Among them, the status update notification message is used to instruct the main chain nodes to verify the transaction block.

[0109] In one possible implementation, the processor 1010 obtains the transaction instruction information corresponding to the transaction block, and uses it to perform the following steps: Analyze each transaction data in the transaction block and determine the analysis result information corresponding to each transaction data. The analysis result information includes one or more of the following: target object, associated object, resource type of the resource to be transferred, and resource amount of the resource to be transferred. Based on the analysis results of each transaction, transaction instruction information corresponding to the transaction block is generated.

[0110] In one possible implementation, transaction blocks are generated by the main chain node and sent to the child chain nodes after the main chain node receives transaction data from one or more business scenarios; or, A transaction block is generated by a subchain node after receiving transaction data from one or more business scenarios.

[0111] In one possible implementation, the smart contract stores at least one contract account and at least one account state associated with each contract account; wherein, one contract account corresponds to one transaction object, and the transaction object includes a target object or an associated object; The main chain nodes update the account status stored in the smart contract, including: Based on the analysis results of each transaction data in the transaction instruction information, update the account status of the contract account corresponding to each target object, and update the account status of the contract account corresponding to each associated object.

[0112] In this embodiment, the blockchain node can first obtain transaction blocks related to the target object, and then obtain verification data of the target object based on the transaction data included in the transaction blocks. The verification data is stored based on a tree-like storage structure, specifically a Merkle tree-based storage structure, which includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. During the process of obtaining the verification data of the target object, the blockchain node performs at least one or two of the following steps: storing the target object's transaction data in a second node; and storing the target object's state data in a first node, where the target object's state data is determined based on the transaction data. Therefore, the tree-like storage structure used for storing state data in this application is an improvement on the Merkle tree storage structure. Specifically, storage domain nodes are added to the data nodes of the Merkle tree, so that the content of transaction data can be stored in the second node included in the storage domain node, and the content of state data determined by the transaction data can be stored in the first node included in the storage domain node. Due to the addition of storage domain nodes, both transaction data and state data can be stored in the tree-like storage structure, thus making the tree-like storage structure adaptable to the state data storage needs of various business scenarios. In addition, the binary tree structure can be extended to obtain a multi-branch tree-like storage structure, thereby reducing the height of the Merkle tree, reducing the amount of computation, and thus improving verification performance.

[0113] Furthermore, it should be noted that this application also provides a computer storage medium storing a computer program, which includes program instructions. When the processor executes these program instructions, it can perform the methods described in the preceding embodiments. Therefore, further details will not be provided here. For technical details not disclosed in the embodiments of the computer storage medium involved in this application, please refer to the description of the method embodiments of this application. As an example, the program instructions can be deployed on a computer device, executed on multiple computer devices located in one location, or executed on multiple computer devices distributed in multiple locations and interconnected through a communication network.

[0114] According to one aspect of this application, a computer program product or computer program is provided, comprising 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 methods described in the preceding embodiments; therefore, further details will not be provided here.

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

[0116] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A blockchain data processing method, characterized in that, Applied to blockchain nodes, the method includes: Retrieve transaction blocks related to the target object; Based on the transaction data included in the transaction block, the verification data of the target object is obtained. The transaction block includes transaction data from one or more business scenarios. The verification data is stored based on a tree-like storage structure, which is a Merkle tree-based storage structure. The tree-like storage structure includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. The storage domain nodes include first nodes and second nodes. One data node is associated with one or more first nodes. One first node corresponds to one business scenario, and one first node is associated with one or more second nodes. The process of obtaining the verification data of the target object includes storing data in the nodes of the tree-like storage structure to obtain the verification data. The blockchain node storing data in the nodes of the tree-like storage structure includes at least one or two of the following steps: The transaction data of the target object in each business scenario is stored in the second node respectively. Different transaction data in the same business scenario are stored in different second nodes, and the second nodes storing transaction data in the same business scenario are all associated with the same first node. The state data of the target object in each business scenario is stored in the first node respectively, and the state data of different business scenarios are stored in different first nodes. The state data of the target object in each business scenario is determined based on the transaction data of the target object in each business scenario.

2. The method as described in claim 1, characterized in that, The transaction data is used to indicate the transfer of a target amount of target resources between the target object and the associated object; The data node is associated with at least one first node; The step of storing the state data of the target object in the first node includes: In the tree-like storage structure, determine the target first node associated with the data node corresponding to the target object; Based on the target amount, the updated status data of the target object is obtained; The updated state data is stored in the target first node. The updated state data includes: state data after increasing resources for the target object according to the target amount, or state data after decreasing resources for the target object according to the target amount.

3. The method as described in claim 2, characterized in that, The method further includes: In the tree-like storage structure, determine the associated data node corresponding to the associated object, and determine the reference first node associated with the associated data node; Based on the target amount, the updated reference status data of the associated object is obtained; The updated reference state data is stored in the first reference node. The reference state data includes: state data after reducing resources for the associated object according to the target amount, or state data after increasing resources for the associated object according to the target amount.

4. The method as described in claim 3, characterized in that, The method further includes one or two of the following steps: If the target first node does not exist in the tree storage structure, then a storage domain node is added to the tree storage structure, and the added storage domain node is determined as the target first node; If the reference first node does not exist in the tree storage structure, a storage domain node is added to the tree storage structure, and the added storage domain node is determined as the reference first node.

5. The method as described in claim 1, characterized in that, Before obtaining the verification data of the target object based on the transaction data included in the transaction block, the method further includes: Obtain the transaction instruction information corresponding to the transaction block and send the transaction instruction information to the main chain node. The transaction instruction information is used to trigger the main chain node to update the account status stored in the smart contract and to verify the transaction block. Once it is determined that the main chain node has verified the transaction block, the execution of obtaining the verification data of the target object based on the transaction data included in the transaction block is triggered.

6. The method as described in claim 5, characterized in that, Before obtaining the transaction instruction information corresponding to the transaction block, the method further includes: The transaction block is verified using a zero-knowledge proof circuit. If the verification passes, the circuit proof data corresponding to the transaction block is obtained. The circuit proof data is sent to the main chain node, wherein the circuit proof data is used to trigger the main chain node to verify the transaction block based on the circuit proof data.

7. The method as described in claim 6, characterized in that, The method further includes: Receive a status update notification message sent by the main chain node, wherein the status update notification message is generated by the main chain node after verifying the transaction block based on the circuit proof data; The status update notification message is used to instruct the main chain node to verify the transaction block.

8. The method as described in claim 5, characterized in that, The step of obtaining the transaction instruction information corresponding to the transaction block includes: Analyze each transaction data in the transaction block and determine the analysis result information corresponding to each transaction data. The analysis result information includes any one or more of the following: target object, associated object, resource type of the resource to be transferred, and resource amount of the resource to be transferred. Based on the analysis results of each transaction data, transaction instruction information corresponding to the transaction block is generated.

9. The method as described in claim 5, characterized in that, The transaction block is generated by the main chain node and sent to the sub-chain node after the main chain node receives transaction data from one or more business scenarios; or, The transaction block is generated by the sub-chain node after receiving transaction data from one or more business scenarios.

10. The method as described in claim 8, characterized in that, The smart contract stores at least one contract account and at least one account status associated with each contract account; wherein, one contract account corresponds to one transaction object, and the transaction object includes a target object or an associated object; Specifically, the main chain node updates the account status stored in the smart contract, including: Based on the analysis results of each transaction data in the transaction instruction information, update the account status of the contract account corresponding to each target object, and update the account status of the contract account corresponding to each associated object.

11. A blockchain data processing device, characterized in that, The device, applied to a blockchain node, includes: The acquisition unit is used to acquire transaction blocks related to the target object; The processing unit is configured to obtain verification data of the target object based on the transaction data included in the transaction block. The transaction block includes transaction data from one or more business scenarios. The verification data is stored based on a tree-like storage structure, which is a Merkle tree-based storage structure. The tree-like storage structure includes a root node, intermediate nodes, data nodes, and storage domain nodes associated with the data nodes. The storage domain nodes include first nodes and second nodes. One data node is associated with one or more first nodes. One first node corresponds to one business scenario, and one first node is associated with one or more second nodes. The process of obtaining the verification data of the target object includes storing data in the nodes of the tree-like storage structure to obtain the verification data. The blockchain node storing data in the nodes of the tree-like storage structure includes at least one or two of the following steps: The transaction data of the target object in each business scenario is stored in the second node respectively. Different transaction data in the same business scenario are stored in different second nodes, and the second nodes storing transaction data in the same business scenario are all associated with the same first node. The state data of the target object in each business scenario is stored in the first node respectively, and the state data of different business scenarios are stored in different first nodes. The state data of the target object in each business scenario is determined based on the transaction data of the target object in each business scenario.

12. A computer device, characterized in that, include: Storage devices and processors; A memory, wherein one or more computer programs are stored; A processor for loading one or more computer programs to implement the blockchain data processing method as described in any one of claims 1-10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program adapted to be loaded by a processor and executed as described in any one of claims 1-10.

14. A computer program product, characterized in that, The computer program product includes a computer program adapted to be loaded by a processor and execute the blockchain data processing method as described in any one of claims 1-10.

Citation Information

Patent Citations

  • Method and device for updating state Merkle tree

    CN110688377A

  • Decentralized private data access and verification scheme

    CN112685791A