Data verification method and device, storage medium and electronic equipment

By using a hash verification mechanism between the verification party device and the verified party device, the security and efficiency of numerical information verification in the prior art are solved, efficient and secure data verification is achieved, and user privacy is protected.

CN119691791AActive Publication Date: 2025-03-25ZHUHAI ZHENGBEI INVESTMENT CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202411648379.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-25
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

In the prior art, centralized verification methods for numerical information have problems such as data security risks, high system coupling, low verification efficiency and excessive data collection, which are difficult to meet the needs of efficient, security and privacy protection.

Method used

By establishing a hash-based verification mechanism between the verification party device and the verified party device, the verified party device calculates the verification hash value based on the target judgment results, and compares it with the root hash value generated by the verified party device to complete data verification. This method does not rely on centralized systems, improves verification efficiency and security, and protects user privacy.

Benefits of technology

It realizes efficient and secure verification of the value range of numerical information without relying on a centralized system, improves the stability and scalability of the system, and protects user privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691791A_ABST
    Figure CN119691791A_ABST
Patent Text Reader

Abstract

The invention provides a data verification method and device, a computer program product, a non-transitory computer readable storage medium and electronic equipment. A target judgment result and a root hash value are obtained, the root hash value is generated by the verified party device according to a preset algorithm and leaf hash values generated according to at least one judgment result, and each leaf hash value corresponds to the judgment result of the target data under one judgment condition; the target judgment result corresponds to a target leaf hash value in the at least one leaf hash value; according to a preset algorithm, a corresponding verification hash value is obtained through calculation according to the target judgment result; and comparing the verification hash value with the root hash value to complete verification of the target data. According to the embodiment of the invention, an efficient and safe numerical range verification means can be provided without depending on a centralized system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure generally relates to the field of computer technology, and more specifically to a data verification method, device, computer program product, non-transitory computer-readable storage medium, and electronic device. Background Art

[0002] This section is intended to introduce some aspects of the art, which may be related to various aspects of the present disclosure described below and / or claimed. It is believed that this section helps to provide background information to facilitate a better understanding of various aspects of the present disclosure. Therefore, it should be understood that these statements should be understood from this perspective, rather than as an admission of the prior art.

[0003] Currently, the protection and verification of numerical information has become an important research direction in the field of information security. Traditional methods mostly rely on centralized verification systems, which usually require the numerical information to be verified to be transmitted to the server for centralized processing and verification. This centralized verification method has the following main problems: (1) Data security risk: During the transmission process, numerical information may be stolen or tampered with, resulting in the leakage of sensitive data. This risk is particularly prominent when the network security environment is not stable enough; (2) High system coupling: The centralized system requires that all verification requests be processed through a unified verification platform, which increases the complexity of the system and also makes the system a potential single point of failure. Once the centralized verification system fails, the entire verification process will be unable to proceed; (3) Low verification efficiency: As the verification demand increases, the centralized system is prone to processing bottlenecks, resulting in longer response time, which affects the user experience. In addition, the system has limited scalability and is difficult to meet the needs of large-scale data processing; (4) Excessive data collection: When collecting user data, each service provider has the phenomenon of excessive collection, obtaining a large amount of user privacy data that is not related to the business, infringing on user privacy.

[0004] Therefore, it is necessary to propose a new technical solution to alleviate or solve at least one of the above technical problems. Summary of the invention

[0005] The purpose of the present disclosure is to provide a data verification method, device, computer program product, non-transitory computer-readable storage medium and electronic device, which can provide efficient and secure numerical range verification means without relying on a centralized system.

[0006] According to the first aspect of the present disclosure, a data verification method is provided, which is implemented by a verification party device, including: obtaining a target judgment result and a root hash value, wherein the root hash value is generated by the verified party device according to a preset algorithm and a leaf hash value generated according to at least one judgment result, each of the leaf hash values ​​corresponds to a judgment result of the target data under a judgment condition, and the target judgment result corresponds to a target leaf hash value in at least one of the leaf hash values; calculating a corresponding verification hash value according to the preset algorithm and the target judgment result; comparing the verification hash value with the root hash value to complete the verification of the target data.

[0007] According to a second aspect of the present disclosure, a data verification method is provided, which is implemented by a verified party device, including: generating a root hash value based on a leaf hash value generated by at least one judgment result, each of the leaf hash values ​​corresponding to a judgment result of target data under a judgment condition; receiving a verification request sent by a verifying party device, the verification request including a target judgment condition; sending the root hash value and the target judgment result corresponding to the target judgment condition to the verifying party device, so that the verifying party device can complete the verification of the target data.

[0008] According to a third aspect of the present disclosure, a data verification method is provided, which is implemented by a credit guarantor device, including: obtaining a root hash value, which is generated by a leaf hash value generated by a verified party device according to a preset algorithm and based on at least one judgment result, each of the leaf hash values ​​corresponding to a judgment result of the target data under a judgment condition; digitally signing the root hash value to obtain a corresponding signature value; sending the signature value to the verified party device, and sending the public key corresponding to the signature value to the verifier device, so that the verifier device can complete the verification of the target data.

[0009] According to a fourth aspect of the present disclosure, a data verification device is provided, which is applied to a verification party device, including: a verification information acquisition module, used to obtain a target judgment result and a root hash value, the root hash value is generated by the verified party device according to a preset algorithm and a leaf hash value generated according to at least one judgment result, each of the leaf hash values ​​corresponds to a judgment result of the target data under a judgment condition, and the target judgment result corresponds to a target leaf hash value in at least one of the leaf hash values; a calculation module, used to calculate a corresponding verification hash value according to the preset algorithm and the target judgment result; a verification module, used to compare the verification hash value with the root hash value to complete the verification of the target data.

