A data verification method, device, computer device, and storage medium

By determining the distinction between intermediate nodes and target fill nodes in the Merkel tree, using the summary information of these nodes to verify the effectiveness of the nodes to be verified, the problem of inefficient data verification in traditional Merkel tree is solved, and more efficient and accurate data verification is achieved.

CN115794825BActive Publication Date: 2025-07-01BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211519426.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2025-07-01
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

Traditional Merkel trees have redundant node calculations and frequent random I/O operations during data verification, resulting in inefficient data verification.

Method used

By obtaining the set of root sets to be verified and the set of target root sets of target nodes to be verified, distinguishing between intermediate nodes and target fill nodes, and using the summary information of these nodes to be verified.

Benefits of technology

It improves the efficiency of data verification, avoids frequent random I/O operations, and improves the accuracy of verification results through two verifications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115794825B_ABST
    Figure CN115794825B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data verification method, apparatus, computer device, and storage medium. Among them, the method includes: obtaining a set of to-be-verified root sets of to-be-verified nodes and a set of target root sets of target nodes of a constructed node tree; determining, from first intermediate nodes of the set of target root sets, nodes that do not exist in the set of to-be-verified root sets as different intermediate nodes, and determining, according to the different intermediate nodes and the set of to-be-verified root sets, target filling nodes required for constructing the different intermediate nodes by using the set of to-be-verified root sets; determining a verification result of the to-be-verified nodes based on first digest information of the target filling nodes, second digest information of the different intermediate nodes, and root digest information corresponding to the target nodes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of blockchain technology, and in particular, to a data verification method, apparatus, computer device, and storage medium. Background Art

[0002] A trusted relational database, also known as a ledger database, a blockchain database, etc., is a database in which a ledger server manages various transaction data from clients. The trusted relational database usually stores data in the structure of a node tree (such as a Merkle tree), so that the stored data has excellent characteristics such as decentralization and encryption.

[0003] However, due to the calculation of redundant nodes in the traditional Merkle tree, when verifying the data stored in the structure of the Merkle tree, it is necessary to frequently perform random input / output (I / O) reads, which affects the efficiency of data verification. Therefore, how to improve the efficiency of data verification has become an urgent problem to be solved. Summary of the Invention

[0004] The embodiments of the present disclosure at least provide a data verification method, apparatus, computer device, and storage medium.

[0005] In a first aspect, the embodiments of the present disclosure provide a data verification method, including:

[0006] Obtaining a set of root sets to be verified of nodes to be verified and a set of target root sets of target nodes of a constructed node tree; leaf nodes in the node tree are used to represent summary information of stored data, and other nodes in the node tree are generated according to the summary information represented by the leaf nodes; the target nodes are the latest generated leaf nodes in the node tree; the set of root sets to be verified is used to represent root nodes of the nodes to be verified, including at least the nodes to be verified; the set of target root sets is used to represent root nodes of the target nodes, including at least the target nodes and / or first intermediate nodes generated according to the target nodes;

[0007] Determining, from the first intermediate nodes in the set of target root sets, nodes that do not exist in the set of root sets to be verified as different intermediate nodes, and determining target filling nodes required to construct the different intermediate nodes by using the set of root sets to be verified according to the different intermediate nodes and the set of root sets to be verified;

[0008] Determining a verification result of the nodes to be verified based on first summary information of the target filling nodes, second summary information of the different intermediate nodes, and root summary information corresponding to the target nodes.

[0009] In a possible implementation, when the target node number of the node to be verified is odd and greater than the preset number, the set of roots to be verified at least includes the node to be verified and at least one second intermediate node of the intermediate node type generated according to the node to be verified; or,

[0010] When the target node number of the node to be verified is even, the set of roots to be verified at least includes the node to be verified and the previous node of the node to be verified; the previous node is adjacent to the node to be verified and the node number is less than the target node number.

[0011] In a possible implementation, determining, from the first intermediate nodes of the target set of roots, the nodes that do not exist in the set of roots to be verified as the differential intermediate nodes includes:

[0012] Screening out the second intermediate nodes of the intermediate node type from the set of roots to be verified;

[0013] Extracting first nodes to be compared from the first intermediate nodes and second nodes to be compared from the second intermediate nodes in ascending order of node numbers;

[0014] Determining whether the currently extracted first node to be compared and the second node to be compared are the same;

[0015] If so, return to the step of extracting first nodes to be compared from the first intermediate nodes and second nodes to be compared from the second intermediate nodes in ascending order of node numbers until it is determined that the currently extracted first node to be compared and second node to be compared are not the same, and use this first node to be compared as the differential intermediate node.

[0016] In a possible implementation, determining, according to the differential intermediate node and the set of roots to be verified, the target filling nodes required to construct the differential intermediate node by using the set of roots to be verified includes:

[0017] Screening out third intermediate nodes with node numbers greater than the node number of the target second node to be compared from the second intermediate nodes included in the set of roots to be verified; the target second node to be compared is the second node to be compared for consistency comparison with the differential intermediate node;

[0018] Determining an intermediate set of roots based on each leaf node of the leaf node type and the third intermediate node in the set of roots to be verified;

[0019] When it is determined that the node level structure corresponding to the intermediate root set does not match the preset level structure according to the node levels corresponding to the respective nodes in the intermediate root set, the target filling node is determined based on the to-be-supplemented level corresponding to the intermediate root set and the intermediate root set.

[0020] In a possible implementation manner, the determining the target filling node based on the to-be-supplemented level corresponding to the intermediate root set and the intermediate root set includes:

[0021] For any to-be-supplemented level, it is determined whether the initial node for determining the initial filling node located in the to-be-supplemented level is a leaf node in the intermediate root set; the initial node is located in the level below the to-be-supplemented level.

[0022] If so, a first target serial number is determined according to the serial number of the parent node of the initial node and a preset increment value, and the node corresponding to the first target serial number is used as the initial filling node located in the to-be-supplemented level.

[0023] The target filling node is determined according to the initial filling node.

[0024] In a possible implementation manner, the method further includes:

[0025] When the initial node does not belong to the leaf nodes in the intermediate root set, it is determined whether the initial node is other nodes in the intermediate root set;

[0026] If so, the serial number of the sibling node of the initial node is determined according to the node level and serial number of the initial node;

[0027] The serial number of the parent node of the sibling node is determined according to the serial number of the sibling node and the preset increment value, and a second target serial number is determined according to the serial number of this parent node and the node level of the initial node;

[0028] The node corresponding to the second target serial number is used as the initial filling node located in the to-be-supplemented level

[0029] In a possible implementation manner, the method further includes:

[0030] When it is determined that the initial node does not belong to other nodes in the intermediate root set, a third target serial number is determined according to the serial number of the parent node of the initial node and the node level of the initial node, and the node corresponding to the third target serial number is used as the initial filling node located in the to-be-supplemented level.

[0031] In a possible implementation manner, determining the target filling node according to the initial filling node includes:

[0032] Determine whether the target root node determined according to the initial filling node and each node in the intermediate root set is equal to the different intermediate node;

[0033] If not, determine the sibling node of the target root node, and use this sibling node as the new initial filling node;

[0034] Return to the step of determining whether the target root node determined according to the initial filling node and each node in the intermediate root set is equal to the different intermediate node, until the currently determined target root node is equal to the different intermediate node, and use each of the currently determined initial filling nodes as the target filling node.

[0035] In a possible implementation manner, determining the verification result of the node to be verified based on the first summary information of the target filling node, the second summary information of the different intermediate node, and the root summary information corresponding to the target node includes:

[0036] Use the currently determined target filling node and the intermediate root set to replace the target root set to obtain a replaced root set;

[0037] Calculate the first target summary information based on the first summary information of the target filling node and the third summary information of each node in the intermediate root set;

[0038] Determine the second target summary information according to the fourth summary information of each node in the replaced root set;

[0039] When the first target summary information is equal to the second summary information of the different intermediate node and the second target summary information is equal to the root summary information, determine that the verification of the node to be verified passes.

[0040] In a second aspect, an embodiment of the present disclosure further provides a data verification device, including:

[0041] An acquisition module, configured to acquire a set of to-be-verified root sets of nodes to be verified and a set of target root sets of target nodes of a constructed node tree; a leaf node in the node tree is used to represent summary information of stored data, and other nodes in the node tree are generated according to the summary information represented by the leaf nodes; the target node is the latest generated leaf node in the node tree; the set of to-be-verified root sets is used to represent root nodes of the nodes to be verified, and at least includes the nodes to be verified; the set of target root sets is used to represent root nodes of the target nodes, and at least includes the target nodes and / or first intermediate nodes generated according to the target nodes;

[0042] A first determination module, configured to determine, from the first intermediate nodes in the set of target root sets, nodes that do not exist in the set of to-be-verified root sets as differential intermediate nodes, and determine, according to the differential intermediate nodes and the set of to-be-verified root sets, target filling nodes required to fill the differential intermediate nodes when constructing the differential intermediate nodes by using the set of to-be-verified root sets;

[0043] A second determination module, configured to determine a verification result of the nodes to be verified based on first summary information of the target filling nodes, second summary information of the differential intermediate nodes, and root summary information corresponding to the target nodes.

[0044] In a third aspect, an optional implementation manner of the present disclosure further provides a computer device, including a processor and a memory. The memory stores machine-readable instructions executable by the processor. The processor is configured to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the machine-readable instructions execute the steps in the first aspect, or any possible implementation manner in the first aspect.

