Data integrity verification method and apparatus

By constructing distributed subtrees at the edge and performing lightweight aggregation at the center, a data integrity verification method is proposed. This method addresses the problem of high computational complexity in resource-constrained scenarios, achieving efficient and secure data integrity verification and improving system throughput.

CN121547303BActive Publication Date: 2026-06-09CETC BIGDATA RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CETC BIGDATA RES INST CO LTD
Filing Date
2026-01-20
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In resource-constrained scenarios such as the Internet of Things and edge computing, when a massive number of terminal devices transmit data to the aggregation node, the existing data integrity verification schemes are computationally intensive and highly complex, leading to the depletion of computing resources and difficulty in meeting the timeliness requirements of real-time sensitive scenarios.

Method used

A two-layer verification architecture of distributed subtree construction and central lightweight aggregation is adopted. By using distributed computing on the edge side and lightweight aggregation on the central side, a lightweight algorithm is used to build the subtree root hash value locally, and the central node performs fast iterative aggregation root calculation, thereby reducing the computational load.

Benefits of technology

It simplifies the data integrity verification process while ensuring data security, improves system throughput, meets the timeliness requirements of real-time sensitive scenarios, and has strong applicability and scalability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121547303B_ABST
    Figure CN121547303B_ABST
Patent Text Reader

Abstract

The application discloses a data integrity verification method and device, and the method comprises the following steps: receiving data information sent by each source node, wherein the data information comprises a source data set, a hash value of a sub-tree root node and a calculation path of the sub-tree root node; constructing an aggregation tree by taking the sub-tree root node corresponding to each data information as a leaf node, calculating a hash value of an aggregation root node and generating a calculation path of the aggregation root node; taking the hash value of the sub-tree root node as a local reference value, taking the hash value of the aggregation root node as an aggregation reference value, and performing data integrity verification according to the local reference value, the calculation path of the sub-tree root node, the aggregation reference value and the calculation path of the aggregation root node. By using the application scheme, the received data can be simply and efficiently verified for integrity, and the safety of data transmission is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data quality management, and specifically to a data integrity verification method and apparatus. Background Technology

[0002] In scenarios such as smart city monitoring, industrial IoT, and distributed sensor networks, the number of terminal devices can reach millions, and the data generated daily needs to be aggregated to a central node. To ensure the reliability of the analysis results, the central node typically needs to verify that all data has not been tampered with during transmission. In resource-constrained scenarios such as IoT and edge computing, the verification process to ensure data integrity faces significant challenges when massive numbers of terminal devices continuously transmit data to the aggregation node. Existing data integrity verification schemes are computationally intensive and complex. On the one hand, this poses a risk of exhausting computing resources for resource-constrained terminal devices; on the other hand, it is difficult to meet the timeliness requirements of real-time sensitive scenarios. Summary of the Invention

[0003] This invention provides a data integrity verification method and apparatus that, while ensuring data security, simply and efficiently verifies data integrity and effectively improves system throughput.

[0004] Therefore, the present invention provides the following technical solution:

[0005] On one hand, the present invention provides a data integrity verification method, the method comprising:

[0006] The system receives data information sent by each source node. The data information includes: source dataset, hash value of subtree root node, and calculation path of subtree root node; the source dataset includes one or more data blocks; the subtree root node is the root node of the subtree generated by the source node based on all data blocks in the source dataset.

[0007] The root node of each data information subtree is used as a leaf node to construct an aggregate tree. The hash value of the aggregate root node is calculated based on the hash value of the subtree root node, and the calculation path of the aggregate root node is generated. The aggregate root node refers to the root node of the aggregate tree.

[0008] The hash value of the subtree root node is used as a local reference value, and the hash value of the aggregate root node is used as an aggregate reference value. Data integrity verification is performed based on the local reference value and the calculation path of the subtree root node, as well as the aggregate reference value and the calculation path of the aggregate root node.

[0009] Optionally, the method further includes:

[0010] The source node divides the data to be sent into multiple data blocks to generate a source dataset.

[0011] Treat each data block in the source dataset as a leaf node and calculate the hash value of each leaf node;

[0012] Construct a Merkle subtree based on the hash value of the leaf node, obtain the hash value of the root node of the subtree, and record the calculation path of the root node of the subtree.

[0013] Optionally, calculating the hash value of each leaf node includes: calculating the hash value of each leaf node using the Ascon-Hash algorithm.

