Data asset information verification method and device, equipment, medium and program product

CN120804108BActive Publication Date: 2026-09-11SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510636304.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2026-09-11
Estimated Expiration
2045-05-16

AI Technical Summary

Technical Problem

然而,在使用哈希链进行数据校验时,需要逐个比较数据块的哈希值与预期哈希值,该过程会消耗大量的时间,导致数据校验流程效率低下,不符合大数据环境下对数据快速校验的需求

Benefits of technology

[0014] This application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the data asset information verification method as described above.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120804108B_ABST
    Figure CN120804108B_ABST
Patent Text Reader

Abstract

The application provides a data asset information verification method and device, equipment, medium and program product. The method of the application comprises: obtaining to-be-verified data; dividing the to-be-verified data into multiple data; performing hash calculation on the multiple data respectively to obtain a hash value corresponding to each data; generating a target hash value corresponding to the to-be-verified data according to the hash value corresponding to each data; determining a standard hash value corresponding to standard data corresponding to the to-be-verified data; and if the target hash value and the standard hash value are the same, determining that the to-be-verified data passes the reliability (consistency and integrity) verification. Since the application is based on the hash values corresponding to the multiple data to calculate the final single target hash value, and then directly compares the target hash value with the standard hash value, it is not necessary to compare the multiple hash values on the hash chain one by one, and the data processing speed can be significantly improved. The application also provides a verification method based on a Merkle tree, which can improve the data verification efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method, apparatus, equipment, medium, and program product for verifying data asset information. Background Technology

[0002] With the rapid development of big data and cloud computing technologies, the scale of data is growing exponentially, and the types of data are becoming increasingly diverse. Data reliability (integrity, consistency) verification technology, as one of the important means to ensure data security, is fundamentally about accurately and quickly identifying whether data has been tampered with, thus ensuring data reliability.

[0003] Hash chains are a common method for verifying data reliability. They divide the entire dataset into multiple blocks, generate a hash value for each block, and link them together in a linear hash chain structure, where each block's hash value depends on the hash value of its predecessor. However, using hash chains for data verification requires comparing the hash values ​​of each block with the expected hash value, a process that consumes significant time and results in inefficient data verification, failing to meet the demands for rapid data verification in big data environments. Summary of the Invention

[0004] This application provides a data asset information verification method, apparatus, equipment, medium, and program product. The data asset information verification method can avoid the shortcomings of low verification efficiency in traditional verification methods and can significantly improve the efficiency of data verification while maintaining the accuracy of the verification results.

[0005] This application provides a data asset information verification method, wherein the data asset information represents information related to data resources with economic value, and the data asset information verification method includes: Obtain the data to be verified; The data to be verified is divided into multiple data sets; Perform hash calculations on the multiple data sets to obtain the hash value corresponding to each data set; Based on the hash value corresponding to each piece of data, generate the target hash value corresponding to the data to be verified; Determine the standard hash value corresponding to the standard data corresponding to the data to be verified; If the target hash value is the same as the standard hash value, the data to be verified is determined to have passed the reliability verification.

[0006] According to the data asset information verification method provided in this application, the multiple data sets are arranged in sequence; the step of generating a target hash value corresponding to the data to be verified based on the hash value corresponding to each data set includes: For each piece of data corresponding to a hash value, based on the arrangement order of the multiple pieces of data, each preset number of hash values ​​are sequentially divided into a group to obtain multiple groups, and the hash value corresponding to each group is determined according to each hash value in each group. If the number of remaining hash values ​​during the division process is less than the preset number, the remaining hash values ​​are determined as a group. Repeat the above steps until a single combination is obtained; Determine the hash value corresponding to the single combination, and set the hash value corresponding to the single combination as the target hash value corresponding to the data to be verified.

[0007] According to the data asset information verification method provided in this application, determining the hash value corresponding to the single combination includes: According to a preset combination strategy, the hash values ​​in a single combination are combined to obtain the combined data; The combined data is hashed, and the resulting value is used as the hash value corresponding to the individual combination.

[0008] According to the data asset information verification method provided in this application, after determining the standard hash value corresponding to the standard data to be verified, the method further includes: If the target hash value is different from the standard hash value, the hash value corresponding to each combination is compared with the corresponding standard hash value, starting from the single combination, in the reverse order of the generation order of each combination during the partitioning process, to obtain the target combination with inconsistent hash values; In the target combination, the data corresponding to the hash value that is inconsistent with the corresponding standard hash value in the combination with the earliest generation time is determined as the data that is inconsistent with the standard data in the data to be verified.

[0009] According to the data asset information verification method provided in this application, the step of generating a target hash value corresponding to the data to be verified based on the hash value corresponding to each piece of data includes: Based on the generation principle of Merkle trees, a Merkle tree corresponding to the data to be verified is generated according to the hash value corresponding to each piece of data. The hash value corresponding to the root node of the Merkle tree is determined as the target hash value corresponding to the data to be verified.

[0010] According to the data asset information verification method provided in this application, the step of performing hash calculations on the multiple data sets to obtain the hash value corresponding to each data set includes: The multiple data sets are hashed using a preset hash algorithm to obtain the hash value corresponding to each data set. The preset hash algorithm includes any one of the following: 256-bit Secure Hash Algorithm, third-generation Secure Hash Algorithm, or Message Digest Algorithm Version 5.

[0011] This application also provides a data asset information verification device, wherein the data asset information represents information related to data resources with economic value, and the data asset information verification device includes: The acquisition module is used to acquire the data to be verified. A partitioning module is used to divide the data to be verified into multiple data sets. The calculation module is used to perform hash calculations on the multiple data sets respectively to obtain the hash value corresponding to each data set; The generation module is used to generate the target hash value corresponding to the data to be verified based on the hash value corresponding to each piece of data; The first determining module is used to determine the standard hash value corresponding to the standard data corresponding to the data to be verified; The second determining module is used to determine that the data to be verified passes the reliability verification if the target hash value is the same as the standard hash value.

