Search

CN-121979871-A - Block chain-based data verification method, device, equipment and medium

CN121979871ACN 121979871 ACN121979871 ACN 121979871ACN-121979871-A

Abstract

The application discloses a data verification method, device, equipment and medium based on a blockchain. Calculating She Ziha hash values of source data subfiles of any batch of the data storage nodes, generating a merck root hash value and a corresponding merck proving path, synchronizing batch identification, a data storage address, the merck root hash value and a generation timestamp to the data index node through logs of a blockchain technology, acquiring the merck proving path corresponding to the corresponding batch identification from the data storage node by the data index node, calculating a local hash value for any target source data subfile of target batch identification to be verified by a verification client based on the merck proof path, reconstructing the root hash value to be verified according to the target merck proving path acquired from the data index node, comparing the root hash value to be confirmed with the target merck root hash value, and verifying the target source data subfile of the target batch. Ensuring the authenticity and creditability of the data.

Inventors

  • LI JUNLONG
  • CHEN HONGJI
  • CHEN HONG
  • XIONG SIWEI
  • Ouyang ya
  • Ding Zhenlan
  • LIU YONGHENG

Assignees

  • 鹏城实验室

Dates

Publication Date
20260505
Application Date
20251231

Claims (11)

  1. 1. A blockchain-based data verification method, characterized by being applied to a data verification system, the data verification system comprising a verification client, a blockchain service node, a data storage node and a data index node, the method comprising: the verification client acquires a data batch list from the data index node, and selects at least one target batch identifier from the data batch list; The verification client determines a target data storage address corresponding to the target batch identifier, and downloads a corresponding target source data subfile from the data storage node according to the target data storage address, wherein the data storage node stores a plurality of data storage addresses corresponding to a plurality of data batches and a plurality of source data subfiles associated with each data storage address; The verification client calculates a local hash value of the target source data subfile, and obtains a corresponding target merck root hash value from the blockchain service node according to the target batch identifier; The verification client acquires a target merck proving path corresponding to the target batch identifier and the local hash value from the data index node, wherein the target merck proving path is acquired from the data storage node by the data index node according to the target batch identifier and the target data storage address; the verification client calculates a root hash value to be confirmed based on the target merck proving path and the local hash value; And the verification client verifies the target source data subfile by combining the root hash value to be confirmed and the target merck root hash value.
  2. 2. The method of claim 1, wherein the verifying client computing a root hash value to be validated based on the target merck-proving path and the local hash value comprises: the verification client determines a hash calculation path associated with the local hash value and a plurality of target related hash values corresponding to the hash calculation path based on the target merck proving path; and carrying out hash calculation by combining the local hash value and the target related hash values according to the hash calculation path to obtain a root hash value to be confirmed.
  3. 3. The method of claim 2, wherein the verifying the target source data subfile by the verification client in combination with the root hash value to be validated and the target merck root hash value comprises: the verification client compares the root hash value to be confirmed with the target merck root hash value to obtain a comparison result; When the comparison result is that the root hash value to be confirmed is consistent with the target merck root hash value, determining that verification of the target source data subfile is passed; And when the comparison result is that the root hash value to be confirmed is inconsistent with the target merck root hash value, determining that verification of the target source data subfile is not passed.
  4. 4. A method according to any one of claims 1 to 3, wherein, before the verification client obtains a list of data batches from the data inode, the method further comprises: the data acquisition node acquires a source data set and a corresponding batch identifier of the same data batch according to a preset data batch range, divides the source data set into a plurality of source data subfiles, and each source data subfile corresponds to a file identifier; the data processing node calculates a corresponding She Ziha Hibisci value for each source data subfile, combines She Ziha Hibisci values of each source data subfile, generates a merck root hash value and a merck proving path, and acquires a generation timestamp; The data processing node constructs a metadata file by combining the generation timestamp, the batch identifier, the merck root hash value, the merck proving path, a plurality of She Ziha hash values and a plurality of file identifiers, and sends the source data subfiles and the metadata file to the data storage node for storage so as to acquire a data storage address corresponding to the batch identifier; The data processing node sends the batch identifier, the merck root hash value, the data storage address and the generation timestamp to the blockchain service node, so that the blockchain service node triggers generation of a data storage log based on the batch identifier, the merck root hash value, the data storage address and the generation timestamp; When the data index node detects the data storage log generated by the blockchain service node, mapping the batch identifier, the merck root hash value, the data storage address, the generation timestamp, the transaction hash, the block identifier and the block timestamp which are obtained through analysis according to the data storage log into a database table structure to establish a data query index.
  5. 5. The method of claim 4, wherein the validating client obtaining a list of data batches from the data inode comprises: the verification client sends a batch information query request through a metadata query interface provided by the data index node; the data index node responds to the batch information inquiry request and generates a data batch list based on a plurality of batch information in the database table structure; And the verification client receives the data batch list returned by the data index node through a batch inquiry interface provided by the data index node.
  6. 6. The method of claim 4, further comprising, before the validating client determines the target data storage address corresponding to the target lot identification and downloads the corresponding target source data subfile from the data storage node based on the target data storage address: The data index node reads the corresponding metadata file from the data storage node according to the batch identification and the data storage address; And acquiring a plurality of file identifications corresponding to the source data subfiles associated with the batch identifications according to the metadata file.
  7. 7. The method of claim 6, wherein the validating client determining a target data storage address corresponding to the target lot identification and downloading a corresponding target source data subfile from the data storage node based on the target data storage address comprises: The verification client sends a file identification acquisition request through a metadata query interface provided by the data index node; The data index node determines a corresponding target metadata file based on a target batch identifier in the file identifier acquisition request, and reads a corresponding target data storage address and a plurality of file identifiers according to the target metadata file; the verification client receives the target data storage address and the plurality of file identifications returned by the data index node through a metadata query interface provided by the data index node, and selects one target file identification from the plurality of file identifications; And the verification client downloads the target source data subfile corresponding to the target file identifier from the data storage node according to the target data storage address.
  8. 8. A blockchain-based data verification system, comprising a verification client, a blockchain service node, a data storage node, a data indexing node, a data acquisition node, and a data processing node, comprising: the data acquisition node acquires a source data set and a corresponding batch identifier of the same data batch according to a preset data batch range, divides the source data set into a plurality of source data subfiles, and each source data subfile corresponds to a file identifier; the data processing node calculates a corresponding She Ziha Hibisci value for each source data subfile, combines She Ziha Hibisci values of each source data subfile, generates a merck root hash value and a merck proving path, and acquires a generation timestamp; The data processing node constructs a metadata file by combining the generation timestamp, the batch identifier, the merck root hash value, the merck proving path, a plurality of She Ziha hash values and a plurality of file identifiers, and sends the source data subfiles and the metadata file to the data storage node for storage so as to acquire a data storage address corresponding to the batch identifier; The data processing node sends the batch identifier, the merck root hash value, the data storage address and the generation timestamp to the blockchain service node, so that the blockchain service node triggers generation of a data storage log based on the batch identifier, the merck root hash value, the data storage address and the generation timestamp; When the data index node detects the data storage log generated by the blockchain service node, mapping the batch identifier, the merck root hash value, the data storage address, the generation timestamp, the transaction hash, the block identifier and the block timestamp which are obtained by analyzing the data storage log into a database table structure to establish a data query index; the verification client acquires a data batch list from the data index node, and selects at least one target batch identifier from the data batch list; the verification client determines a target data storage address corresponding to the target batch identifier, and downloads a corresponding target source data subfile from the data storage node according to the target data storage address; The verification client calculates a local hash value of the target source data subfile, and obtains a corresponding target merck root hash value from the blockchain service node according to the target batch identifier; the verification client acquires a target merck proving path corresponding to the target batch identifier and the local hash value from the data index node; the verification client calculates a root hash value to be confirmed based on the target merck proving path and the local hash value; And the verification client verifies the target source data subfile by combining the root hash value to be confirmed and the target merck root hash value.
  9. 9. A blockchain-based data verification device, for use in a verification client in a data verification system, the data verification system further comprising a blockchain service node, a data storage node, and a data indexing node, comprising: The first acquisition unit is used for acquiring a data batch list from the data index node and selecting at least one target batch identifier from the data batch list; a downloading unit, configured to determine a target data storage address corresponding to the target lot identifier, and download, according to the target data storage address, a corresponding target source data subfile from the data storage node, where the data storage node stores a plurality of data storage addresses corresponding to a plurality of data lots and a plurality of source data subfiles associated with each data storage address; the first calculation unit is used for calculating a local hash value of the target source data subfile and acquiring a corresponding target merck root hash value from the blockchain service node according to the target batch identifier; A second obtaining unit, configured to obtain, from the data index node, a target merck certification path corresponding to the target lot identifier and the local hash value; The second computing unit is used for computing a root hash value to be confirmed based on the target merck proving path and the local hash value; and the verification unit is used for verifying the target source data subfile by combining the root hash value to be confirmed and the target merck root hash value by the verification client.
  10. 10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the blockchain-based data verification method of any of claims 1 to 8 when the computer program is executed.
  11. 11. A computer readable storage medium storing a plurality of instructions adapted to be loaded by a processor to perform the blockchain-based data verification method of any of claims 1 to 8.