[0010] According to a fifth aspect of the present disclosure, a data verification device is provided, which is applied to a verified party device, including: a generation module, used to generate a root hash value based on a leaf hash value generated by at least one judgment result, each of the leaf hash values ​​corresponding to a judgment result of the target data under a judgment condition; a receiving module, used to receive a verification request sent by a verification party device, the verification request including a target judgment condition; a sending module, used to send the root hash value and the target judgment result corresponding to the target judgment condition to the verification party device, so that the verification party device can complete the verification of the target data.

[0011] According to a sixth aspect of the present disclosure, a data verification device is provided, which is applied to a credit guarantor device, including: a signature information acquisition module, used to obtain a root hash value, wherein the root hash value is generated by the verified party device according to a preset algorithm and a leaf hash value generated according to at least one judgment result, and each of the leaf hash values ​​corresponds to a judgment result of the target data under a judgment condition; a signature module, used to digitally sign the root hash value to obtain a corresponding signature value; a signature information sending module, used to send the signature value to the verified party device, and send the public key corresponding to the signature value to the verifying party device, so that the verifying party device can complete the verification of the target data.

[0012] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising program code instructions. When the program product is executed by a computer, the program code instructions enable the computer to execute the method according to the first aspect, the second aspect or the third aspect of the present disclosure.

[0013] According to an eighth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method according to the first aspect, the second aspect or the third aspect of the present disclosure.

[0014] According to the ninth aspect of the present disclosure, an electronic device is provided, comprising: a processor, a memory that electronically communicates with the processor; and instructions, wherein the instructions are stored in the memory and can be executed by the processor to enable the electronic device to perform the method according to the first aspect, the second aspect or the third aspect of the present disclosure.

[0015] In the embodiments of the present disclosure, data verification is performed based on the value range of the target data (the judgment result under specific judgment conditions), without leaking the specific value of the target data, which is beneficial to improving privacy and security; the verification party device performs verification operations according to the target judgment result, which can effectively verify the authenticity of the value range of the target data on the one hand, and avoid centralized verification processing on the guarantor's device on the other hand, which is beneficial to improving verification efficiency and ensuring system stability.

[0016] It should be understood that the content described in this section is not intended to identify key or essential features of the claimed invention, nor is it intended to be used alone to determine the scope of the claimed invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0018] Figure 1 A system architecture diagram of an embodiment of a data verification method according to the present disclosure is shown;

[0019] Figure 2A A flow chart of an embodiment of a data verification method according to the present disclosure is shown, and the implementation subject is a verification party device;

[0020] Figure 2B A flow chart of an embodiment of a data verification method according to the present disclosure is shown, and the implementation subject is a device to be verified;

[0021] Figure 2C A flow chart of an embodiment of a data verification method according to the present disclosure is shown, and the implementation subject is a credit guarantor device;

[0022] Figure 3A A schematic diagram of a Merkle tree according to an embodiment of a data verification method disclosed herein is shown;

[0023] Figure 3B A schematic diagram showing a specific example of an embodiment of a data verification method according to the present disclosure;

[0024] Figure 4A An exemplary block diagram of an embodiment of a data verification apparatus according to the present disclosure is shown, which is applied to a verification party device;

[0025] Figure 4B An exemplary block diagram of an embodiment of a data verification apparatus according to the present disclosure is shown, which is applied to a verified party device;

[0026] Figure 4C An exemplary block diagram of an embodiment of a data verification apparatus according to the present disclosure is shown, which is applied to a credit guarantor device;

[0027] Figure 5A schematic diagram of an example electronic device 500 is shown that may be used to implement embodiments of the present disclosure.

[0028] Specific implementation method

[0029] The present disclosure will be described more fully below with reference to the accompanying drawings. However, the present disclosure may be embodied in a variety of alternative forms and should not be construed as being limited to the embodiments described in the present disclosure. Therefore, although the present disclosure is susceptible to various modifications and alternative forms, its specific embodiments are shown by way of example in the accompanying drawings and will be described in detail in the present disclosure. However, it should be understood that this approach is not intended to limit the present disclosure to the specific form disclosed, but rather, the present disclosure covers all modifications, equivalents, and alternatives that fall within the spirit and scope of the present disclosure as defined by the claims.

[0030] It should be understood that although the present disclosure can use the terms first, second, etc. to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another element. For example, the first element can be called the second element, and similarly, the second element can be called the first element without departing from the teaching of the present disclosure.

[0031] The present disclosure describes some examples in conjunction with block diagrams and / or flow charts, wherein each frame represents a circuit element, a module or a portion of a code including one or more executable instructions for implementing a specified logical function. It should also be noted that in other implementations, the functions in the frame may not occur in the order specified. For example, depending on the functions involved, two frames shown in succession may actually be executed substantially simultaneously, or the frames may sometimes be executed in reverse order.

[0032] The phrases "according to an embodiment..." or "in an embodiment..." mentioned in the present disclosure mean that a specific feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one implementation of the present disclosure. The phrases "according to an embodiment..." or "in an embodiment..." that appear in different places in the present disclosure do not necessarily refer to the same embodiment, nor are they necessarily separate or alternative embodiments that are mutually exclusive with other embodiments.