[0045] In a fourth aspect, an optional implementation manner of the present disclosure further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run, it executes the steps in the first aspect, or any possible implementation manner in the first aspect.

[0046] For the effect description of the above data verification device, computer device, and computer-readable storage medium, refer to the description of the above data verification method, which will not be elaborated here.

[0047] The data verification method, apparatus, computer device, and storage medium provided by the embodiments of the present disclosure first implement the transformation of the structure of the traditional node tree because the set of nodes to be verified at least includes the nodes to be verified. Secondly, by first determining the differentiating intermediate nodes and then determining the target filling nodes, it can be verified whether the differentiating intermediate nodes can be accurately constructed using the set of nodes to be verified, realizing the first verification of the nodes to be verified. Then, using the first digest information of the target filling nodes and the second digest information of the differentiating intermediate nodes, it can be verified whether the root digest information corresponding to the target nodes can be accurately determined based on the set of nodes to be verified, that is, the second verification of the nodes to be verified is realized. In this way, the embodiments of the present disclosure can realize the verification of the data corresponding to the nodes to be verified by constructing the set of nodes to be verified and the target set of nodes, avoiding the problem of frequent random I / O, improving the efficiency of data verification, and also improving the accuracy of the verification results through two verifications. In addition, only when the structure of the transformed node tree is correct can the nodes to be verified pass the verification. Therefore, using the verification method provided by the embodiments of the present disclosure, not only can data verification be realized, but also the verification of the tree structure between the nodes to be verified and the target nodes can be realized.

[0048] To make the above objects, features, and advantages of the present disclosure more obvious and understandable, the following specific embodiments are given in detail in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] To more clearly illustrate the technical solutions of the embodiments of the present disclosure, the following briefly introduces the accompanying drawings required in the embodiments. The accompanying drawings are incorporated into the specification and form a part of the specification. These drawings show embodiments that conform to the present disclosure and are used together with the specification to explain the technical solutions of the present disclosure. It should be understood that the following drawings only show some embodiments of the present disclosure and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0050] Figure 1 The flowchart of a data verification method provided by the embodiments of the present disclosure is shown;

[0051] Figure 2 The schematic diagram of a node tree provided by the embodiments of the present disclosure is shown;

[0052] Figure 3 The schematic diagram of another node tree provided by the embodiments of the present disclosure is shown;

[0053] Figure 4 The schematic diagram of another node tree provided by the embodiments of the present disclosure is shown;

[0054] Figure 5 Shows a schematic diagram of another node tree provided by an embodiment of the present disclosure;

[0055] Figure 6 Shows a schematic diagram of another node tree provided by an embodiment of the present disclosure;

[0056] Figure 7 Shows a schematic diagram of a data verification device provided by an embodiment of the present disclosure;

[0057] Figure 8 Shows a schematic structural diagram of a computer device provided by an embodiment of the present disclosure. Detailed implementation manners

[0058] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are only some of the embodiments of the present disclosure, rather than all of the embodiments. Usually, the components of the embodiments of the present disclosure described and illustrated here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present disclosure is not intended to limit the scope of the present disclosure claimed, but merely represents selected embodiments of the present disclosure. All other embodiments obtained by those skilled in the art based on the embodiments of the present disclosure without creative efforts fall within the scope of protection of the present disclosure.

[0059] In addition, terms such as "first" and "second" in the specification, claims, and the above-mentioned drawings of the embodiments of the present disclosure are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments described here can be implemented in an order different from that shown or described here.

[0060] As used herein, "a plurality of or several" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0061] Through research, it is found that although the data stored in the trusted relational database has excellent characteristics such as decentralization and encryption, due to the redundant intermediate node calculations in the composition of the traditional Merkle tree and the problem of excessive random I / O it brings, the data verification efficiency for the trusted relational data cannot be guaranteed. Therefore, how to efficiently verify the data stored in the trusted relational database has become an urgent problem to be solved.

[0062] Based on the above research, the present disclosure provides a data verification solution. Since the set of roots to be verified at least includes the nodes to be verified, the structure of the traditional node tree is first transformed. Secondly, by first determining the differentiating intermediate nodes and then determining the target filling nodes, it can be verified whether the differentiating intermediate nodes can be accurately constructed using the set of roots to be verified, thus realizing the first verification of the nodes to be verified. By using the first digest information of the target filling nodes and the second digest information of the differentiating intermediate nodes, it can be verified whether the root digest information corresponding to the target nodes can be accurately determined based on the set of roots to be verified, that is, the second verification of the nodes to be verified is realized. In this way, the embodiments of the present disclosure can verify the data corresponding to the nodes to be verified by constructing the set of roots to be verified and the target set of roots, which not only avoids the problem of frequent random I / O, improves the efficiency of data verification, but also can improve the accuracy of the verification result through two verifications. In addition, only when the structure of the transformed node tree is correct can the nodes to be verified pass the verification. Therefore, by using the verification method provided by the embodiments of the present disclosure, not only can data verification be realized, but also the verification of the tree structure between the nodes to be verified and the target nodes can be realized.

[0063] All the defects existing in the above solutions are the results obtained by the inventors through practice and careful research. Therefore, the process of discovering the above problems and the solutions proposed by the present disclosure for the above problems in the following text should be the contributions made by the inventors to the present disclosure during the process of the present disclosure.

[0064] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0065] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the users and the authorization of the users should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0066] To facilitate the understanding of this embodiment, a data verification method disclosed in the embodiments of the present disclosure will be introduced in detail first. The execution subject of the data verification method provided by the embodiments of the present disclosure is generally a terminal device or other processing device with certain computing capabilities. The terminal device can be a user equipment (UE), a mobile device, a user terminal, a terminal, a personal digital assistant device (PDA), a handheld device, a computer device, etc.; in some possible implementation manners, the data verification method can be implemented by a processor calling computer-readable instructions stored in a memory.

[0067] Taking the execution entity as a computer device as an example, the data verification method provided by the embodiments of the present disclosure will be described below.

[0068] As Figure 1 shown, it is a flowchart of a data verification method provided by the embodiments of the present disclosure, which may include the following steps:

[0069] S101: Obtain the set of root sets to be verified of the node to be verified and the set of target root sets of the target nodes of the constructed node tree; the leaf nodes in the node tree are used to represent the digest information of the stored data, and the other nodes in the node tree are generated according to the digest information represented by the leaf nodes; the target node is the latest generated leaf node in the node tree; the set of root sets to be verified is used to represent the root nodes of the nodes to be verified, which at least includes the nodes to be verified; the set of target root sets is used to represent the root nodes of the target nodes, which at least includes the target nodes and / or the first intermediate nodes generated according to the target nodes.

[0070] Here, the node tree is generated by the server according to the data to be stored obtained from the client. Among them, one piece of data to be stored is used to generate the node digest information of a leaf node in the node tree. The node digest information can specifically be obtained by performing a hashing process on the data to be stored. Therefore, it can be known that each leaf node in the node tree is used to represent the digest information of the stored data corresponding to the leaf node. The other nodes in the node tree except the leaf nodes can be called intermediate nodes, and different intermediate nodes can be generated according to the digest information represented by different leaf nodes. For example, since the nodes in adjacent levels in the node tree can include nodes with a parent-child relationship, the intermediate node with a parent-child relationship with the leaf node can be generated according to the digest information represented by the leaf node.

[0071] The node to be verified is any one of the generated leaf nodes (denoted as LeafNode) corresponding to the node tree. As Figure 2 shown, it is a schematic diagram of a node tree provided by the embodiments of the present disclosure, which includes leaf nodes of the leaf node type corresponding to 32 pieces of data to be stored respectively (i.e., leaf nodes 1 to 32), and intermediate nodes of the intermediate node type generated according to the leaf nodes (i.e., each node except the leaf nodes in the node tree, denoted as InterNode). For example, based on leaf node 1 and leaf node 2, intermediate node 1 can be generated, and the node digest information of intermediate node 1 can be determined based on the node digest information of leaf node 1 and the node digest information of leaf node 2. Based on leaf node 3 and leaf node 4, intermediate node 2 can be generated, and based on intermediate nodes 1 and 2, intermediate node 3 can be generated. Regarding Figure 2 the nodes upon which each intermediate node depends when being generated, reference can be made to Figure 2The connection relationships among the nodes are not elaborated one by one here. Different nodes have different node numbers. For example, the node number of leaf node 1 is 1, the node number of leaf node 10 is 10, and the node number of intermediate node 15 is 15. Each leaf node corresponds to a root set, and the root set may include the leaf node itself and / or intermediate nodes generated based on the leaf node. For example, the root set of leaf node 1 includes leaf node 1 and can be represented by [1]; the root set of leaf node 4 includes intermediate node 3 and can be represented by [3]; the root set of leaf node 14 can include intermediate nodes 7, 10, and 11 and can be represented by [7, 10, 11]; the root set of leaf node 24 can include intermediate nodes 15 and 22 and can be represented by [15, 22].

[0072] It should be noted that if a leaf node is a node to be verified and its node number is even, the root set corresponding to the node to be verified needs to be expanded to the leaf node. For example, when leaf node 8 is the node to be verified, the root set of this leaf node will be expanded from [7] to [3, 4, 7, 8], where the underscore is used to indicate that the node is a leaf node. When leaf node 14 is the node to be verified, the root set of this leaf node will be expanded from [7, 10, 11] to [7, 10, 13, 14]. If a leaf node is a node to be verified and its node number is odd, since the root set corresponding to the leaf node with an odd node number must include the leaf node itself, the root set of this leaf node has already been expanded to the leaf node, so there is no need to show it specifically. For example, if leaf node 13 is the node to be verified, the root set corresponding to leaf node 13 to be verified is [7, 10, 13].