Description

Block chain-based data verification method, device, equipment and medium Technical Field The present application relates to the field of computer technologies, and in particular, to a data verification method, apparatus, device, and medium based on a blockchain. Background Under the background of the rapid development of the Internet of things technology, massive intelligent devices continuously generate massive high-frequency streaming data. These data are critical to production efficiency detection, equipment predictive maintenance and quality control, and even the core assets of data transactions. In the related art, these data are typically stored in a centralized database, with the integrity and authenticity of the data maintained by the operator of the centralized database. However, in the related art, in the data storage manner of storing data in the centralized database, once the centralized database is subject to external attack, internal malicious or management error, the problem of tampering of the data may be caused, which affects the authenticity of the data, and the data storage manner cannot provide data verification, so that the data lacks of creditability. Disclosure of Invention The embodiment of the application provides a data verification method, device, equipment and medium based on a blockchain, which can perform data verification on data of any batch stored in advance so as to detect whether the data is tampered or not, and ensure the authenticity and the public confidence of the data. In a first aspect, the present application provides a blockchain-based data verification method, applied to a data verification system, where the data verification system includes a verification client, a blockchain service node, a data storage node, and a data index node, and includes: the verification client acquires a data batch list from the data index node, and selects at least one target batch identifier from the data batch list; The verification client determines a target data storage address corresponding to the target batch identifier, and downloads a corresponding target source data subfile from the data storage node according to the target data storage address, wherein the data storage node stores a plurality of data storage addresses corresponding to a plurality of data batches and a plurality of source data subfiles associated with each data storage address; The verification client calculates a local hash value of the target source data subfile, and obtains a corresponding target merck root hash value from the blockchain service node according to the target batch identifier; The verification client acquires a target merck proving path corresponding to the target batch identifier and the local hash value from the data index node, wherein the target merck proving path is acquired from the data storage node by the data index node according to the target batch identifier and the target data storage address; the verification client calculates a root hash value to be confirmed based on the target merck proving path and the local hash value; And the verification client verifies the target source data subfile by combining the root hash value to be confirmed and the target merck root hash value. In some embodiments, the verifying client calculates a root hash value to be validated based on the target merck certification path and the local hash value, including: the verification client determines a hash calculation path associated with the local hash value and a plurality of target related hash values corresponding to the hash calculation path based on the target merck proving path; and carrying out hash calculation by combining the local hash value and the target related hash values according to the hash calculation path to obtain a root hash value to be confirmed. In some embodiments, the verifying the target source data subfile by the verifying client in combination with the root hash value to be validated and the target merck root hash value includes: the verification client compares the root hash value to be confirmed with the target merck root hash value to obtain a comparison result; When the comparison result is that the root hash value to be confirmed is consistent with the target merck root hash value, determining that verification of the target source data subfile is passed; And when the comparison result is that the root hash value to be confirmed is inconsistent with the target merck root hash value, determining that verification of the target source data subfile is not passed. In some embodiments, the data verification system further comprises a data acquisition node and a data processing node, the method further comprising: the data acquisition node acquires a source data set and a corresponding batch identifier of the same data batch according to a preset data batch range, divides the source data set into a plurality of source data subfiles, and each source data subfile corresponds to