[0014] Optionally, constructing an aggregate tree by using the root node of the subtree corresponding to each data information as the leaf node includes: constructing a Merkle aggregate tree by using the root node of the subtree corresponding to each data information as the leaf node.

[0015] Optionally, the data integrity verification includes:

[0016] Obtain each data block in the source dataset to which the data block to be verified belongs, and calculate the hash value of each leaf node of the corresponding subtree based on the data block;

[0017] Calculate the hash value of the subtree root node based on the hash value of each leaf node and the calculation path of the corresponding subtree root node;

[0018] If the hash value of the calculated subtree root node is the same as the local reference value corresponding to the source dataset, then the data block to be verified passes the verification.

[0019] Optionally, the data integrity verification further includes:

[0020] Calculate the hash value of each data block in each source dataset, and calculate the hash value of the subtree root node based on the hash value of the data block and the calculation path of the subtree root node corresponding to the source dataset;

[0021] Calculate the hash value of the aggregate tree root node based on the hash value of each subtree root node and the calculation path of the aggregate root node;

[0022] If the calculated hash value of the root node of the aggregate tree is the same as the aggregate reference value, then the data integrity verification is successful.

[0023] Optionally, the method further includes:

[0024] If the data integrity verification passes, the corresponding data is stored.

[0025] If the data integrity verification fails, the corresponding data is discarded or isolated, a log is recorded, and the corresponding source node is requested to retransmit it.

[0026] On the other hand, the present invention also provides a data integrity verification device, the device comprising:

[0027] The receiving module is used to receive data information sent by each source node. The data information includes: source dataset, hash value of subtree root node, and calculation path of subtree root node; the source dataset includes one or more data blocks; the subtree root node is the root node of the subtree generated by the source node based on all data blocks in the source dataset.

[0028] The aggregation module is used to construct an aggregation tree by using the root nodes of the subtrees corresponding to each data information as leaf nodes, calculate the hash value of the aggregation root node based on the hash value of the subtree root node, and generate the calculation path of the aggregation root node; the aggregation root node refers to the root node of the aggregation tree.

[0029] The verification module is used to use the hash value of the subtree root node as a local reference value and the hash value of the aggregate root node as an aggregate reference value, and to perform data integrity verification based on the local reference value and the calculation path of the subtree root node, as well as the aggregate reference value and the calculation path of the aggregate root node.

[0030] Optionally, the verification module includes: a local verification unit and / or a global verification unit;

[0031] The local verification unit is used to verify one or more data blocks in the source dataset;

[0032] The global verification unit is used to verify the data in the data information sent by all source nodes.

[0033] Optionally, the global verification unit includes:

[0034] The subtree root calculation unit is used to calculate the hash value of each data block in each source dataset, and to calculate the hash value of the subtree root node based on the hash value of the data block and the calculation path of the subtree root node corresponding to the source dataset.

[0035] The aggregation root calculation unit is used to calculate the hash value of the aggregation tree root node based on the hash value of each subtree root node and the calculation path of the aggregation root node;

[0036] The judgment unit is used to determine that the data integrity verification is passed if the calculated hash value of the root node of the aggregate tree is the same as the aggregate reference value.

[0037] Optionally, the device further includes:

[0038] The storage module is used to store the corresponding data after the verification module determines that the data integrity verification has passed;

[0039] The processing module is used to discard or isolate the corresponding data, record logs, and request the corresponding source node to retransmit the data after the verification module determines that the data integrity verification has failed.

[0040] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to perform the steps of the data integrity verification method.

[0041] The data integrity verification method and apparatus provided by this invention, based on the data information received from each source node, reduces the computational complexity of the central node by combining distributed construction of local subtrees with aggregate verification. This enables simple and efficient data integrity verification in massive data aggregation scenarios, ensuring data security and better meeting the timeliness requirements of real-time sensitive scenarios. It can provide effective security guarantees for distributed systems such as the Internet of Things, blockchain, and edge computing. Furthermore, the solution of this invention is not limited by the number of source nodes or the amount of data transmitted, and can be arbitrarily expanded, exhibiting strong applicability. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0043] Figure 1 This is a flowchart of a data integrity verification method provided in an embodiment of the present invention;

[0044] Figure 2 This is a flowchart illustrating the verification of local data in an embodiment of the present invention;

[0045] Figure 3 This is a flowchart illustrating the verification of global data in an embodiment of the present invention;