[0073] The target node is the latest generated leaf node in the node tree. For example, in Figure 2 the target node is leaf node 32. The target root set corresponding to the target node does not need to be shown specifically expanded to the leaf node. For example, when the target node is leaf node 16, the target root set is

[15] ; when the target node is leaf node 24, the target root set is [15, 22]; when the target node is leaf node 27, the target root set is [15, 22, 23, 27], where the node corresponding to serial number 27 is leaf node 27.

[0074] The node to be verified can be represented by a proof node. The set of root sets to be verified is determined according to the nodes in the root set to be verified corresponding to the node to be verified, and is used to represent the root node of the node to be verified, which at least includes the node to be verified. In the set to be verified, the leaf nodes are shown first and then the intermediate nodes. For example, when the node to be verified is the leaf node 8, the root set to be verified is [3, 4, 7, 8], and the set of root sets to be verified is {LeafNode7 / 8, InterNode3 / 4}, where LeafNode7 / 8 represents the leaf nodes 7 and 8, and InterNode3 / 4 represents the intermediate nodes 3 and 4. The leaf nodes 7 and 8 are before the intermediate nodes 3 and 4, and the root nodes of the node to be verified include LeafNode7 / 8 and InterNode3 / 4; when the node to be verified is the leaf node 14, the root set to be verified is [7, 10, 13, 14], and the set of root sets to be verified is {LeafNode13 / 14, InterNode7 / 10}; when the node to be verified is the leaf node 17, the root set to be verified is [15, 17], and the set of root sets to be verified is {LeafNode17, InterNode15}.

[0075] The target node can be represented by a last leaf node. The set of target root sets is determined according to the nodes in the root set to be verified corresponding to the node to be verified. In the set of target root sets, the leaf nodes are shown first and then the intermediate nodes. For example, when the target node is the leaf node 16, the target root set is

[15] , and the set of target root sets is {InterNode15}; when the target node is the leaf node 27, the target root set is [15, 22, 23, 27], and the set of target root sets is {LeafNode27, InterNode15 / 22 / 23}, where LeafNode27 represents the leaf node 27, and InterNode15 / 22 / 23 represents the intermediate nodes 15, 22, and 23; when the target node is the leaf node 24, the target root set is [15, 22], and the set of target root sets is {InterNode15 / 22}, and InterNode15 / 22 represents the intermediate nodes 15 and 22; when the target node is the leaf node 27, the target root set is [15, 22, 23, 27], and the set of target root sets is {LeafNode27, InterNode15 / 22 / 23}, where LeafNode27 represents the leaf node 27, and InterNode15 / 22 / 23 represents the intermediate nodes 15, 22, and 23. It should be noted that in Figure 2When the node to be verified is leaf node 14, the root set to be verified corresponding to the node to be verified is [7, 10, 13, 14], and when the target node is leaf node 24, the target root set corresponding to the target node is [15, 22]. Among them, in the root set to be verified and the target root set, the nodes belonging to the leaf node type are marked with an underline.

[0076] The root set to be verified is used to represent the root node of the node to be verified, which at least includes the node to be verified. Specifically, the root set to be verified may only include the node to be verified. For example, when the node to be verified is leaf node 1, the root set to be verified may only include leaf node 1. Of course, the root set to be verified may also include the node to be verified and intermediate nodes generated according to the node to be verified. For example, when the node to be verified is leaf node 3, the root set to be verified may include leaf node 3 and intermediate node 1. Or, the root set to be verified may also include the node to be verified, intermediate nodes generated according to the node to be verified, and the previous node of the node to be verified. For example, when the node to be verified is leaf node 14, the root set to be verified may only include leaf node 13, leaf node 14, intermediate node 7, and intermediate node 10.

[0077] In one embodiment, when the target node number of the node to be verified is odd and greater than the preset number, the root set to be verified at least includes the node to be verified and at least one second intermediate node of the intermediate node type generated according to the node to be verified. Here, the target node number is the node number of the node to be verified, and the preset number may be 2. The second intermediate node is an intermediate node generated according to the node to be verified and can be used to verify the digest information corresponding to the node to be verified. Specifically, when the target node number is odd and 1, the root set to be verified only includes the node to be verified; when the target node number is odd and greater than 2, the root set to be verified may include the node to be verified and at least one second intermediate node of the intermediate node type. Or, when the target node number of the node to be verified is even, the root set to be verified at least includes the node to be verified and the previous node of the node to be verified; the previous node is adjacent to the node to be verified and the node number is less than the target node number. Exemplarily, when the node to be verified is leaf node 2, the root set to be verified may include leaf node 2 and leaf node 1; when the node to be verified is leaf node 6, the root set to be verified may include leaf node 5, leaf node 6, and second intermediate node 3.

[0078] The set of target root sets includes at least the target node and / or the first intermediate node generated according to the target node, and the first intermediate node can be used to verify the digest information corresponding to the target node. Specifically, the set of target root sets can only include the target node. For example, when the target node is leaf node 1, the set of target root sets can only include leaf node 1; the set of target root sets can also only include the first intermediate node of the intermediate node type that verifies the target node. For example, when the target node is leaf node 24, the set of target root sets can only include intermediate node 15 and intermediate node 22. Or, the set of target root sets can also include the target node and the first intermediate node of the intermediate node type used to verify the target node. For example, when the target node is leaf node 15, the set of target root sets can include leaf node 15, intermediate node 7, intermediate node 10, and intermediate node 11.

[0079] Each node in the node tree can have a root digest information. Specifically, the root digest information of a node is the node digest information of the nodes in the root set corresponding to that node. For example, the root digest information corresponding to leaf node 4 is the node digest information corresponding to intermediate node 3; the root digest information corresponding to leaf node 7 is composed of the node digest information corresponding to intermediate node 3, the node digest information corresponding to intermediate node 4, and the node digest information corresponding to leaf node 7; the root digest information corresponding to leaf node 16 is the node digest information corresponding to intermediate node 15. After the server generates the root digest information of each node, it can send the root digest information to the client for the client to save and use.

[0080] When specifically implementing the above step S101, when it is determined that there is a verification requirement for any node to be verified, the set of root sets to be verified for the node to be verified and the set of target root sets for the target node can be determined according to the constructed node tree.

[0081] S102: Determine the nodes that do not exist in the set of root sets to be verified among the first intermediate nodes of the set of target root sets as the different intermediate nodes, and determine the target filling nodes required to construct the different intermediate nodes using the set of root sets to be verified according to the different intermediate nodes and the set of root sets to be verified.

[0082] Here, the different intermediate nodes are nodes of the intermediate node type, which exist in the set of target root sets and do not exist in the set of root sets to be verified. Exemplarily, when there are multiple intermediate nodes that do not exist in the set of root sets to be verified among the first intermediate nodes, the intermediate node with the smallest node number among the multiple intermediate nodes can be used as the different intermediate node.

[0083] The target filling nodes are the nodes that need to be supplemented when constructing the differentiating intermediate nodes using the nodes in the set of root nodes to be verified, and may include leaf nodes of the leaf node type and intermediate nodes of the intermediate node type.

[0084] During specific implementation, the first intermediate node in the target set of root nodes can be compared with the second intermediate node in the set of root nodes to be verified to determine the differentiating intermediate nodes that do not exist in the set of root nodes to be verified. Then, based on the nodes in the set of root nodes to be verified, the target filling nodes required to construct the differentiating intermediate nodes are determined.

[0085] Exemplarily, when the target set of root nodes includes leaf node x1, leaf node x2, intermediate node x3, intermediate node x4, and intermediate node x5, and the set of root nodes to be verified includes leaf node x6, leaf node x7, intermediate node x8, intermediate node x9, and intermediate node x10, the target set of root nodes can be represented as last leaf node = {LeafNodex1 / x2, InterNodex3 / x4 / x5}, and the set of root nodes to be verified can be represented as proof node = {LeafNodex6 / x7, InterNodex8 / x9 / x10}. The first intermediate node includes InterNodex3 / x4 / x5, and the second intermediate node includes InterNodex8 / x9 / x10. Suppose InterNodex3 = InterNodex8 and InterNodex4!= InterNodex9, then the differentiating intermediate node can be determined as InterNodex4. Then, when constructing InterNodex4 using LeafNodex6 / x7 and InterNodex9 / x10, the respective target filling nodes that need to be supplemented can be determined. For example, the target filling node can be intermediate node xa, i.e., InterNodexa. Thus, the differentiating intermediate node InterNodex4 can be constructed based on LeafNodex6 / x7, InterNodex9 / x10 / xa. Therefore, InterNodex4 can be replaced with LeafNodex6 / x7, InterNodex9 / x10 / xa, and last leaf node can be represented as {LeafNodex1 / x2, InterNodex3 / LeafNodex6 / x7, InterNodex9 / x10 / xa / x5}.

[0086] In one embodiment, for the step of determining the differentiating intermediate nodes, it can be implemented according to the following steps:

[0087] Step 1: Screen out the second intermediate nodes of the intermediate node type from the set of root nodes to be verified.