[0033] In the present disclosure, a hash value is a result of a hash algorithm. A hash algorithm can convert an input of any length (such as file content, string, etc.) into a hash value of a fixed length through mathematical calculation. A hash value is unique.

[0034] In the present disclosure, a leaf hash value corresponds to a judgment result of the target data under a judgment condition. For example, when the judgment condition is "is it greater than 100" and the judgment result is "greater than 100" (denoted as ">100"), the corresponding leaf hash value is the operation result of the expression ">100" under the hash algorithm (denoted as "H(>100)"). In the case of a tree structure, a leaf hash value may refer to the hash value of a leaf node in the tree structure, and a root hash value may refer to the hash value of a root node in the tree structure. In the case of not using a hash tree (for example, using a hash chain), a leaf hash value may refer to a basic hash value, and a root hash value may refer to a final hash value.

[0035] When generating a leaf hash value based on the judgment result, the judgment result can be directly subjected to a hash algorithm operation, or additional information such as interference items, salt values ​​or sand can be added on the basis of the judgment result and then subjected to a hash algorithm operation.

[0036] In this disclosure, a hash tree may refer to any tree structure with leaf hash values ​​as leaf nodes. Figure 3A The hash tree shown. The Merkle tree in the present disclosure is a specific form of the hash tree. In addition, any variation of the Merkle tree is within the scope of protection of the present disclosure.

[0037] Figure 1 An exemplary system architecture 100 is shown to which embodiments of the data verification method, apparatus, terminal device, and storage medium of the present disclosure can be applied.

[0038] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and servers 105, 106. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the servers 105, 106. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0039] Users can use terminal devices 101, 102, 103 to interact with servers 105, 106 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as voice interaction applications, video conferencing applications, short video social applications, web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0040] Terminal devices 101, 102, 103 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with microphones and speakers, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Compression Standard Audio Layer 3), MP4 (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Compression Standard Audio Layer 4) players, portable computers and desktop computers, etc. When terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules, or as a single software or software module. No specific limitation is made here.

[0041] Servers 105 and 106 may be servers that provide various services. For example, server 105 may be a server of a verifier, and server 106 may be a server of a credit guarantor.

[0042] In some cases, the data verification method provided by the present disclosure may be executed by the terminal devices 101 , 102 , 103 , and accordingly, the data verification apparatus may also be disposed in the terminal devices 101 , 102 , 103 . In this case, the system architecture 100 may not include the servers 105 , 106 .

[0043] In some cases, the data verification method provided by the present disclosure may be executed by the servers 105 and 106 , and accordingly, the data verification device may also be set in the servers 105 and 106 . In this case, the system architecture 100 may not include the terminal devices 101 , 102 , and 103 .

[0044] In some cases, the data verification method provided by the present disclosure may be performed jointly by the terminal devices 101, 102, 103 and the servers 105, 106. Accordingly, the data verification apparatus may also be respectively disposed in the terminal devices 101, 102, 103 and the servers 105, 106.

[0045] It should be noted that the servers 105 and 106 can be hardware or software. When the servers 105 and 106 are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the servers 105 and 106 are software, they can be implemented as multiple software or software modules (for example, for providing distributed services), or as a single software or software module. No specific limitation is made here.

[0046] In one example, the authenticator device is, for example, Figure 1 The server 105 in the credit guarantee device is, for example, Figure 1 The server 106 in the example is Figure 1 The terminal devices 101, 102, and 103 in the embodiment. The above scenarios are only examples of various device types and do not constitute specific limitations on various device types.

[0047] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0048] In one example, the verification scheme in the present disclosure can be applied to an unmanned supermarket, where the verifier is the operator of the unmanned supermarket, the verified party is the customer of the unmanned supermarket, and the guarantor is the operator of the payment platform. In this example, the operator of the unmanned supermarket verifies the customer's credit score, and if the credit score meets certain conditions (for example, greater than 400 points), the door is opened to allow the customer to enter the unmanned supermarket.

[0049] In another example, the verification scheme in the present disclosure can be applied to power bank rental, where the verifier is the operator of the power bank rental platform, the verified party is the user who rents the power bank, and the guarantor is the credit rating agency. In this example, the operator of the power bank rental platform verifies the user's credit record, and if there is no record of default, the power bank is provided to the user.

[0050] The above two situations are merely examples of application scenarios of the verification scheme in the present disclosure and are not limiting. It should be understood that the verification scheme in the present disclosure can also be applied to other situations where data verification is required.

[0051] Figure 2A A flow chart of an embodiment of a data verification method according to the present disclosure is shown, and the implementation subject is a verification party device.

[0052] In the embodiments of the present disclosure, the verification of the target data is, on the one hand, to verify the value range of the target data (whether the target data meets the target judgment condition), and on the other hand, to verify whether the above value range is authentic.

[0053] like Figure 2A As shown, the method 210 includes the following steps:

[0054] Step 211, obtain the target judgment result and root hash value from the verification party device. The root hash value is generated by the verified party device according to a preset algorithm and based on the leaf hash value generated by at least one judgment result. Each leaf hash value corresponds to the judgment result of the target data under a judgment condition. The target judgment result corresponds to the target leaf hash value in at least one leaf hash value.

[0055] In the embodiments of the present disclosure, the target data may be a numerical value or a non-numerical value. In one example, the target data is a credit score (numerical value), and the judgment condition is, for example, "whether it is greater than 100". In another example, the target data is a gender (non-numerical value), and the judgment condition is, for example, "whether it is male (or female)".