[0046] Figure 4 This is a schematic diagram of a data integrity verification device provided in an embodiment of the present invention;

[0047] Figure 5 This is a schematic diagram of a global verification unit in an embodiment of the present invention;

[0048] Figure 6 This is another structural schematic diagram of the data integrity verification device provided in the embodiments of the present invention. Detailed Implementation

[0049] The specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0050] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0051] For distributed systems, due to the large number of source nodes and the massive amount of data converging at the central node, the central node needs to verify the integrity of this data to ensure its reliability. However, the computational pressure and resource requirements brought about by the massive data volume make traditional centralized verification methods inadequate for meeting the timeliness requirements of real-time sensitive scenarios. Therefore, this invention provides a data integrity verification method and apparatus, employing a two-layer verification architecture of "distributed subtree construction - central lightweight aggregation," which overcomes the bottleneck of traditional centralized verification through responsibility decomposition. This mainly includes the following two aspects:

[0052] (1) Edge-side distributed computing: The source node uses a lightweight algorithm to build a subtree locally and generate the subtree root hash value. This process completely distributes the hash calculation pressure that was originally concentrated on the central node to the data source end, which can make full use of the idle computing power of the edge device.

[0053] (2) Lightweight aggregation at the center: The central node receives the hash value of the subtree root and the corresponding calculation path, and completes the aggregation root calculation through fast iteration. This process does not require rebuilding the complete tree structure or processing the original data, which can reduce the computational load by several orders of magnitude.

[0054] like Figure 1 The diagram shown is a flowchart of a data integrity verification method provided in an embodiment of the present invention, which includes the following steps:

[0055] Step 101: Receive data information sent by each source node. The data information includes: source dataset, hash value of subtree root node, and calculation path of subtree root node.

[0056] The source dataset includes one or more data blocks; the subtree root node is the root node of the subtree generated by the source node based on all the data blocks in the source dataset.

[0057] The data block can be divided by the source node according to the length of the data to be sent, according to a set size. For example, each 1MB of data is read as a data block.

[0058] Assuming the message to be sent k One data block is d 1 , d 2 , ..., d k Then the source dataset Data i = {d 1 , d 2 , ..., d k } Each data block corresponds to a leaf node of a subtree, and the subtree is constructed based on these leaf nodes.

[0059] In some embodiments, the subtree may be a Merkle tree. Specifically, the Merkle tree may be constructed according to the standard Merkle tree construction method, and the Merkle tree corresponding to the source dataset is referred to as the subtree.

[0060] A Merkle tree is a tree-like data structure whose core feature is the use of hash pointers instead of ordinary pointers. The construction process of a Merkle tree is as follows:

[0061] Leaf nodes: The bottom-level leaf nodes of the tree are the hash values ​​of data blocks (e.g., the hash of a file after being divided into blocks, the hash of transaction data).

[0062] Non-leaf nodes (i.e., parent nodes): Each non-leaf node is the hash value of the concatenation of the hash values ​​of all its child nodes.

[0063] Root node: Hash upwards layer by layer to obtain the root node.

[0064] In this embodiment of the invention, the source node can use a hash algorithm (such as the Ascon-Hash algorithm) to calculate each leaf node corresponding to each data block in the source dataset. d j Hash value: h j = H(d j )。 Then, following the standard Merkle tree construction method, the hash values ​​of two adjacent leaf nodes are concatenated and hashed again to form parent nodes, and so on until the root node. That is, parent nodes are calculated layer by layer. parent hash value h {parent} Taking a binary tree as an example: h {parent} = H(h {left} || h {right} ) ,in, h {left} Indicates the parent node parent left child node left hash value, h {right} Indicates the parent node parent right child node right The hash value is used, where || is the concatenation operator, indicating that two hash values ​​are concatenated in order to form a new byte string; this generates the local root hash value, which is the hash value of the root node of the subtree. R i And record the calculation path of the root node of the subtree. Path i Then send data information S i Data information to the central node S i include:{ Data i , R i Path i}

[0065] Step 102: Construct an aggregate tree by using the root nodes of the subtrees corresponding to each data information as leaf nodes, calculate the hash value of the aggregate root node based on the hash value of the subtree root node, and generate the calculation path of the aggregate root node; the aggregate root node refers to the root node of the aggregate tree.