[0088] Exemplarily, in the case where last leaf node = {LeafNodex1 / x2, InterNodex3 / x4 / x5} and proofnode = {LeafNodex6 / x7, InterNodex8 / x9 / x10}, the first intermediate nodes can be InterNodex3, InterNodex4, and InterNodex5, and the second intermediate nodes can be InterNodex8, InterNodex9, and InterNodex10.

[0089] Step 2: Extract the first node to be compared from the first intermediate nodes and the second node to be compared from the second intermediate nodes in ascending order of node numbers.

[0090] Exemplarily, the first node to be compared InterNodex3, the first node to be compared InterNodex4, and the first node to be compared InterNodex5 can be successively extracted from the first intermediate nodes in ascending order of node numbers, and the second node to be compared InterNodex8, the second node to be compared InterNodex9, and the second node to be compared InterNodex10 can be successively extracted from the second intermediate nodes in ascending order of node numbers.

[0091] Step 3: Determine whether the currently extracted first node to be compared and the second node to be compared are the same.

[0092] Step 4: If so, return to the step of extracting the first node to be compared from the first intermediate nodes and the second node to be compared from the second intermediate nodes in ascending order of node numbers until it is determined that the currently extracted first node to be compared and the second node to be compared are not the same, and use this first node to be compared as the differentiating intermediate node.

[0093] In specific implementation, the first node to be compared extracted for the first time and the second node to be compared extracted for the first time can be compared to determine whether they are the same. If they are not the same, the first node to be compared can be directly used as the differentiating intermediate node. If they are the same, continue to compare the first node to be compared extracted for the second time and the second node to be compared for the second time. Based on multiple comparisons, the first different intermediate node in the target root set and the root set to be verified can be found. That is, for each comparison, one intermediate node is extracted from the target root set and the root set to be verified respectively, and when extracting from the target root set and the root set to be verified, they are both extracted in ascending order of node numbers.

[0094] Taking the example where InterNodex3 is equal to InterNodex8 and nterNodex4 is not equal to InterNodex9, when determining the different intermediate nodes, for the first time, the first node to be compared, InterNodex3, and the second node to be compared, InterNodex8, are compared, and the comparison result is that the two are the same; then, the first node to be compared, InterNodex4, and the second node to be compared, InterNodex9, can be continuously compared. When the comparison result is that the two are different, InterNodex4 can then be used as the different intermediate node.

[0095] In one embodiment, for the step of determining the target filling node, it can be implemented according to the following steps:

[0096] S1: From the second intermediate nodes included in the set of roots to be verified, filter out the third intermediate nodes whose node numbers are greater than the node number of the target second node to be compared.

[0097] Here, the target second node to be compared is the second node to be compared that is compared for consistency with the different intermediate node, or the target second node to be compared is the second intermediate node that is compared with the different intermediate node when comparing the first node to be compared and the second node to be compared using the above steps 1 to 4.

[0098] Exemplarily, when the different intermediate node is InterNodex4, the target second node to be compared is InterNodex9. Further, the third intermediate node whose node number is greater than the node number of InterNodex9 can be filtered out from the set to be verified, that is, InterNodex10.

[0099] S2: Based on each leaf node of the leaf node type in the set of roots to be verified and the third intermediate node, determine the set of intermediate roots.

[0100] In specific implementation, each leaf node, the third intermediate node, and the target second node to be compared in the set of roots to be verified can be combined to obtain the set of intermediate roots.

[0101] For example, when proof node = {LeafNodex6 / x7, InterNodex8 / x9 / x10}, the target second node to be compared is InterNodex9, and the third intermediate node is InterNodex10, the leaf nodes LeafNodex6 and LeafNodex7 in proof node can be combined with InterNodex9 and InterNodex10 to obtain the set of intermediate roots {LeafNodex6 / x7, InterNodex9 / x10}.

[0102] It should be noted that if there is no second intermediate node in the root set to be verified, the first intermediate node with the smallest node number in the target root set can be used as the distinguishing intermediate node. In this case, the target second node to be compared will not exist, nor will the third intermediate node. The intermediate root set can be directly constructed based on the leaf nodes in the root set to be verified. If the number of second intermediate nodes is less than the number of first intermediate nodes and there is a consistent first intermediate node among the second intermediate nodes, the node with the smallest node number among the first intermediate nodes that does not exist in the root set to be verified can be used as the distinguishing intermediate node. At this time, there is also no target second node to be compared and third intermediate node. At this time, the root set to be verified can be directly used as the intermediate root set.

[0103] S3: When it is determined that the node hierarchy structure corresponding to the intermediate root set does not match the preset hierarchy structure according to the node hierarchies corresponding to the nodes in the intermediate root set, determine the target filling node based on the missing hierarchy corresponding to the intermediate root set and the intermediate root set.

[0104] Here, the preset hierarchy structure is used to indicate that the nodes in the first level need to include 2, and the nodes in levels other than the first level need to include 1. Exemplarily, the preset hierarchy structure can be <4 / 3 / 2 / 1 / 1>, <5 / 4 / 3 / 2 / 1 / 1>, <10 / 9 / 8 / 7 / 6 / 5 / 4 / 3 / 2 / 1 / 1>, <1 / 1 / 2 / 3 / 4 / 5>, etc.

[0105] For the node tree, the node level to which the leaf node belongs is the first level, the node level to which the parent node of the leaf node belongs is the second level, the node level to which the parent node of the parent node of the leaf node belongs is the third level, and so on, and each level of the node tree can be determined. For example, Figure 2 The corresponding node tree includes 6 levels.

[0106] Each node in the intermediate root set is all types of nodes included in the intermediate root set. The missing hierarchy is the hierarchy that the node hierarchy structure lacks compared to the preset hierarchy structure.

[0107] In specific implementation, when obtaining the intermediate root set, the node levels to which each node in the intermediate root set belongs in the node tree can be determined respectively. Then, according to the node levels to which each node belongs respectively, the node level structure corresponding to the intermediate root set can be determined. Exemplarily, when the intermediate root set is {LeafNode7 / 8, InterNode3 / 4}, since LeafNode7 / 8 is at the first level, InterNode3 is at the third level, and InterNode4 is at the second level, the node level structure can be <3 / 2 / 1 / 1>, or it can be said that the node level structure is <1 / 1 / 2 / 3>. When the intermediate root set is {LeafNode9 / 10, InterNode7}, the node level structure can be <1 / 1 / 4>.

[0108] After determining the node level structure, it can be judged whether the node level structure matches the preset level structure, that is, it is determined whether the node level structure conforms to the preset level structure. If not, the missing levels to be supplemented for the node level structure relative to the preset level structure are determined. Exemplarily, the node level structure <3 / 2 / 1 / 1> conforms to the preset level structure. The node level structure <1 / 1 / 4> does not conform to the preset level structure. In this case, it can be determined that the levels to be supplemented include node level 2 and node level 3.

[0109] After that, according to the intermediate root set, the missing nodes in each level to be supplemented can be determined, and then the target filling nodes can be determined according to the missing nodes in each level to be supplemented.

[0110] In another implementation manner, when the node level structure conforms to the preset level structure, it can be judged whether distinct intermediate nodes can be constructed based on the intermediate root set. If so, it can be determined that the target filling nodes are not needed. If not, the nodes to be supplemented can be constructed based on the intermediate root set, and then according to the nodes to be supplemented and the distinct intermediate nodes, the nodes required to construct the distinct intermediate nodes by using the nodes to be supplemented are determined, and the determined required filling nodes are used as the target filling nodes.

[0111] In one embodiment, for the step of "determining the target filling nodes based on the levels to be supplemented corresponding to the intermediate root set and the intermediate root set", it can be implemented according to the following steps:

[0112] T1: For any level to be supplemented, judge whether the initial node used to determine the initial filling node located in the level to be supplemented is a leaf node in the intermediate root set; the initial node is located in the next level of the level to be supplemented.

[0113] Here, the initial filling node is the intermediate node determined to be supplemented at the level to be supplemented. For any level to be supplemented, the initial filling node of this level to be supplemented needs to depend on the nodes of the next level, and this node can be called the initial node, and the initial node can include one or more. For example, when determining the initial filling node of the third level, the initial nodes located at the second level need to be used; when determining the initial filling node of the fifth level, the initial nodes located at the fourth level need to be used. The leaf nodes in the intermediate root set are located at the first level.

[0114] In the case where there are multiple levels to be supplemented, the initial filling nodes in each level to be supplemented can be determined in order from the lowest level to the highest level. For example, in the case where the levels to be supplemented include the third level, the fourth level, and the fifth level, the initial filling node of the third level can be determined first by using the initial nodes in the second level, and then, the initial filling node of the third level can be used as the initial node to determine the initial filling node of the fourth level; then, the initial filling node of the fourth level can be used as the initial node to determine the initial filling node of the fifth level.

[0115] During specific implementation, for any level to be supplemented that needs to determine the initial filling node, it can be determined whether the initial nodes of the next level are located at the first level. If so, the following T2 is executed.

[0116] T2: If so, determine the first target serial number according to the node serial number of the parent node of the initial node and the preset increment value, and use the node corresponding to the first target serial number as the initial filling node located at the level to be supplemented.

[0117] Exemplarily, the preset increment value can be 1. In the case where it is determined that the initial node is located at the first level, the parent node of the initial node can be calculated and the node serial number of the parent node can be determined. The steps for determining the parent node are similar to the steps for generating each parent node in the node tree, and will not be elaborated here. After that, the node serial number of the parent node and the preset increment value can be added to obtain the first target serial number. Furthermore, the node with this first target serial number can be used as the initial filling node of the level to be supplemented.