[0056] In an embodiment of the present disclosure, the target judgment result can be obtained in the following manner: the verifying device sends a target judgment condition to the verified device, such as "whether it is greater than 100"; the verified device determines the corresponding target judgment result, such as "greater than 100" (represented as ">100"), and returns it to the verifying device.

[0057] It is easy to understand that the verification device can determine the value range of the target data it needs based on the target judgment result, and at the same time, the specific value of the target data will not be leaked.

[0058] In the embodiments of the present disclosure, the authenticator and the authenticated party may communicate in advance to determine the judgment conditions to be used. For example, in the case of verifying age, the agreed judgment condition is, for example, "whether over 18 years old". The authenticated party device may determine the judgment result of each judgment condition in advance according to the target data based on the agreed judgment condition, and calculate the root hash value.

[0059] In an embodiment of the present disclosure, the target judgment result corresponds to a target leaf hash value in at least one leaf hash value. Exemplarily, the target judgment result may be hashed to obtain a corresponding target leaf hash value. For example, the target judgment result ">100" may be hashed to obtain a corresponding target leaf hash value H(>100).

[0060] In the embodiments of the present disclosure, the number of leaf hash values ​​may be one or more, and each leaf hash value corresponds to the judgment result of the target data under a judgment condition. Exemplarily, the target data is a credit score, and the judgment conditions include "whether it is greater than 100", "whether it is less than 200", "whether it is less than 300", and "whether it is less than 400", and the corresponding judgment results are ">100", "<200", "<300", and "<400", and the corresponding leaf hash values ​​are H(>100), H(<200), H(<300), and H(<400).

[0061] In an embodiment of the present disclosure, a root hash value is generated by the authenticated device according to a leaf hash value.

[0062] In one example, a root hash value may be generated based on a hash tree. Figure 3A, this is an example of a hash tree (Merkle tree), which includes leaf nodes (bottom-level nodes), intermediate nodes (intermediate nodes) and root nodes (top-level nodes). The leaf nodes H1, H2, H3 and H4 correspond to the leaf hash values ​​H(>100), H(<200), H(<300) and H(<400) in the previous example. The hash value of the intermediate node is calculated based on the hash value of the corresponding leaf node. For example, the hash value of the intermediate node H12 is obtained by adding the hash values ​​of H1 and H2 and then performing a hash calculation (denoted as "H(H1+H2)"), and the value of the intermediate node H34 is obtained by adding the hash values ​​of H3 and H4 and then performing a hash calculation (denoted as "H(H3+H4)"). The hash value of the root node is calculated based on the hash value of the corresponding intermediate node, that is, the hash value of the root node H1234 is obtained by adding the hash values ​​of the intermediate nodes H12 and H34 and then performing a hash calculation (denoted as "H(H12+H34)").

[0063] In another example, a root hash value may be generated based on a hash chain. For example, the leaf hash values ​​H(>100), H(<200), H(<300), and H(<400) may be directly concatenated to obtain a root hash value H(>100)-H(<200)-H(<300)-H(<400).

[0064] The above method is only an example of a root hash value generation method and is not a limitation. Those skilled in the art may use other methods to calculate the root hash value based on the leaf hash value.

[0065] In the present disclosure, the target leaf hash value is a leaf hash value corresponding to the target judgment condition. For example, the authenticator device may send a verification request to the authenticated device, the verification request includes the target judgment condition, the authenticated device sends the root hash value and the target judgment result corresponding to the target judgment condition to the authenticator device, and the authenticator device generates the corresponding target leaf hash value according to the target judgment result. For example, for Figure 3A In the example, assuming that the verification condition contained in the verification request sent by the authenticating device is "is it greater than 100", the authenticated device returns the corresponding target judgment result and ">100", and the authenticating device calculates the target leaf hash value H(>100), which is the hash value of the leaf node H1.

[0066] Whether the judgment results (or leaf hash values) other than the target judgment results need to be transmitted depends on the specific situation. Figure 3A In the case of the Merkle tree in , it is not necessary to transmit all judgment results or leaf hash values, only the hash value of the leaf node H2 and the hash value of the intermediate node H34 need to be transmitted. For another example, when a hash chain is used, all judgment results (or leaf hash values) other than the target judgment result need to be transmitted.

[0067] When a Merkle tree is used, the number of leaf hash values ​​should be more than 4 and an even number. When the number of leaf hash values ​​is small or an odd number, dummy leaf nodes can be introduced to meet the conditions for building a Merkle tree.

[0068] Step 212, calculate the corresponding verification hash value according to the preset algorithm and the target judgment result.

[0069] In step 212, the corresponding target leaf hash value can be calculated based on the target judgment result, and then the verification hash value can be calculated based on the target leaf hash value and the corresponding verification information (when a Merkle tree is used, the verification information includes each associated hash value corresponding to the branch pointing from the target leaf hash value to the root hash value; when a hash chain is used, the verification information includes other leaf hash values ​​other than the target leaf hash value corresponding to the target judgment result).

[0070] In the embodiments of the present disclosure, the verifier device obtains the root hash value from the verifier device on the one hand, and can calculate the corresponding verification hash value based on the judgment result obtained from the verified party on the other hand, and then compares the obtained root hash value with the calculated verification hash value to complete the first verification of the value range of the target data, namely, the hash verification (the second verification, namely, the signature verification, will also be described below).