[0066] The central node collects the hash values ​​of the subtree root nodes sent by all data sources (i.e., source nodes). These hash values ​​are used as new leaf nodes, and the same hash algorithm is used to construct a complete Merkle tree, or aggregate tree, from these subtree root node hash values. The root of the aggregate tree is called the aggregate root node. The hash value of the aggregate root node is obtained by calculating the hash values ​​layer by layer. Root agg .

[0067] Step 103: Use the hash value of the subtree root node as the local reference value and the hash value of the aggregate root node as the aggregate reference value. Perform data integrity verification based on the local reference value and the calculation path of the subtree root node, as well as the calculation path of the aggregate reference value and the aggregate root node.

[0068] In some embodiments, only a portion of the data may be validated, such as validating one or more data blocks in the source dataset of a source node. For ease of description, this is referred to as partial data validation.

[0069] A flowchart for performing partial data validation is as follows: Figure 2 As shown, it includes the following steps:

[0070] Step 201: Obtain each data block in the source dataset to which the data block to be verified belongs, and calculate the hash value of each leaf node of the corresponding subtree based on the data block.

[0071] Step 202: Calculate the hash value of the subtree root node based on the hash value of each leaf node and the calculation path of the corresponding subtree root node.

[0072] Step 203: If the hash value of the calculated subtree root node is the same as the local reference value corresponding to the source dataset, then the data block to be verified passes the verification.

[0073] Suppose we want to verify S i data of a certain leaf node d n To determine if a node is complete, first use the same hash algorithm to calculate the values ​​of each leaf node. d j The hash value is obtained; then, using the calculation path of the subtree root node in the subtree, the hash value of the subtree root node is calculated step by step, and compared with the received hash value. S i In R i If the two are the same, the verification passes, proving that the leaf node data is correct. d n Complete; otherwise, there may be tampering or transmission errors.

[0074] In some embodiments, data from all received source nodes can also be verified. To distinguish this from the local data verification mentioned above, this data verification is called global data verification.

[0075] A flowchart for performing partial data validation is as follows: Figure 3 As shown, it includes the following steps:

[0076] Step 301: Calculate the hash value of each data block in each source dataset, and calculate the hash value of the subtree root node based on the hash value of the data block and the calculation path of the subtree root node corresponding to the source dataset.

[0077] Step 302: Calculate the hash value of the aggregated tree root node based on the hash values ​​of each subtree root node and the calculation path of the aggregated root node;

[0078] Step 303: If the calculated hash value of the root node of the aggregate tree is the same as the aggregate reference value, the data integrity verification is successful.

[0079] Suppose we want to verify all data sent by all source nodes. Data i To ensure completeness, the same hash algorithm is first used to calculate the values ​​of each leaf node. d j The hash value of the aggregate tree is calculated by taking the hash value of the aggregate root node and then using the calculation path of the corresponding subtree root node to calculate the hash value of the subtree root node step by step. After calculating the hash values ​​of all subtree root nodes, these subtree root nodes are used as leaf nodes of the aggregate tree. The hash value of the aggregate tree root node is calculated using the calculation path of the aggregate tree root node. Then the hash value of the aggregate root node is compared with the aggregate reference value. If the two are the same, the data integrity verification is successful.

[0080] In some embodiments of the data integrity verification method of the present invention, after the data integrity verification is passed, the corresponding data can be stored locally or sent to other nodes that need the data; if the data integrity verification fails, the corresponding data can be discarded or isolated, a log can be recorded, and the corresponding source node can be requested to retransmit.

[0081] Accordingly, embodiments of the present invention also provide a data integrity verification device, such as... Figure 4 The diagram shown is a structural schematic of the device.

[0082] The data integrity verification device 400 includes the following modules:

[0083] The receiving module 401 is used to receive data information sent by each source node. The data information includes: source dataset, hash value of subtree root node, and calculation path of subtree root node; the source dataset includes one or more data blocks; the subtree root node is the root node of the subtree generated by the source node based on all data blocks in the source dataset.

[0084] The aggregation module 402 is used to construct an aggregation tree by using the root nodes of the subtrees corresponding to each data information as leaf nodes, calculate the hash value of the aggregation root node based on the hash value of the subtree root node, and generate the calculation path of the aggregation root node; the aggregation root node refers to the root node of the aggregation tree.

[0085] The verification module 403 is used to use the hash value of the subtree root node as a local reference value and the hash value of the aggregate root node as an aggregate reference value, and to perform data integrity verification based on the local reference value and the calculation path of the subtree root node, as well as the aggregate reference value and the calculation path of the aggregate root node.