[0012] According to the data asset information verification device provided in this application, the multiple data files are arranged in sequence, and the generation module includes: The first partitioning submodule is used to partition each preset number of hash values ​​into a group based on the arrangement order for each data hash value, thereby obtaining multiple groups, and to determine the hash value corresponding to each group according to each hash value in each group. If the number of remaining hash values ​​during the partitioning process is less than the preset number, the remaining hash values ​​are determined as a group. The second partitioning submodule is used to repeat the above steps until a single combination is obtained; The first determining submodule is used to determine the hash value corresponding to the single combination, and to determine the hash value corresponding to the single combination as the target hash value corresponding to the data to be verified.

[0013] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data asset information verification method as described above.

[0014] This application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the data asset information verification method as described above.

[0015] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the data asset information verification method as described above.

[0016] This application provides a data asset information verification method, apparatus, device, medium, and program product. When using the data verification scheme provided in this application, the data to be verified is first obtained and divided into multiple data sets. Next, hash calculations are performed on each of the multiple data sets to obtain a hash value corresponding to each data set. Then, based on the hash value corresponding to each data set, a target hash value corresponding to the data to be verified is generated. Finally, a standard hash value corresponding to the standard data corresponding to the data to be verified is determined. If the target hash value is the same as the standard hash value, the data to be verified is determined to have passed the reliability verification. Since this application calculates the final single target hash value based on the hash values ​​corresponding to multiple data sets, and then directly compares the target hash value with the standard hash value, compared to the traditional hash chain-based verification method, it eliminates the need to verify multiple hash values ​​on the hash chain one by one, significantly improving data processing speed and thus improving the efficiency of data verification. Attached Figure Description

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

[0018] Figure 1 This is a flowchart illustrating a data asset information verification method according to an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a Merkle tree shown in one embodiment of this application; Figure 3 This is a schematic diagram of the structure of a data asset information verification device according to an embodiment of this application; Figure 4 This is a schematic diagram of the physical structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] The execution subject of the data asset information verification method provided in this application can be a data asset information verification device or an electronic device. The electronic device can be a server or a terminal device used by the user.

[0021] The embodiments of this application will be further described below, taking an electronic device as the executing entity and the electronic device as a server as an example.

[0022] Figure 1 This is a flowchart illustrating a data asset information verification method according to an embodiment of this application. (Refer to...) Figure 1 The data asset information verification method of this application includes the following steps: Step 101: Obtain the data to be verified.

[0023] In step 101, the server establishes a communication connection with one or more terminal devices on the user side. This communication connection can be a network connection based on Wi-Fi (Wireless Fidelity), cellular networks, or other types of communication connections. The specific connection can be configured according to actual needs, and this embodiment does not impose any specific restrictions on it.

[0024] In one implementation, when the server determines that data in a terminal device needs to be verified, it can send a data verification request to the terminal device. After receiving the data verification request, the terminal device sends the data to be verified as indicated in the data verification request to the server as response data, and the server uses the data to be verified as the data to be verified.

[0025] In another approach, when a terminal device determines that it needs to verify its internal data, it sends a data verification request to the server and sends the data to be verified to the server. After receiving the data verification request and the data to be verified, the server takes the data to be verified as the data to be verified.

[0026] In this application, the data to be verified belongs to data asset information. Data asset information represents information related to data resources with economic value, which may specifically include data product name (to ensure users can accurately identify each product), data size (indicating the asset's storage space requirements and providing a reference for data management and transmission), industry (recording the asset's application area to ensure its relevance and applicability), completion time (the time when it was completed or prepared), release time (the time when it was officially released or became available for use, indicating that relevant personnel can access or use the resource from this moment), data description (providing a brief description of the asset, including its main characteristics and uses, enabling users to quickly grasp the core value of the asset), application scenario (providing a description of the actual application scenarios of the data product), etc. The specific type of data asset information can be set according to actual needs, and this embodiment does not impose specific limitations on it.

[0027] Step 102: Divide the data to be verified into multiple data sets.

[0028] The number of data segments can be set according to actual business needs.

[0029] In practice, the number of data partitions can be adapted to the server's data processing capabilities. When the server has strong data processing capabilities, the number of data partitions can be set to a larger value, allowing the server to process more data partitions in parallel at the same time, thereby enhancing data processing efficiency and data verification efficiency.

[0030] In one implementation, if the data to be verified comes from multiple different terminal devices, the server can treat the data from a single terminal device as a single set of data. In another implementation, if the data to be verified comes from a single terminal device and the data volume is large, the server can divide the data to be verified into multiple sets of data according to different data categories.

[0031] Step 103: Perform hash calculations on multiple data sets to obtain the hash value corresponding to each data set.

[0032] In step 103, the server can perform hash calculations on each piece of data simultaneously to obtain the hash value corresponding to each piece of data.

[0033] Specifically, step 103 may include: Multiple data sets are hashed using a preset hash algorithm to obtain the hash value for each data set. The preset hash algorithm can be any of the following: 256-bit Secure Hash Algorithm, Third Generation Secure Hash Algorithm, or Message Digest Algorithm Version 5.

[0034] Among them, the Secure Hash Algorithm 256-bit (SHA-256) is a variant of the SHA-2 (Secure Hash Algorithm 2) series. It has many characteristics such as irreversibility (it is impossible to deduce the original input data from the hash value), uniqueness (different input data will produce different hash values, even if the input data has only slight differences), fixed length (regardless of the length of the input data, the length of the output hash value is always 256 bits), high security (because the hash value length is fixed and irreversible, it is difficult for attackers to find the original data), and collision resistance (even if there are slight changes in the input data, the hash value will change drastically, making it difficult to tamper with).