[0118] T3: Determine the target filling node according to the initial filling node.

[0119] During specific implementation, after obtaining the initial filling nodes corresponding to each level to be supplemented respectively, each initial filling node can be used as the target filling node.

[0120] In another embodiment, when the initial node does not belong to the leaf nodes in the intermediate root set, that is, when the initial node does not belong to the first level, it is possible to further determine whether the initial node is another node in the intermediate root set. Here, the other nodes in the intermediate root set can specifically refer to each node other than the leaf nodes.

[0121] Exemplarily, when there are two consecutive levels to be supplemented, the initial node for determining the initial filling node of the higher level is usually a node that does not belong to the intermediate root set.

[0122] When it is determined that the initial node is another node in the intermediate root set, the node number of the sibling node of the initial node can be determined according to the node level and node number of the initial node.

[0123] Exemplarily, when the initial node belongs to another node in the intermediate root set, the node number of the right sibling node of the initial node can be determined according to the node level and node number of the initial node. Specifically, the node number of the right sibling node can be determined according to the following formula:

[0124] Num = n + 2 h-1 -1;

[0125] where Num represents the node number of the right sibling node, n is the node number of the initial node, and h is the node level of the initial node.

[0126] Then, the node number of the parent node of the sibling node can be determined according to the node number of the sibling node and the preset increment value, and the second target number can be determined according to the node number of the parent node and the node level of the initial node.

[0127] During specific implementation, the node number of the right sibling node of the initial node and the preset increment value can be used to obtain the node number of the parent node of the sibling node. Substitute the node number of the parent node as n and the node level of the initial node as h into the above formula to obtain the second target number.

[0128] After that, the node corresponding to the second target number can be used as the initial filling node located at the level to be supplemented.

[0129] Exemplarily, the node with the second target number is the right sibling node of the parent node.

[0130] Exemplarily, when it is determined that the initial node is another node in the intermediate root set, the right sibling node of the initial node can be determined first, then the parent node of the right sibling node can be determined, and finally the right sibling node of the parent node can be determined. The right sibling node is used as the initial filling node at the level to be supplemented.

[0131] In another embodiment, in the case where it is determined that the initial node does not belong to other nodes in the intermediate root set, it can be explained that the node level where the initial node is located is also the level to be supplemented, and the initial node is the initial filling node that was previously determined and is located in the next level of the current level to be supplemented. In this case, the third target serial number can be determined according to the serial number of the parent node of the initial node and the node level of the initial node, and the node corresponding to the third target serial number is used as the initial filling node located in the level to be supplemented. Among them, the node corresponding to the third target serial number is the right sibling node of the parent node of the initial node.

[0132] Exemplarily, in the case where it is determined that the initial node does not belong to other nodes in the intermediate root set, the serial number of the initial node can be incremented by 1 to obtain the serial number of the parent node of the initial node, and then the serial number of the parent node can be used as n and the node level of the initial node can be used as h and substituted into the above formula to obtain the third target serial number. After that, the right sibling node with the third target serial number can be used as the initial filling node of the current level to be supplemented.

[0133] It should be noted that in the case where the level to be supplemented is the first level, that is, when leaf nodes need to be supplemented, the serial numbers of the existing leaf nodes in the intermediate root set can be incremented by 1 to obtain the fourth target serial number, and the leaf node with the fourth target serial number is used as the initial filling node of the first level.

[0134] In one embodiment, after determining the initial filling nodes corresponding to each level to be supplemented, for the above T3, it can be implemented according to the following steps:

[0135] T3-1: Determine whether the target root node determined according to the initial filling node and each node in the intermediate root set is equal to the distinguishing intermediate node.

[0136] Here, each node in the intermediate root set includes leaf nodes and intermediate nodes.

[0137] Exemplarily, in the case where the intermediate root set is {LeafNodex6 / x7, InterNodex9 / x10} and the initial filling node is InterNodexa, the target root node can be determined according to LeafNodex6 / x7, InterNodex9 / x10, and InterNodexa according to the generation method of the node tree, and it is determined whether the target root node is equal to the distinguishing intermediate node.

[0138] If so, the initial filling nodes corresponding to each level to be supplemented that are determined can all be used as target filling nodes; if not, execute the following T3-2.

[0139] T3-2: If not, determine the sibling node of the target root node and use this sibling node as the new initial filling node.

[0140] Exemplarily, when the target root node is not equal to the differential intermediate node, the right sibling node of the target root node can be determined first and used as the new initial filling node.

[0141] T3-3: Return to the step of determining whether the target root node determined according to the initial filling node and each node in the intermediate root set is equal to the differential intermediate node, until the currently determined target root node is equal to the differential intermediate node, and use each currently determined initial filling node as the target filling node.

[0142] Exemplarily, after using the right sibling node of the target root node as the new initial filling node, it can be determined whether the new target root node calculated based on the new initial filling node is equal to the differential intermediate node. If so, the new initial filling node and the initial filling nodes corresponding to each to-be-supplemented level determined previously can be used as the target filling nodes together. If not, the right sibling node corresponding to the new target root node needs to be determined, and the target root node is recalculated based on this right sibling node, and then it is determined whether the target root node is equal to the differential intermediate node. Through continuous looping, the differential intermediate node can be constructed, and at this time, all currently determined initial filling nodes can be used as the target filling nodes.

[0143] S103: Determine the verification result of the node to be verified based on the first summary information of the target filling node, the second summary information of the differential intermediate node, and the root summary information corresponding to the target node.

[0144] Here, the root summary information corresponding to the target node may include the node summary information of each node in the target root set corresponding to the target node. For example, when the target node is leaf node 16, the root summary information is the node summary information corresponding to intermediate node 15. The root summary information of the target node can be stored in the user terminal.

[0145] Exemplarily, the target summary information corresponding to the target node can be calculated according to the node summary information of each node in the root set to be verified, the first summary information of the target filling node, and the second summary information of the differential intermediate node. Then, the target summary information is compared with the stored root summary information corresponding to the target node. When it is determined that the two are consistent, it can be determined that the verification of the node to be verified passes, that is, it can be shown that the data to be stored corresponding to the target node is successfully stored in the server. On the contrary, when the two are inconsistent, it can be determined that the verification of the node to be verified fails, that is, it can be shown that there is an abnormality in the data to be stored corresponding to the target node in the server.

[0146] In one embodiment, for S103, it can be implemented according to the following steps:

[0147] S103-1: Use the currently determined target filling node and the intermediate root set to replace the target root set, obtaining a replacement root set.

[0148] Exemplarily, when the target filling node is InterNodexa, the intermediate root set is {LeafNodex6 / x7, InterNodex9 / x10}, and the target root set is {LeafNodex1 / x2, InterNodex3 / x4 / x5}, the different intermediate node InterNodex4 in the target root set can be replaced with the target filling node InterNodexa and the intermediate root set {LeafNodex6 / x7, InterNodex9 / x10}. Thus, the obtained replacement root set is {LeafNodex1 / x2, InterNodex3 / LeafNodex6 / x7, InterNodex9 / x10 / xa / x5}.

[0149] S103-2: Calculate the first target summary information based on the first summary information of the target filling node and the third summary information of each node in the intermediate root set.

[0150] Here, based on the first summary information of the target filling node and the third summary information of each node in the intermediate root set, the first target summary information of the root node constructed by the target filling node and each node in the intermediate root set can be determined.

[0151] Exemplarily, the first target summary information of the root node corresponding to the set {LeafNodex6 / x7, InterNodex9 / x10 / xa} can be calculated.

[0152] S103-3: Determine the second target summary information according to the fourth summary information of each node in the replacement root set.

[0153] Here, the fourth summary information of each node in the replacement root set is the node summary information of each node in the replacement root set.

[0154] Exemplarily, in the replacement root set {LeafNodex1 / x2, InterNodex3 / LeafNodex6 / x7, InterNodex9 / x10 / xa / x5}, the fourth summary information of LeafNodex1 and the fourth summary information of LeafNodex2 can be added to obtain a first result; the first result and the fourth summary information of InterNodex3 are added to obtain a second result; the second result and the first target summary information are added to obtain a third result. Here, since the node summary information of the root node corresponding to {LeafNodex6 / x7, InterNodex9 / x10 / xa} has been determined using S103-2, it can be directly used here. That is, after obtaining the second result, the second result and the first target summary information can be directly added to obtain the third result. Then, the third result and the fourth summary information of InterNodex5 can be added to obtain the second target summary information.

[0155] S103-4: When the first target summary information is equal to the second summary information of the differentiating intermediate node and the second target summary information is equal to the root summary information, it is determined that the verification of the node to be verified passes.

[0156] Here, the second summary information of the differentiating intermediate node is the node summary information of the differentiating intermediate node.

[0157] In specific implementation, the verification process provided by the embodiments of the present disclosure may include two parts. One part is horizontal verification, that is, verifying whether the first target summary information is equal to the second summary information of the differentiating intermediate node; the other part is vertical verification, that is, verifying whether the second target summary information is equal to the root summary information corresponding to the target node.

[0158] When it is determined that both the horizontal verification and the vertical verification pass, it can be determined that the verification of the node to be verified passes, that is, it can be determined that the data to be stored corresponding to the node to be verified is successfully stored on the server. Otherwise, it can be determined that the verification of the node to be verified fails, that is, it can be determined that there is a storage exception for the data to be stored corresponding to the node to be verified.

