Data verification method and device, computer device, readable storage medium and program product
By generating hash values and timestamps for measurement data through hash functions and sorting mechanisms, constructing structural chains, and sorting by risk scoring, the problem of easy tampering of measurement data is solved, and the reliable verification and traceability of data are realized, thereby improving the overall credibility of measurement data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUIZHOU POWER GRID CO LTD
- Filing Date
- 2026-06-24
- Publication Date
- 2026-07-21
Smart Images

Figure CN122433136A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data verification technology, and in particular to a data verification method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology
[0002] As industries such as intelligent manufacturing, high-end equipment, and precision testing increasingly demand higher accuracy and reliability in metrology, metrology laboratories, as core institutions for the collection and traceability of various measurement data, play a fundamental supporting role in key aspects such as product quality assessment, standard calibration, and equipment inspection. However, current metrology data generation, transmission, verification, and supervision are generally hampered by technical bottlenecks such as susceptibility to data tampering, difficulty in verifying sources, weak identity authentication mechanisms, missing authorization chains, and reliance on explicit disclosure for verification methods. These bottlenecks severely restrict the construction of a reliable metrology data system. Summary of the Invention
[0003] Therefore, it is necessary to provide a data verification method, apparatus, computer equipment, computer-readable storage medium, and computer program product that can improve the reliability of measurement data in response to the above-mentioned technical problems.
[0004] Firstly, this application provides a data verification method, the method comprising:
[0005] For the current measurement operation during the metrological experiment, during the execution of the current measurement operation, the corresponding current metrological data is obtained, and the current metrological data is input into a hash function to output the current hash value; wherein, the current metrological data includes the current measurement value, the unit of measurement of the current measurement value and the current standard error, the device identifier of the measuring equipment, the identity identifier of the measuring personnel, the current measurement timestamp, and the current environmental parameters;
[0006] Based on the current hash value, the current structural constraint hash value is obtained, and a current data node is constructed in the structural chain, encapsulating the current hash value, the current measurement timestamp, the identity identifier, and the current structural constraint hash value. Each data node in the structural chain corresponds one-to-one with a hash value, and the structural chain is formed by connecting different data nodes in a forward-to-back order according to the encapsulated measurement timestamps. The current structural constraint hash value is used to constrain the position and validity of the current data node in the structural chain.
[0007] For any data node in the structural chain, obtain the number of requests for verification of the data node, the encapsulation time of the data encapsulated in the data node, the structural constraint hash value encapsulated in the data node, and the standard deviation between the data node and other adjacent data nodes. Based on the number of requests, the encapsulation time, the structural constraint hash value, and the standard deviation, obtain the risk score of the data node.
[0008] According to the risk score values in descending order, all data nodes are initially sorted to obtain an initial sorting result. For any two data nodes in the structural chain, the initial sorting result is adjusted based on the sequential relationship between the test timestamps encapsulated by the two data nodes, the permission flow relationship between the encapsulated identity identifiers, and the logical relationship between the corresponding measurement operations of the two data nodes to obtain a target sorting result.
[0009] Based on the target sorting result, each data node is verified sequentially.
[0010] In one embodiment, obtaining the current structural constraint hash value based on the current hash value includes:
[0011] According to the connection order of different data nodes in the structural chain, determine a preset number of first historical data nodes that are located before the current data node and are closest to the current data node, and obtain the historical hash value encapsulated by any one of the first historical data nodes;
[0012] The current hash value and all historical hash values are concatenated, and the concatenated hash value is input into the hash function to output the current structural constraint hash value of the current data node.
[0013] In one embodiment, the step of verifying any data node sequentially based on the target sorting result includes:
[0014] For any historical data node in the structural chain, if the number of other historical data nodes preceding the historical data node is not less than the preset number, the historical data node is determined as the second historical data node.
[0015] According to the connection order of different data nodes in the structural chain, a preset number of other historical data nodes that are located before the second historical data node and are closest to the second historical data node are determined as the third historical data node;
[0016] Based on the historical hash value of the second historical data node, the historical hash values of all third historical data nodes, and the target sorting result, any data node is verified.
[0017] In one embodiment, the verification of any data node based on the historical hash value of the second historical data node, the historical hash values of all third historical data nodes, and the target sorting result includes:
[0018] The historical hash value of the second historical data node and the historical hash values of all third historical data nodes are concatenated, and the concatenated historical hash value is input into the hash function to output the first historical structure constraint hash value of the second historical data node.
[0019] Obtain the hash value of the second historical structure constraint encapsulated by the second historical data node, and if the hash value of the first historical structure constraint is consistent with the hash value of the second historical structure constraint, verify the second historical data node based on its position in the target sorting result.
[0020] In one embodiment, the step of verifying any data node sequentially based on the target sorting result includes:
[0021] During the verification of the current data node according to the target sorting result, the credibility score of the current data node is obtained based on the hash value difference between the current hash value and the historical hash value encapsulated by any historical data node, the timestamp difference between the current measurement timestamp and the historical measurement timestamp encapsulated by any historical data node, the identity identifier, and the current measurement timestamp.
[0022] The confidence score, the current measurement data, the identity identifier, and the current measurement timestamp are input into the dual verification function, and the dual verification value is output.
[0023] The dual verification value, the identity identifier, and the current measurement timestamp are concatenated, and the concatenated data is input into the hash function to output the public verification value of the current data node.
[0024] If the publicly verified value matches the benchmark verified value, the current data node is determined to have passed verification.
[0025] In one embodiment, obtaining the risk score of the data node based on the number of requests, the encapsulation duration, the structural constraint hash value, and the standard deviation includes:
[0026] Based on the structural constraint hash value encapsulated by the data node, the distribution entropy of the data node in the structural chain is obtained;
[0027] The risk score of the data node is obtained based on the number of requests, the encapsulation time, the distribution entropy, and the standard deviation.
[0028] Secondly, this application also provides a data verification device, the device comprising:
[0029] The first acquisition module is used to acquire the current measurement data corresponding to the current measurement operation during the execution of the current measurement operation, and input the current measurement data into a hash function to output the current hash value; wherein, the current measurement data includes the current measurement value, the unit of measurement of the current measurement value and the current standard error, the device identifier of the measuring equipment, the identity identifier of the measuring personnel, the current measurement timestamp, and the current environmental parameters;
[0030] The second acquisition module is used to acquire the current structural constraint hash value based on the current hash value, and to construct a current data node in the structural chain that encapsulates the current hash value, the current measurement timestamp, the identity identifier, and the current structural constraint hash value; wherein, the data nodes in the structural chain correspond one-to-one with the hash values, and the structural chain is obtained by connecting different data nodes in order from front to back according to the encapsulated measurement timestamps, and the current structural constraint hash value is used to constrain the position and legality of the current data node in the structural chain;
[0031] The third acquisition module is used to acquire, for any data node in the structure chain, the number of requests for verification of the data node, the encapsulation time of the data encapsulated in the data node, the structural constraint hash value encapsulated in the data node, and the standard deviation between the data node and other adjacent data nodes, and to acquire the risk score value of the data node based on the number of requests, the encapsulation time, the structural constraint hash value and the standard deviation.
[0032] The sorting module is used to initially sort all data nodes according to the risk score values from largest to smallest to obtain an initial sorting result. For any two data nodes in the structure chain, the module adjusts the initial sorting result based on the chronological relationship between the test timestamps encapsulated by the two data nodes, the permission flow relationship between the encapsulated identity identifiers, and the logical relationship between the corresponding measurement operations of the two data nodes to obtain a target sorting result.
[0033] The verification module is used to verify any data node sequentially based on the target sorting result.
[0034] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method in any of the above embodiments.
[0035] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the methods in any of the above embodiments.
[0036] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the methods in any of the above embodiments.
[0037] The aforementioned data verification method, apparatus, computer equipment, computer-readable storage medium, and computer program product, for the current measurement operation in the metrology experiment, acquire the current metrology data corresponding to the current measurement operation during the execution of the current measurement operation, input the current metrology data into a hash function, and output the current hash value; wherein, the current metrology data includes the current measured value, the unit of measurement of the current measured value and the current standard error, the equipment identifier of the measuring equipment, the identity identifier of the measuring personnel, the current measurement timestamp, and the current environmental parameters; based on the current hash value, the current structural constraint hash value is obtained, and a current data node encapsulating the current hash value, the current measurement timestamp, the identity identifier, and the current structural constraint hash value is constructed in the structural chain; wherein, the data nodes in the structural chain correspond one-to-one with the hash values, and the structural chain is obtained by connecting different data nodes in the order of the encapsulated measurement timestamps from front to back, and the current structural constraint hash value... This method constrains the position and legitimacy of the current data node in the structural chain. For any data node in the structural chain, it obtains the number of requests for verification of the data node, the encapsulation time of the data encapsulated in the data node, the structural constraint hash value encapsulated in the data node, and the standard deviation between the data node and other adjacent data nodes. Based on the number of requests, encapsulation time, structural constraint hash value, and standard deviation, it obtains the risk score of the data node. All data nodes are initially sorted according to their risk scores from largest to smallest to obtain an initial sorting result. For any two data nodes in the structural chain, the initial sorting result is adjusted based on the sequential relationship between the test timestamps encapsulated by the two data nodes, the permission flow relationship between the encapsulated identity identifiers, and the logical relationship between the corresponding measurement operations of the two data nodes to obtain a target sorting result. Based on the target sorting result, any data node is verified sequentially. The method provided in this application sorts data nodes based on the relationships between different data nodes, enabling priority verification of data nodes with higher risks, thereby maximizing the overall credibility of the structural chain. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0039] Figure 1 This is a flowchart illustrating a data verification method in one embodiment;
[0040] Figure 2This is a flowchart illustrating the steps for obtaining the current structural constraint hash value in one embodiment;
[0041] Figure 3 This is a structural block diagram of a data verification device in one embodiment;
[0042] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0044] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0045] In one embodiment, such as Figure 1 As shown, a data verification method is provided. This embodiment illustrates the method applied to a terminal. It is understood that this method can also be applied to a server, and further to a system including both a terminal and a server, and is implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0046] S102. For the current measurement operation in the metrology experiment, during the execution of the current measurement operation, obtain the current metrology data corresponding to the current measurement operation, input the current metrology data into the hash function, and output the current hash value; wherein, the current metrology data includes the current measurement value, the unit of measurement of the current measurement value and the current standard error, the device identifier of the measuring equipment, the identity identifier of the measuring personnel, the current measurement timestamp, and the current environmental parameters.
[0047] Optionally, the current environmental parameters may include, but are not limited to, the temperature, humidity, and air pressure around the measuring device.
[0048] Optionally, all data items in the current measurement data are standardized to obtain a standardized feature vector of the current measurement data, and the obtained feature vector is hashed. The standardization process may include, but is not limited to, data type unification, numerical normalization and discrete variable encoding, and the hash function may include, but is not limited to, the SHA3-512 (Secure Hash Algorithm 3-512) hash algorithm with collision resistance and irreversibility.
[0049] S104. Obtain the current structural constraint hash value based on the current hash value, and construct a current data node in the structural chain that encapsulates the current hash value, the current measurement timestamp, the identity identifier, and the current structural constraint hash value; wherein, the data nodes in the structural chain correspond one-to-one with the hash values, and the structural chain is obtained by connecting different data nodes in the order of the encapsulated measurement timestamps from front to back, and the current structural constraint hash value is used to constrain the position and legality of the current data node in the structural chain.
[0050] Optionally, in order to strengthen the constraint of the chain structure on data continuity and ensure the irreversibility and forward non-insertionability of the measurement data in the structure chain, a multi-directional hash binding structure constraint mechanism is introduced in this embodiment, that is, the structure constraint hash value of the data node is calculated; the current structure constraint hash value is an encrypted signature representing the position, context structure and historical path of the current measurement data in the structure chain.
[0051] S106. For any data node in the structural chain, obtain the number of requests for verification of the data node, the encapsulation time of the data encapsulated in the data node, the structural constraint hash value encapsulated in the data node, and the standard deviation between the data node and other adjacent data nodes. Based on the number of requests, encapsulation time, structural constraint hash value and standard deviation, obtain the risk score of the data node.
[0052] Alternatively, the packaging time can be calculated using the following formula:
[0053]
[0054] In the formula, For encapsulation time, For the current moment, This is the measurement timestamp for the corresponding metering data of the data node.
[0055] Alternatively, the risk score can be calculated using the following formula:
[0056]
[0057] In the formula, This is the risk score. The distribution entropy of structural constraint hash values in the structural chain; For the number of requests; α represents the standard deviation between a data node and its neighboring data nodes, reflecting the anomaly of that data node; α, β, and γ are all weighting coefficients.
[0058] Optionally, the higher the risk score of a data node, the lower its credibility.
[0059] S108. Sort all data nodes in descending order of risk score to obtain an initial sorting result. For any two data nodes in the structural chain, adjust the initial sorting result based on the sequential relationship between the test timestamps encapsulated by the two data nodes, the permission flow relationship between the encapsulated identity identifiers, and the logical relationship between the corresponding measurement operations of the two data nodes to obtain the target sorting result.
[0060] Alternatively, the causal relationship between any two data nodes can be represented by the following equation:
[0061]
[0062] In the formula, This represents the causal relationship between node i and node j. and These are the measurement timestamps stored at node i and node j, respectively. and These are the identity identifiers stored in nodes i and j, respectively. and These are the event numbers for the corresponding measurement operations of nodes i and j, respectively. This is a Boolean function that represents the legal authorization transfer path from node i to node j, that is, it means that the permission transfer relationship between node i and node j is from node i to node j; The logical relationship between the measurement operations of node i and node j is as follows: the measurement operation of node i occurs first, and the measurement operation of node j occurs later.
[0063] Optionally, if A value of 1 indicates that the existence of node j in terms of time, logic, and permissions can all be derived from node i, meaning that node i is a verifiable and trustworthy source of traceability for node j; if If the value is 0, it means that the trustworthiness of node j cannot be reasonably traced through node i, and there is a risk of abnormal or forged behavior in the link. In this case, the verification is interrupted and an anomaly is marked.
[0064] S110. Based on the target sorting result, verify any data node in turn.
[0065] Optionally, if node j is located before node i in the initial sorting result, it means that the risk score of node j is greater than the risk score of node i, and node j needs to be verified before node i. The value of is 1, meaning node i is the cause and node j is the effect, and node i needs to be verified before node j. In this case, the initial sorting result needs to be adjusted to ensure that node i is placed before node j in the target sorting result.
[0066] In the aforementioned data verification method, for the current measurement operation during the metrological experiment, during the execution of the current measurement operation, the corresponding current metrological data is acquired, and the current metrological data is input into a hash function to output the current hash value. The current metrological data includes the current measured value, the unit of measurement and the current standard error, the device identifier of the measuring equipment, the identity identifier of the measuring personnel, the current measurement timestamp, and the current environmental parameters. Based on the current hash value, the current structural constraint hash value is obtained, and a current data node encapsulating the current hash value, the current measurement timestamp, the identity identifier, and the current structural constraint hash value is constructed in the structural chain. Each data node in the structural chain corresponds one-to-one with a hash value, and the structural chain is formed by connecting different data nodes in order of their encapsulated measurement timestamps from front to back. The current structural constraint hash value is used to constrain the current data node within the structural chain. The method involves determining the position and legitimacy of any data node in the chain. For any data node in the chain, it obtains the number of verification requests, the encapsulation time of the data encapsulated in the data node, the structural constraint hash value of the data node, and the standard deviation between the data node and its neighboring data nodes. Based on the number of requests, encapsulation time, structural constraint hash value, and standard deviation, it obtains the risk score of the data node. All data nodes are initially sorted according to their risk scores from highest to lowest. For any two data nodes in the chain, the initial sorting result is adjusted based on the sequential relationship between the test timestamps encapsulated by the two data nodes, the permission flow relationship between the encapsulated identity identifiers, and the logical relationship between the corresponding measurement operations of the two data nodes, resulting in a target sorting result. Based on the target sorting result, any data node is verified sequentially. The method provided in this application sorts data nodes based on the relationships between them, enabling priority verification of data nodes with higher risks, thereby maximizing the overall credibility of the chain.
[0067] In some embodiments, such as Figure 2 As shown, obtaining the current structural constraint hash value based on the current hash value includes:
[0068] S202. According to the connection order of different data nodes in the structural chain, determine a preset number of first historical data nodes that are located before the current data node and are closest to the current data node, and obtain the historical hash value encapsulated by any one of the first historical data nodes.
[0069] S204. Concatenate the current hash value with all historical hash values, input the concatenated hash value into the hash function, and output the current structural constraint hash value of the current data node.
[0070] Optionally, the current structural constraint hash value can be calculated using the following formula:
[0071]
[0072] In the formula, The hash value of the current structural constraints. The current hash value is given, and k is the preset quantity. , ... All are historical hash values. This is the hash concatenation operator, where Hash is the hash function.
[0073] In this embodiment, by introducing the hashes of the previous few historical nodes into the calculation, a strong correlation is formed between the current node and the historical nodes, strengthening the continuity and integrity of the structural chain; relying only on the most recent preset number of historical nodes, the computational complexity and storage overhead are reduced while ensuring the strength of structural constraints; by using a hash concatenation and re-hashing method, the structural constraint hash value has unidirectional irreversibility and tamper-resistant characteristics, and any node tampering, insertion, or deletion will result in verification failure; thus, dual constraints on the position and legality of nodes in the chain are achieved, improving the credibility and traceability of measurement data.
[0074] In some embodiments, based on the target sorting result, any one data node is verified sequentially, including: for any historical data node in the structural chain, if the number of other historical data nodes preceding the historical data node is not less than a preset number, the historical data node is determined as the second historical data node; according to the connection order of different data nodes in the structural chain, a preset number of other historical data nodes that are preceding the second historical data node and are closest to the second historical data node are determined as the third historical data node; and any one data node is verified based on the historical hash value of the second historical data node, the historical hash values of all third historical data nodes, and the target sorting result.
[0075] Optionally, but not limited to, the historical hash value of the second historical data node and the historical hash values of all third historical data nodes can be concatenated, and the second historical data node can be verified based on the concatenation result.
[0076] In this embodiment, only data nodes that meet the historical node quantity condition are verified to ensure the effectiveness and stability of structural constraint hash verification; the most recent preset number of historical nodes are used to participate in the calculation, which strengthens the chain association constraint while reducing the computation and storage overhead; the verification is performed in combination with the target sorting result to realize the priority verification of high-risk nodes, thereby improving the overall verification efficiency and data credibility.
[0077] In some embodiments, verification of any data node is performed based on the historical hash value of the second historical data node, the historical hash values of all third historical data nodes, and the target sorting result. This includes: concatenating the historical hash value of the second historical data node with the historical hash values of all third historical data nodes, and inputting the concatenated historical hash value into a hash function to output the first historical structure constraint hash value of the second historical data node; obtaining the second historical structure constraint hash value encapsulated by the second historical data node, and verifying the second historical data node based on its position in the target sorting result if the first historical structure constraint hash value matches the second historical structure constraint hash value.
[0078] Optionally, if the hash value of the first historical structure constraint is inconsistent with the hash value of the second historical structure constraint, it indicates that the context chain of the second historical data node has been tampered with or replaced, the verification process of the chain will be suspended, and a warning will be issued.
[0079] In this embodiment, the integrity and legality of historical data nodes are verified by recalculating and comparing the historical structural constraint hash values, effectively identifying anomalies such as tampering and forgery; the target sorting results are combined for sequential verification, with priority given to verifying high-risk nodes, which improves the overall verification efficiency while ensuring the accuracy of verification; the chain structure constraint is strengthened by using hash concatenation and rehashing, ensuring that the structural chain cannot be tampered with or inserted.
[0080] In some embodiments, based on the target ranking result, any data node is verified sequentially, including: during the verification of the current data node according to the target ranking result, obtaining the credibility score of the current data node based on the hash value difference between the current hash value and the historical hash value encapsulated by any historical data node, the timestamp difference between the current measurement timestamp and the historical measurement timestamp encapsulated by any historical data node, the identity identifier, and the current measurement timestamp; inputting the credibility score, current measurement data, identity identifier, and current measurement timestamp into the dual verification function, and outputting the dual verification value; concatenating the dual verification value, identity identifier, and current measurement timestamp, and inputting the concatenated data into the hash function, and outputting the public verification value of the current data node; if the public verification value is consistent with the benchmark verification value, determining that the current data node has passed the verification.
[0081] Alternatively, the credibility score can be calculated using the following formula:
[0082]
[0083] In the formula, The reliability score for the current data node, where i represents the current data node and k is the preset number; The current hash value, This represents the historical hash value of the j-th historical data node preceding the current data node i; This is the current measurement timestamp. The first data node before the current data node i Historical measurement timestamps for each historical data node; It is a time decay factor that controls the influence of time difference on weights; The identity identifier encapsulated by the current data node.
[0084] Optionally, the standardized feature vector of the current measurement data is used. The mapping variable is defined as a nonlinear exponential perturbation function, as shown in the following equation:
[0085]
[0086] In the formula, The mapping variable representing the current data node i represents the strength of the data feature index mapping. The eigenvector of the current data node i represents the eigenvector of the current data node i. Dimensional eigenvalues.
[0087] Alternatively, the dual verification function can be expressed as follows:
[0088]
[0089] In the formula, This represents the dual verification value of the current data node i.
[0090] Alternatively, the public verification value can be expressed as follows:
[0091]
[0092] In the formula, This represents the publicly verified value of the current data node i; As an amplified integer part of the floating-point value of the dual function, artificial jitter control is introduced to increase the randomness of the disturbance.
[0093] In this embodiment, a multi-dimensional credibility score is calculated to make the node credibility assessment more comprehensive and objective; a public verification value is generated by combining the dual verification function and hash operation to enhance the data anti-tampering and anti-forgery capabilities; the legality and integrity of nodes are efficiently verified by comparing the public verification value with the benchmark value; high-risk nodes are verified first according to the target sorting, which improves the overall verification efficiency while ensuring the verification accuracy.
[0094] In some embodiments, the risk score of a data node is obtained based on the number of requests, encapsulation time, structural constraint hash value, and standard deviation, including: obtaining the distribution entropy of the data node in the structural chain based on the structural constraint hash value encapsulated by the data node; and obtaining the risk score of the data node based on the number of requests, encapsulation time, distribution entropy, and standard deviation.
[0095] Optionally, the distribution entropy represents the information complexity and can be calculated from the Shannon entropy.
[0096] In this embodiment, distribution entropy is introduced to quantify the structural constraint hash value, which can more accurately reflect the distribution complexity and anomaly of nodes in the chain and improve the accuracy of risk identification. The integration of multiple-dimensional factors such as request count, encapsulation time, distribution entropy, and standard deviation makes the risk scoring more comprehensive and objective. The joint calculation of risks by multiple features can identify potential tampering, abnormal insertion, and other risk nodes in advance, thereby improving verification efficiency and data credibility.
[0097] In one exemplary embodiment, another data verification method is provided, which includes the following:
[0098] (1) Obtain the original measurement data in the measurement experiment, construct the feature vector of the original measurement data after standardization, compress and encode the feature vector to generate a hash digest, introduce a multi-way hash binding structure constraint mechanism to generate a structure constraint hash value, and conduct preliminary verification.
[0099] (2) After passing the initial verification, the credibility score is calculated. At the same time, a zero-knowledge irreversible verification mechanism is introduced. Based on the feature vector, it is implemented through a non-interactive exponential dual verification algorithm to obtain a public verification value for data verification.
[0100] (3) During the verification process, an information entropy-driven multi-factor priority evaluation mechanism is introduced to prioritize all data to be verified and verify them in turn. At the same time, a tensor causal verification mechanism based on triplet causal modeling is introduced to realize the traceability of data.
[0101] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0102] Based on the same inventive concept, this application also provides a data verification apparatus for implementing the data verification method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more data verification apparatus embodiments provided below can be found in the limitations of the data verification method described above, and will not be repeated here.
[0103] In one exemplary embodiment, such as Figure 3 As shown, a data verification device 300 is provided, including: a first acquisition module 301, a second acquisition module 302, a third acquisition module 303, a sorting module 304, and a verification module 305, wherein:
[0104] The first acquisition module 301 is used to acquire the current measurement data corresponding to the current measurement operation during the execution of the current measurement operation in the metrology experiment, and input the current measurement data into a hash function to output the current hash value; wherein, the current measurement data includes the current measurement value, the unit of measurement of the current measurement value and the current standard error, the device identifier of the measuring equipment, the identity identifier of the measuring personnel, the current measurement timestamp, and the current environmental parameters.
[0105] The second acquisition module 302 is used to acquire the current structural constraint hash value based on the current hash value, and to construct a current data node in the structural chain that encapsulates the current hash value, the current measurement timestamp, the identity identifier, and the current structural constraint hash value; wherein, the data nodes in the structural chain correspond one-to-one with the hash values, the structural chain is obtained by connecting different data nodes in order from front to back according to the encapsulated measurement timestamps, and the current structural constraint hash value is used to constrain the position and legality of the current data node in the structural chain.
[0106] The third acquisition module 303 is used to acquire, for any data node in the structure chain, the number of requests for verification of the data node, the encapsulation time of the data encapsulated in the data node, the structural constraint hash value encapsulated in the data node, and the standard deviation between the data node and other adjacent data nodes, and to acquire the risk score value of the data node based on the number of requests, the encapsulation time, the structural constraint hash value and the standard deviation.
[0107] The sorting module 304 is used to initially sort all data nodes according to the risk score values from largest to smallest to obtain an initial sorting result, and for any two data nodes in the structural chain, adjust the initial sorting result based on the sequential relationship between the test timestamps encapsulated by the two data nodes, the permission flow relationship between the encapsulated identity identifiers, and the logical relationship between the corresponding measurement operations of the two data nodes to obtain a target sorting result.
[0108] The verification module 305 is used to verify any data node sequentially based on the target sorting result.
[0109] In some embodiments, the second acquisition module 302 is further configured to determine a preset number of first historical data nodes that are located before the current data node and are closest to the current data node according to the connection order of different data nodes in the structural chain, and acquire the historical hash value encapsulated by any one of the first historical data nodes; concatenate the current hash value and all historical hash values, and input the concatenated hash value into the hash function to output the current structural constraint hash value of the current data node.
[0110] In some embodiments, the verification module 305 is further configured to, for any historical data node in the structural chain, determine the historical data node as a second historical data node if the number of other historical data nodes preceding the historical data node is not less than the preset number; determine the preset number of other historical data nodes that are preceding the second historical data node and are closest to the second historical data node as third historical data nodes according to the connection order of different data nodes in the structural chain; and verify any data node based on the historical hash value of the second historical data node, the historical hash values of all third historical data nodes, and the target sorting result.
[0111] In some embodiments, the verification module 305 is further configured to concatenate the historical hash value of the second historical data node and the historical hash values of all third historical data nodes, and input the concatenated historical hash value into the hash function to output the first historical structure constraint hash value of the second historical data node; obtain the second historical structure constraint hash value encapsulated by the second historical data node, and verify the second historical data node based on its position in the target sorting result if the first historical structure constraint hash value is consistent with the second historical structure constraint hash value.
[0112] In some embodiments, the verification module 305 is further configured to, during the verification of the current data node according to the target sorting result, obtain a credibility score of the current data node based on the hash value difference between the current hash value and the historical hash value encapsulated by any historical data node, the timestamp difference between the current measurement timestamp and the historical measurement timestamp encapsulated by any historical data node, the identity identifier, and the current measurement timestamp; input the credibility score, the current measurement data, the identity identifier, and the current measurement timestamp into a dual verification function and output a dual verification value; concatenate the dual verification value, the identity identifier, and the current measurement timestamp, and input the concatenated data into the hash function to output a public verification value of the current data node; and determine that the current data node passes verification if the public verification value is consistent with the benchmark verification value.
[0113] In some embodiments, the third acquisition module 303 is further configured to acquire the distribution entropy of the data node in the structural chain based on the structural constraint hash value encapsulated by the data node; and acquire the risk score value of the data node based on the number of requests, the encapsulation duration, the distribution entropy and the standard deviation.
[0114] Each module in the aforementioned data verification device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0115] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a data verification method.
[0116] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0117] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0118] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0119] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0120] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0121] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0122] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0123] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data verification method, characterized in that, The method includes: For the current measurement operation during the metrological experiment, during the execution of the current measurement operation, the corresponding current metrological data is obtained, and the current metrological data is input into a hash function to output the current hash value; wherein, the current metrological data includes the current measurement value, the unit of measurement of the current measurement value and the current standard error, the device identifier of the measuring equipment, the identity identifier of the measuring personnel, the current measurement timestamp, and the current environmental parameters; Based on the current hash value, the current structural constraint hash value is obtained, and a current data node is constructed in the structural chain, encapsulating the current hash value, the current measurement timestamp, the identity identifier, and the current structural constraint hash value. Each data node in the structural chain corresponds one-to-one with a hash value, and the structural chain is formed by connecting different data nodes in a forward-to-back order according to the encapsulated measurement timestamps. The current structural constraint hash value is used to constrain the position and validity of the current data node in the structural chain. For any data node in the structural chain, obtain the number of requests for verification of the data node, the encapsulation time of the data encapsulated in the data node, the structural constraint hash value encapsulated in the data node, and the standard deviation between the data node and other adjacent data nodes. Based on the number of requests, the encapsulation time, the structural constraint hash value, and the standard deviation, obtain the risk score of the data node. According to the risk score values in descending order, all data nodes are initially sorted to obtain an initial sorting result. For any two data nodes in the structural chain, the initial sorting result is adjusted based on the sequential relationship between the test timestamps encapsulated by the two data nodes, the permission flow relationship between the encapsulated identity identifiers, and the logical relationship between the corresponding measurement operations of the two data nodes to obtain a target sorting result. Based on the target sorting result, each data node is verified sequentially.
2. The method according to claim 1, characterized in that, The step of obtaining the current structural constraint hash value based on the current hash value includes: According to the connection order of different data nodes in the structural chain, determine a preset number of first historical data nodes that are located before the current data node and are closest to the current data node, and obtain the historical hash value encapsulated by any one of the first historical data nodes; The current hash value and all historical hash values are concatenated, and the concatenated hash value is input into the hash function to output the current structural constraint hash value of the current data node.
3. The method according to claim 2, characterized in that, The step of verifying any data node sequentially based on the target sorting result includes: For any historical data node in the structural chain, if the number of other historical data nodes preceding the historical data node is not less than the preset number, the historical data node is determined as the second historical data node. According to the connection order of different data nodes in the structural chain, a preset number of other historical data nodes that are located before the second historical data node and are closest to the second historical data node are determined as the third historical data node; Based on the historical hash value of the second historical data node, the historical hash values of all third historical data nodes, and the target sorting result, any data node is verified.
4. The method according to claim 3, characterized in that, The verification of any data node based on the historical hash value of the second historical data node, the historical hash values of all third historical data nodes, and the target sorting result includes: The historical hash value of the second historical data node and the historical hash values of all third historical data nodes are concatenated, and the concatenated historical hash value is input into the hash function to output the first historical structure constraint hash value of the second historical data node. Obtain the hash value of the second historical structure constraint encapsulated by the second historical data node, and if the hash value of the first historical structure constraint is consistent with the hash value of the second historical structure constraint, verify the second historical data node based on its position in the target sorting result.
5. The method according to claim 1, characterized in that, The step of verifying any data node sequentially based on the target sorting result includes: During the verification of the current data node according to the target sorting result, the credibility score of the current data node is obtained based on the hash value difference between the current hash value and the historical hash value encapsulated by any historical data node, the timestamp difference between the current measurement timestamp and the historical measurement timestamp encapsulated by any historical data node, the identity identifier, and the current measurement timestamp. The confidence score, the current measurement data, the identity identifier, and the current measurement timestamp are input into the dual verification function, and the dual verification value is output. The dual verification value, the identity identifier, and the current measurement timestamp are concatenated, and the concatenated data is input into the hash function to output the public verification value of the current data node. If the publicly verified value matches the benchmark verified value, the current data node is determined to have passed verification.
6. The method according to claim 1, characterized in that, The process of obtaining the risk score value of the data node based on the number of requests, the encapsulation time, the structural constraint hash value, and the standard deviation includes: Based on the structural constraint hash value encapsulated by the data node, the distribution entropy of the data node in the structural chain is obtained; The risk score of the data node is obtained based on the number of requests, the encapsulation time, the distribution entropy, and the standard deviation.
7. A data verification apparatus, employing a data verification method as described in any one of claims 1-6, characterized in that, Includes the following modules: The first acquisition module is used to acquire the current measurement data corresponding to the current measurement operation during the execution of the current measurement operation, and input the current measurement data into a hash function to output the current hash value; wherein, the current measurement data includes the current measurement value, the unit of measurement of the current measurement value and the current standard error, the device identifier of the measuring equipment, the identity identifier of the measuring personnel, the current measurement timestamp, and the current environmental parameters; The second acquisition module is used to acquire the current structural constraint hash value based on the current hash value, and to construct a current data node in the structural chain that encapsulates the current hash value, the current measurement timestamp, the identity identifier, and the current structural constraint hash value; wherein, the data nodes in the structural chain correspond one-to-one with the hash values, and the structural chain is obtained by connecting different data nodes in order from front to back according to the encapsulated measurement timestamps, and the current structural constraint hash value is used to constrain the position and legality of the current data node in the structural chain; The third acquisition module is used to acquire, for any data node in the structure chain, the number of requests for verification of the data node, the encapsulation time of the data encapsulated in the data node, the structural constraint hash value encapsulated in the data node, and the standard deviation between the data node and other adjacent data nodes, and to acquire the risk score value of the data node based on the number of requests, the encapsulation time, the structural constraint hash value and the standard deviation. The sorting module is used to initially sort all data nodes according to the risk score values from largest to smallest to obtain an initial sorting result. For any two data nodes in the structure chain, the module adjusts the initial sorting result based on the chronological relationship between the test timestamps encapsulated by the two data nodes, the permission flow relationship between the encapsulated identity identifiers, and the logical relationship between the corresponding measurement operations of the two data nodes to obtain a target sorting result. The verification module is used to verify any data node sequentially based on the target sorting result.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.