[0035] The third-generation Secure Hash Algorithm (SHA-3) mainly includes four versions: SHA3-224, SHA3-256, SHA3-384, and SHA3-512. The main difference lies in the length of the output hash value, which is 224 bits, 256 bits, 384 bits, and 512 bits respectively. The SHA-3 algorithm possesses many characteristics, including high security (the algorithm uses a complex mathematical structure and computational difficulty, making it difficult for attackers to forge hash values ​​through brute force or other attack methods), strong collision resistance (even with slight changes in the input data, the hash value generated by the SHA-3 algorithm will be significantly different, thus ensuring the uniqueness and collision resistance of the hash value), efficiency (the algorithm uses a structure called a "sponge function," which can process multiple input data blocks simultaneously, thereby improving the algorithm's efficiency), and flexibility (the algorithm can adapt to different application scenarios, including digital signatures, data integrity verification, and cryptographic hashing, and supports multiple output lengths, allowing the extraction of hash values ​​of different lengths as needed).

[0036] The Message-Digest Algorithm 5 (MD5) has the characteristics of compression (the length of the calculated MD5 value is a fixed 128 bits regardless of the length of the input message) and resistance to modification (any small change to the input message will cause a large change in the calculated MD5 value, which can be used to detect whether the information has been tampered with).

[0037] Since hardware support for SHA-3 is not as widespread as that for SHA-256 (SHA-256 has better compatibility), and in some scenarios, SHA-256 outperforms SHA-3 in terms of performance and efficiency, and SHA-256 has significant advantages over MD5 in terms of security, collision resistance, and many other aspects, this embodiment mainly uses SHA-256 to ensure fast data processing.

[0038] In practice, the specific hash algorithm can be selected based on the server's performance and business requirements. Alternatively, other hash algorithms besides those listed above can be used. This embodiment does not impose any specific restrictions on this.

[0039] Step 104: Generate the target hash value corresponding to the data to be verified based on the hash value corresponding to each piece of data.

[0040] In step 104, a preset processing strategy can be adopted to generate a corresponding target hash value for the entire data to be verified based on all the hash values ​​obtained in step 103. The preset processing strategy will be described in detail later.

[0041] Step 105: Determine the standard hash value corresponding to the standard data corresponding to the data to be verified.

[0042] In this embodiment, the server pre-generates a standard hash value based on the standard data using the aforementioned preset processing strategy, and stores it, for example, in a database. Thus, when determining the standard hash value corresponding to the standard data, the standard hash value can be directly read from the database, thereby improving the efficiency of subsequent data processing and verification.

[0043] Step 106: If the target hash value is the same as the standard hash value, the data to be verified has passed the reliability check.

[0044] In this embodiment, the principle for generating the target hash value is exactly the same as the principle for generating the standard hash value. Therefore, if the target hash value is the same as the standard hash value, it indicates that the data to be verified is accurate and has not been tampered with, that is, the data to be verified is complete and consistent with the standard data in the server. Thus, the reliability of the data to be verified is guaranteed, meaning the data to be verified passes the reliability check. Conversely, if the target hash value is different from the standard hash value, it indicates that the data to be verified has been tampered with, that is, the data to be verified is incomplete and inconsistent with the standard data in the server. Therefore, the reliability of the data to be verified cannot be guaranteed, meaning the data to be verified fails the reliability check.

[0045] The data asset information verification method of this application first obtains the data to be verified and divides it into multiple data sets. Next, hash calculations are performed on each data set to obtain a hash value for each data set. Then, based on the hash values ​​of each data set, a target hash value is generated for the data to be verified. Finally, a standard hash value corresponding to the standard data set is determined. If the target hash value matches the standard hash value, the data to be verified passes the reliability verification. Since this application calculates the final single target hash value based on the hash values ​​of multiple data sets and then directly compares the target hash value with the standard hash value, compared to the traditional hash chain-based verification method, it eliminates the need to compare multiple hash values ​​on the hash chain one by one, significantly improving data processing speed and thus data verification efficiency.

[0046] In conjunction with the above embodiments, in one implementation, multiple data sets are arranged sequentially. Accordingly, in step 104, generating a target hash value corresponding to the data to be verified based on the hash value corresponding to each data set may include: Step 1041: For each piece of data, based on the order of arrangement, divide each preset number of hash values ​​into a group to obtain multiple groups, and determine the hash value corresponding to each group according to each hash value in each group. If the number of remaining hash values ​​during the division process is less than the preset number, the remaining hash values ​​are determined as a group.

[0047] For example, if the multiple data obtained by partitioning are arranged in order, including data 1, data 2, ... data 8, and the preset quantity is 2, then the hash values ​​corresponding to data 1 and data 2 are taken as combination 1, the hash values ​​corresponding to data 3 and data 4 are taken as combination 2, the hash values ​​corresponding to data 5 and data 6 are taken as combination 3, and the hash values ​​corresponding to data 7 and data 8 are taken as combination 4.

[0048] For another example, if the multiple data obtained from the division are arranged in order, including data 1, data 2, ..., data 7, and the preset quantity is 2, then the hash values ​​corresponding to data 1 and data 2 are taken as combination 1, the hash values ​​corresponding to data 3 and data 4 are taken as combination 2, the hash values ​​corresponding to data 5 and data 6 are taken as combination 3, and since there is 1 data 7 left, the number of data 7 is less than 2, so the hash value corresponding to data 7 is taken as combination 4.

[0049] After obtaining combinations 1 through 4, calculate the hash value corresponding to each combination.

[0050] If a combination contains a preset number of hash values, then the preset number of hash values ​​are first concatenated in the order they are arranged, and then the hash value is calculated on the concatenated result. The resulting value is used as the hash value corresponding to the entire combination. If a combination contains only one hash value, then the hash value is calculated again on that hash value, and the resulting value is used as the hash value corresponding to the entire combination.

[0051] For example, for combination 1, first concatenate the hash values ​​corresponding to data 1 and data 2 in order, calculate the hash value of the concatenated result, and use the resulting value as the hash value corresponding to combination 1. As another example, for combination 4, which only contains the hash value corresponding to data 7, calculate the hash value of the hash value corresponding to data 7 again, and use the resulting value as the hash value corresponding to combination 4.

[0052] Step 1042: Repeat the above steps until a single combination is obtained.

[0053] Following the example above, for the obtained combinations 1 to 4, the hash values ​​corresponding to combinations 1 and 2 are taken as combination 1', and the hash values ​​corresponding to combinations 3 and 4 are taken as combination 2'. The hash values ​​corresponding to combinations 1' and 2' are calculated respectively. The principle of calculating the hash values ​​is exactly the same as the principle of calculating the hash values ​​in step 1041.

[0054] Specifically, for combination 1', the hash values ​​corresponding to combination 1 and combination 2 are concatenated first, and then the hash value of the concatenated result is calculated, and the obtained value is used as the hash value corresponding to combination 1'; for combination 2', the hash values ​​corresponding to combination 3 and combination 4 are concatenated first, and then the hash value of the concatenated result is calculated, and the obtained value is used as the hash value corresponding to combination 2'.

[0055] Next, combination 1' and combination 2' are divided into combination 1''. Since only one combination remains after this division, combination 1'' is the single combination described in step 1042.

[0056] Step 1043: Determine the hash value corresponding to a single combination, and set the hash value corresponding to the single combination as the target hash value corresponding to the data to be verified.

[0057] Specifically, determining the hash value corresponding to a single combination can include: According to the preset combination strategy, the hash values ​​in a single combination are combined to obtain the combined data; Perform a hash calculation on the combined data, and use the resulting value as the hash value corresponding to each individual combination.

[0058] The preset combination strategy can be splicing, XOR, or other combination methods, which can be set according to actual needs.

[0059] For example, if a single combination includes a first hash value and a second hash value, determining the hash value corresponding to the single combination may include: The first hash value and the second hash value are combined to obtain the combined data; Perform a hash calculation on the combined data to obtain the hash value corresponding to each combination.

[0060] In step 1043, the principle of calculating the hash value corresponding to a single combination is the same as the principle of calculating the hash value corresponding to each combination in step 1041, and will not be repeated here in this embodiment.

[0061] Steps 1041-1043 above give the principle of calculating the target hash value of the data to be verified. In actual implementation, the principle of calculating the standard hash value of the standard data corresponding to the data to be verified is exactly the same as the calculation principle in steps 1041-1043, so it will not be repeated here.

[0062] Secondly, in this application, the preset quantity is typically a value not less than 2. The preset quantity can be set according to actual needs, and this embodiment does not impose specific limitations on it.

[0063] In this embodiment, a method for generating the target hash value corresponding to the data to be verified is provided. By continuously dividing and combining the hash values ​​corresponding to multiple data and generating new combination hash values, the target hash value uniquely corresponding to the entire data to be verified can be calculated quickly, which can significantly improve the verification efficiency of the data to be verified.

[0064] In conjunction with the above embodiments, in one implementation, step 104 involves generating a target hash value corresponding to the data to be verified based on the hash value corresponding to each piece of data, including: Based on the generation principle of Merkle trees, a Merkle tree corresponding to the data to be verified is generated according to the hash value corresponding to each piece of data. The hash value corresponding to the root node of the Merkle tree is determined as the target hash value corresponding to the data to be verified.

[0065] Merkle trees, also known as hash trees, are binary trees whose basic structure includes: Leaf node: The lowest level node in the tree. Each leaf node stores the hash value of a data block.

[0066] Non-leaf nodes: Nodes other than leaf nodes. Each non-leaf node stores a combination of the hash values ​​of its two child nodes (calculated using a hash function).

[0067] Root node: The top-level node of the tree, storing the hash value of the entire tree, also known as the root hash or top hash. The top hash is calculated level by level from the hash values ​​of all child nodes in the hash tree, representing the integrity of the entire dataset. If the top hash value matches the expected value, it means that the dataset is complete and has not been tampered with, and is reliable.

[0068] In this embodiment, based on a pre-defined Merkle tree structure and the Merkle tree generation principle, the hash values ​​corresponding to multiple data sets are used as leaf nodes of the Merkle tree to be generated. Thus, based on each leaf node, the hash value corresponding to the child node of the next higher level can be calculated. Then, based on the hash value of the child node at that level, the hash value corresponding to the child node at the level above that level can be calculated. This process is repeated until the hash value corresponding to the root node is calculated. The hash value corresponding to the root node is the root hash (or top-level hash), which is also the target hash value corresponding to the data to be verified. During the generation of adjacent data, there must be a common parent node. The hash values ​​of each pair of leaf nodes are combined to generate a new node at the next higher level. This process is recursively performed until only one node remains, which is the root node of the Merkle tree.

[0069] The structure of a Merkel tree can be as follows: Figure 2 As shown. Figure 2 This is a schematic diagram illustrating the structure of a Merkle tree according to an embodiment of this application. (Refer to...) Figure 2 Leaf node 1 stores the hash value corresponding to data L1, and leaf node 2 stores the hash value corresponding to data L2. By concatenating the hash values ​​corresponding to data L1 and data L2 and then taking the hash value, we can obtain the hash value of the same parent node (i.e., child node X) of leaf node 1 and leaf node 2.

[0070] For example, assuming the data to be verified is divided into 8 parts (data 1-data 8), based on the Merkle tree generation principle, the hash values ​​corresponding to the 8 parts of data need to be used as the hash values ​​corresponding to the 8 leaf nodes. Specifically, the hash value corresponding to data 1 is used as the hash value corresponding to leaf node 1, the hash value corresponding to data 2 is used as the hash value corresponding to leaf node 2, and so on, until the hash value corresponding to data 8 is used as the hash value corresponding to leaf node 8. Next, the hash values ​​corresponding to leaf node 1 and leaf node 2 are combined to obtain the hash value corresponding to the same parent node of leaf node 1 and leaf node 2 (hereinafter referred to as node 1). The hash values ​​corresponding to leaf node 3 and leaf node 4 are combined to obtain the hash value corresponding to the same parent node of leaf node 3 and leaf node 4 (hereinafter referred to as node 2). The hash values ​​corresponding to leaf node 5 and leaf node 6 are combined to obtain the hash value corresponding to the same parent node of leaf node 5 and leaf node 6 (hereinafter referred to as node 3). The hash values ​​corresponding to leaf node 7 and leaf node 8 are combined to obtain the hash value corresponding to the same parent node of leaf node 7 and leaf node 8 (hereinafter referred to as node 4). Next, the hash values ​​corresponding to nodes 1 and 2 are combined to obtain the hash value corresponding to the same parent node of nodes 1 and 2 (hereinafter referred to as node 1'). Similarly, the hash values ​​corresponding to nodes 3 and 4 are combined to obtain the hash value corresponding to the same parent node of nodes 3 and 4 (hereinafter referred to as node 2'). Then, the hash values ​​corresponding to nodes 1' and 2' are combined to obtain the hash value corresponding to the same parent node of nodes 1' and 2' (hereinafter referred to as node 1''). At this point, only node 1'' remains. Therefore, node 1'' is the root node of the generated Merkle tree, and the hash value corresponding to node 1'' is the top-level hash, which is also the target hash value corresponding to the entire data to be verified.

[0071] To illustrate further, suppose the data to be verified is divided into three parts (data 1-data 3). Based on the Merkle tree generation principle, the hash values ​​corresponding to the three parts of data need to be used as the hash values ​​of the three leaf nodes. Specifically, the hash value corresponding to data 1 is used as the hash value of leaf node 1, the hash value corresponding to data 2 is used as the hash value of leaf node 2, and the hash value corresponding to data 3 is used as the hash value of leaf node 3. Next, the hash values ​​corresponding to leaf node 1 and leaf node 2 are combined to obtain the hash value of the same parent node of leaf node 1 and leaf node 2 (hereinafter referred to as node 1). The hash value corresponding to leaf node 3 is directly used as the hash value of its parent node (hereinafter referred to as node 2). Next, the hash values ​​corresponding to node 1 and node 2 are combined to obtain the hash value of the same parent node of node 1 and node 2 (hereinafter referred to as node 1'). At this point, only node 1' remains. Therefore, node 1' is the root node of the generated Merkle tree.

[0072] This embodiment presents another method for generating the target hash value corresponding to the data to be verified. Based on the generation principle of Merkle tree, a Merkle tree corresponding to the data to be verified is generated, which can quickly calculate the target hash value of the data to be verified and significantly improve the verification efficiency of the data to be verified.

[0073] In conjunction with the above embodiments, in one implementation, this application provides a first method for determining the difference data between the data to be verified and standard data. Specifically, after determining the standard hash value corresponding to the standard data corresponding to the data to be verified, the method further includes: If the target hash value is different from the standard hash value, it is determined that the data to be verified has failed the reliability check.

[0074] If the data to be verified fails the reliability verification, the method of this application may further include: If the target hash value is different from the standard hash value, the hash value corresponding to each combination is compared with the corresponding standard hash value, starting from a single combination, in the reverse order of the generation order of each combination during the partitioning process, to obtain the target combination with inconsistent hash values; In the target combination, the data corresponding to the hash value that is inconsistent with the corresponding standard hash value in the combination with the earliest generation time is identified as the data that is inconsistent with the standard data and is to be verified.

[0075] For example, following the previous embodiment, if the combinations generated in the first step are combination 1, combination 2, combination 3, and combination 4, the second step generates combination 1' based on combination 1 and combination 2, and generates combination 2' based on combination 3 and combination 4, and the third step generates combination 1'' based on combination 1' and combination 2', then the hash value of combination 1'' is first compared with the corresponding pre-stored standard hash value. If they are inconsistent, the hash values ​​of combination 1' and combination 2' are then compared with the corresponding standard hash value. If the hash value of combination 1' is inconsistent with the standard hash value, the hash values ​​of combination 1 and combination 2 are further compared with the corresponding standard hash value. If the hash value of combination 1 is inconsistent with the corresponding standard hash value, then each hash value contained in combination 1 is compared with the corresponding standard hash value. For example, when combination 1 contains hash value 1 and hash value 2, if hash value 1 is different from the corresponding standard hash value, it means that the data corresponding to hash value 1 is data that is different from the standard data of the entire data to be verified. In the above process, combination 1'', combination 1', and combination 1 are the target combinations, combination 1 is the earliest generated combination among the target combinations, and hash value 1 is the hash value of the earliest generated combination that is inconsistent with the corresponding standard hash value.

[0076] In the above process, since the hash value of combination 2' is consistent with the corresponding standard hash value, it is unnecessary to compare combinations 3 and 4 below combination 2'. Similarly, since the hash value of combination 2 is consistent with the corresponding standard hash value, it is unnecessary to compare each hash value contained in combination 2 with its corresponding standard hash value individually. This method allows for quick location of discrepancies between the data to be verified and the standard data, enabling rapid identification of the differences between the two.

[0077] In practice, no matter how many inconsistencies exist between the data to be verified and the standard data, the above method can be used to quickly locate all inconsistencies, so as to quickly find the differences between the two data.

[0078] To illustrate further, if a Merkle tree is generated for the data to be verified, then when locating the difference data, starting from the root node of the Merkle tree, since the top-level hash stored in the root node is inconsistent with the standard top-level hash, the hash values ​​of the next-level child nodes are compared with the corresponding standard hash values. When a child node's hash value is inconsistent with the corresponding standard hash value, the comparison continues for that child node, comparing the hash values ​​of its next-level child nodes with the corresponding standard hash values, until a leaf node with inconsistent hash values ​​is found. The data corresponding to the hash value stored in this leaf node is the difference data between the data to be verified and the standard data. The principle of the entire traversal is exactly the same as in the previous embodiment. If the root node of the Merkle tree is node 1'', the child nodes of node 1'' are node 1' and node 2', the child nodes of node 1' are node 1 and node 2, the child nodes of node 2' are node 3 and node 4, the child nodes of node 1 are leaf nodes 1 and leaf nodes 2, the child nodes of node 2 are leaf nodes 3 and leaf nodes 4, the child nodes of node 3 are leaf nodes 5 and leaf nodes 6, and the child nodes of node 4 are leaf nodes 7 and leaf nodes 8. When the top-level hash corresponding to node 1'' is inconsistent with the standard top-level hash, the hash values ​​corresponding to node 1'' and node 2' are compared with their respective standard hash values. If the hash value corresponding to node 1'' is consistent with the standard hash value, but the hash value corresponding to node 2' is inconsistent, then the hash values ​​corresponding to nodes 3 and 4 are compared with their respective standard hash values, without comparing the hash values ​​corresponding to nodes 1 and 2 with their respective standard hash values. If the hash value corresponding to node 3 matches the corresponding standard hash value, while the hash value corresponding to node 4 does not, then the hash values ​​corresponding to leaf nodes 7 and 8 are compared with their respective standard hash values, instead of comparing the hash values ​​corresponding to leaf nodes 5 and 6. If the hash value corresponding to leaf node 7 matches the corresponding standard hash value, while the hash value corresponding to leaf node 8 does not, then the data corresponding to leaf node 8 is the difference data between the data to be verified and the standard data. This application also provides a second method for determining the difference data between the data to be verified and the standard data, including: The hash value corresponding to each data set is compared with the corresponding standard hash value. If there are inconsistent hash values, the data corresponding to these inconsistent hash values ​​are used as the difference data between the data to be verified and the standard data.

[0079] For example, when the data to be verified is divided into multiple data sets including data 1 to data 8, if the data to be verified fails the reliability check, the hash value corresponding to data 1 is compared with the corresponding standard hash value (the hash value of the data corresponding to data 1 in the standard data), the hash value corresponding to data 2 is compared with the corresponding standard hash value, and so on, until the hash value corresponding to each data set is compared with the corresponding standard hash value. If the final comparison result is that only the hash values ​​corresponding to data 1 and data 3 are inconsistent with the corresponding standard hash value, then data 1 and data 3 are determined to be the difference data between the data to be verified and the standard data.

[0080] In this embodiment, when the amount of data to be verified is small, the difference data can be determined using either the first or second method described above. When the amount of data is large, it is recommended to use the first method to determine the difference data, as it requires fewer comparisons and can significantly improve data processing efficiency. Of course, in actual implementation, other methods can also be used to determine the difference data between the data to be verified and the standard data, and this embodiment does not impose specific limitations on this.

[0081] This embodiment allows for the reverse comparison of the hash values ​​of each generated combination with the corresponding pre-stored standard hash values ​​when the data to be verified fails the reliability check. This identifies combinations with discrepancies and further pinpoints the tampered data. This method can quickly locate tampered data within the data to be verified, facilitating subsequent data processing.

[0082] The above embodiments are all described using a server as the executing entity. The mode in which the server executes the data asset information verification method of this application is the online verification mode, and the mode in which the user-side terminal device executes the data asset information verification method of this application is the offline verification mode. In the online verification mode, when the server determines to verify the data in the user-side terminal device, it receives the data to be verified sent by each terminal device, then generates a target hash value corresponding to the data to be verified, and compares it with the standard hash value corresponding to the standard data pre-stored in the database. If they match, it indicates that the data to be verified is reliable. In the offline verification mode, since the user-side terminal device cannot establish a communication connection with the server, the terminal device generates a target hash value corresponding to the data to be verified, compares it with the standard hash value corresponding to the standard data pre-issued by the server, and if they match, it indicates that the data to be verified is reliable.

[0083] In this application, the interaction modes between the server and the terminal device include, but are not limited to, BS architecture (Browser-Server Architecture) and CS architecture (Client-Server Architecture).

[0084] In a browser-server (BS) architecture, terminal devices interact with the server through a browser without requiring the installation of a specific client application. During data validation, the browser sends the data to be validated to the server, which then validates the data and returns the validation result to the browser.

[0085] In a client-server (CS) architecture, a specific client application needs to be installed on the terminal device (responsible for displaying the interface to the user, receiving user input commands, and sending these commands to the server for processing). During data validation, the client is responsible for sending the data to be validated to the server, which then validates the data and returns the validation result to the client.

[0086] In this embodiment, the terminal device and the server can perform data verification through various interaction modes, enabling the data asset information verification method to be implemented in more scenarios and significantly enhancing the applicability of the data asset information verification method of this application.

[0087] The data asset information verification method of this application will be described below with an embodiment. In this embodiment, the server is communicatively connected to multiple different terminal devices (including terminal device X and terminal device Y) on the user side.

[0088] In online verification mode, if the server determines that it needs to verify the asset data in terminal devices X and Y, it sends a data verification request to both devices. Terminal devices X and Y respond to the request, returning the asset data to be verified to the server. For the asset data sent by terminal device X, the server generates a corresponding target hash value and compares it with a pre-stored standard hash value in the database. If they match, the reliability verification of the asset data in terminal device X is considered successful. Similarly, for the asset data sent by terminal device Y, the server generates a corresponding target hash value and compares it with a pre-stored standard hash value in the database. If they match, the reliability verification of the asset data in terminal device Y is considered successful. The verification of asset data in terminal devices X and Y can be performed in parallel.

[0089] If the data verification of a terminal device fails during the verification process, an alarm message will be output, and the inconsistent data content will be identified and output.

[0090] In the above process, terminal device X (or terminal device Y) may determine the asset data that needs to be verified, send a data verification request to the server, and send the asset data to be verified to the server for verification.

[0091] In offline verification mode, if terminal device X determines that it needs to verify internal asset data, terminal device X generates a target hash value corresponding to the data to be verified, compares it with the standard hash value corresponding to the standard data pre-issued by the server, and if they match, the reliability verification is confirmed to be successful.

[0092] The process of generating the target hash value and locating the difference data are detailed above and will not be repeated here in this embodiment.

[0093] In summary, the data asset information verification method of this application has at least the following technical effects: (1) Divide the data to be verified into multiple data, and through continuous division and combination and layer-by-layer hash calculation, form a unique target hash value for the entire data to be verified. The integrity and consistency of the data to be verified can be quickly verified through this target hash value, ensuring that the data to be verified has not been tampered with during transmission and storage. Therefore, the efficiency of data verification can be significantly improved while maintaining accuracy.

[0094] (2) An offline verification mechanism is provided. The offline verification mechanism does not rely on a real-time network connection, ensuring that data reliability (integrity and consistency) verification can be performed even in a network-free environment. By using pre-stored standard hash values, terminal devices can quickly compare the target hash value generated by the data to be verified, thus verifying the reliability of the data. This mechanism enhances the reliability and adaptability of the system, and is particularly suitable for data verification in environments with unstable or no network.

[0095] (3) When the data to be verified fails the reliability check, the hash values ​​of each generated combination can be compared with the pre-stored standard hash values ​​to find the combinations that differ, and further find the data that differs. This method can quickly locate the tampered data in the data to be verified, providing convenience for the subsequent processing of the data.

[0096] The data asset information verification device provided in this application is described below. The data asset information verification device described below can be referred to in correspondence with the data asset information verification method described above.

[0097] Figure 3 This is a schematic diagram illustrating the structure of a data asset information verification device according to an embodiment of this application. (Refer to...) Figure 3 The data asset information verification device 300 provided in this application includes: Module 301 is used to acquire the data to be verified. The partitioning module 302 is used to divide the data to be verified into multiple data sets. The calculation module 303 is used to perform hash calculations on the multiple data sets respectively to obtain the hash value corresponding to each data set; The generation module 304 is used to generate a target hash value corresponding to the data to be verified based on the hash value corresponding to each piece of data. The first determining module 305 is used to determine the standard hash value corresponding to the standard data corresponding to the data to be verified; The second determining module 306 is used to determine that the data to be verified passes the reliability verification if the target hash value is the same as the standard hash value.

[0098] According to the data asset information verification device 300 provided in this application, the multiple data files are arranged in sequence, and the generation module 304 includes: The first partitioning submodule is used to partition each preset number of hash values ​​into a group based on the arrangement order for each data hash value, thereby obtaining multiple groups, and to determine the hash value corresponding to each group according to each hash value in each group. If the number of remaining hash values ​​during the partitioning process is less than the preset number, the remaining hash values ​​are determined as a group. The second partitioning submodule is used to repeat the above steps until a single combination is obtained; The first determining submodule is used to determine the hash value corresponding to the single combination, and to determine the hash value corresponding to the single combination as the target hash value corresponding to the data to be verified.

[0099] According to the data asset information verification device 300 provided in this application, the first determining submodule includes: The processing submodule is used to combine the hash values ​​in the single combination according to a preset combination strategy to obtain the combined data; The first calculation submodule is used to perform hash calculation on the combined data and use the obtained value as the hash value corresponding to the individual combination.

[0100] According to the data asset information verification device 300 provided in this application, it further includes: The comparison module is used to compare the hash values ​​of each combination with the corresponding standard hash values ​​in the reverse order of the generation order of each combination in the partitioning process if the target hash value is different from the standard hash value, starting with the single combination, to obtain the target combination with inconsistent hash values. The third determining module is used to determine, in the target combination, the data corresponding to the hash value that is inconsistent with the corresponding standard hash value in the combination with the earliest generation time as the data that is inconsistent with the standard data in the data to be verified.

[0101] According to the data asset information verification device 300 provided in this application, the generation module 304 includes: The generation submodule is used to generate the Merkle tree corresponding to the data to be verified based on the generation principle of Merkle tree and the hash value corresponding to each piece of data. The second determining submodule is used to determine the hash value corresponding to the root node of the Merkle tree as the target hash value corresponding to the data to be verified.

[0102] According to the data asset information verification device 300 provided in this application, the calculation module 303 includes: The second calculation submodule is used to perform hash calculations on the multiple data sets using a preset hash algorithm to obtain the hash value corresponding to each data set. The preset hash algorithm can be any one of the following: Secure Hash Algorithm 256-bit, Third Generation Secure Hash Algorithm, or Message Digest Algorithm Version 5.

[0103] Figure 4 This is a schematic diagram of the physical structure of an electronic device according to an embodiment of this application, as shown below. Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute the data asset information verification method of this application, the method including: Obtain the data to be verified; The data to be verified is divided into multiple data sets; Perform hash calculations on the multiple data sets to obtain the hash value corresponding to each data set; Based on the hash value corresponding to each piece of data, generate the target hash value corresponding to the data to be verified; Determine the standard hash value corresponding to the standard data corresponding to the data to be verified; If the target hash value is the same as the standard hash value, the data to be verified is determined to have passed the reliability verification.

[0104] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the 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 to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0105] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the data asset information verification method provided by the above methods, the method including: Obtain the data to be verified; The data to be verified is divided into multiple data sets; Perform hash calculations on the multiple data sets to obtain the hash value corresponding to each data set; Based on the hash value corresponding to each piece of data, generate the target hash value corresponding to the data to be verified; Determine the standard hash value corresponding to the standard data corresponding to the data to be verified; If the target hash value is the same as the standard hash value, the data to be verified is determined to have passed the reliability verification.

[0106] Furthermore, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the data asset information verification method provided by the above methods, the method comprising: Obtain the data to be verified; The data to be verified is divided into multiple data sets; Perform hash calculations on the multiple data sets to obtain the hash value corresponding to each data set; Based on the hash value corresponding to each piece of data, generate the target hash value corresponding to the data to be verified; Determine the standard hash value corresponding to the standard data corresponding to the data to be verified; If the target hash value is the same as the standard hash value, the data to be verified is determined to have passed the reliability verification.

[0107] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0108] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0109] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for verifying data asset information, characterized in that, The data asset information represents information related to data resources with economic value, and the data asset information verification method includes: Obtain the data to be verified; The data to be verified is divided into multiple data sets, which are arranged in sequence. Perform hash calculations on the multiple data sets to obtain the hash value corresponding to each data set; Generating a target hash value for the data to be verified based on the hash value corresponding to each piece of data includes: for each piece of data, based on the arrangement order of the multiple pieces of data, sequentially dividing each preset number of hash values ​​into a group to obtain multiple groups, and determining the hash value corresponding to each group based on each hash value in each group; if the number of remaining hash values ​​during the division process is less than the preset number, the remaining hash values ​​are determined as a group; repeating the above steps until a single group is obtained; determining the hash value corresponding to the single group, and determining the hash value corresponding to the single group as the target hash value corresponding to the data to be verified; Determine the standard hash value corresponding to the standard data corresponding to the data to be verified; If the target hash value is the same as the standard hash value, the data to be verified is determined to have passed the reliability verification.