[0159] In this way, since the set of roots to be verified at least includes the nodes to be verified, the structure of the traditional node tree is first transformed. Secondly, by first determining the differentiating intermediate nodes and then determining the target filling nodes, it can be verified whether the differentiating intermediate nodes can be accurately constructed using the set of roots to be verified, achieving the first verification of the nodes to be verified. By using the first digest information of the target filling nodes and the second digest information of the differentiating intermediate nodes, it can be verified whether the root digest information corresponding to the target nodes can be accurately determined based on the set of roots to be verified, that is, the second verification of the nodes to be verified is achieved. Thus, the embodiments of the present disclosure can verify the data corresponding to the nodes to be verified by constructing the set of roots to be verified and the set of target roots obtained, avoiding the problem of frequent random I / O, improving the efficiency of data verification, and also improving the accuracy of the verification results through two verifications. In addition, only when the structure of the transformed node tree is correct can the nodes to be verified pass the verification. Therefore, by using the verification method provided by the embodiments of the present disclosure, not only can data verification be achieved, but also the verification of the tree structure between the nodes to be verified and the target nodes can be achieved.

[0160] Exemplarily, as Figure 3 shown, it is a schematic diagram of another node tree provided by the embodiments of the present disclosure. Among them, the last leaf node is leaf node 16, and the proof node is leaf node 8. Then, the verification process for the proof node can be as follows:

[0161] 1. Calculate the set of target roots of the last leaf node and the set of roots to be verified of the proof node:

[0162] last leaf node = {InterNode15}; proof node = {LeafNode7 / 8, InterNode3 / 4}.

[0163] 2. Determine the intermediate set of roots and the node hierarchy structure:

[0164] First, it can be determined that the differentiating intermediate node is InterNode15. Then, it can be determined that the intermediate set of roots is {LeafNode7 / 8, InterNode3 / 4}, and the node hierarchy structure is <3 / 2 / 1 / 1>.

[0165] 3. Determine whether there are target filling nodes:

[0166] a. Determine whether there is a level to be supplemented in the node hierarchy structure. Among them, <3 / 2 / 1 / 1> conforms to the preset hierarchy structure, so there is no level to be supplemented.

[0167] b. Determine whether the target root node determined based on the intermediate root set is equal to the differentiated intermediate node. Among them, the target root node determined based on {LeafNode7 / 8, InterNode3 / 4} is InterNode7, which is not equal to InterNode15. Further, the right sibling node InterNode14 of InterNode7 can be determined. In the case where it is determined that the target root node constructed by using InterNode7 and InterNode14 is InterNode15, the target filling node is determined to be InterNode14.

[0168] 4. Determine the replacement root set:

[0169] The target root set {InterNode15} is replaced with {InterNode3 / 4, LeafNode7 / 8, InterNode14}.

[0170] 5. Data verification

[0171] a. Horizontal verification

[0172] b. Vertical verification

[0173] Exemplarily, as Figure 4 shown, it is a schematic diagram of another node tree provided by an embodiment of the present disclosure. Among them, the last leaf node is LeafNode17, and the proof node is LeafNode8. Then, the verification process for the proof node can be as follows:

[0174] 1. Calculate the target root set of the last leaf node and the root set to be verified of the proof node:

[0175] last leaf node = {LeafNode17, InterNode15}; proof node = {LeafNode7 / 8, InterNode3 / 4}.

[0176] 2. Determine the intermediate root set and the node hierarchy:

[0177] First, the differentiated intermediate node can be determined to be InterNode15. Then, the intermediate root set can be determined to be {LeafNode7 / 8, InterNode3 / 4}, and the node hierarchy is <3 / 2 / 1 / 1>.

[0178] 3. Determine whether there is a target filling node:

[0179] a. Determine whether there is a level to be supplemented in the node hierarchy. Among them, <3 / 2 / 1 / 1> conforms to the preset hierarchy, so there is no level to be supplemented.

[0180] b. Determine whether the target root node determined based on the intermediate root set is equal to the differentiating intermediate node. Among them, the target root node determined based on {LeafNode7 / 8, InterNode3 / 4} is InterNode7, which is not equal to InterNode15. Further, the right sibling node InterNode14 of InterNode7 can be determined. In the case where it is determined that the target root node constructed by using InterNode7 and InterNode14 is InterNode15, the target filling node is determined to be InterNode14.

[0181] 4. Determine the replacement root set:

[0182] The target root set {LeafNode17, InterNode15} is replaced with {LeafNode17, LeafNode7 / 8, InterNode3 / 4 / 14}.

[0183] 5. Data verification

[0184] a. Horizontal verification

[0185] b. Vertical verification

[0186] Exemplarily, as Figure 5 shown, it is a schematic diagram of another node tree provided by an embodiment of the present disclosure. Among them, the last leaf node is leaf node 16, and the proof node is leaf node 10. Then, the verification process for the proof node can be as follows:

[0187] 1. Calculate the target root set of the last leaf node and the root set to be verified of the proof node:

[0188] last leaf node = {InterNode15}; proof node = {LeafNode9 / 10, InterNode7}.

[0189] 2. Determine the intermediate root set and the node hierarchy:

[0190] First, the differentiating intermediate node can be determined to be InterNode15. Then, the intermediate root set can be determined to be {LeafNode9 / 10, InterNode7}, and the node hierarchy is <4 / 1 / 1>.

[0191] 3. Determine whether there is a target filling node:

[0192] a. Determine whether there is a level to be supplemented in the node hierarchy. Among them, <4 / 1 / 1> does not conform to the preset hierarchy, so there are levels to be supplemented - the second level and the third level. Then, the initial filling node of the second level can be determined as InterNode9, and the initial filling node of the third level can be determined as InterNode13.

[0193] b. Determine whether the target root node determined based on the intermediate root set and the initial filling node is equal to the differentiating intermediate node.

[0194] Among them, based on LeafNode9 / 10 in {LeafNode9 / 10, InterNode7}, InterNode8 can be determined. Based on InterNode8 and InterNode9, InterNode10 can be determined. Based on InterNode1 and InterNode13, InterNode14 can be determined. Based on InterNode14 and InterNode7, the target root node InterNode15 can be determined. Furthermore, it can be determined that the target root node is equal to the differentiating intermediate node, so each initial filling node can be used as the target filling node.

[0195] 4. Determine the replacement root set:

[0196] The target root set {InterNode15} is replaced by {LeafNode9 / 10, InterNode7 / 9 / 13}.

[0197] 5. Data verification

[0198] a. Horizontal verification

[0199] b. Vertical verification

[0200] Exemplarily, for Figure 2 assuming the last leaf node is leaf node 24 and the proof node is leaf node 14, the verification process for the proof node can be as follows:

[0201] 1. Calculate the target root set of the last leaf node and the root set to be verified of the proof node:

[0202] last leaf node = {InterNode15 / 22}; proof node = {LeafNode13 / 14, InterNode7 / 10}.

[0203] 2. Determine the intermediate root set and the node hierarchy:

[0204] First, it can be determined that the differentiating intermediate node is InterNode15. Then, the intermediate root set can be determined as {LeafNode13 / 14, InterNode7 / 10}, and the node hierarchy is <4 / 3 / 1 / 1>.

[0205] 3. Determine whether there is a target filling node:

[0206] a. Determine whether there is a level to be supplemented in the node hierarchy. Among them, <4 / 3 / 1 / 1> does not conform to the preset hierarchy, so there is a level to be supplemented - the second level. Then, the initial filling node of the second level can be determined as InterNode12.

[0207] b. Determine whether the target root node determined based on the intermediate root set and the initial filling node is equal to the differentiating intermediate node.

[0208] Among them, based on LeafNode13 / 14 in {LeafNode13 / 14, InterNode7 / 10}, InterNode11 can be determined. Based on InterNode11 and InterNode12, InterNode13 can be determined. Based on InterNode13 and InterNode10, InterNode14 can be determined. Based on InterNode14 and InterNode7, the target root node InterNode15 can be determined. Furthermore, it can be determined that the target root node is equal to the differentiating intermediate node, so each initial filling node can be used as the target filling node.

[0209] 4. Determine the replacement root set:

[0210] The target root set {InterNode15 / 22} is replaced with {LeafNode13 / 14, InterNode7 / 10 / 12 / 22}.

[0211] 5. Data verification

[0212] a. Horizontal verification

[0213] b. Vertical verification

[0214] Exemplarily, as Figure 6 shown, it is a schematic diagram of another node tree provided by the embodiment of the present disclosure. Assuming that the lastleaf node is leaf node 24 and the proof node is leaf node 10, the verification process for the proof node can be as follows:

[0215] 1. Calculate the target root set of the last leaf node and the root set to be verified of the proof node:

[0216] last leaf node = {InterNode15 / 22}; proof node = {LeafNode9 / 10, InterNode7}.

[0217] 2. Determine the intermediate root set and the node hierarchy:

[0218] First, the differentiating intermediate node can be determined as InterNode15. Then, the intermediate root set can be determined as {LeafNode9 / 10, InterNode7}, and the node hierarchy is <4 / 1 / 1>.

[0219] 3. Determine whether there is a target filling node:

