Data verification methods, devices, storage media and electronic equipment
By employing a distributed data verification scheme that utilizes hash algorithms and digital signatures, the security and efficiency issues inherent in traditional centralized verification methods are resolved, achieving efficient and secure data verification while protecting user privacy.
Patent Information
- Application Number
- CN202411648379.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-18
AI Technical Summary
Traditional centralized data verification methods suffer from data security risks, high system coupling, low verification efficiency, and excessive collection of user privacy data, making it difficult to meet the needs of large-scale data processing.
A distributed data verification scheme is adopted, in which data verification is performed by the devices of the verifier, the verified party, and the credit guarantor respectively. The root hash value and leaf hash value are generated by the hash algorithm to verify the value range of the target data. Combined with digital signature, the authenticity and security of the data are ensured.
It improves the efficiency and security of data verification, reduces the risk of data leakage, lowers system coupling, protects user privacy, and adapts to the needs of large-scale data processing.
Smart Images

Figure CN119691791B_ABST
Abstract
Description
Technical Field
[0001] This disclosure generally relates to the field of computer technology, and more specifically to a data verification method, apparatus, computer program product, non-transitory computer-readable storage medium, and electronic device. Background Technology
[0002] This section is intended to introduce aspects of the art that may relate to the various aspects of this disclosure described below and / or claimed. It is believed that this section will help provide background information to facilitate a better understanding of the various aspects of this disclosure. Therefore, it should be understood that these statements should be interpreted in this context and not as an admission of 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 a server for centralized processing and verification. This centralized verification method has the following main problems: (1) Data security risks: During the transmission process, numerical information may be stolen or tampered with, leading to the leakage of sensitive data. This risk is particularly prominent when the network security environment is not stable; (2) High system coupling: Centralized systems require all verification requests to 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 not be able to proceed; (3) Low verification efficiency: With the increase in verification demand, centralized systems are prone to processing bottlenecks, resulting in extended response times and affecting 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, various service providers have excessive collection phenomena, obtaining a large amount of user privacy data that is not related to business, which infringes on user privacy.
[0004] Therefore, it is necessary to propose a new technical solution to alleviate or solve at least one of the above-mentioned technical problems. Summary of the Invention
[0005] The purpose of this disclosure is to provide a data verification method, apparatus, computer program product, non-transitory computer-readable storage medium, and electronic device that can provide efficient and secure means of verifying numerical ranges without relying on a centralized system.
[0006] According to a first aspect of this disclosure, a data verification method is provided, implemented by a verification device, comprising: acquiring a target judgment result and a root hash value, wherein the root hash value is generated by the device being verified according to a preset algorithm and based on leaf hash values generated from at least one judgment result, each leaf hash value corresponding to a judgment result of target data under a judgment condition, and the target judgment result corresponding to a target leaf hash value among at least one of the leaf hash values; calculating a corresponding verification hash value according to the preset algorithm and based on the target judgment result; and 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 this disclosure, a data verification method is provided, implemented by a device being verified, comprising: generating a root hash value based on leaf hash values generated from at least one judgment result, each leaf hash value corresponding to a judgment result of target data under a judgment condition; receiving a verification request sent by a verification device, the verification request including a target judgment condition; and sending the root hash value and a 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.
[0008] According to a third aspect of this disclosure, a data verification method is provided, implemented by a credit guarantor device, comprising: obtaining a root hash value, wherein the root hash value is generated by a leaf hash value generated by a device being verified according to a preset algorithm and based on at least one judgment result, each leaf hash value corresponding to a judgment result of target data under a judgment condition; digitally signing the root hash value to obtain a corresponding signature value; sending the signature value to the device being verified, and sending the public key corresponding to the signature value to a verification device, so that the verification device can complete the verification of the target data.
[0009] According to a fourth aspect of this disclosure, a data verification apparatus is provided, applied to a verification device, comprising: a verification information acquisition module, configured to acquire a target judgment result and a root hash value, wherein the root hash value is generated by the device being verified according to a preset algorithm and based on leaf hash values generated from at least one judgment result, each leaf hash value corresponding to a judgment result of target data under a judgment condition, and the target judgment result corresponding to a target leaf hash value among at least one of the leaf hash values; a calculation module, configured to calculate a corresponding verification hash value according to the preset algorithm and based on the target judgment result; and a verification module, configured 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 this disclosure, a data verification apparatus is provided, applied to a device to be verified, comprising: a generation module, configured to generate a root hash value based on leaf hash values generated from at least one judgment result, each leaf hash value corresponding to a judgment result of target data under a judgment condition; a receiving module, configured to receive a verification request sent by the verification device, the verification request including a target judgment condition; and a sending module, configured to send the root hash value and a 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.
[0011] According to a sixth aspect of this disclosure, a data verification apparatus is provided, applied to a credit guarantor device, comprising: a signature information acquisition module for acquiring a root hash value, wherein the root hash value is generated by the verified party device according to a preset algorithm and leaf hash values generated based on at least one judgment result, each leaf hash value corresponding to a judgment result of target data under a judgment condition; a signature module for digitally signing the root hash value to obtain a corresponding signature value; and a signature information sending module for 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.
[0012] According to a seventh aspect of this disclosure, a computer program product is provided, including program code instructions that, when executed by a computer, cause the computer to perform the method described according to a first, second, or third aspect of this disclosure.
[0013] According to an eighth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method described according to a first, second, or third aspect of this disclosure.
[0014] According to a ninth aspect of this disclosure, an electronic device is provided, comprising: a processor; a memory in electronic communication with the processor; and instructions stored in the memory and executable by the processor to cause the electronic device to perform the method according to a first, second, or third aspect of this disclosure.
[0015] In the embodiments of this disclosure, data verification is performed based on the value range of the target data (the judgment result under specific judgment conditions), without disclosing the specific value of the target data, which is beneficial to improving privacy and security. The verification device performs the verification operation based on the target judgment result, which can effectively verify the authenticity of the target data value range on the one hand, and avoid the verification process being carried out centrally on the guarantor 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. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this disclosure 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 only some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In all drawings, the same reference numerals refer to similar but not necessarily the same elements.
[0018] Figure 1 A system architecture diagram of one embodiment of the data verification method according to this disclosure is shown;
[0019] Figure 2A A flowchart of an embodiment of the data verification method according to the present disclosure is shown, wherein the implementing entity is a verification device;
[0020] Figure 2B A flowchart of an embodiment of the data verification method according to the present disclosure is shown, wherein the subject of the implementation is the device being verified;
[0021] Figure 2C A flowchart of one embodiment of the data verification method according to this disclosure is shown, in which the implementer is a credit guarantor device;
[0022] Figure 3A A schematic diagram of a Merkle tree is shown as an embodiment of the data verification method according to this disclosure;
[0023] Figure 3B A schematic diagram illustrating a specific example of an embodiment of the data verification method according to this disclosure is shown;
[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 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 device being verified;
[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 that can be used to implement embodiments of the present disclosure is shown.
[0028] Specific implementation method
[0029] The present disclosure will now be described more fully with reference to the accompanying drawings. However, the present disclosure may be embodied in various alternative forms and should not be construed as limited to the embodiments described herein. Therefore, while the present disclosure is readily adaptable to various modifications and alternatives, specific embodiments thereof are shown by way of example in the accompanying drawings and will be described in detail herein. However, it should be understood that this approach is not intended to limit the present disclosure to the specific forms disclosed; rather, the present disclosure covers all modifications, equivalents, and alternatives falling within the spirit and scope of the present disclosure as defined by the claims.
[0030] It should be understood that although this disclosure may use the terms first, second, etc., to describe various elements, these elements should not be limited by these terms. These terms are used only to distinguish one element from another. For example, a first element may be referred to as a second element, and similarly, a second element may be referred to as a first element, without departing from the teachings of this disclosure.
[0031] This disclosure describes examples in conjunction with block diagrams and / or flowcharts, wherein each block represents a portion of circuitry, modularity, or code comprising one or more executable instructions for implementing a specified logical function. It should also be noted that in other implementations, the functions within a block may occur out of order. For example, depending on the function involved, two blocks shown consecutively may actually execute substantially simultaneously, or these blocks may sometimes execute in reverse order.
[0032] The phrases "according to... embodiments" or "in... embodiments" as used in this disclosure mean that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one implementation of this disclosure. The phrases "according to... embodiments" or "in... embodiments" appearing in different places in this 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 this disclosure, the hash value is the result of a hash algorithm. A hash algorithm can convert input of arbitrary length (such as file content, strings, etc.) into a fixed-length hash value through mathematical calculation. Hash values are unique.
[0034] In this disclosure, the leaf hash value corresponds to the judgment result of the target data under a certain condition. For example, if the judgment condition is "whether it is greater than 100" and the judgment result is "greater than 100" (denoted as ">100"), the corresponding leaf hash value is the result of the hash algorithm operation of the expression ">100" (denoted as "H(>100)"). When a tree structure is used, the leaf hash value can refer to the hash value of the leaf node in the tree structure, and the root hash value can refer to the hash value of the root node in the tree structure. When a hash tree is not used (e.g., a hash chain is used), the leaf hash value can refer to the basic hash value, and the root hash value can refer to the 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 to the judgment result before performing a hash algorithm operation.
[0036] In this disclosure, a hash tree can refer to any tree structure with leaf hash values as leaf nodes. A Merkle tree can refer to a tree structure of the form... Figure 3A The hash tree shown is a specific form of hash tree in this disclosure. Furthermore, any variations of the Merkle tree are within the scope of this disclosure.
[0037] Figure 1 An exemplary system architecture 100 is shown, in which embodiments of the data verification methods, apparatus, terminal devices, and storage media of this disclosure can be applied.
[0038] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, and 103, network 104, and servers 105 and 106. Network 104 is used as a medium to provide communication links between terminal devices 101, 102, and 103 and servers 105 and 106. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.
[0039] Users can use terminal devices 101, 102, and 103 to interact with servers 105 and 106 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 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, and 103 can be either hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices with microphones and speakers, including but not limited to smartphones, tablets, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 players (Moving Picture Experts Group Audio Layer IV), portable computers, and desktop computers, etc. When terminal devices 101, 102, and 103 are software, they can be installed in the aforementioned electronic devices. They can be implemented as multiple software programs or software modules, or as a single software program or software module. No specific limitations are made here.
[0041] Servers 105 and 106 can be servers that provide various services. For example, server 105 can be the server of the verifier, and server 106 can be the server of the credit guarantor.
[0042] In some cases, the data verification method provided in this disclosure can be executed by terminal devices 101, 102, and 103. Correspondingly, the data verification device can also be set in terminal devices 101, 102, and 103. In this case, the system architecture 100 may not include servers 105 and 106.
[0043] In some cases, the data verification method provided in this disclosure can be executed by servers 105 and 106. Accordingly, the data verification device can also be set in servers 105 and 106. In this case, the system architecture 100 may not include terminal devices 101, 102, and 103.
[0044] In some cases, the data verification method provided in this disclosure can be jointly executed by terminal devices 101, 102, 103 and servers 105, 106. Correspondingly, data verification devices can also be respectively set in terminal devices 101, 102, 103 and servers 105, 106.
[0045] It should be noted that servers 105 and 106 can be either hardware or software. When 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 servers 105 and 106 are software, they can be implemented as multiple software programs or software modules (for example, used to provide distributed services), or as a single software program or software module. No specific limitations are made here.
[0046] In one example, the verification device is, for example, Figure 1 Server 105, the credit guarantor equipment, is, for example, Figure 1 Server 106 in the middle, the device being verified is, for example, Figure 1 Terminal devices 101, 102, and 103 are mentioned above. The above examples are merely illustrations of various device types and do not constitute specific limitations on any particular device type.
[0047] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0048] In one example, the verification scheme in this 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. If the credit score meets certain conditions (e.g., greater than 400 points), the access control is opened to allow the customer to enter the unmanned supermarket.
[0049] In another example, the verification scheme in this disclosure can be applied to power bank rentals, where the verifier is the operator of the power bank rental platform, the verified party is the user renting the power bank, and the guarantor is a credit rating agency. In this example, the operator of the power bank rental platform verifies the user's credit record; if there is no record of dishonesty, the power bank is provided to the user.
[0050] The two scenarios described above are merely examples of application scenarios for the verification scheme in this disclosure and are not intended to limit it. It should be understood that the verification scheme in this disclosure can also be applied to other situations requiring data verification.
[0051] Figure 2A A flowchart of one embodiment of the data verification method according to this disclosure is shown, wherein the implementing entity is a verification device.
[0052] In the embodiments of this disclosure, the verification of the target data involves two aspects: firstly, verifying the range of values of the target data (whether the target data meets the target judgment conditions), and secondly, verifying whether the aforementioned range of values is true and reliable.
[0053] like Figure 2A As shown, method 210 includes the following steps:
[0054] Step 211: Obtain the target judgment result and root hash value from the verification device. The root hash value is generated by the verification 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 embodiments of this disclosure, the target data can be numerical or non-numerical. In one example, the target data is a credit score (numerical), and the judgment condition is, for example, "whether it is greater than 100". In another example, the target data is gender (non-numerical), and the judgment condition is, for example, "whether it is male (or female)".
[0056] In the embodiments of this disclosure, the target judgment result can be obtained in the following way: the verification device sends the target judgment condition, such as "whether it is greater than 100", to the verification device; the verification device determines the corresponding target judgment result, such as "greater than 100" (denoted as ">100"), and returns it to the verification device.
[0057] It is easy to understand that the verification device can determine the range of values of the target data it needs based on the target judgment result, while the specific value of the target data will not be disclosed.
[0058] In the embodiments of this disclosure, the verifying party and the verified party can 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 it exceeds 18". The verified party device can determine the judgment result of each judgment condition in advance based on the target data, and calculate the root hash value according to the agreed judgment conditions.
[0059] In embodiments of this disclosure, the target determination result corresponds to a target leaf hash value among at least one leaf hash value. For example, the target determination result can be hashed to obtain the corresponding target leaf hash value. For instance, the target determination result ">100" can be hashed to obtain the corresponding target leaf hash value H(>100).
[0060] In the embodiments of this disclosure, the number of leaf hash values can be one or more, and each leaf hash value corresponds to the judgment result of the target data under a judgment condition. For example, 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" respectively, and the corresponding leaf hash values are H(>100), H(<200), H(<300) and H(<400) respectively.
[0061] In embodiments of this disclosure, the root hash value is generated by the device being verified based on the leaf hash value.
[0062] In one example, the root hash value can be generated based on a hash tree. See also Figure 3AThis is an example of a hash tree (Merkel tree), which consists of leaf nodes (bottom-level nodes), intermediate nodes (middle-level nodes), and a root node (top-level node). 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 an intermediate node is calculated from the hash values of its corresponding leaf nodes. For example, the hash value of 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)"). The value of 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 its 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, the root hash value can be generated based on the hash chain. For example, the leaf hash values H(>100), H(<200), H(<300), and H(<400) can be directly concatenated to obtain the root hash value H(>100)-H(<200)-H(<300)-H(<400).
[0064] The above method is merely an example of a root hash value generation method and not a limitation. Those skilled in the art can use other methods to calculate the root hash value based on the leaf hash values.
[0065] In this disclosure, the target leaf hash value is the leaf hash value corresponding to the target judgment condition. For example, the verifying device can send a verification request to the verified device, the verification request including the target judgment condition. The verified device sends the root hash value and the target judgment result corresponding to the target judgment condition to the verifying device. The verifying device then generates the corresponding target leaf hash value based on the target judgment result. For example, for... Figure 3A In the example, suppose the verification request sent by the verifying device contains the verification condition "whether it is greater than 100". The verified device returns the corresponding target judgment result and ">100". Based on this, the verifying device calculates the target leaf hash value as H (>100), which is the hash value of the leaf node H1.
[0066] Whether or not the judgment result other than the target judgment result (or leaf hash value) needs to be transmitted depends on the specific situation. For example, when using... Figure 3A In the case of a Merkle tree, it is not necessary to transmit all the judgment results or leaf hash values; only the hash value of leaf node H2 and the hash value of intermediate node H34 need to be transmitted. Conversely, in the case of a hash chain, all judgment results (or leaf hash values) other than the target judgment result need to be transmitted.
[0067] When using a Merkle tree, the number of leaf hashes should be at least four and even. If the number of leaf hashes is small or odd, dummy leaf nodes can be introduced to satisfy the conditions for constructing 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 target leaf hash value can be calculated first 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 (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; in the case of using a hash chain, 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 this disclosure, the verification device obtains the root hash value from the verification device and calculates the corresponding verification hash value based on the judgment result obtained from the verified party. Then, the obtained root hash value and the calculated verification hash value can be compared to complete the first verification of the value range of the target data, namely hash verification (the second verification, namely signature verification, will be described below).
[0071] In the embodiments of this disclosure, the specific type of the preset algorithm is not limited. The preset algorithm is agreed upon in advance by the verification device and the verified device. For example, when a Merkle tree is used, 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 values of the leaf nodes of the Merkle tree.
[0072] In an optional embodiment, step 212 requires not only the target judgment result but also verification information corresponding to the target judgment result. When using a Merkle tree, the verification information includes the associated hash values corresponding to each branch pointing from the target leaf hash value to the root hash value. For Figure 3A For example, the target leaf hash value is the hash value of leaf node H1, and the corresponding verification information includes the hash value of leaf node H2 and the hash value of intermediate node H34. Therefore, the hash value of H12 can be calculated first based on the hash values of H1 and H2, and then the hash value of the root node H1234 can be calculated based on the hash values of H12 and H34, thus obtaining the verification hash value.
[0073] Using Merkle trees can reduce the amount of data that needs to be computed and transmitted, which helps to reduce the computational load and improve computational efficiency.
[0074] When using a hash chain, the verification information includes leaf hash values other than the target leaf hash value corresponding to the target judgment result. Based on this, the leaf hash values can be concatenated in a specific order to obtain the verification hash value.
[0075] Step 213: Compare the verification hash value with the root hash value to complete the verification of the target data.
[0076] It's easy to understand that if the root hash value that can be obtained matches the calculated verification hash value, then the first verification passes, and the authenticity of the target data's value range can be preliminarily determined.
[0077] In an optional embodiment, the method further includes: obtaining a signature value corresponding to the root hash value, wherein the signature value is obtained by the credit guarantor device digitally signing the root hash value. And, after step 213, the method further includes the following step 214: if the hash value is verified to be consistent with the root hash value, verifying the validity of the signature value using a public key previously obtained from the credit guarantor device, thereby completing the verification of the target data.
[0078] In the above embodiments, 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 is successful.
[0079] In the embodiments of this disclosure, both the signature value and the public key are generated by the guarantor device. After generating the signature value, the guarantor device sends it to the verified party device, which then sends it to the verifier device in response to the verification request. After generating the public key, the guarantor device sends it to the verifier device for use during verification.
[0080] In step 214 above, those skilled in the art can use a signature method they know to generate a signature value and provide a public key. This disclosure does not limit the specific signature method.
[0081] In the above embodiments, a second verification can be achieved by verifying the validity of the signature value. If the second verification passes, 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 illustrating a specific example of an embodiment of the data verification method according to this disclosure is shown. See also Figure 3A and Figure 3B This example includes the following implementation process:
[0083] The first phase involves logically validating the construction of the Merkle tree for the target data, including:
[0084] (1) Select logical judgment intervals: Based on the characteristics of the target value, set multiple logical judgment intervals. For example, for the target value 198, the following judgment intervals can be set:
[0085] a. First judgment interval: whether it is greater than 100, marked as condition > 100.
[0086] b. Second judgment interval: whether it is less than 200, marked as condition <200.
[0087] c. Third judgment interval: whether it is less than 300, marked as condition <300.
[0088] d. Fourth judgment interval: whether it is less than 400, marked as condition <400.
[0089] (2) Calculate the 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 the Merkle tree: Using these hash values as leaf nodes, combine them according to specific rules, calculate the hash values of intermediate nodes layer by layer, and finally obtain the root node hash value H1234 of the Merkle tree. For example:
[0091] a. First layer: Calculate H12 = H(H(>100) + H(<200)) and H34 = H(H(<300) + ...
[0092] H(<400))
[0093] b. Second level: Calculate the root node hash value H1234 = H(H12 + H34)
[0094] The second phase involves signing and publishing the root node hash value, including:
[0095] (1) Signature: The calculated root node hash value H1234 is submitted to the credit guarantee institution for digital signature to generate the 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 stage, the verification process, includes:
[0098] (1) Verification request: The verifier sends a logical verification request to the verifier, such as "whether the target value is greater than 100".
[0099] (2) Verification path provision: The party being verified provides relevant verification information according to the verification request. For verifying "whether it is greater than 100", the party being verified provides the target judgment result ">100", the hash value of the leaf node H2 and the hash value of the intermediate node H34.
[0100] (3) Obtain 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 calculating to obtain the root node hash value (i.e., the verification hash value) H1234' = H(H12+
[0104] H34).
[0105] c. The verifier compares the calculated root node hash value H1234' with the root node hash value H1234 of the signature. If they match, the verification passes.
[0106] d. Signature verification: The verifier uses the public key of the credit guarantee institution 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 flowchart of one embodiment of the data verification method according to this disclosure is shown, in which the implementing entity is a terminal device.
[0108] like Figure 2B As shown, method 220 includes the following steps:
[0109] Step 221: Generate a root hash value 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.
[0110] Step 222: Receive the verification request sent by the verification device. The verification request includes the target judgment conditions.
[0111] Step 223: Send 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, and the 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 implementation, the target hash tree is a Merkle tree.
[0114] In an optional implementation, the method further includes: sending verification information corresponding to the target judgment result to the verification device, wherein 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 from the target leaf hash value to the root hash value.
[0115] For details and technical effects of method 220, please refer to the description of method 210 above.
[0116] Figure 2C A flowchart of one embodiment of the data verification method according to this disclosure is shown, in which the implementation subject is an edge node.
[0117] like Figure 2C As shown, method 230 includes the following steps:
[0118] Step 231: Obtain the root hash value. The root hash value is generated by the verified device according to a preset algorithm and based on at least one judgment result. Each leaf hash value corresponds to the judgment result of the target data under a judgment condition.
[0119] Step 232: Digitally sign the root hash value to obtain the corresponding signature value.
[0120] Step 233: Send the signature value to the device being verified and send the public key corresponding to the signature value to the device being verified, so that the device being verified can complete the verification of the target data.
[0121] In an optional implementation, the number of leaf hash values is at least two, and the 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 implementation, the target hash tree is a Merkle tree.
[0123] For details and technical effects of method 230, please refer to the description of method 210 above.
[0124] Figure 4A An exemplary block diagram of a data verification apparatus according to embodiments of the present disclosure is shown. Figure 4AAs shown, the data verification device 410 includes: a verification information acquisition module 411, used to acquire a target judgment result and a root hash value, wherein the root hash value is generated by the device being verified according to a preset algorithm and based on leaf hash values generated from at least one judgment result, and each leaf hash value 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 among at least one of the leaf hash values; a calculation module 412, used to calculate a corresponding verification hash value according to the preset algorithm and based on the target judgment result; and a verification module 413, 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 various modules of the device 410 shown can be connected to the reference. Figure 2A The steps in method 210 described correspond to each other. Therefore, the operations, features, and advantages described above for method 210 also apply to device 410 and its included modules. For the sake of brevity, some operations, features, and advantages will not be repeated here.
[0126] In an optional implementation, the verification information acquisition module 411 is further configured to: acquire the signature value corresponding to the root hash value, wherein the signature value is obtained by the credit guarantor device digitally signing the root hash value. The verification module 413 is further configured to: if the verification hash value is consistent with the root hash value, verify the validity of the signature value using a public key previously obtained from the credit guarantor device, thereby completing the verification of the target data.
[0127] In an optional implementation, the number of 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 the 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 configured to: acquire verification information corresponding to the target judgment result, wherein the verification information includes each associated hash value corresponding to the branch from the target leaf hash value to the root hash value. The verification module 413 is further configured to: calculate the target leaf hash value based on the target judgment result; and calculate the verification hash value based on the target leaf hash value and each of the associated hash values.
[0130] Figure 4B An exemplary block diagram of a data verification apparatus according to embodiments of the present disclosure is shown. Figure 4BAs shown, the data verification device 420 includes: a generation module 421, used to generate a root hash value based on leaf hash values generated from at least one judgment result, each leaf hash value corresponding to a judgment result of target data under a judgment condition; a receiving module 422, used to receive a verification request sent by a verification device, the verification request including a target judgment condition; and a sending module 423, used to send 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.
[0131] It should be understood that Figure 4B The various modules of the device 420 shown can be connected to the reference. Figure 2B The steps in method 220 described correspond to each other. Therefore, the operations, features, and advantages described above for method 220 also apply to device 420 and its included modules. For the sake of brevity, some operations, features, and advantages will not be repeated here.
[0132] In an optional implementation, the number of 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 the 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 further configured to: send verification information corresponding to the target judgment result to the verification device, wherein 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 from the target leaf hash value to the root hash value.
[0135] Figure 4C An exemplary block diagram of a data verification apparatus according to embodiments of the present disclosure is shown. Figure 4C As shown, the data verification device 430 includes: a signature information acquisition module 431, used to acquire a root hash value, wherein the root hash value is generated by the device being verified according to a preset algorithm and based on 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 a judgment condition; a signature module 432, used to digitally sign the root hash value to obtain a corresponding signature value; and a signature information sending module 433, used to send the signature value to the device being verified and to send the public key corresponding to the signature value to the verification device, so that the verification 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 can be connected to the reference. Figure 2CThe steps in method 230 described correspond to each other. Therefore, the operations, features, and advantages described above for method 230 also apply to device 430 and its included modules. For the sake of brevity, some operations, features, and advantages will not be repeated here.
[0137] In an optional implementation, the number of 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 the root node of the target hash tree.
[0138] In an optional implementation, the target hash tree is a Merkle tree.
[0139] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. See also Figure 5 The present invention describes a structural block diagram of an electronic device 500 that can serve as a server or client of the present disclosure, which is an example of hardware devices 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, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown in this disclosure, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein. 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. The RAM 503 may also store various programs and data required for the operation of the device 500. The computing unit 501, ROM 502, and RAM 503 are interconnected via 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, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, optical disk, etc.; and a communication unit 509, such as a network card, modem, wireless transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0140] The computing unit 501 can be a variety of general-purpose and / or special-purpose 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 special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as data verification methods. For example, in some embodiments, the data verification method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on 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 data verification methods by any other suitable means (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 can 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 this functionality is implemented in hardware or software depends on the specific application and design constraints on the overall system.
[0142] Hardware and data processing apparatus for implementing the various illustrative logics, logic blocks, modules, and circuits described in conjunction with aspects of this disclosure may be implemented or performed by 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, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described in this disclosure. A general-purpose processor may be a microprocessor or any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, such as a combination of a DSP and a microprocessor, multiple microprocessors, one or more microprocessors combined with a DSP core, or any other such configuration. In some aspects, specific processes and methods may be performed by circuitry specific to a given function.
[0143] In one or more aspects, the described functionality can be implemented in hardware, digital electronic circuits, computer software, firmware (including the structures disclosed in this specification and their equivalents) or any combination thereof. The aspects of the subject matter described in this specification can also be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a computer storage medium for execution by a data processing apparatus or for controlling the operation of a data processing apparatus.
[0144] If implemented in software, the functionality can be stored or transferred as one or more instructions or code onto a computer-readable medium. The processes of the methods or algorithms disclosed in this disclosure can be implemented in a processor-executable software module that may reside on a computer-readable medium. Computer-readable media include computer storage media and communication media, including any medium capable of transferring a computer program from one place to another. Storage media can be any available medium accessible to a computer. By way of example and not limitation, this computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disc storage, disk storage or other magnetic storage devices, or any other medium that can be used to store the required program code in the form of instructions or data structures and is accessible to a computer. Furthermore, any connection can be properly referred to as a computer-readable medium. The disks and discs used in this disclosure include high-density optical discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, wherein disks typically magnetically copy data, while discs optically copy data using lasers. Combinations of the above should also be included within the scope of computer-readable media. Additionally, the operation of a method or algorithm may be one or any combination or set of code and instructions on a machine-readable and computer-readable medium, which may be incorporated into a computer program product.
[0145] The various embodiments in this disclosure are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments, equipment embodiments, computer-readable storage medium embodiments, and computer program product embodiments are basically similar to the method embodiments, so the descriptions are relatively simple, and relevant parts can be referred to the descriptions of the method embodiments.
Claims
1. A data verification method, implemented by a verification device, comprising: Obtain the target judgment result and the root hash value. The root hash value is generated by the verified 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 of the leaf hash values. The corresponding verification hash value is calculated according to the preset algorithm and the target judgment result; 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 includes: Obtain the signature value corresponding to the root hash value, wherein the signature value is obtained by the credit guarantor device digitally signing the root hash value; and After comparing the verification hash value with the root hash value, the method further includes: If the verification hash value matches the root hash value, the validity of the signature value is verified using the public key obtained in advance from the credit guarantor's device, thereby completing the verification of the target data.
3. The method according to claim 1, wherein, The number of 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 the 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 includes: Obtain the verification information corresponding to the target judgment result, the verification information including each associated hash value corresponding to the branch 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: Based on the target determination result, the target leaf hash value is calculated; The verification hash value is calculated based on the target leaf hash value and each of the associated hash values.
6. A data verification method, implemented by the device being verified, comprising: A root hash value is generated based on the leaf hash value produced by at least one judgment result, and each leaf hash value corresponds to the judgment result of the target data under a judgment condition; Receive a verification request sent by the verification device, the verification request including target judgment conditions; The root hash value and the target judgment result corresponding to the target judgment condition are sent to the verification device so that the verification device can complete the verification of the target data.
7. The method according to claim 6, wherein, The number of 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 the 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 includes: The verification information corresponding to the target judgment result is sent to the verification device. The target leaf hash value is obtained by hashing the target judgment result. The verification information includes each associated hash value corresponding to the branch from the target leaf hash value to the root hash value.
10. A data verification method, implemented by a credit guarantor device, comprising: Obtain the root hash value, which is generated by the verified device according to a preset algorithm and based on at least one judgment result. Each leaf hash value corresponds to the judgment result of the target data under a judgment condition. The root hash value is digitally signed to obtain the corresponding signature value; The signature value is sent to the device being verified, and the public key corresponding to the signature value is sent to the device being verified, so that the device being verified can complete the verification of the target data.
11. The method according to claim 10, wherein, The number of 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 the 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: The verification information acquisition module is used to acquire the target judgment result and the root hash value. The root hash value is generated by the device being verified 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 of the leaf hash values. The calculation module is used to calculate the 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 being verified, comprising: A generation module is used to generate a root hash value based on the leaf hash value generated by at least one judgment result, wherein each leaf hash value corresponds to the judgment result of the target data under a judgment condition; The receiving module is used to receive a verification request sent by the verification device, the verification request including target judgment conditions; The sending module is used to send 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.
15. A data verification device, applied to a credit guarantor device, comprising: The signature information acquisition module is used to acquire the root hash value, which is generated by the verified device according to a preset algorithm and based on at least one judgment result. Each leaf hash value corresponds to the judgment result of the target data under a judgment condition. The signature module is used to digitally sign the root hash value to obtain the corresponding signature value; The signature information sending module is used to send the signature value to the device being verified and to send the public key corresponding to the signature value to the device being verified, so that the device being verified can complete the verification of the target data.
16. A computer program product comprising program code instructions that, when executed by a computer, cause the computer to perform the method according to any one of claims 1-12.
17. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-12.
18. An electronic device comprising: processor, A memory that communicates electronically with the processor; as well as Instructions, which are stored in the memory and can be executed by the processor, to cause the electronic device to perform the method according to any one of claims 1-12.
Citation Information
Patent Citations
KR20220083931A
KR20220094899A