2. The data asset information verification method according to claim 1, characterized in that, Determining the hash value corresponding to the single combination includes: According to a preset combination strategy, the hash values ​​in a single combination are combined to obtain the combined data; The combined data is hashed, and the resulting value is used as the hash value corresponding to the individual combination.

3. The data asset information verification method according to claim 1, characterized in that, After determining the standard hash value corresponding to the standard data corresponding to the data to be verified, the method further includes: If the target hash value is different from the standard hash value, the hash value corresponding to each combination is compared with the corresponding standard hash value, starting from the single combination, in the reverse order of the generation order of each combination during the partitioning process, to obtain the target combination with inconsistent hash values; In the target combination, the data corresponding to the hash value that is inconsistent with the corresponding standard hash value in the combination with the earliest generation time is determined as the data that is inconsistent with the standard data in the data to be verified.

4. The data asset information verification method according to claim 1, characterized in that, The step of generating the target hash value corresponding to the data to be verified based on the hash value corresponding to each piece of data includes: Based on the generation principle of Merkle trees, a Merkle tree corresponding to the data to be verified is generated according to the hash value corresponding to each piece of data. The hash value corresponding to the root node of the Merkle tree is determined as the target hash value corresponding to the data to be verified.

5. The data asset information verification method according to any one of claims 1-4, characterized in that, The step of performing hash calculations on the multiple data sets to obtain the hash value corresponding to each data set includes: The multiple data sets are hashed using a preset hash algorithm to obtain the hash value corresponding to each data set. The preset hash algorithm includes any one of the following: 256-bit Secure Hash Algorithm, third-generation Secure Hash Algorithm, or Message Digest Algorithm Version 5.