[0071] In the embodiments of the present disclosure, the specific type of the preset algorithm is not limited. The preset algorithm is communicated in advance by the verifying device and the verified device to be consistent. Exemplarily, in the case of using a Merkle tree, the preset algorithm is a method known to those skilled in the art for calculating the hash value of the root node based on the hash value of the leaf node of the Merkle tree.

[0072] In an optional embodiment, in addition to the target judgment result, verification information corresponding to the target judgment result is also required in step 212. In the case of using a Merkle tree, the verification information includes each associated hash value corresponding to the branch from the target leaf hash value to the root hash value. Figure 3A In the example, the target leaf hash value is the hash value of the leaf node H1, and the corresponding verification information includes the hash value of the leaf node H2 and the hash value of the intermediate node H34. Based on this, the hash value of H12 can be calculated based on the hash value of H1 and the hash value of H2, and then the hash value of the root node H1234 can be calculated based on the hash value of H12 and the hash value of H34, so as to obtain the verification hash value.

[0073] The use of Merkle trees can reduce the amount of data that needs to be calculated and transmitted, which helps reduce computing load and improve computing efficiency.

[0074] In the case of adopting a hash chain, the verification information includes other leaf hash values ​​other than the target leaf hash value corresponding to the target judgment result. Accordingly, the leaf hash values ​​can be concatenated in a specific order to obtain a verification hash value.

[0075] Step 213, comparing the verification hash value with the root hash value to complete the verification of the target data.

[0076] It is easy to understand that if the obtainable root hash value is consistent with the calculated verification hash value, the first verification passes, and the authenticity of the value range of the target data can be preliminarily determined.

[0077] In an optional embodiment, the method further includes: obtaining a signature value corresponding to the root hash value, the signature value being obtained by the credit guarantor device digitally signing the root hash value. And, after step 213, the method further includes the following step 214: when the hash value is verified to be consistent with the root hash value, the validity of the signature value is verified using the public key obtained in advance from the credit guarantor device to complete the verification of the target data.

[0078] In the above embodiment, the credit guarantor knows the specific value of the target data, and can verify the root hash value generated by the verified party using the same preset algorithm, and digitally sign the root hash value if the verification passes.

[0079] In the embodiments of the present disclosure, the signature value and the public key are both generated by the credit guarantor device. After the credit guarantor device generates the signature value, it sends it to the verified party device, and the verified party device then sends it to the verifying party device in response to the verification request. After the credit guarantor device generates the public key, it sends it to the verifying party device for use by the verifying party device during verification.

[0080] In the above step 214, those skilled in the art may use a signature method known to them to generate a signature value and provide a public key, and the present disclosure does not limit the specific signature method.

[0081] In the above embodiment, the second verification can be achieved by verifying the validity of the signature value. If the second verification is passed, the authenticity of the value range of the target data can be confirmed, thereby completing the verification of the target data.

[0082] Figure 3B A schematic diagram showing a specific example of an embodiment of a data verification method according to the present disclosure is shown. Figure 3A and Figure 3B , the example includes the following implementations:

[0083] In the first stage, the target data logic verifies the construction of the Merkle tree, including:

[0084] (1) Select logical judgment intervals: Set multiple logical judgment intervals according to the characteristics of the target value. For example, for a target value of 198, you can set the following judgment intervals:

[0085] a. The first judgment interval: whether it is greater than 100, marked as condition >100.

[0086] b. The second judgment interval: whether it is less than 200, marked as condition <200.

[0087] c. The third judgment interval: whether it is less than 300, marked as condition <300.

[0088] d. The fourth judgment interval: whether it is less than 400, marked as condition <400.

[0089] (2) Calculate hash value: Perform hash calculation on the result of each judgment interval to obtain hash values ​​H(>100), H(<200), H(<300), H(<400).

[0090] (3) Constructing a Merkle tree: These hash values ​​are used as leaf nodes, combined according to specific rules, and the hash values ​​of the intermediate nodes are calculated layer by layer, and finally the hash value of the root node of the Merkle tree, H1234, is obtained. For example:

[0091] a. First layer: calculate H12 = H(H(>100) + H(<200)) and H34 = H(H(<300) +

[0092] H(<400)

[0093] b. Second layer: Calculate the root node hash value H1234 = H (H12 + H34)

[0094] The second stage is the signing and disclosure of the root node hash value, including:

[0095] (1) Signature: The calculated root node hash value H1234 is submitted to the credit guarantee agency, which digitally signs it and generates a signature value S(H1234).

[0096] (2) Public: The root node hash value H1234 and its signature S(H1234) are made public for subsequent verification.

[0097] The third phase, the verification process, includes:

[0098] (1) Verification request: The verifier makes a logical verification request to the party being verified, such as “Is the target value greater than 100?”

[0099] (2) Verification path provision: The verified party provides relevant verification information according to the verification request. For the verification of "is it greater than 100", the verified party provides the target judgment result ">100", the hash value of the verification information leaf node H2 and the hash value of the intermediate node H34.

[0100] (3) Obtaining the public key: The verifier obtains the publicly available verification public key from the credit guarantee institution, which is used to verify the authenticity of the credit guarantee institution.

[0101] (4) Verification calculation:

[0102] a. The verifier uses the target judgment result ">100" to calculate the hash value H(>100) and the hash value H(<200) of the verification information to calculate the hash value H12=H(H(>100)+H(<200)).

[0103] b. Continue to calculate the root node hash value (i.e. verification hash value) H1234' = H(H12+

[0104] H34).