[0086] In some embodiments, the verification module 403 may include a local verification unit and / or a global verification unit. Wherein:

[0087] The local verification unit is used to verify one or more data blocks in the source dataset;

[0088] The global verification unit is used to verify the data in the data information sent by all source nodes.

[0089] One non-restricted structure of the global verification unit is as follows: Figure 5 As shown. In this embodiment, the global verification unit 500 may include the following units:

[0090] The subtree root calculation unit 501 is used to calculate the hash value of each data block in each source dataset, and to calculate the hash value of the subtree root node based on the hash value of the data block and the calculation path of the subtree root node corresponding to the source dataset.

[0091] The aggregation root calculation unit 502 is used to calculate the hash value of the aggregation tree root node based on the hash value of each subtree root node and the calculation path of the aggregation root node;

[0092] The judgment unit 503 is used to determine that the data integrity verification is passed if the calculated hash value of the root node of the aggregation tree is the same as the aggregation reference value.

[0093] like Figure 6 The diagram shown is another structural schematic of the data integrity verification device provided in an embodiment of the present invention.

[0094] and Figure 4 Compared to the illustrated embodiment, in this embodiment, the data integrity verification device 400 further includes: a storage module 404 and a processing module 405. Wherein:

[0095] Storage module 404 is used to store the corresponding data after the verification module determines that the data integrity verification has passed;

[0096] The processing module 405 is used to discard or isolate the corresponding data, record the log, and request the corresponding source node to retransmit after the verification module determines that the data integrity verification has failed.

[0097] The specific implementation methods of the above modules and units can be referred to the description in the previous embodiments of the present invention, and will not be repeated here.

[0098] By utilizing the data integrity verification method and apparatus provided in this invention, the central node only needs to aggregate the hash values ​​of the subtree root nodes, avoiding the processing of original data, thus achieving an exponential reduction in computational load. This collaborative mechanism, combined with the efficient cryptographic characteristics of hash algorithms, significantly improves system throughput while ensuring security, better meeting the timeliness requirements of real-time sensitive scenarios, and providing effective security guarantees for distributed systems such as the Internet of Things, blockchain, and edge computing. Moreover, the solution of this invention is not limited by the number of source nodes or the amount of data transmitted, and can be arbitrarily expanded, exhibiting strong applicability.

[0099] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0100] The present invention also provides a storage medium, which is a computer-readable storage medium storing a computer program thereon, the computer program being executable when it is run. Figure 1 or Figure 2 or Figure 3 The method shown may include some or all of the steps. The storage medium may include read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc. The storage medium may also include non-volatile memory or non-transitory memory, etc.

[0101] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data provider to another website, computer, server, or data provider via wired or wireless means.

[0102] The embodiments of the present invention have been described in detail above. Specific implementation methods have been used to illustrate the present invention. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and apparatus of the present invention, and are only a part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention, and the content of this specification should not be construed as a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A data integrity verification method, characterized in that, The method includes: The system receives data information sent by each source node. The data information includes: source dataset, hash value of subtree root node, and calculation path of subtree root node; the source dataset includes one or more data blocks; the subtree root node is the root node of the subtree generated by the source node based on all data blocks in the source dataset. The root node of each data information subtree is used as a leaf node to construct an aggregate tree. The hash value of the aggregate root node is calculated based on the hash value of the subtree root node, and the calculation path of the aggregate root node is generated. The aggregate root node refers to the root node of the aggregate tree. The hash value of the subtree root node is used as a local reference value, and the hash value of the aggregate root node is used as an aggregate reference value. Data integrity verification is performed based on the local reference value and the calculation path of the subtree root node, as well as the calculation path of the aggregate reference value and the aggregate root node. The data integrity verification includes: Obtain each data block in the source dataset to which the data block to be verified belongs, and calculate the hash value of each leaf node of the corresponding subtree based on the data block; Calculate the hash value of the subtree root node based on the hash value of each leaf node and the calculation path of the corresponding subtree root node; If the hash value of the calculated subtree root node is the same as the local reference value corresponding to the source dataset, then the data block to be verified passes the verification. The data integrity verification process also includes: Calculate the hash value of each data block in each source dataset, and calculate the hash value of the subtree root node based on the hash value of the data block and the calculation path of the subtree root node corresponding to the source dataset; Calculate the hash value of the aggregated tree root node based on the hash values ​​of the root nodes of each subtree and the calculation path of the aggregated root node; If the calculated hash value of the root node of the aggregate tree is the same as the aggregate reference value, the data integrity verification is successful.