6. A data asset information verification device, characterized in that, The data asset information represents information related to data resources with economic value, and the data asset information verification device includes: The acquisition module is used to acquire the data to be verified. A partitioning module is used to divide the data to be verified into multiple data sets, which are arranged in sequence. The calculation module is used to perform hash calculations on the multiple data sets respectively to obtain the hash value corresponding to each data set; The generation module is used to generate the target hash value corresponding to the data to be verified based on the hash value corresponding to each piece of data. The first determining module is used to determine the standard hash value corresponding to the standard data corresponding to the data to be verified; The second determining module is used to determine that the data to be verified passes the reliability verification if the target hash value is the same as the standard hash value. The generation module includes: The first partitioning submodule is used to partition each preset number of hash values ​​into a group based on the arrangement order for each data hash value, thereby obtaining multiple groups, and to determine the hash value corresponding to each group according to each hash value in each group. If the number of remaining hash values ​​during the partitioning process is less than the preset number, the remaining hash values ​​are determined as a group. The second partitioning submodule is used to repeat the above steps until a single combination is obtained; The first determining submodule is used to determine the hash value corresponding to the single combination, and to determine the hash value corresponding to the single combination as the target hash value corresponding to the data to be verified.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the data asset information verification method as described in any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the data asset information verification method as described in any one of claims 1 to 5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the data asset information verification method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data verification method and device and related equipment

    CN118193536A

  • Data verification method and device, equipment, storage medium and program product

    CN119557926A