[0105] c. The verifier compares the calculated root node hash value H1234' with the signed root node hash value H1234. If the two are consistent, the verification is successful.

[0106] d. Signature verification: The verifier uses the public key of the credit guarantee agency to verify the validity of the signature S (H1234) to ensure the authenticity and integrity of the root node hash value.

[0107] Figure 2B A flow chart of an embodiment of a data verification method according to the present disclosure is shown, and the implementation subject is a terminal device.

[0108] like Figure 2B As shown, the method 220 includes the following steps:

[0109] Step 221 , generating a root hash value according to a leaf hash value generated by at least one judgment result, each leaf hash value corresponding to a judgment result of the target data under a judgment condition.

[0110] Step 222: Receive a verification request sent by the verification party device, where the verification request includes a target judgment condition.

[0111] Step 223, sending the root hash value and the target judgment result corresponding to the target judgment condition to the verification device, so that the verification device can complete the verification of the target data.

[0112] In an optional implementation, the number of leaf hash values ​​is at least two, a target hash tree is formed with each leaf hash value as a leaf node, and the root hash value is the root node of the target hash tree.

[0113] In an optional embodiment, the target hash tree is a Merkle tree.

[0114] In an optional embodiment, the method also includes: sending verification information corresponding to the target judgment result to the verification party device, the target leaf hash value is obtained by hashing the target judgment result, and the verification information includes each associated hash value corresponding to the branch pointing from the target leaf hash value to the root hash value.

[0115] The specific details and technical effects of the method 220 can be found in the above description of the method 210.

[0116] Figure 2C A flow chart of an embodiment of a data verification method according to the present disclosure is shown, and the implementation subject is an edge node.

[0117] like Figure 2C As shown, the method 230 includes the following steps:

[0118] Step 231, obtaining a root hash value, where the root hash value is generated by the authenticated party device according to a preset algorithm and based on a leaf hash value generated according to at least one judgment result, and each leaf hash value corresponds to a judgment result of the target data under a judgment condition.

[0119] Step 232: digitally sign the root hash value to obtain a corresponding signature value.

[0120] Step 233, the signature value is sent to the verified device, and the public key corresponding to the signature value is sent to the verifying device, so that the verifying device can complete the verification of the target data.

[0121] In an optional implementation, the number of leaf hash values ​​is at least two, a target hash tree is formed with each leaf hash value as a leaf node, and the root hash value is the root node of the target hash tree.

[0122] In an optional embodiment, the target hash tree is a Merkle tree.

[0123] The specific details and technical effects of the method 230 can be found in the above description of the method 210.

[0124] Figure 4A FIG. 1 shows an exemplary block diagram of a data verification device according to an embodiment of the present disclosure. Figure 4AAs shown, the data verification device 410 includes: a verification information acquisition module 411, which is used to obtain a target judgment result and a root hash value, the root hash value is generated by the verified party device according to a preset algorithm and a leaf hash value generated according to at least one judgment result, each of the leaf hash values ​​corresponds to a judgment result of the target data under a judgment condition, and the target judgment result corresponds to a target leaf hash value in at least one of the leaf hash values; a calculation module 412, which is used to calculate a corresponding verification hash value according to the preset algorithm and the target judgment result; a verification module 413, which is used to compare the verification hash value with the root hash value to complete the verification of the target data.

[0125] It should be understood that Figure 4A The modules of the device 410 shown in FIG. 4 can be used in conjunction with the reference Figure 2A The steps in the method 210 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 210 are also applicable to the device 410 and the modules included therein. For the sake of brevity, some operations, features and advantages are not repeated here.

[0126] In an optional implementation, the verification information acquisition module 411 is also used to: obtain the signature value corresponding to the root hash value, and the signature value is obtained by the credit guarantor device digitally signing the root hash value. The verification module 413 is also used to: when the verification hash value is consistent with the root hash value, use the public key obtained in advance from the credit guarantor device to verify the validity of the signature value to complete the verification of the target data.

[0127] In an optional implementation, the number of the leaf hash values ​​is at least two, a target hash tree is formed with each of the leaf hash values ​​as a leaf node, and the root hash value is a root node of the target hash tree.

[0128] In an optional implementation, the target hash tree is a Merkle tree.

[0129] In an optional implementation, the verification information acquisition module 411 is further used to: obtain the verification information corresponding to the above target judgment result, the above verification information includes each associated hash value corresponding to the branch from the above target leaf hash value to the above root hash value. The verification module 413 is also used to: calculate the target leaf hash value according to the above target judgment result; calculate the above verification hash value according to the above target leaf hash value and each of the above associated hash values.

[0130] Figure 4B FIG. 1 shows an exemplary block diagram of a data verification device according to an embodiment of the present disclosure. Figure 4BAs shown, the data verification device 420 includes: a generating module 421, which is used to generate a root hash value based on a leaf hash value generated by at least one judgment result, each of the above leaf hash values ​​corresponds to a judgment result of the target data under a judgment condition; a receiving module 422, which is used to receive a verification request sent by a verification party device, and the above verification request includes a target judgment condition; a sending module 423, which is used to send the above root hash value and the target judgment result corresponding to the above target judgment condition to the above verification party device, so that the above verification party device can complete the verification of the above target data.