2. The data integrity verification method according to claim 1, characterized in that, The method further includes: The source node divides the data to be sent into multiple data blocks to generate a source dataset. Treat each data block in the source dataset as a leaf node and calculate the hash value of each leaf node; Construct a Merkle subtree based on the hash value of the leaf node, obtain the hash value of the root node of the subtree, and record the calculation path of the root node of the subtree.

3. The data integrity verification method according to claim 2, characterized in that, The calculation of the hash value of each leaf node includes: The Ascon-Hash algorithm is used to calculate the hash value of each leaf node.

4. The data integrity verification method according to claim 1, characterized in that, The step of constructing an aggregate tree by using the root node of the subtree corresponding to each data information as the leaf node includes: Construct a Merkle aggregation tree by using the root node of the subtree corresponding to each data information as the leaf node.

5. The data integrity verification method according to any one of claims 1 to 4, characterized in that, The method further includes: If the data integrity verification passes, the corresponding data is stored. If the data integrity verification fails, the corresponding data is discarded or isolated, a log is recorded, and the corresponding source node is requested to retransmit it.

6. A data integrity verification device, characterized in that, The device includes: The receiving module is used to receive data information sent by each source node. The data information includes: source dataset, hash value of subtree root node, and calculation path of subtree root node; the source dataset includes one or more data blocks; the subtree root node is the root node of the subtree generated by the source node based on all data blocks in the source dataset. The aggregation module is used to construct an aggregation tree by using the root nodes of the subtrees corresponding to each data information as leaf nodes, calculate the hash value of the aggregation root node based on the hash value of the subtree root node, and generate the calculation path of the aggregation root node; the aggregation root node refers to the root node of the aggregation tree. The verification module is used to use the hash value of the subtree root node as a local reference value and the hash value of the aggregate root node as an aggregate reference value, and to perform data integrity verification based on the local reference value and the calculation path of the subtree root node, as well as the calculation path of the aggregate reference value and the aggregate root node. The data integrity verification includes: Obtain each data block in the source dataset to which the data block to be verified belongs, and calculate the hash value of each leaf node of the corresponding subtree based on the data block; Calculate the hash value of the subtree root node based on the hash value of each leaf node and the calculation path of the corresponding subtree root node; If the hash value of the calculated subtree root node is the same as the local reference value corresponding to the source dataset, then the data block to be verified passes the verification. The data integrity verification process also includes: Calculate the hash value of each data block in each source dataset, and calculate the hash value of the subtree root node based on the hash value of the data block and the calculation path of the subtree root node corresponding to the source dataset; Calculate the hash value of the aggregated tree root node based on the hash values ​​of the root nodes of each subtree and the calculation path of the aggregated root node; If the calculated hash value of the root node of the aggregate tree is the same as the aggregate reference value, the data integrity verification is successful.

7. The data integrity verification device according to claim 6, characterized in that, The verification module includes: a local verification unit and / or a global verification unit; The local verification unit is used to verify one or more data blocks in the source dataset; The global verification unit is used to verify the data in the data information sent by all source nodes.

8. The data integrity verification device according to claim 7, characterized in that, The global verification unit includes: The subtree root calculation unit is used to calculate the hash value of each data block in each source dataset, and to calculate the hash value of the subtree root node based on the hash value of the data block and the calculation path of the subtree root node corresponding to the source dataset. The aggregation root calculation unit is used to calculate the hash value of the aggregation tree root node based on the hash value of each subtree root node and the calculation path of the aggregation root node; The judgment unit is used to determine that the data integrity verification is passed if the calculated hash value of the root node of the aggregate tree is the same as the aggregate reference value.

9. The data integrity verification device according to any one of claims 6 to 8, characterized in that, The device further includes: The storage module is used to store the corresponding data after the verification module determines that the data integrity verification has passed; The processing module is used to discard or isolate the corresponding data, record logs, and request the corresponding source node to retransmit the data after the verification module determines that the data integrity verification has failed.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program, when run by a processor, performs the steps of the data integrity verification method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data integrity authentication information generation method and device as well as data integrity authentication method and device

    CN102413313A

  • Integrity auditing method and system in edge computing environment

    CN121278787A