[0220] a. Determine whether there is a level to be supplemented in the node hierarchy. Among them, <4 / 1 / 1> does not conform to the preset hierarchy, so there are levels to be supplemented - the second level and the third level. Then, the initial filling node of the second level can be determined as InterNode9, and the initial filling node of the third level can be determined as InterNode13.

[0221] b. Determine whether the target root node determined based on the intermediate root set and the initial filling node is equal to the differentiating intermediate node.

[0222] Among them, based on LeafNode9 / 10 in {LeafNode9 / 10, InterNode7}, InterNode8 can be determined. Based on InterNode8 and InterNode9, InterNode10 can be determined. Based on InterNode10 and InterNode13, InterNode14 can be determined. Based on InterNode14 and InterNode7, the target root node InterNode15 can be determined. Furthermore, it can be determined that the target root node is equal to the differentiating intermediate node, so each initial filling node can be used as the target filling node.

[0223] 4. Determine the replacement root set:

[0224] The target root set {InterNode15 / 22} is replaced with {LeafNode9 / 10, InterNode7 / 9 / 13, InterNode22}.

[0225] 5. Data verification

[0226] a. Horizontal verification

[0227] b. Vertical verification

[0228] Those skilled in the art can understand that in the above method of the specific implementation manner, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined according to its function and possible internal logic.

[0229] Based on the same inventive concept, the embodiments of the present disclosure also provide a data verification device corresponding to the data verification method. Since the principle of solving problems by the device in the embodiments of the present disclosure is similar to the above data verification method in the embodiments of the present disclosure, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be elaborated.

[0230] As Figure 7 shown, it is a schematic diagram of a data verification device provided by an embodiment of the present disclosure, including:

[0231] An acquisition module 701, configured to acquire a to-be-verified root set of a to-be-verified node and a target root set of a target node of a constructed node tree; a leaf node in the node tree is used to represent the summary information of stored data, and other nodes in the node tree are generated according to the summary information represented by the leaf nodes; the target node is the latest generated leaf node in the node tree; the to-be-verified root set is used to represent the root node of the to-be-verified node, which at least includes the to-be-verified node; the target root set is used to represent the root node of the target node, which at least includes the target node and / or a first intermediate node generated according to the target node;

[0232] A first determination module 702, configured to determine, from the first intermediate nodes of the target root set, a node that does not exist in the to-be-verified root set as a different intermediate node, and determine, according to the different intermediate node and the to-be-verified root set, a target filling node required to construct the different intermediate node by using the to-be-verified root set;

[0233] A second determination module 703, configured to determine the verification result of the to-be-verified node based on the first summary information of the target filling node, the second summary information of the different intermediate node, and the root summary information corresponding to the target node.

[0234] In a possible implementation manner, when the target node number of the to-be-verified node is odd and greater than a preset number, the to-be-verified root set at least includes the to-be-verified node and at least one second intermediate node of an intermediate node type generated according to the to-be-verified node; or,

[0235] When the target node number of the node to be verified is an even number, the set of roots to be verified at least includes the node to be verified and the previous node of the node to be verified; the previous node is adjacent to the node to be verified and has a node number smaller than the target node number.

[0236] In a possible implementation manner, when the first determination module 702 determines a node that does not exist in the set of roots to be verified as a different intermediate node from the first intermediate nodes of the target set of roots, it is used for:

[0237] Filter out second intermediate nodes of the intermediate node type from the set of roots to be verified;

[0238] Extract a first node to be compared from the first intermediate nodes and a second node to be compared from the second intermediate nodes in ascending order of node numbers;

[0239] Determine whether the currently extracted first node to be compared and the second node to be compared are the same;

[0240] If so, return to the step of extracting a first node to be compared from the first intermediate nodes and a second node to be compared from the second intermediate nodes in ascending order of node numbers, until it is determined that the currently extracted first node to be compared and the second node to be compared are not the same, and use this first node to be compared as the different intermediate node.

[0241] In a possible implementation manner, when the first determination module 702 determines a target filling node required to construct the different intermediate node by using the set of roots to be verified according to the different intermediate node and the set of roots to be verified, it is used for:

[0242] Filter out third intermediate nodes from the second intermediate nodes included in the set of roots to be verified, where the node numbers of the third intermediate nodes are greater than the node number of the target second node to be compared; the target second node to be compared is the second node to be compared for consistency comparison with the different intermediate node;

[0243] Determine an intermediate set of roots based on each leaf node of the leaf node type and the third intermediate nodes in the set of roots to be verified;

[0244] In the case where it is determined that the node level structure corresponding to the intermediate set of roots does not match the preset level structure according to the node levels respectively corresponding to the nodes in the intermediate set of roots, determine the target filling node based on the level to be supplemented corresponding to the intermediate set of roots and the intermediate set of roots.

[0245] In a possible implementation, when determining the target filling node based on the to-be-supplemented level corresponding to the intermediate root set and the intermediate root set, the first determination module 702 is configured to:

[0246] For any to-be-supplemented level, determine whether the initial node for determining the initial filling node located at the to-be-supplemented level is a leaf node in the intermediate root set; the initial node is located at the next level of the to-be-supplemented level;

[0247] If so, determine a first target serial number according to the serial number of the parent node of the initial node and a preset increment value, and use the node corresponding to the first target serial number as the initial filling node located at the to-be-supplemented level;

[0248] Determine the target filling node according to the initial filling node.

[0249] In a possible implementation, the first determination module 702 is further configured to:

[0250] In the case where the initial node does not belong to the leaf nodes in the intermediate root set, determine whether the initial node is another node in the intermediate root set;

[0251] If so, determine the serial number of the sibling node of the initial node according to the node level and serial number of the initial node;

[0252] Determine the serial number of the parent node of the sibling node according to the serial number of the sibling node and the preset increment value, and determine a second target serial number according to the serial number of this parent node and the node level of the initial node;

[0253] Use the node corresponding to the second target serial number as the initial filling node located at the to-be-supplemented level.

[0254] In a possible implementation, the first determination module 702 is further configured to:

[0255] In the case where it is determined that the initial node does not belong to other nodes in the intermediate root set, determine a third target serial number according to the serial number of the parent node of the initial node and the node level of the initial node, and use the node corresponding to the third target serial number as the initial filling node located at the to-be-supplemented level.

[0256] In a possible implementation, when determining the target filling node according to the initial filling node, the first determination module 702 is configured to:

[0257] Determine whether the target root node determined according to the initial filling node and each node in the intermediate root set is equal to the different intermediate node;

[0258] If not, determine the sibling node of the target root node, and use this sibling node as the new initial filling node;

[0259] Return to the step of determining whether the target root node determined according to the initial filling node and each node in the intermediate root set is equal to the different intermediate node, until the currently determined target root node is equal to the different intermediate node, and use each of the currently determined initial filling nodes as the target filling node.

[0260] In a possible implementation manner, when determining the verification result of the node to be verified based on the first summary information of the target filling node, the second summary information of the different intermediate node, and the root summary information corresponding to the target node, the second determination module 703 is configured to:

[0261] Use the currently determined target filling node and the intermediate root set to replace the target root set, and obtain a replaced root set;

[0262] Calculate the first target summary information based on the first summary information of the target filling node and the third summary information of each node in the intermediate root set;

[0263] Determine the second target summary information according to the fourth summary information of each node in the replaced root set;

[0264] When the first target summary information is equal to the second summary information of the different intermediate node and the second target summary information is equal to the root summary information, determine that the verification of the node to be verified passes.

[0265] The description of the processing flow of each module in the device and the interaction flow between each module can refer to the relevant description in the above method embodiments, and will not be elaborated here.

[0266] Based on the same inventive concept, an embodiment of the present application also provides a computer device. Refer to Figure 8 As shown, it is a schematic structural diagram of a computer device provided by an embodiment of the present application, including:

[0267] A processor 81, a memory 82, and a bus 83. Among them, the memory 82 stores machine-readable instructions executable by the processor 81. The processor 81 is configured to execute the machine-readable instructions stored in the memory 82. When the machine-readable instructions are executed by the processor 81, the processor 81 performs the following steps: S101: Obtain a set of to-be-verified root sets of to-be-verified nodes and a set of target root sets of target nodes of a constructed node tree; the leaf nodes in the node tree are used to represent the summary information of the stored data, and the other nodes in the node tree are generated according to the summary information represented by the leaf nodes; the target node is the latest generated leaf node in the node tree; the set of to-be-verified root sets is used to represent the root nodes of the to-be-verified nodes, which at least includes the to-be-verified nodes; the set of target root sets is used to represent the root nodes of the target nodes, which at least includes the target node and / or the first intermediate node generated according to the target node; S102: Determine, from the first intermediate nodes in the set of target root sets, the nodes that do not exist in the set of to-be-verified root sets as the differential intermediate nodes, and determine, according to the differential intermediate nodes and the set of to-be-verified root sets, the target filling nodes required to construct the differential intermediate nodes using the set of to-be-verified root sets, and S103: Based on the first summary information of the target filling nodes, the second summary information of the differential intermediate nodes, and the root summary information corresponding to the target node, determine the verification result of the to-be-verified node.

[0268] The above-mentioned memory 82 includes a memory 821 and an external memory 822; the memory 821 here is also called internal memory, which is used to temporarily store the operation data in the processor 81 and the data exchanged with the external memory 822 such as a hard disk. The processor 81 exchanges data with the external memory 822 through the memory 821. When the computer device is running, the processor 81 communicates with the memory 82 through the bus 83, so that the processor 81 executes the execution instructions mentioned in the above method embodiments.