[0131] It should be understood that Figure 4B The various modules of the device 420 shown in FIG. Figure 2B The steps in the method 220 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 220 are also applicable to the device 420 and the modules included therein. For the sake of brevity, some operations, features and advantages are not repeated here.

[0132] In an optional implementation, the number of the leaf hash values ​​is at least two, a target hash tree is formed with each of the leaf hash values ​​as a leaf node, and the root hash value is a root node of the target hash tree.

[0133] In an optional implementation, the target hash tree is a Merkle tree.

[0134] In an optional implementation, the sending module 423 is also used to: send verification information corresponding to the target judgment result to the verification party device, the target leaf hash value is obtained by performing hash calculation on the target judgment result, and the verification information includes each associated hash value corresponding to the branch pointing from the target leaf hash value to the root hash value.

[0135] Figure 4C FIG. 1 shows an exemplary block diagram of a data verification device according to an embodiment of the present disclosure. Figure 4C As shown, the data verification device 430 includes: a signature information acquisition module 431, used to obtain a root hash value, the root hash value is generated by the verified party device according to a preset algorithm and a leaf hash value generated according to at least one judgment result, and each of the leaf hash values ​​corresponds to a judgment result of the target data under a judgment condition; a signature module 432, used to digitally sign the root hash value to obtain a corresponding signature value; a signature information sending module 433, used to send the signature value to the verified party device, and send the public key corresponding to the signature value to the verification party device, so that the verification party device can complete the verification of the target data.

[0136] It should be understood that Figure 4C The various modules of the device 430 shown in FIG. 4 can be used in conjunction with the reference Figure 2CThe steps in the method 230 described above correspond to each other. Therefore, the operations, features and advantages described above for the method 230 are also applicable to the device 430 and the modules included therein. For the sake of brevity, some operations, features and advantages are not repeated here.

[0137] In an optional implementation, the number of the leaf hash values ​​is at least two, a target hash tree is formed with each of the leaf hash values ​​as a leaf node, and the root hash value is a root node of the target hash tree.

[0138] In an optional implementation, the target hash tree is a Merkle tree.

[0139] Figure 5 Schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. Figure 5 , a structural block diagram of an electronic device 500 that can serve as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown in the present disclosure, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required in the present disclosure. As Figure 5 As shown, the electronic device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504. Multiple components in the device 500 are connected to the I / O interface 505, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0140] The computing unit 501 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 501 performs the various methods and processes described above, such as a data verification method. For example, in some embodiments, the data verification method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via ROM 502 and / or communication unit 509. When the computer program is loaded into RAM 503 and executed by the computing unit 501, one or more steps of the data verification method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the data verification method in any other appropriate manner (e.g., by means of firmware).

[0141] The various illustrative logics, logic blocks, modules, circuits, and algorithmic processes described in conjunction with the aspects disclosed herein may be implemented as electronic hardware, computer software, or a combination of both. The interchangeability of hardware and software has been generally described in terms of functionality and illustrated in the various illustrative components, blocks, modules, circuits, and processes described above. Whether such functionality is implemented in hardware or software depends on the specific application and design constraints on the overall system.

[0142] The hardware and data processing devices for implementing the various illustrative logics, logic blocks, modules and circuits described in conjunction with the aspects disclosed in the present disclosure can be implemented or executed with a general-purpose single-chip or multi-chip processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic, a discrete hardware component, or any combination thereof designed to perform the functions described in the present disclosure. A general-purpose processor can be a microprocessor or any conventional processor, controller, microcontroller or state machine. The processor can also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration. In some aspects, specific processes and methods can be performed by circuits specific to a given function.

[0143] In one or more aspects, the functions described may be implemented in hardware, digital electronic circuitry, computer software, firmware (including the structures disclosed in this specification and their equivalents), or any combination thereof. Aspects of the subject matter described in this specification may also be implemented as one or more computer programs, i.e., one or more modules of computer program instructions, encoded on computer storage media for execution by a data processing apparatus or to control the operation of the data processing apparatus.

[0144] If implemented in software, the function can be stored or transferred to a computer-readable medium as one or more instructions or codes. The process of the method or algorithm disclosed in the present disclosure can be implemented in a software module executable by a processor, and the software module can reside on a computer-readable medium. Computer-readable media include computer storage media and communication media, and the communication media include any medium capable of transmitting a computer program from one place to another. The storage medium can be any available medium accessible by a computer. As an example and not limitation, this computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, or any other medium that can be used to store the required program code in the form of instructions or data structures and can be accessed by a computer. In addition, any connection can be appropriately referred to as a computer-readable medium. The disk (Disk) and disc (disc) used in the present disclosure include high-density optical disks (CDs), laser disks, optical disks, digital versatile disks (DVDs), floppy disks and blue-ray disks, wherein the disk (Disk) usually copies data magnetically, and the disc (disc) copies data optically with lasers. The above combination should also be included in the scope of computer-readable media. Additionally, the operations of a method or algorithm may be implemented as one or any combination or set of codes and instructions on a machine-readable medium and a computer-readable medium, which may be incorporated into a computer program product.

[0145] Each embodiment in the present disclosure is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, equipment embodiment, computer-readable storage medium embodiment, and computer program product embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

Claims

1. A data verification method, implemented by a verification device, comprising: Obtain a target judgment result and a root hash value, wherein the root hash value is generated by the authenticated party device according to a preset algorithm and based on a leaf hash value generated according to at least one judgment result, each of the leaf hash values ​​corresponds to a judgment result of the target data under a judgment condition, and the target judgment result corresponds to a target leaf hash value in at least one of the leaf hash values; According to the preset algorithm and the target judgment result, a corresponding verification hash value is calculated; The verification hash value is compared with the root hash value to complete the verification of the target data.

2. The method according to claim 1, wherein: The method further comprises: Obtaining a signature value corresponding to the root hash value, where the signature value is obtained by a credit guarantor device digitally signing the root hash value; and After comparing the verification hash value to the root hash value, the method further comprises: When the verification hash value is consistent with the root hash value, the validity of the signature value is verified using the public key obtained in advance from the credit guarantor device to complete the verification of the target data.

3. The method according to claim 1, wherein: The number of the leaf hash values ​​is at least two, and a target hash tree is formed with each leaf hash value as a leaf node, and the root hash value is a root node of the target hash tree.

4. The method according to claim 3, wherein: The target hash tree is a Merkle tree.

5. The method according to claim 3, wherein: The method further comprises: Acquire verification information corresponding to the target judgment result, the verification information including each associated hash value corresponding to a branch pointing from the target leaf hash value to the root hash value; and The step of calculating the corresponding verification hash value according to the preset algorithm and the target judgment result includes: According to the target judgment result, the target leaf hash value is calculated; The verification hash value is calculated based on the target leaf hash value and each associated hash value.

6. A data verification method, implemented by a device of a verified party, comprising: generating a root hash value according to a leaf hash value generated by at least one judgment result, each of the leaf hash values ​​corresponding to a judgment result of the target data under a judgment condition; Receiving a verification request sent by a verification party device, wherein the verification request includes a target judgment condition; The root hash value and a target judgment result corresponding to the target judgment condition are sent to the verification party device so that the verification party device can complete the verification of the target data.

7. The method according to claim 6, wherein: The number of the leaf hash values ​​is at least two, and a target hash tree is formed with each of the leaf hash values ​​as a leaf node, and the root hash value is a root node of the target hash tree.

8. The method according to claim 7, wherein: The target hash tree is a Merkle tree.

9. The method according to claim 7, wherein: The method further comprises: Verification information corresponding to the target judgment result is sent to the verification party device, the target leaf hash value is obtained by hashing the target judgment result, and the verification information includes each associated hash value corresponding to the branch pointing from the target leaf hash value to the root hash value.

10. A data verification method, implemented by a credit guarantor device, comprising: Obtaining a root hash value, where the root hash value is generated by the authenticated party device according to a preset algorithm and based on leaf hash values ​​generated according to at least one judgment result, each of the leaf hash values ​​corresponding to a judgment result of the target data under a judgment condition; Digitally signing the root hash value to obtain a corresponding signature value; The signature value is sent to the authenticated device, and the public key corresponding to the signature value is sent to the authenticating device, so that the authenticating device can complete the authentication of the target data.

11. The method according to claim 10, wherein: The number of the leaf hash values ​​is at least two, and a target hash tree is formed with each leaf hash value as a leaf node, and the root hash value is a root node of the target hash tree.

12. The method according to claim 11, wherein: The target hash tree is a Merkle tree.

13. A data verification device, applied to a verification device, comprising: A verification information acquisition module, used to obtain a target judgment result and a root hash value, wherein the root hash value is generated by the verified party device according to a preset algorithm and based on a leaf hash value generated by at least one judgment result, each of the leaf hash values ​​corresponds to a judgment result of the target data under a judgment condition, and the target judgment result corresponds to a target leaf hash value in at least one of the leaf hash values; A calculation module, used to calculate a corresponding verification hash value according to the preset algorithm and the target judgment result; The verification module is used to compare the verification hash value with the root hash value to complete the verification of the target data.

14. A data verification device, applied to a device to be verified, comprising: A generating module, configured to generate a root hash value according to a leaf hash value generated by at least one judgment result, each of the leaf hash values ​​corresponding to a judgment result of the target data under a judgment condition; A receiving module, configured to receive a verification request sent by a verification party device, wherein the verification request includes a target judgment condition; A sending module is used to send the root hash value and the target judgment result corresponding to the target judgment condition to the verification party device, so that the verification party device can complete the verification of the target data.

15. A data verification device, applied to a credit guarantor device, comprising: A signature information acquisition module, used to obtain a root hash value, where the root hash value is generated by the authenticated party device according to a preset algorithm and based on a leaf hash value generated according to at least one judgment result, each of which corresponds to a judgment result of the target data under a judgment condition; A signature module, used to digitally sign the root hash value to obtain a corresponding signature value; The signature information sending module is used to send the signature value to the verified party device, and send the public key corresponding to the signature value to the verifying party device, so that the verifying party device can complete the verification of the target data.

16. A computer program product, comprising program code instructions, which, when the program product is executed by a computer, cause the computer to execute the method according to any one of claims 1 to 12.

17. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-12.

18. An electronic device, comprising: processor, a memory in electronic communication with the processor; as well as Instructions, which are stored in the memory and can be executed by the processor to enable the electronic device to perform the method according to any one of claims 1-12.

Citation Information

Patent Citations

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

    CN102413313A

  • Identity authentication method and device, storage medium and electronic equipment

    CN112948789A

  • Data auditing method and device and storage medium

    CN115906109A

  • Information verification method and device, electronic equipment and computer readable storage medium

    CN116055056A

  • Data evidence storage method, data verification method, data verification system, data verification equipment and medium

    CN116451251A