[0269] The embodiments of the present disclosure also provide a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps of the data verification method described in the above method embodiments. Among them, the storage medium can be a volatile or non-volatile computer-readable storage medium.

[0270] The computer program product of the data verification method provided by the embodiments of the present disclosure includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the data verification method described in the above method embodiments. For details, please refer to the above method embodiments and will not be elaborated here.

[0271] The computer program product can be specifically implemented in the form of hardware, software, or a combination thereof. In an alternative embodiment, the computer program product is specifically embodied as a computer storage medium. In another alternative embodiment, the computer program product is specifically embodied as a software product, such as a Software Development Kit (SDK), etc.

[0272] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the devices described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein. In several embodiments provided by the present disclosure, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical functional division, and there may be other division methods in actual implementation. For another example, multiple units or components can be combined, or some features can be ignored, or not executed. Another point is that the couplings or direct couplings or communication connections shown or discussed with each other can be through some communication interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0273] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0274] In addition, in each embodiment of the present disclosure, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0275] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present disclosure, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present disclosure. The foregoing storage medium includes: various media that can store program codes such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs.

[0276] If the technical solution of this application involves personal information, the product using the technical solution of this application has clearly informed the personal information processing rules and obtained the individual's voluntary consent before processing the personal information. If the technical solution of this application involves sensitive personal information, the product using the technical solution of this application has obtained the individual's separate consent before processing the sensitive personal information, and at the same time meets the "explicit consent" requirement. For example, on personal information collection devices such as cameras, clear and prominent signs are set to inform that the personal information collection scope has been entered and personal information will be collected. If the individual voluntarily enters the collection scope, it is deemed that he or she agrees to the collection of his or her personal information; or on the device that processes personal information, the personal information processing rules are notified by obvious signs / information, and the individual's authorization is obtained through pop-up information or by asking the individual to upload his or her personal information; among them, the personal information processing rules may include information such as the personal information processor, the purpose of personal information processing, the processing method, and the type of personal information processed.

[0277] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present disclosure, which are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. A data verification method, characterized in that, Including: Obtaining transaction data to be stored from a client and generating a node tree based on the transaction data to be stored; Generating root summary information for each node in the node tree and sending the root summary information of each node to the client; Obtaining a set of to-be-verified root sets of a to-be-verified node and a set of target root sets of a target node of a constructed node tree; a leaf node in the node tree is used to represent summary information of stored data, and other nodes in the node tree are generated based on the summary information represented by the leaf nodes; the target node is the latest generated leaf node in the node tree; The set of to-be-verified root sets is used to represent the root node of the to-be-verified node, which at least includes the to-be-verified node; the set of target root sets is used to represent the root node of the target node, which at least includes the target node and / or a first intermediate node generated based on the target node, and the node tree is used for a trusted database to store and manage various transaction data from the client; Determining, from the first intermediate nodes in the set of target root sets, a node that does not exist in the set of to-be-verified root sets as a different intermediate node, and determining a target filling node required to construct the different intermediate node by using the set of to-be-verified root sets based on the different intermediate node and the set of to-be-verified root sets; Determining a verification result of the to-be-verified node based on a first summary information of the target filling node, a second summary information of the different intermediate node, and a root summary information corresponding to the target node.

2. The method according to claim 1, wherein When the target node serial number of the to-be-verified node is odd and greater than a preset serial number, the set of to-be-verified root sets at least includes the to-be-verified node and at least one second intermediate node of an intermediate node type generated based on the to-be-verified node; or, When the target node serial number of the to-be-verified node is even, the set of to-be-verified root sets at least includes the to-be-verified node and the previous node of the to-be-verified node; the previous node is adjacent to the to-be-verified node and has a node serial number smaller than the target node serial number.

3. The method according to claim 1, characterized in that, The determining, from the first intermediate nodes in the set of target root sets, a node that does not exist in the set of to-be-verified root sets as a different intermediate node includes: Screening out second intermediate nodes of an intermediate node type from the set of to-be-verified root sets; Extracting a first node to be compared from the first intermediate nodes and extracting a second node to be compared from the second intermediate nodes in ascending order of node serial numbers; Determining whether the currently extracted first node to be compared and the second node to be compared are the same; If so, returning to the step of extracting a first node to be compared from the first intermediate nodes and extracting a second node to be compared from the second intermediate nodes in ascending order of node serial numbers until it is determined that the currently extracted first node to be compared and the second node to be compared are different, and taking the first node to be compared as the different intermediate node.

4. The method according to claim 3, characterized in that, The determining a target filling node required to construct the different intermediate node by using the set of to-be-verified root sets based on the different intermediate node and the set of to-be-verified root sets includes: From the second intermediate nodes included in the set of to-be-verified root sets, filter out third intermediate nodes whose node numbers are greater than the node number of the target second node to be compared; the target second node to be compared is the second node to be compared for consistency comparison with the different intermediate node. Based on each leaf node of the leaf node type in the set of to-be-verified root sets and the third intermediate node, determine the set of intermediate root sets. In the case where it is determined that the node level structure corresponding to the set of intermediate root sets does not match the preset level structure according to the node levels respectively corresponding to each node in the set of intermediate root sets, determine the target filling node based on the to-be-supplemented level corresponding to the set of intermediate root sets and the set of intermediate root sets.

5. The method according to claim 4, wherein The determining the target filling node based on the to-be-supplemented level corresponding to the set of intermediate root sets and the set of intermediate root sets includes: For any to-be-supplemented level, determine whether the initial node for determining the initial filling node located at the to-be-supplemented level is a leaf node in the set of intermediate root sets; the initial node is located at the next level of the to-be-supplemented level. If so, determine the first target number according to the node number of the parent node of the initial node and the preset increment value, and use the node corresponding to the first target number as the initial filling node located at the to-be-supplemented level. Determine the target filling node according to the initial filling node.

6. The method according to claim 5, wherein The method further includes: In the case where the initial node does not belong to the leaf nodes in the set of intermediate root sets, determine whether the initial node is another node in the set of intermediate root sets. If so, determine the node number of the sibling node of the initial node according to the node level and node number of the initial node. Determine the node number of the parent node of the sibling node according to the node number of the sibling node and the preset increment value, and determine the second target number according to the node number of this parent node and the node level of the initial node. Use the node corresponding to the second target number as the initial filling node located at the to-be-supplemented level.

7. The method according to claim 6, wherein The method further includes: In the case where it is determined that the initial node does not belong to other nodes in the set of intermediate root sets, determine the third target number according to the node number of the parent node of the initial node and the node level of the initial node, and use the node corresponding to the third target number as the initial filling node located at the to-be-supplemented level.

8. The method according to claim 5, wherein The determining the target filling node according to the initial filling node includes: Determine whether the target root node determined according to the initial filling node and each node in the set of intermediate root sets is equal to the different intermediate node. If not, determine the sibling node of the target root node, and use this sibling node as the new initial filling node. Return to the step of determining whether the target root node determined according to the initial filling node and each node in the set of intermediate root sets is equal to the different intermediate node, until the currently determined target root node is equal to the different intermediate node, and use each of the currently determined initial filling nodes as the target filling node.

9. The method according to claim 4, characterized in that, Determining a verification result of the node to be verified based on the first summary information of the target filling node, the second summary information of the differentiated intermediate node, and the root summary information corresponding to the target node includes: Using the currently determined target filling node and the intermediate root set to replace the target root set, obtaining a replaced root set; Calculating first target summary information based on the first summary information of the target filling node and the third summary information of each node in the intermediate root set; Determining second target summary information according to the fourth summary information of each node in the replaced root set; When the first target summary information is equal to the second summary information of the differentiated intermediate node and the second target summary information is equal to the root summary information, determining that the verification of the node to be verified passes.

10. A data verification device, characterized in that, Including: An acquisition module, configured to acquire transaction data to be stored from a client and generate a node tree according to the transaction data to be stored; Generating root summary information of each node in the node tree and sending the root summary information of each node to the client; Obtaining a target root set of a target node of the node tree to be verified and a node tree that has been constructed; a leaf node in the node tree is used to represent summary information of stored data, and other nodes in the node tree are generated according to the summary information represented by the leaf nodes; the target node is the latest generated leaf node in the node tree; The root set to be verified is used to represent the root node of the node to be verified, and at least includes the node to be verified; the target root set is used to represent the root node of the target node, and at least includes the target node and / or a first intermediate node generated according to the target node, and the node tree is used for trusted database storage and management of various transaction data from the client; A first determination module, configured to determine, from the first intermediate nodes of the target root set, a node that does not exist in the root set to be verified as a differentiated intermediate node, and determine, according to the differentiated intermediate node and the root set to be verified, a target filling node required for constructing the differentiated intermediate node by using the root set to be verified; A second determination module, configured to determine a verification result of the node to be verified based on the first summary information of the target filling node, the second summary information of the differentiated intermediate node, and the root summary information corresponding to the target node.

11. A computer device, characterized in that, Including: A processor and a memory, where the memory stores machine-readable instructions executable by the processor, and the processor is configured to execute the machine-readable instructions stored in the memory. When the machine-readable instructions are executed by the processor, the processor executes the steps of the data verification method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is run by a computer device, the computer device executes the steps of the data verification method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Transaction information verification method and related device

    CN110060064A

  • Block chain node account book processing method and device, server and storage medium

    CN111026770A