WO2021174499A1 - Blockchain-based data verification method, apparatus and system - Google Patents
Blockchain-based data verification method, apparatus and system Download PDFInfo
- Publication number
- WO2021174499A1 WO2021174499A1 PCT/CN2020/078038 CN2020078038W WO2021174499A1 WO 2021174499 A1 WO2021174499 A1 WO 2021174499A1 CN 2020078038 W CN2020078038 W CN 2020078038W WO 2021174499 A1 WO2021174499 A1 WO 2021174499A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- hash value
- blockchain
- terminal
- original data
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Definitions
- the present invention relates to the technical field of data fidelity, in particular to a data verification method, device and system based on blockchain.
- the technical problem to be solved by the present invention is how to provide a blockchain-based data verification method, device and system to verify whether data has been tampered with.
- the embodiment of the present invention provides a blockchain-based data verification method, which is applied to the original data terminal, and the method includes:
- For the original data in the original data terminal obtain the hash value of the original data, and send the hash value to the block chain, so that the block chain stores the hash value in the latest area of the block chain Block, and make the data audit terminal generate a key-value pair corresponding to the hash value of the original data, and audit whether the target data corresponding to the original data is consistent with the original data according to the key-value pair.
- the method when sending the hash value to the data audit terminal, the method further includes:
- the original data terminal obtains the timestamp when the original data is obtained, and sends the timestamp to the blockchain, so that the blockchain stores the hash value and the timestamp on the latest block of the blockchain.
- the step of sending the timestamp to the blockchain includes:
- the hash value and the timestamp are spliced together to obtain the spliced result
- the block chain stores the hash value and timestamp on the latest block of the block chain, including:
- the blockchain stores the spliced result in the latest block of the blockchain.
- the embodiment of the present invention also provides a blockchain-based data verification method, which is applied to a blockchain network, and the method includes:
- the method when storing the hash value on the latest block of the blockchain, the method further includes:
- the storing the timestamp and the hash value in the same block includes:
- the embodiment of the present invention also provides a blockchain-based data verification method, which is applied to the data verification end, and the method includes:
- the hash value of the target data is obtained; the hash value is encoded into the query request, and the query request is sent to the data audit terminal so that the data audit terminal will In the query request, it is determined whether the key-value pair matching the hash value in the query request can be obtained; if so, the first preset information is sent to the data verification end, where the first preset information includes: The storage address in the key-value pair matched by the hash value in the query request; if not, send second preset information to the data verification terminal, where the preset information includes: a null value; in the data audit terminal A key-value pair corresponding to the target data is stored, and the key-value pair includes the hash value of the original data and the storage address of the hash value on the blockchain, wherein the original data corresponds to the target Data data;
- the embodiment of the present invention also provides a blockchain-based data verification method, which is applied to the data audit terminal, and the method includes:
- the query request determine whether it is possible to obtain a key-value pair that matches the hash value in the query request;
- first preset information includes: a storage address in a key-value pair that matches the hash value in the query request;
- the obtaining the hash value for the original data terminal includes:
- the embodiment of the present invention also provides a blockchain-based data verification method, which is applied to a data verification system.
- the data verification system includes an original data terminal, a blockchain network, a data verification terminal, and a data audit terminal.
- the method includes:
- the original data terminal obtains the hash value of the original data for the original data in the original data terminal, and sends the hash value to the blockchain, so that the blockchain stores the hash value in the blockchain And make the data audit terminal generate a key-value pair corresponding to the hash value of the original data, and audit whether the target data corresponding to the original data is the same as the original data according to the key-value pair Consistent
- the blockchain network receives the hash value for the original data, and stores the hash value on the latest block of the blockchain;
- the data audit terminal obtains the hash value for the original data terminal; uses the hash value as the primary key, obtains the storage address of the hash value on the blockchain, and uses the storage address as the value to generate the data corresponding to the original data Key-value pairs;
- the data verification terminal obtains the hash value of the target data according to the target data corresponding to the original data; encodes the hash value into a query request, and sends the query request to the data audit terminal;
- the data audit terminal receives the data query request sent by the data verification terminal, and determines whether it can obtain the key-value pair matching the hash value in the query request according to the query request; if so, sends the first preset to the data verification terminal Information, wherein the first preset information includes: the storage address in the key-value pair that matches the hash value in the query request; if not, the second preset information is sent to the data verification end, where all The preset information includes: a null value; the data audit terminal stores a key-value pair corresponding to the target data, and the key-value pair includes the hash value of the original data and the hash value on the blockchain A storage address, wherein the original data is data corresponding to the target data;
- the embodiment of the present invention also provides a blockchain-based data verification device, which is applied to the original data terminal, and the device includes:
- the first obtaining module is used to obtain the hash value of the original data for the original data in the original data terminal, and send the hash value to the block chain, so that the block chain stores the hash value On the latest block of the blockchain, and make the data audit terminal generate a key-value pair corresponding to the hash value of the original data, and audit the target data corresponding to the original data according to the key-value pair Whether it is consistent with the original data.
- the device further includes:
- the second obtaining module is used to obtain the time stamp when the original data terminal obtains the original data, and send the time stamp to the blockchain, so that the blockchain stores the hash value and the time stamp in the block chain. On the latest block.
- the second acquisition module is used to:
- the hash value and the timestamp are spliced together to obtain the spliced result
- the block chain stores the hash value and timestamp on the latest block of the block chain, including:
- the blockchain stores the spliced result in the latest block of the blockchain.
- the embodiment of the present invention also provides a block chain-based data verification device, which is applied to a block chain network, and the device includes:
- the first receiving module is used to receive the hash value for the original data, and store the hash value on the latest block of the blockchain.
- the device further includes:
- the second receiving module is configured to receive the timestamp when the hash value of the original data is generated from the original data terminal, and store the timestamp and the hash value in the same block.
- the second receiving module is configured to:
- the embodiment of the present invention also provides a block chain-based data verification device, which is applied to the data verification end, and the device includes:
- the third obtaining module is configured to obtain the hash value of the target data according to the target data corresponding to the original data
- the third receiving module is configured to receive the response result returned by the data auditing terminal, where the response result includes: the first preset information or the second preset information.
- the embodiment of the present invention also provides a block chain-based data verification device, which is applied to the data audit end, and the device includes:
- the fourth obtaining module is used to obtain the hash value for the original data terminal
- a generating module configured to use the hash value as a primary key, obtain the storage address of the hash value on the blockchain, and use the storage address as a value to generate a key-value pair corresponding to the original data;
- a fourth receiving module configured to receive a data query request sent by a data verification terminal, wherein the query request includes a hash value of target data, and the target data is data corresponding to the original data;
- the judging module is used to judge whether the key-value pair matching the hash value in the query request can be obtained according to the query request;
- the first sending module is configured to send first preset information to the data verification terminal when the judgment result of the judgment module is yes, where the first preset information includes: The storage address in the key-value pair matched by the hash value;
- the second sending module is configured to send second preset information to the data verification terminal when the judgment result of the judgment module is no, where the preset information includes: a null value.
- the fourth obtaining module is configured to:
- the embodiment of the present invention also provides a blockchain-based data verification system, the system includes;
- the data verification terminal according to any one of the above.
- the hash value of the original data is stored on the blockchain, and the non-tamperable modification of the blockchain is used to ensure the correctness of the hash value of the original data, so that the data audit terminal that conducts the data audit can be based on
- the hash value stored on the blockchain is audited for the target data corresponding to the original data, and then it can be verified whether the data has been tampered with.
- Another advantage is that since only the hash value is stored on the blockchain, there is no worry of exposing the original data, so the entire blockchain query system is an open public platform. If the original data is stored, it cannot be a public platform but a private platform. Then the data purchasing company will doubt the credibility of the platform. Therefore, the embodiment of the present invention can guarantee the data purchase without leaking the original data. The company can obtain target data that has not been tampered with.
- FIG. 1 is a schematic flowchart of a method for data verification based on blockchain according to an embodiment of the present invention
- FIG. 2 is a schematic structural diagram of a data verification system based on blockchain according to an embodiment of the present invention.
- the embodiment of the present invention provides a blockchain-based data verification method, which is applied to the original data terminal, and the method includes:
- company A uses the data or database to be sold as original data, and uses the original data terminal to obtain the hash value of the original data for the original data in the original data terminal in advance.
- the original data end can actively obtain or passively receive the original data.
- the original data end uses a hash algorithm to hash the original data to obtain the hash value of the original data.
- the hash algorithm can be MD5, SHA-1, SHA256 One or a combination of other algorithms.
- the original data can come from sensors, industrial computers, etc.
- the original data terminal can be the gateway device of the sensor network.
- Sensors, industrial computers, etc. can transmit raw data in JSON format, string format or binary array format to the original data terminal through wired, wifi, ZigBee and other communication methods.
- the blockchain can be a public chain, a private chain or a consortium chain.
- the blockchain network After the blockchain network receives the hash value of the original data, it generates a new block on the blockchain, stores the hash value on the latest block of the blockchain, and makes the The data audit terminal generates a key-value pair corresponding to the hash value of the original data, and audits whether the target data corresponding to the original data is consistent with the original data according to the key-value pair.
- the blockchain After the blockchain receives the hash value of the original data, it can first compare all the hash values stored on the blockchain, and the hash value that is the same as the hash value of the original data is not compared. In the case of hope, a newest block is generated on the blockchain. When the hash value is the same as the hash value of the original data, the hash value that is the same as the hash value of the original data will be used as the value, which will be used to store the hash value that is the same as the hash value of the original data.
- the address of the value block is used as the primary key, and a key-value pair is generated according to the key and value for data audit by B company.
- the hash value of the original data is stored on the blockchain, and the non-tamperable modification of the blockchain is used to ensure the correctness of the hash value of the original data, so that the data auditing terminal that conducts the data audit is based on
- the hash value stored on the blockchain is audited for the target data corresponding to the original data, and then it can be verified whether the data has been tampered with.
- the embodiment of the present invention also provides a blockchain-based data verification method.
- the method further includes:
- the original data terminal When the original data terminal generates the hash value corresponding to the original data, it also obtains the time value corresponding to the time when the original data terminal obtains the original data. For example, the original data terminal obtains the original data at the time when the timestamp value is A. Data, use the timestamp A as the timestamp corresponding to the original data, and send the timestamp and the hash value corresponding to the original data to the blockchain network, where the timestamp refers to 1970 Greenwich Mean Time The total number of milliseconds from 00: 00: 00, 01 January (08:00: 00: 00, January 1, 1970, Beijing time) to the present.
- the blockchain network After receiving the hash value of the original data and the timestamp corresponding to the original data, the blockchain network generates a new block on the blockchain, and stores the hash value and timestamp in the block On the latest block of the chain.
- the data audit end can use smart contracts or other technical means to monitor whether a new hash value is stored in a new block on the blockchain.
- the data audit end knows that a new hash value has been stored in the blockchain
- the new hash value and the corresponding address of the block used to store the hash value are read from the block on the blockchain, the address corresponding to the block is used as the primary key, and the read
- the new hash value that is, the hash value corresponding to the original data, is used as the value to generate a key-value pair corresponding to the original data.
- the data auditing terminal When the data auditing terminal performs data auditing, it can search on the blockchain according to the timestamp input by the user corresponding to the original data obtained or the input timestamp range, which improves the search speed and thus the data audit speed.
- the step of sending the timestamp to the blockchain includes: the original data end splices the hash value and the timestamp to obtain the spliced result, and the spliced The result is sent to the blockchain.
- the blockchain network After the blockchain network receives the spliced result, it generates a new block on the blockchain and stores the spliced result on the latest block of the blockchain.
- Embodiment 3 of the present invention also provides a blockchain-based data verification method, which is applied to a blockchain network, and the method includes:
- each block node in the blockchain is authenticated by consensus, and a new block is generated on the blockchain.
- the blockchain can be a public chain, a private chain or a consortium chain.
- the blockchain can store the hash value for the original data in the block to prevent the hash value from being tampered with.
- the blockchain network After receiving the hash value of the original data and the timestamp corresponding to the original data, the blockchain network generates a new block on the blockchain, and stores the hash value and timestamp in the district. On the latest block of the blockchain.
- the data auditing terminal when the data auditing terminal performs data auditing, it can search on the blockchain according to the timestamp input by the user corresponding to the original data or the input timestamp range, which improves the search speed and further improves the data auditing. speed.
- the storing the timestamp and the hash value in the same block includes: receiving the splicing result sent by the original data terminal, and storing the spliced result in the latest block of the blockchain Above, where the splicing result is obtained by splicing the hash value and the timestamp on the original data terminal.
- one data header and one data tail can be reduced, and storage space on the blockchain can be saved.
- Embodiment 4 of the present invention provides a blockchain-based data verification method, which is applied to the data verification end, and the method includes:
- company B receives the data sent by company A, but company B cannot confirm whether the data is completely consistent with the original data promised by company A. Therefore, the data received by company B is referred to as target data in the embodiment of the present invention.
- Company B uses the same hash algorithm configured on the data verification terminal as that used by Company A to generate the hash value of the original data to generate the hash value of the target data.
- the data verification terminal encodes the hash value of the target data into the query request, and sends the query request to the data audit terminal.
- the data auditing terminal After receiving the data query request from the data verification terminal used by Company B, the data auditing terminal parses the query request to obtain the hash value of the target data contained in the query request.
- the data auditing terminal Based on the hash value of the target data, the data auditing terminal performs search and comparison among the key-value pairs stored in itself, and judges whether it can find a key-value pair that contains the same hash value as the target data hash value, and then achieve The purpose of comparing the hash value of the target data with the hash value stored in the blockchain.
- the first preset information can include but is not limited to the address of the block, and can also include the data volume of the original data, the generation time of the original data, and the storage of the hash value. Time to the blockchain, etc., to facilitate users to more comprehensively understand the information of the original data.
- the data audit end has not found a hash value in the blockchain that is exactly the same as the hash value of the target data, that is to say, the target data is not completely consistent with the original data, and the data audit The end returns the second preset information to the data verification end.
- the preset information is a null value.
- the second preset information may be a "no" judgment result, or information such as "target data has been tampered with”.
- a key-value pair corresponding to the target data is stored in the data audit terminal, and the key-value pair includes the hash value of the original data and the storage address of the hash value on the blockchain, where , The original data is data corresponding to the target data.
- the hash value of the original data is stored on the block chain, and the non-tamperable modification of the block chain is used to ensure the correctness of the hash value of the original data.
- the stored hash value is audited for the target data corresponding to the original data, so that it can be verified whether the data has been tampered with.
- Embodiment 5 of the present invention provides a blockchain-based data verification method, which is characterized in that it is applied to a data audit terminal, and the method includes:
- the blockchain network can send the "new block" information to the data audit end, so that the data audit end knows that the new hash value is stored on the blockchain
- the data audit end knows that the new hash value is stored on the blockchain
- read the new hash value and the corresponding address of the block used to store the hash value from the block on the blockchain use the address corresponding to the block as the value, and use the read new hash value as the value.
- the hope value is used as the primary key, that is, the hash value corresponding to the original data is used as the value to generate key-value pairs corresponding to the original data, and then these key-value pairs are stored locally.
- the data auditing terminal will create an index table in which the aforementioned key-value pairs are stored, and then query the key-value pair corresponding to the hash value of the target data in the key-value pair index table to obtain the query The block address corresponding to the obtained hash value.
- the function of the key-value pair is to use the data verification terminal for data verification in company B, as the basis for the hash value query on the data audit terminal.
- Company B needs to verify the received target data to ensure that the target data is completely consistent with the original data promised by Company A.
- Company B uses the same hash algorithm configured on the data verification terminal as that used by Company A to generate the hash value of the original data to generate the hash value of the target data.
- the data verification terminal encodes the hash value of the target data into the query request, and sends the query request to the data audit terminal.
- the data audit terminal receives a data query request sent by the data verification terminal, wherein the query request includes a hash value of target data, and the target data is data corresponding to the original data;
- the data auditing terminal parses the query request, and then can obtain the hash value of the target data contained in the query request, and then traverses the locally stored key-value pairs based on the hash value of the target data, and puts each key-value pair in The hash value of is compared with the hash value of the target data; then it is judged whether the two are consistent, until a hash value that is exactly the same as the hash value of the target data is obtained or all key-value pairs are traversed; or the block can be traversed Each block on the chain compares the hash value stored in each block with the hash value of the target data; then judges whether the two are consistent, until the hash value that is exactly the same as the hash value of the target data is obtained Or traverse all the blocks.
- a hash value that is exactly the same as the hash value of the target data it means that the hash value stored in the block matches the hash value of the target data.
- the block is used as the target block, the block address of the block is obtained, and the block address is sent to the data verification terminal as the first preset information.
- the preset information includes: a null value.
- the obtaining the hash value for the original data terminal includes:
- the data auditing side can use smart contracts or other technical means to monitor whether a new hash value is stored in a new block on the blockchain.
- the data auditing side knows that a new hash is stored on the blockchain After the value, read the new hash value and the corresponding address of the block used to store the hash value from the block on the blockchain, use the address corresponding to the block as the value, and use the new
- the hash value is used as the primary key, that is, the hash value corresponding to the original data is used as the value to generate a key-value pair corresponding to the original data.
- the data auditing terminal can actively monitor the blockchain network, which improves the real-time performance of the data auditing terminal's work.
- the sixth embodiment of the present invention provides a blockchain-based data verification method, which is applied to a data verification system.
- the data verification system includes an original data terminal, a blockchain network, a data verification terminal, and a data audit. end.
- Fig. 1 is a schematic flowchart of a blockchain-based data verification method provided by an embodiment of the present invention. As shown in Fig. 1, the method includes the following steps:
- the original data terminal uses a hash algorithm to hash the original data to obtain the hash value of the original data, where the hash algorithm can be one or a combination of MD5, SHA-1, SHA256 and other algorithms.
- the original data terminal sends the hash value to the blockchain network.
- the blockchain network After receiving the hash value of the original data, the blockchain network generates a new block on the blockchain, stores the hash value on the latest block of the blockchain, and makes the The data audit terminal generates a key-value pair corresponding to the hash value of the original data, and audits whether the target data corresponding to the original data is consistent with the original data according to the key-value pair.
- Each block node in the blockchain network is authenticated by consensus, and the hash value is written into the latest block.
- the blockchain can be a public chain, a private chain or a consortium chain.
- the data audit end can use smart contracts or other technical means to monitor whether a new hash value is stored in a new block on the blockchain.
- the new hash value and the corresponding address of the block used to store the hash value are read from the block on the blockchain, the address corresponding to the block is used as the value, and the read
- the new hash value is used as the primary key, that is, the hash value corresponding to the original data is used as the value to generate a key-value pair corresponding to the original data.
- Company B uses the same hash algorithm configured on the data verification terminal as that used by Company A when generating the hash value of the original data to generate the hash value of the target data.
- the data verification terminal encodes the hash value of the target data into the query request, and sends the query request to the data audit terminal.
- S605 After receiving the data query request from the data verification terminal used by company B, the data auditing terminal parses the query request to obtain the hash value of the target data contained in the query request.
- the data audit terminal is based on the hash value of the target data, compares the hash value of the target data with the hash value stored in the blockchain, and then judges whether the hash value of the target data can be obtained from the blockchain A hash value with exactly the same value.
- the data verification terminal receives the audit result for the target data sent by the data audit terminal, and presents the audit result to the staff of company B.
- the first preset information may include, but is not limited to, the address of the block, but may also include the data amount of the original data, the generation time of the original data, the time when the hash value is stored on the blockchain, etc. It is convenient for users to have a more comprehensive understanding of the information of the original data.
- the data audit end has not found a hash value in the blockchain that is exactly the same as the hash value of the target data, that is to say, the target data is not completely consistent with the original data, and the data audit The end returns the second preset information to the data verification end.
- the preset information is a null value.
- the second preset information may be a "no" judgment result, or information such as "target data has been tampered with”.
- the hash value of the original data is stored on the block chain, and the non-tamperable modification of the block chain is used to ensure the correctness of the hash value of the original data.
- the stored hash value is audited for the target data corresponding to the original data, so that it can be verified whether the data has been tampered with. Due to the non-tampering feature of the blockchain, it also avoids the possibility of data collusion between A company and a third-party data audit unit, thereby ensuring the interests of B company.
- the original data terminal only stores the hash value on the blockchain and discloses the original data to each node in the blockchain network. Therefore, the privacy of the original data can be guaranteed.
- Embodiment 7 of the present invention provides a blockchain-based data verification device applied to the original data terminal, and the device includes:
- the first obtaining module is used to obtain the hash value of the original data for the original data in the original data terminal, and send the hash value to the block chain, so that the block chain stores the hash value On the latest block of the blockchain, and make the data audit terminal generate a key-value pair corresponding to the hash value of the original data, and audit the target data corresponding to the original data according to the key-value pair Whether it is consistent with the original data.
- the hash value of the original data is stored on the blockchain, and the non-tamperable modification of the blockchain is used to ensure the correctness of the hash value of the original data, so that the data audit terminal that conducts the data audit can be based on
- the hash value stored on the blockchain is audited for the target data corresponding to the original data, and then it can be verified whether the data has been tampered with.
- the device further includes:
- the second obtaining module is used to obtain the time stamp when the original data terminal obtains the original data, and send the time stamp to the blockchain, so that the blockchain stores the hash value and the time stamp in the block chain. On the latest block.
- the second acquisition module is configured to:
- the hash value and the timestamp are spliced together to obtain the spliced result
- the block chain stores the hash value and timestamp on the latest block of the block chain, including:
- the blockchain stores the spliced result in the latest block of the blockchain.
- the embodiment of the present invention also provides a blockchain-based data verification device, which is applied to a blockchain network, and the device includes:
- the first receiving module is used to receive the hash value for the original data, and store the hash value on the latest block of the blockchain.
- the device further includes:
- the second receiving module is configured to receive the timestamp when the hash value of the original data is generated from the original data terminal, and store the timestamp and the hash value in the same block.
- the second receiving module is configured to:
- the data audit terminal can verify the consistency of the target data corresponding to the original data according to the hash value.
- Embodiment 9 of the present invention provides a blockchain-based data verification device, which is applied to a data verification end, and the device includes:
- the third obtaining module is configured to obtain the hash value of the target data according to the target data corresponding to the original data
- the third receiving module is configured to receive the response result returned by the data auditing terminal, where the response result includes: the first preset information or the second preset information.
- the blockchain can store the hash value for the original data in the block to prevent the hash value from being tampered with.
- Embodiment 10 of the present invention also provides a blockchain-based data verification method, which is applied to a data audit terminal, and the device includes:
- the fourth obtaining module is used to obtain the hash value for the original data terminal
- a generating module configured to use the hash value as a primary key, obtain the storage address of the hash value on the blockchain, and use the storage address as a value to generate a key-value pair corresponding to the original data;
- a fourth receiving module configured to receive a data query request sent by a data verification terminal, wherein the query request includes a hash value of target data, and the target data is data corresponding to the original data;
- the judging module is used to judge whether the key-value pair matching the hash value in the query request can be obtained according to the query request;
- the first sending module is configured to send first preset information to the data verification terminal when the judgment result of the judgment module is yes, where the first preset information includes: The storage address in the key-value pair matched by the hash value;
- the second sending module is configured to send second preset information to the data verification terminal when the judgment result of the judgment module is no, where the preset information includes: a null value.
- the hash value of the original data is stored on the block chain, and the non-tamperable modification of the block chain is used to ensure the correctness of the hash value of the original data.
- the stored hash value is audited for the target data corresponding to the original data, so that it can be verified whether the data has been tampered with.
- the fourth acquisition module is used to:
- FIG. 2 is a schematic structural diagram of a blockchain-based data verification system provided by an embodiment of the present invention. As shown in Figure 2, the system includes:
- the hash value of the original data is stored on the blockchain, and the non-tamperable modification of the blockchain is used to ensure the correctness of the hash value of the original data, so that the data audit terminal that conducts the data audit can be based on
- the hash value stored on the blockchain is audited for the target data corresponding to the original data, and then it can be verified whether the data has been tampered with.
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Finance (AREA)
- Accounting & Taxation (AREA)
- Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- Health & Medical Sciences (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Provided is a blockchain-based data verification method, which is applied to an original data terminal. The method comprises: for original data in an original data terminal, acquiring a hash value of the original data and sending the hash value to a blockchain, such that the blockchain stores the hash value in the latest block of the blockchain, and making a data audit terminal generate a key-value pair corresponding to the hash value of the original data and auditing, according to the key-value pair, regarding whether target data corresponding to the original data is consistent with the original data.
Description
本发明涉及数据保真技术领域,具体涉及一种基于区块链的数据验证方法、装置及***。The present invention relates to the technical field of data fidelity, in particular to a data verification method, device and system based on blockchain.
随着大数据技术的不断发展,数据交易行为越来越多的出现在互联网领域中。以数据交易为例,A公司宣称会出售一个数据库,B公司购买了该数据库中的全部数据,在A公司向B公司交货时候,A公司改动了数据库中的数据,B公司则无法发现数据被改变,则B公司的利益得不到保证。B公司为了避免自己的损失,在数据库交付时要对数据进行审计,如果数据库中的容量很大的话会导致审计过程较为漫长;或者可以交由第三方进行数据审计,但是并不能排出A公司与第三方串通篡改的可能,因此,如何验证数据是否被篡改是亟待解决的技术问题。With the continuous development of big data technology, more and more data transaction behaviors appear in the Internet field. Take the data transaction as an example. Company A announced that it would sell a database, and Company B bought all the data in the database. When Company A delivered to Company B, Company A changed the data in the database, and Company B could not find the data. If it is changed, the interests of Company B cannot be guaranteed. In order to avoid its own losses, Company B needs to audit the data when the database is delivered. If the capacity in the database is large, the audit process will be longer; or it can be handed over to a third party for data auditing, but it does not exclude company A and company A. It is possible for third parties to collude with tampering. Therefore, how to verify whether data has been tampered with is a technical problem that needs to be solved urgently.
发明内容Summary of the invention
本发明所要解决的技术问题在于如何提供一种基于区块链的数据验证方法、装置及***以验证数据是否被篡改。The technical problem to be solved by the present invention is how to provide a blockchain-based data verification method, device and system to verify whether data has been tampered with.
本发明通过以下技术手段实现解决上述技术问题的:The present invention solves the above technical problems through the following technical means:
本发明实施例提供了一种基于区块链的数据验证方法,应用于原始数据端,所述方法包括:The embodiment of the present invention provides a blockchain-based data verification method, which is applied to the original data terminal, and the method includes:
针对原始数据端中的原始数据,获取所述原始数据的哈希值,并将所述哈希值发送至区块链,以使区块链将该哈希值存储在区块链的最新区块 上,并使所述数据审计端生成对应于所述原始数据的哈希值的键值对,并根据所述键值对审计对应于所述原始数据的目标数据是否与原始数据一致。For the original data in the original data terminal, obtain the hash value of the original data, and send the hash value to the block chain, so that the block chain stores the hash value in the latest area of the block chain Block, and make the data audit terminal generate a key-value pair corresponding to the hash value of the original data, and audit whether the target data corresponding to the original data is consistent with the original data according to the key-value pair.
可选的,在将所述哈希值发送至数据审计端时,所述方法还包括:Optionally, when sending the hash value to the data audit terminal, the method further includes:
获取原始数据端获取原始数据时的时间戳,并将所述时间戳发送至区块链,以使区块链将该哈希值与时间戳存储在区块链的最新区块上。The original data terminal obtains the timestamp when the original data is obtained, and sends the timestamp to the blockchain, so that the blockchain stores the hash value and the timestamp on the latest block of the blockchain.
可选的,所述将所述时间戳发送至区块链步骤,包括:Optionally, the step of sending the timestamp to the blockchain includes:
将哈希值与时间戳进行拼接,得到拼接后的结果;The hash value and the timestamp are spliced together to obtain the spliced result;
将拼接后的结果发送至区块链;Send the spliced result to the blockchain;
所述区块链将该哈希值与时间戳存储在区块链的最新区块上,包括:The block chain stores the hash value and timestamp on the latest block of the block chain, including:
区块链将拼接后的结果存储在区块链的最新区块上。The blockchain stores the spliced result in the latest block of the blockchain.
本发明实施例还提供了一种基于区块链的数据验证方法,应用于区块链网络,所述方法包括:The embodiment of the present invention also provides a blockchain-based data verification method, which is applied to a blockchain network, and the method includes:
接收针对原始数据的哈希值,将该哈希值存储在区块链的最新区块上。Receive the hash value for the original data, and store the hash value on the latest block of the blockchain.
可选的,在将该哈希值存储在区块链的最新区块上时,所述方法还包括:Optionally, when storing the hash value on the latest block of the blockchain, the method further includes:
接收原始数据端发送的生成原始数据的哈希值时的时间戳,将所述时间戳与所述哈希值存储在同一个区块中。Receive the timestamp when the hash value of the original data is generated from the original data terminal, and store the timestamp and the hash value in the same block.
可选的,所述将所述时间戳与所述哈希值存储在同一个区块中,包括:Optionally, the storing the timestamp and the hash value in the same block includes:
接收原始数据端发送的拼接结果,将拼接后的结果存储在区块链的最新区块上,其中,所述拼接结果为原始数据端将哈希值与时间戳进行拼接后得到的。Receive the splicing result sent by the original data end, and store the spliced result on the latest block of the blockchain, where the splicing result is obtained by splicing the hash value and the timestamp on the original data end.
本发明实施例还提供了一种基于区块链的数据验证方法,应用于数据 验证端,所述方法包括:The embodiment of the present invention also provides a blockchain-based data verification method, which is applied to the data verification end, and the method includes:
根据对应于原始数据的目标数据,获取所述目标数据的哈希值;将所述哈希值编码至查询请求中,并将所述查询请求发送至数据审计端,以使数据审计端根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;若是,向数据验证端发送第一预设信息,其中,所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;若否,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值;所述数据审计端中存储有对应于目标数据的键值对,且所述键值对包括原始数据的哈希值和该哈希值在区块链上的存储地址,其中,所述原始数据为对应于所述目标数据的数据;According to the target data corresponding to the original data, the hash value of the target data is obtained; the hash value is encoded into the query request, and the query request is sent to the data audit terminal so that the data audit terminal will In the query request, it is determined whether the key-value pair matching the hash value in the query request can be obtained; if so, the first preset information is sent to the data verification end, where the first preset information includes: The storage address in the key-value pair matched by the hash value in the query request; if not, send second preset information to the data verification terminal, where the preset information includes: a null value; in the data audit terminal A key-value pair corresponding to the target data is stored, and the key-value pair includes the hash value of the original data and the storage address of the hash value on the blockchain, wherein the original data corresponds to the target Data data;
接收数据审计端返回的响应结果,其中,所述响应结果包括:第一预设信息或者第二预设信息。Receive the response result returned by the data audit terminal, where the response result includes: the first preset information or the second preset information.
本发明实施例还提供了一种基于区块链的数据验证方法,应用于数据审计端,所述方法包括:The embodiment of the present invention also provides a blockchain-based data verification method, which is applied to the data audit terminal, and the method includes:
获取针对原始数据端的哈希值;Obtain the hash value for the original data terminal;
将所述哈希值作为主键,获取该哈希值在区块链上的存储地址并将该存储地址作为值,生成对应于所述原始数据的键值对;Using the hash value as a primary key, obtaining the storage address of the hash value on the blockchain and using the storage address as a value to generate a key-value pair corresponding to the original data;
接收数据验证端发送的数据查询请求,其中,所述查询请求中包括目标数据的哈希值,且所述目标数据为对应于所述原始数据的数据;Receiving a data query request sent by a data verification terminal, wherein the query request includes a hash value of target data, and the target data is data corresponding to the original data;
根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;According to the query request, determine whether it is possible to obtain a key-value pair that matches the hash value in the query request;
若是,向数据验证端发送第一预设信息,其中,所述第一预设信息包 括:与所述查询请求中的哈希值匹配的键值对中的存储地址;If yes, send first preset information to the data verification end, where the first preset information includes: a storage address in a key-value pair that matches the hash value in the query request;
若否,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值。If not, send second preset information to the data verification terminal, where the preset information includes: a null value.
可选的,所述获取针对原始数据端的哈希值,包括:Optionally, the obtaining the hash value for the original data terminal includes:
实时监测区块链上的区块的变化情况,在区块链上新增区块时,从所述区块中获取针对原始数据的哈希值。Real-time monitoring of the changes of blocks on the blockchain, and when a block is added to the blockchain, the hash value for the original data is obtained from the block.
本发明实施例还提供了一种基于区块链的数据验证方法,应用于数据验证***,数据验证***包括原始数据端、区块链网络、数据验证端以及数据审计端,所述方法包括:The embodiment of the present invention also provides a blockchain-based data verification method, which is applied to a data verification system. The data verification system includes an original data terminal, a blockchain network, a data verification terminal, and a data audit terminal. The method includes:
原始数据端针对原始数据端中的原始数据,获取所述原始数据的哈希值,并将所述哈希值发送至区块链,以使区块链将该哈希值存储在区块链的最新区块上,并使所述数据审计端生成对应于所述原始数据的哈希值的键值对,并根据所述键值对审计对应于所述原始数据的目标数据是否与原始数据一致;The original data terminal obtains the hash value of the original data for the original data in the original data terminal, and sends the hash value to the blockchain, so that the blockchain stores the hash value in the blockchain And make the data audit terminal generate a key-value pair corresponding to the hash value of the original data, and audit whether the target data corresponding to the original data is the same as the original data according to the key-value pair Consistent
区块链网络接收针对原始数据的哈希值,将该哈希值存储在区块链的最新区块上;The blockchain network receives the hash value for the original data, and stores the hash value on the latest block of the blockchain;
数据审计端获取针对原始数据端的哈希值;将所述哈希值作为主键,获取所述哈希值在区块链上的存储地址并将该存储地址作为值,生成对应于所述原始数据的键值对;The data audit terminal obtains the hash value for the original data terminal; uses the hash value as the primary key, obtains the storage address of the hash value on the blockchain, and uses the storage address as the value to generate the data corresponding to the original data Key-value pairs;
数据验证端根据对应于原始数据的目标数据,获取所述目标数据的哈希值;将所述哈希值编码至查询请求中,并将所述查询请求发送至数据审计端;The data verification terminal obtains the hash value of the target data according to the target data corresponding to the original data; encodes the hash value into a query request, and sends the query request to the data audit terminal;
数据审计端接收数据验证端发送的数据查询请求,根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;若是,向数据验证端发送第一预设信息,其中,所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;若否,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值;所述数据审计端中存储有对应于目标数据的键值对,且所述键值对包括原始数据的哈希值和该哈希值在区块链上的存储地址,其中,所述原始数据为对应于所述目标数据的数据;The data audit terminal receives the data query request sent by the data verification terminal, and determines whether it can obtain the key-value pair matching the hash value in the query request according to the query request; if so, sends the first preset to the data verification terminal Information, wherein the first preset information includes: the storage address in the key-value pair that matches the hash value in the query request; if not, the second preset information is sent to the data verification end, where all The preset information includes: a null value; the data audit terminal stores a key-value pair corresponding to the target data, and the key-value pair includes the hash value of the original data and the hash value on the blockchain A storage address, wherein the original data is data corresponding to the target data;
接收数据审计端返回的响应结果,其中,所述响应结果包括:第一预设信息或者第二预设信息。Receive the response result returned by the data audit terminal, where the response result includes: the first preset information or the second preset information.
本发明实施例还提供了一种基于区块链的数据验证装置,应用于原始数据端,所述装置包括:The embodiment of the present invention also provides a blockchain-based data verification device, which is applied to the original data terminal, and the device includes:
第一获取模块,用于针对原始数据端中的原始数据,获取所述原始数据的哈希值,并将所述哈希值发送至区块链,以使区块链将该哈希值存储在区块链的最新区块上,并使所述数据审计端生成对应于所述原始数据的哈希值的键值对,并根据所述键值对审计对应于所述原始数据的目标数据是否与原始数据一致。The first obtaining module is used to obtain the hash value of the original data for the original data in the original data terminal, and send the hash value to the block chain, so that the block chain stores the hash value On the latest block of the blockchain, and make the data audit terminal generate a key-value pair corresponding to the hash value of the original data, and audit the target data corresponding to the original data according to the key-value pair Whether it is consistent with the original data.
可选的,所述装置还包括:Optionally, the device further includes:
第二获取模块,用于获取原始数据端获取原始数据时的时间戳,并将所述时间戳发送至区块链,以使区块链将该哈希值与时间戳存储在区块链的最新区块上。The second obtaining module is used to obtain the time stamp when the original data terminal obtains the original data, and send the time stamp to the blockchain, so that the blockchain stores the hash value and the time stamp in the block chain. On the latest block.
可选的,所述第二获取模块,用于:Optionally, the second acquisition module is used to:
将哈希值与时间戳进行拼接,得到拼接后的结果;The hash value and the timestamp are spliced together to obtain the spliced result;
将拼接后的结果发送至区块链;Send the spliced result to the blockchain;
所述区块链将该哈希值与时间戳存储在区块链的最新区块上,包括:The block chain stores the hash value and timestamp on the latest block of the block chain, including:
区块链将拼接后的结果存储在区块链的最新区块上。The blockchain stores the spliced result in the latest block of the blockchain.
本发明实施例还提供了一种基于区块链的数据验证装置,应用于区块链网络,所述装置包括:The embodiment of the present invention also provides a block chain-based data verification device, which is applied to a block chain network, and the device includes:
第一接收模块,用于接收针对原始数据的哈希值,将该哈希值存储在区块链的最新区块上。The first receiving module is used to receive the hash value for the original data, and store the hash value on the latest block of the blockchain.
可选的,所述装置还包括:Optionally, the device further includes:
第二接收模块,用于接收原始数据端发送的生成原始数据的哈希值时的时间戳,将所述时间戳与所述哈希值存储在同一个区块中。The second receiving module is configured to receive the timestamp when the hash value of the original data is generated from the original data terminal, and store the timestamp and the hash value in the same block.
可选的,所述第二接收模块,用于:Optionally, the second receiving module is configured to:
接收原始数据端发送的拼接结果,将拼接后的结果存储在区块链的最新区块上,其中,所述拼接结果为原始数据端将哈希值与时间戳进行拼接后得到的。Receive the splicing result sent by the original data end, and store the spliced result on the latest block of the blockchain, where the splicing result is obtained by splicing the hash value and the timestamp on the original data end.
本发明实施例还提供了一种基于区块链的数据验证装置,应用于数据验证端,所述装置包括:The embodiment of the present invention also provides a block chain-based data verification device, which is applied to the data verification end, and the device includes:
第三获取模块,用于根据对应于原始数据的目标数据,获取所述目标数据的哈希值;The third obtaining module is configured to obtain the hash value of the target data according to the target data corresponding to the original data;
将所述哈希值编码至查询请求中,并将所述查询请求发送至数据审计端,以使数据审计端根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;若是,向数据验证端发送第一预设信息,其中, 所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;若否,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值;所述数据审计端中存储有对应于目标数据的键值对,且所述键值对包括原始数据的哈希值和该哈希值在区块链上的存储地址,其中,所述原始数据为对应于所述目标数据的数据;Encode the hash value into a query request, and send the query request to the data auditing terminal, so that the data auditing terminal can determine whether it can obtain a match with the hash value in the query request according to the query request If yes, send first preset information to the data verification end, where the first preset information includes: the storage address in the key-value pair that matches the hash value in the query request; if No, send second preset information to the data verification terminal, where the preset information includes: a null value; the data audit terminal stores a key-value pair corresponding to the target data, and the key-value pair includes the original The hash value of the data and the storage address of the hash value on the blockchain, wherein the original data is data corresponding to the target data;
第三接收模块,用于接收数据审计端返回的响应结果,其中,所述响应结果包括:第一预设信息或者第二预设信息。The third receiving module is configured to receive the response result returned by the data auditing terminal, where the response result includes: the first preset information or the second preset information.
本发明实施例还提供了一种基于区块链的数据验证装置,应用于数据审计端,所述装置包括:The embodiment of the present invention also provides a block chain-based data verification device, which is applied to the data audit end, and the device includes:
第四获取模块,用于获取针对原始数据端的哈希值;The fourth obtaining module is used to obtain the hash value for the original data terminal;
生成模块,用于将所述哈希值作为主键,获取该哈希值在区块链上的存储地址并将该存储地址作为值,生成对应于所述原始数据的键值对;A generating module, configured to use the hash value as a primary key, obtain the storage address of the hash value on the blockchain, and use the storage address as a value to generate a key-value pair corresponding to the original data;
第四接收模块,用于接收数据验证端发送的数据查询请求,其中,所述查询请求中包括目标数据的哈希值,且所述目标数据为对应于所述原始数据的数据;A fourth receiving module, configured to receive a data query request sent by a data verification terminal, wherein the query request includes a hash value of target data, and the target data is data corresponding to the original data;
判断模块,应用于根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;The judging module is used to judge whether the key-value pair matching the hash value in the query request can be obtained according to the query request;
第一发送模块,用于在所述判断模块的判断结果为是的情况下,向数据验证端发送第一预设信息,其中,所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;The first sending module is configured to send first preset information to the data verification terminal when the judgment result of the judgment module is yes, where the first preset information includes: The storage address in the key-value pair matched by the hash value;
第二发送模块,用于在所述判断模块的判断结果为否的情况下,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值。The second sending module is configured to send second preset information to the data verification terminal when the judgment result of the judgment module is no, where the preset information includes: a null value.
可选的,所述第四获取模块,用于:Optionally, the fourth obtaining module is configured to:
实时监测区块链上的区块的变化情况,在区块链上新增区块时,从所述区块中获取针对原始数据的哈希值。Real-time monitoring of the changes of blocks on the blockchain, and when a block is added to the blockchain, the hash value for the original data is obtained from the block.
本发明实施例还提供了一种基于区块链的数据验证***,所述***包括;The embodiment of the present invention also provides a blockchain-based data verification system, the system includes;
根据上述任一项所述的原始数据端;The original data terminal according to any one of the above;
根据上述任一项所述的区块链;The blockchain according to any of the above;
根据上述任一项所述的数据验证端;The data verification terminal according to any one of the above;
根据上述任一项所述的数据验证端。The data verification terminal according to any one of the above.
本发明的优点在于:The advantages of the present invention are:
应用本发明实施例,将原始数据的哈希值保存在区块链上,利用区块链的不可篡改性保证原始数据的哈希值的正确性,进而以使进行数据审计的数据审计端根据区块链上存储的哈希值进行与原始数据对应的目标数据的审计,进而可以验证数据是否被篡改。By applying the embodiment of the present invention, the hash value of the original data is stored on the blockchain, and the non-tamperable modification of the blockchain is used to ensure the correctness of the hash value of the original data, so that the data audit terminal that conducts the data audit can be based on The hash value stored on the blockchain is audited for the target data corresponding to the original data, and then it can be verified whether the data has been tampered with.
另一个优点是,由于区块链上只存储了哈希值,没有暴露原始数据的担心,所以整个区块链查询***是公开的公共平台。而如果存的是原始数据的话,那就无法是公共平台而是私有平台,那么数据购买公司会对平台的公信力产生怀疑,因此,本发明实施例可以在***露原始数据的前提下保证数据购买公司能够得到未被篡改的目标数据。Another advantage is that since only the hash value is stored on the blockchain, there is no worry of exposing the original data, so the entire blockchain query system is an open public platform. If the original data is stored, it cannot be a public platform but a private platform. Then the data purchasing company will doubt the credibility of the platform. Therefore, the embodiment of the present invention can guarantee the data purchase without leaking the original data. The company can obtain target data that has not been tampered with.
图1为本发明实施例提供的一种基于区块链的数据验证方法的流程示意图;FIG. 1 is a schematic flowchart of a method for data verification based on blockchain according to an embodiment of the present invention;
图2为本发明实施例提供的一种基于区块链的数据验证***的结构示意图。FIG. 2 is a schematic structural diagram of a data verification system based on blockchain according to an embodiment of the present invention.
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are part of the present invention. Examples, not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
实施例1Example 1
本发明实施例提供了一种基于区块链的数据验证方法,应用于原始数据端,所述方法包括:The embodiment of the present invention provides a blockchain-based data verification method, which is applied to the original data terminal, and the method includes:
示例性的,A公司在出售数据库或者某个数据之前,将所要出售的数据或者数据库作为原始数据,预先使用原始数据端针对原始数据端中的原始数据,获取所述原始数据的哈希值。原始数据端可以主动获取或者被动接收原始数据,原始数据端使用哈希算法,对原始数据进行哈希处理,得到原始数据的哈希值,其中,哈希算法可以是MD5、SHA-1、SHA256等算法中的一种或组合。Exemplarily, before selling a database or certain data, company A uses the data or database to be sold as original data, and uses the original data terminal to obtain the hash value of the original data for the original data in the original data terminal in advance. The original data end can actively obtain or passively receive the original data. The original data end uses a hash algorithm to hash the original data to obtain the hash value of the original data. Among them, the hash algorithm can be MD5, SHA-1, SHA256 One or a combination of other algorithms.
在实际应用中,原始数据可以来源于传感器、工控机等。原始数据端可以为传感器网络的网关设备。传感器、工控机等可以通过有线、wifi、ZigBee等通信方式将JSON格式、字符串格式或是二进制数组格式的原始数据传输给原始数据端。In practical applications, the original data can come from sensors, industrial computers, etc. The original data terminal can be the gateway device of the sensor network. Sensors, industrial computers, etc. can transmit raw data in JSON format, string format or binary array format to the original data terminal through wired, wifi, ZigBee and other communication methods.
然后,将所述哈希值发送至区块链网络,区块链网络中的每个区块节 点经过共识认证,将该哈希值写入最新区块中。区块链可以是公有链、私有链或联盟链。Then, the hash value is sent to the blockchain network, and each block node in the blockchain network is verified by consensus, and the hash value is written into the latest block. The blockchain can be a public chain, a private chain or a consortium chain.
然后,区块链网络在接收到原始数据的哈希值之后,在区块链上新生成一个最新区块,并将该哈希值存储在区块链的最新区块上,并使所述数据审计端生成对应于所述原始数据的哈希值的键值对,并根据所述键值对审计对应于所述原始数据的目标数据是否与原始数据一致。Then, after the blockchain network receives the hash value of the original data, it generates a new block on the blockchain, stores the hash value on the latest block of the blockchain, and makes the The data audit terminal generates a key-value pair corresponding to the hash value of the original data, and audits whether the target data corresponding to the original data is consistent with the original data according to the key-value pair.
进一步的,区块链在收到原始数据的哈希值之后,可以先对区块链上存储的所有的哈希值进行比对,在未比对到与原始数据的哈希值相同的哈希值的情况下,再在区块链上生成一个最新区块。在比对到与原始数据的哈希值相同的哈希值的情况下,将与原始数据的哈希值相同哈希值作为值,将用于存储与原始数据的哈希值相同的哈希值的区块的地址作为主键,并根据所述键与值生成键值对以备B公司进行数据审计。Furthermore, after the blockchain receives the hash value of the original data, it can first compare all the hash values stored on the blockchain, and the hash value that is the same as the hash value of the original data is not compared. In the case of hope, a newest block is generated on the blockchain. When the hash value is the same as the hash value of the original data, the hash value that is the same as the hash value of the original data will be used as the value, which will be used to store the hash value that is the same as the hash value of the original data. The address of the value block is used as the primary key, and a key-value pair is generated according to the key and value for data audit by B company.
应用本发明实施例,将原始数据的哈希值保存在区块链上,利用区块链的不可篡改性保证原始数据的哈希值的正确性,进而以使进行数据审计的数据审计端根据区块链上存储的哈希值进行与原始数据对应的目标数据的审计,进而可以验证数据是否被篡改。By applying the embodiment of the present invention, the hash value of the original data is stored on the blockchain, and the non-tamperable modification of the blockchain is used to ensure the correctness of the hash value of the original data, so that the data auditing terminal that conducts the data audit is based on The hash value stored on the blockchain is audited for the target data corresponding to the original data, and then it can be verified whether the data has been tampered with.
实施例2Example 2
在本发明实施例1的基础上,本发明实施例还提供了一种基于区块链的数据验证方法,在将所述哈希值发送至数据审计端时,所述方法还包括:On the basis of Embodiment 1 of the present invention, the embodiment of the present invention also provides a blockchain-based data verification method. When sending the hash value to the data auditing terminal, the method further includes:
原始数据端在生成对应于原始数据的哈希值时,还会获取原始数据端得到该原始数据的时刻对应的时刻值,例如,例如,原始数据端在时间戳值为A的时刻得到的原始数据,则将该时间戳A作为对应于原始数据的时 间戳,将该时间戳与对应于原始数据的哈希值均发送给区块链网络,其中,时间戳是指格林威治时间1970年01月01日00时00分00秒(北京时间1970年01月01日08时00分00秒)起至现在的总毫秒数。When the original data terminal generates the hash value corresponding to the original data, it also obtains the time value corresponding to the time when the original data terminal obtains the original data. For example, the original data terminal obtains the original data at the time when the timestamp value is A. Data, use the timestamp A as the timestamp corresponding to the original data, and send the timestamp and the hash value corresponding to the original data to the blockchain network, where the timestamp refers to 1970 Greenwich Mean Time The total number of milliseconds from 00: 00: 00, 01 January (08:00: 00: 00, January 1, 1970, Beijing time) to the present.
然后,区块链网络在接收到原始数据的哈希值以及对应于原始数据的时间戳之后,在区块链上新生成一个最新区块,并将该哈希值以及时间戳存储在区块链的最新区块上。Then, after receiving the hash value of the original data and the timestamp corresponding to the original data, the blockchain network generates a new block on the blockchain, and stores the hash value and timestamp in the block On the latest block of the chain.
然后,数据审计端可以利用智能合约或者其他技术手段监听区块链上的新的区块中是否被存入了新的哈希值,当数据审计端知晓区块链上被存入了新的哈希值之后,从区块链上的区块中读取新的哈希值以及用于存储该哈希值的区块对应地址,将该区块对应的地址作为主键,将所读取的新的哈希值,即对应于原始数据的哈希值作为值生成对应于原始数据的键值对。Then, the data audit end can use smart contracts or other technical means to monitor whether a new hash value is stored in a new block on the blockchain. When the data audit end knows that a new hash value has been stored in the blockchain After the hash value, the new hash value and the corresponding address of the block used to store the hash value are read from the block on the blockchain, the address corresponding to the block is used as the primary key, and the read The new hash value, that is, the hash value corresponding to the original data, is used as the value to generate a key-value pair corresponding to the original data.
数据审计端在进行数据审计时,可以根据用户输入的对应于获取原始数据的时间戳或者输入的时间戳范围在区块链上进行查找,提高查找速度,进而可以提高数据审计速度。When the data auditing terminal performs data auditing, it can search on the blockchain according to the timestamp input by the user corresponding to the original data obtained or the input timestamp range, which improves the search speed and thus the data audit speed.
进一步的,在本发明实施例2中,所述将所述时间戳发送至区块链步骤,包括:原始数据端将哈希值与时间戳进行拼接,得到拼接后的结果,并将拼接后的结果发送至区块链。Further, in Embodiment 2 of the present invention, the step of sending the timestamp to the blockchain includes: the original data end splices the hash value and the timestamp to obtain the spliced result, and the spliced The result is sent to the blockchain.
区块链网络在接收到拼接后的结果之后,在区块链上生成新的区块,并将拼接后的结果存储在区块链的最新区块上。After the blockchain network receives the spliced result, it generates a new block on the blockchain and stores the spliced result on the latest block of the blockchain.
实施例3Example 3
对应于本发明实施例1或者实施例2,本发明实施例3还提供了一种 基于区块链的数据验证方法,应用于区块链网络,所述方法包括:Corresponding to Embodiment 1 or Embodiment 2 of the present invention, Embodiment 3 of the present invention also provides a blockchain-based data verification method, which is applied to a blockchain network, and the method includes:
区块链网络在接收到原始数据端发送的针对原始数据的哈希值后,区块链中的每个区块节点经过共识认证,在区块链上新生成一个最新区块,After the blockchain network receives the hash value for the original data sent by the original data terminal, each block node in the blockchain is authenticated by consensus, and a new block is generated on the blockchain.
然后,将该哈希值存储在区块链的最新区块上,并使所述数据审计端生成对应于所述原始数据的哈希值的键值对,并根据所述键值对审计对应于所述原始数据的目标数据是否与原始数据一致。区块链可以是公有链、私有链或联盟链。Then, the hash value is stored on the latest block of the blockchain, and the data audit terminal is made to generate a key-value pair corresponding to the hash value of the original data, and audit the corresponding key-value pair according to the key-value pair. Whether the target data of the original data is consistent with the original data. The blockchain can be a public chain, a private chain or a consortium chain.
应用本发明实施例,区块链可以将针对原始数据的哈希值存储在区块中,避免该哈希值被篡改。With the application of the embodiment of the present invention, the blockchain can store the hash value for the original data in the block to prevent the hash value from being tampered with.
进一步的,区块链网络在接收到原始数据的哈希值以及对应于原始数据的时间戳之后,在区块链上新生成一个最新区块,并将该哈希值以及时间戳存储在区块链的最新区块上。Further, after receiving the hash value of the original data and the timestamp corresponding to the original data, the blockchain network generates a new block on the blockchain, and stores the hash value and timestamp in the district. On the latest block of the blockchain.
应用本发明实施例,数据审计端在进行数据审计时,可以根据用户输入的对应于原始数据的时间戳或者输入的时间戳范围在区块链上进行查找,提高查找速度,进而可以提高数据审计速度。By applying the embodiments of the present invention, when the data auditing terminal performs data auditing, it can search on the blockchain according to the timestamp input by the user corresponding to the original data or the input timestamp range, which improves the search speed and further improves the data auditing. speed.
更进一步的,所述将所述时间戳与所述哈希值存储在同一个区块中,包括:接收原始数据端发送的拼接结果,将拼接后的结果存储在区块链的最新区块上,其中,所述拼接结果为原始数据端将哈希值与时间戳进行拼接后得到的。Furthermore, the storing the timestamp and the hash value in the same block includes: receiving the splicing result sent by the original data terminal, and storing the spliced result in the latest block of the blockchain Above, where the splicing result is obtained by splicing the hash value and the timestamp on the original data terminal.
应用本发明实施例,将哈希值与时间戳拼接后,相对于分别存储在同一个区块中,可以减少一个数据头和一个数据尾,节约区块链上的存储空间。By applying the embodiment of the present invention, after concatenating the hash value and the timestamp, compared to storing them in the same block, one data header and one data tail can be reduced, and storage space on the blockchain can be saved.
实施例4Example 4
基于实施例1-3任一实施例,本发明实施例4提供了一种基于区块链的数据验证方法,应用于数据验证端,所述方法包括:Based on any one of Embodiments 1-3, Embodiment 4 of the present invention provides a blockchain-based data verification method, which is applied to the data verification end, and the method includes:
首先,B公司收到了A公司发来的数据,但是B公司无法确认该数据是否与A公司承诺的原始数据完全一致,因此,本发明实施例中将B公司收到的数据称为目标数据。First, company B receives the data sent by company A, but company B cannot confirm whether the data is completely consistent with the original data promised by company A. Therefore, the data received by company B is referred to as target data in the embodiment of the present invention.
B公司使用数据验证端上配置的、与A公司生成原始数据的哈希值时使用的相同的哈希算法,生成目标数据的哈希值。数据验证端将目标数据的哈希值编码到查询请求中,并将该查询请求发送至数据审计端。Company B uses the same hash algorithm configured on the data verification terminal as that used by Company A to generate the hash value of the original data to generate the hash value of the target data. The data verification terminal encodes the hash value of the target data into the query request, and sends the query request to the data audit terminal.
数据审计端在接收到B公司使用的数据验证端发来的数据查询请求后,解析该查询请求进而获得查询请求中包含的目标数据的哈希值。After receiving the data query request from the data verification terminal used by Company B, the data auditing terminal parses the query request to obtain the hash value of the target data contained in the query request.
数据审计端以目标数据的哈希值为基础,在自身中存储的键值对中进行查找比对,判断能否找到包含了与目标数据哈希值相同哈希值的键值对,进而实现将目标数据的哈希值与区块链中存储的哈希值进行比对的目的。Based on the hash value of the target data, the data auditing terminal performs search and comparison among the key-value pairs stored in itself, and judges whether it can find a key-value pair that contains the same hash value as the target data hash value, and then achieve The purpose of comparing the hash value of the target data with the hash value stored in the blockchain.
如果上述判断的结果为是,从自身中存储的键值对中获取存储了与目标数据的哈希值相同的哈希值的区块的地址,将该地址作为第一预设信息发送至B公司使用的数据查询端,当然,在实际应用中,第一预设信息可以包括但不仅限于该区块的地址,还可以包括原始数据的数据量、原始数据的生成时间、哈希值的存储到区块链上的时间等,方便用户更加全面的了解原始数据的信息。If the result of the above judgment is yes, obtain the address of the block storing the same hash value as the hash value of the target data from the key-value pair stored in itself, and send this address as the first preset information to B The data query terminal used by the company. Of course, in practical applications, the first preset information can include but is not limited to the address of the block, and can also include the data volume of the original data, the generation time of the original data, and the storage of the hash value. Time to the blockchain, etc., to facilitate users to more comprehensively understand the information of the original data.
如果上述判断的结果为否,即数据审计端并未在区块链中查询到与目标数据的哈希值完全一致的哈希值,也就是说目标数据与原始数据并不完 全一致,数据审计端向数据验证端返回第二预设信息,在实际应用中,为了方便所述预设信息为空值。当前,在实际应用中,第二预设信息可以为“否”的判断结果,或者“目标数据被篡改”等信息。If the result of the above judgment is no, that is, the data audit end has not found a hash value in the blockchain that is exactly the same as the hash value of the target data, that is to say, the target data is not completely consistent with the original data, and the data audit The end returns the second preset information to the data verification end. In practical applications, for convenience, the preset information is a null value. Currently, in practical applications, the second preset information may be a "no" judgment result, or information such as "target data has been tampered with".
需要强调的是,所述数据审计端中存储有对应于目标数据的键值对,且所述键值对包括原始数据的哈希值和该哈希值在区块链上的存储地址,其中,所述原始数据为对应于所述目标数据的数据。It should be emphasized that a key-value pair corresponding to the target data is stored in the data audit terminal, and the key-value pair includes the hash value of the original data and the storage address of the hash value on the blockchain, where , The original data is data corresponding to the target data.
应用本发明实施例,将原始数据的哈希值保存在区块链上,利用区块链的不可篡改性保证原始数据的哈希值的正确性,进而在进行数据审计时根据区块链上存储的哈希值进行与原始数据对应的目标数据的审计,进而可以验证数据是否被篡改。By applying the embodiment of the present invention, the hash value of the original data is stored on the block chain, and the non-tamperable modification of the block chain is used to ensure the correctness of the hash value of the original data. The stored hash value is audited for the target data corresponding to the original data, so that it can be verified whether the data has been tampered with.
实施例5Example 5
基于实施例1-4中的任一实施例,本发明实施例5提供了一种基于区块链的数据验证方法,其特征在于,应用于数据审计端,所述方法包括:Based on any one of Embodiments 1-4, Embodiment 5 of the present invention provides a blockchain-based data verification method, which is characterized in that it is applied to a data audit terminal, and the method includes:
区块链上新增了一个区块之后,区块链网络可以向数据审计端发送“新增区块”的信息,以使数据审计端知晓区块链上被存入了新的哈希值之后,从区块链上的区块中读取新的哈希值以及用于存储该哈希值的区块对应地址,将该区块对应的地址作为值,将所读取的新的哈希值作为主键,即对应于原始数据的哈希值作为值生成对应于原始数据的键值对,然后将这些键值对存储到本地。通常情况下,数据审计端会建立一个索引表,索引表中存储了前述的键值对,然后在键值对索引表中查询与目标数据的哈希值对应的键值对,进而得到所查询到的哈希值对应的区块地址。键值对的作用就是用于在公司B使用数据验证端进行数据验证时,作为数据审计 端进行哈希值查询的依据。After a new block is added to the blockchain, the blockchain network can send the "new block" information to the data audit end, so that the data audit end knows that the new hash value is stored on the blockchain After that, read the new hash value and the corresponding address of the block used to store the hash value from the block on the blockchain, use the address corresponding to the block as the value, and use the read new hash value as the value. The hope value is used as the primary key, that is, the hash value corresponding to the original data is used as the value to generate key-value pairs corresponding to the original data, and then these key-value pairs are stored locally. Under normal circumstances, the data auditing terminal will create an index table in which the aforementioned key-value pairs are stored, and then query the key-value pair corresponding to the hash value of the target data in the key-value pair index table to obtain the query The block address corresponding to the obtained hash value. The function of the key-value pair is to use the data verification terminal for data verification in company B, as the basis for the hash value query on the data audit terminal.
B公司在需要对收到的目标数据进行验证,以确保目标数据与A公司承诺的原始数据完全一致。B公司使用数据验证端上配置的、与A公司生成原始数据的哈希值时使用的相同的哈希算法,生成目标数据的哈希值。数据验证端将目标数据的哈希值编码到查询请求中,并将该查询请求发送至数据审计端。Company B needs to verify the received target data to ensure that the target data is completely consistent with the original data promised by Company A. Company B uses the same hash algorithm configured on the data verification terminal as that used by Company A to generate the hash value of the original data to generate the hash value of the target data. The data verification terminal encodes the hash value of the target data into the query request, and sends the query request to the data audit terminal.
数据审计端接收数据验证端发送的数据查询请求,其中,所述查询请求中包括目标数据的哈希值,且所述目标数据为对应于所述原始数据的数据;The data audit terminal receives a data query request sent by the data verification terminal, wherein the query request includes a hash value of target data, and the target data is data corresponding to the original data;
数据审计端解析所述查询请求,进而可以得到查询请求中包含的目标数据的哈希值,然后以目标数据的哈希值为基准,遍历本地存储的键值对,将每一个键值对中的哈希值与目标数据的哈希值进行比较;进而判断二者是否一致,直至得到与目标数据的哈希值完全一致的哈希值或者遍历完所有的键值对;或者可以遍历区块链上的各个区块,将每一个区块中存储的哈希值与目标数据的哈希值进行比较;进而判断二者是否一致,直至得到与目标数据的哈希值完全一致的哈希值或者遍历完所有的区块。The data auditing terminal parses the query request, and then can obtain the hash value of the target data contained in the query request, and then traverses the locally stored key-value pairs based on the hash value of the target data, and puts each key-value pair in The hash value of is compared with the hash value of the target data; then it is judged whether the two are consistent, until a hash value that is exactly the same as the hash value of the target data is obtained or all key-value pairs are traversed; or the block can be traversed Each block on the chain compares the hash value stored in each block with the hash value of the target data; then judges whether the two are consistent, until the hash value that is exactly the same as the hash value of the target data is obtained Or traverse all the blocks.
如果能找到目标数据的哈希值完全一致的哈希值,则说明该区块中存储的哈希值与目标数据的哈希值匹配。将该区块作为目标区块,获取该区块的区块地址,将该区块地址作为第一预设信息发送至数据验证端。If a hash value that is exactly the same as the hash value of the target data can be found, it means that the hash value stored in the block matches the hash value of the target data. The block is used as the target block, the block address of the block is obtained, and the block address is sent to the data verification terminal as the first preset information.
如果未能找到目标数据的哈希值完全一致的哈希值,则说明该区块中存储的哈希值与目标数据的哈希值不匹配,则向数据验证端发送第二预设信息,其中,所述预设信息包括:空值。If it fails to find a hash value that is exactly the same as the hash value of the target data, it means that the hash value stored in the block does not match the hash value of the target data, and the second preset information is sent to the data verification end, Wherein, the preset information includes: a null value.
应用本发明实施例,可以对目标数据是否与原始数据完全一致进行验证。By applying the embodiment of the present invention, it is possible to verify whether the target data is completely consistent with the original data.
进一步的,所述获取针对原始数据端的哈希值,包括:Further, the obtaining the hash value for the original data terminal includes:
数据审计端可以利用智能合约或者其他技术手段监听区块链上的新的区块中是否被存入了新的哈希值,当数据审计端知晓区块链上被存入了新的哈希值之后,从区块链上的区块中读取新的哈希值以及用于存储该哈希值的区块对应地址,将该区块对应的地址作为值,将所读取的新的哈希值作为主键,即对应于原始数据的哈希值作为值生成对应于原始数据的键值对。The data auditing side can use smart contracts or other technical means to monitor whether a new hash value is stored in a new block on the blockchain. When the data auditing side knows that a new hash is stored on the blockchain After the value, read the new hash value and the corresponding address of the block used to store the hash value from the block on the blockchain, use the address corresponding to the block as the value, and use the new The hash value is used as the primary key, that is, the hash value corresponding to the original data is used as the value to generate a key-value pair corresponding to the original data.
应用本发明上述实施例,数据审计端可以主动监听区块链网络,提高数据审计端工作的实时性。By applying the above-mentioned embodiments of the present invention, the data auditing terminal can actively monitor the blockchain network, which improves the real-time performance of the data auditing terminal's work.
实施例6Example 6
基于前述实施例,本发明实施例6提供了一种基于区块链的数据验证方法,该方法应用于数据验证***,数据验证***包括原始数据端、区块链网络、数据验证端以及数据审计端。Based on the foregoing embodiment, the sixth embodiment of the present invention provides a blockchain-based data verification method, which is applied to a data verification system. The data verification system includes an original data terminal, a blockchain network, a data verification terminal, and a data audit. end.
图1为本发明实施例提供的一种基于区块链的数据验证方法的流程示意图,如图1所示,该方法包括以下步骤:Fig. 1 is a schematic flowchart of a blockchain-based data verification method provided by an embodiment of the present invention. As shown in Fig. 1, the method includes the following steps:
S601:原始数据端使用哈希算法,对原始数据进行哈希处理,得到原始数据的哈希值,其中,哈希算法可以是MD5、SHA-1、SHA256等算法中的一种或组合。S601: The original data terminal uses a hash algorithm to hash the original data to obtain the hash value of the original data, where the hash algorithm can be one or a combination of MD5, SHA-1, SHA256 and other algorithms.
然后,原始数据端将所述哈希值发送至区块链网络。Then, the original data terminal sends the hash value to the blockchain network.
S602:区块链网络在接收到原始数据的哈希值之后,在区块链上新生 成一个最新区块,并将该哈希值存储在区块链的最新区块上,并使所述数据审计端生成对应于所述原始数据的哈希值的键值对,并根据所述键值对审计对应于所述原始数据的目标数据是否与原始数据一致。区块链网络中的每个区块节点经过共识认证,将该哈希值写入最新区块中。区块链可以是公有链、私有链或联盟链。S602: After receiving the hash value of the original data, the blockchain network generates a new block on the blockchain, stores the hash value on the latest block of the blockchain, and makes the The data audit terminal generates a key-value pair corresponding to the hash value of the original data, and audits whether the target data corresponding to the original data is consistent with the original data according to the key-value pair. Each block node in the blockchain network is authenticated by consensus, and the hash value is written into the latest block. The blockchain can be a public chain, a private chain or a consortium chain.
S603:数据审计端可以利用智能合约或者其他技术手段监听区块链上的新的区块中是否被存入了新的哈希值,当数据审计端知晓区块链上被存入了新的哈希值之后,从区块链上的区块中读取新的哈希值以及用于存储该哈希值的区块对应地址,将该区块对应的地址作为值,将所读取的新的哈希值作为主键,即对应于原始数据的哈希值作为值生成对应于原始数据的键值对。S603: The data audit end can use smart contracts or other technical means to monitor whether a new hash value is stored in a new block on the blockchain. When the data audit end knows that a new hash value has been stored in the blockchain After the hash value, the new hash value and the corresponding address of the block used to store the hash value are read from the block on the blockchain, the address corresponding to the block is used as the value, and the read The new hash value is used as the primary key, that is, the hash value corresponding to the original data is used as the value to generate a key-value pair corresponding to the original data.
S604:B公司使用数据验证端上配置的、与A公司生成原始数据的哈希值时使用的相同的哈希算法,生成目标数据的哈希值。数据验证端将目标数据的哈希值编码到查询请求中,并将该查询请求发送至数据审计端。S604: Company B uses the same hash algorithm configured on the data verification terminal as that used by Company A when generating the hash value of the original data to generate the hash value of the target data. The data verification terminal encodes the hash value of the target data into the query request, and sends the query request to the data audit terminal.
S605:数据审计端在接收到B公司使用的数据验证端发来的数据查询请求后,解析该查询请求进而获得查询请求中包含的目标数据的哈希值。S605: After receiving the data query request from the data verification terminal used by company B, the data auditing terminal parses the query request to obtain the hash value of the target data contained in the query request.
数据审计端以目标数据的哈希值为基础,将目标数据的哈希值与区块链中存储的哈希值进行比对,进而判断是否能够从区块链中得到与目标数据的哈希值完全一致的哈希值。The data audit terminal is based on the hash value of the target data, compares the hash value of the target data with the hash value stored in the blockchain, and then judges whether the hash value of the target data can be obtained from the blockchain A hash value with exactly the same value.
S606:数据验证端接收数据审计端发送的针对目标数据的审计结果,并将该审计结果呈现给公司B的工作人员。S606: The data verification terminal receives the audit result for the target data sent by the data audit terminal, and presents the audit result to the staff of company B.
如果上述判断的结果为是,获取存储了与目标数据的哈希值相同的哈 希值的区块的地址,将该地址作为第一预设信息发送至B公司使用的数据查询端,当然,在实际应用中,第一预设信息可以包括但不仅限于该区块的地址,还可以包括原始数据的数据量、原始数据的生成时间、哈希值的存储到区块链上的时间等,方便用户更加全面的了解原始数据的信息。If the result of the above judgment is yes, obtain the address of the block storing the hash value that is the same as the hash value of the target data, and send this address as the first preset information to the data query terminal used by B company. Of course, In practical applications, the first preset information may include, but is not limited to, the address of the block, but may also include the data amount of the original data, the generation time of the original data, the time when the hash value is stored on the blockchain, etc. It is convenient for users to have a more comprehensive understanding of the information of the original data.
如果上述判断的结果为否,即数据审计端并未在区块链中查询到与目标数据的哈希值完全一致的哈希值,也就是说目标数据与原始数据并不完全一致,数据审计端向数据验证端返回第二预设信息,在实际应用中,为了方便所述预设信息为空值。当前,在实际应用中,第二预设信息可以为“否”的判断结果,或者“目标数据被篡改”等信息。If the result of the above judgment is no, that is, the data audit end has not found a hash value in the blockchain that is exactly the same as the hash value of the target data, that is to say, the target data is not completely consistent with the original data, and the data audit The end returns the second preset information to the data verification end. In practical applications, for convenience, the preset information is a null value. Currently, in practical applications, the second preset information may be a "no" judgment result, or information such as "target data has been tampered with".
应用本发明实施例,将原始数据的哈希值保存在区块链上,利用区块链的不可篡改性保证原始数据的哈希值的正确性,进而在进行数据审计时根据区块链上存储的哈希值进行与原始数据对应的目标数据的审计,进而可以验证数据是否被篡改。由于区块链的不可篡改特性,还避免了A公司与第三方数据审计单位之间串改数据的可能,进而保证了B公司的利益。By applying the embodiment of the present invention, the hash value of the original data is stored on the block chain, and the non-tamperable modification of the block chain is used to ensure the correctness of the hash value of the original data. The stored hash value is audited for the target data corresponding to the original data, so that it can be verified whether the data has been tampered with. Due to the non-tampering feature of the blockchain, it also avoids the possibility of data collusion between A company and a third-party data audit unit, thereby ensuring the interests of B company.
另外,应用本发明实施例6,原始数据端仅将哈希值存储在区块链上,并将原始数据向区块链网络中的各个节点公开,因此,可以保证原始数据的隐私性。In addition, with the application of Embodiment 6 of the present invention, the original data terminal only stores the hash value on the blockchain and discloses the original data to each node in the blockchain network. Therefore, the privacy of the original data can be guaranteed.
实施例7Example 7
与本发明实施例1相对应,本发明实施例7提供了一种基于区块链的数据验证装置,应用于原始数据端,所述装置包括:Corresponding to Embodiment 1 of the present invention, Embodiment 7 of the present invention provides a blockchain-based data verification device applied to the original data terminal, and the device includes:
第一获取模块,用于针对原始数据端中的原始数据,获取所述原始数据的哈希值,并将所述哈希值发送至区块链,以使区块链将该哈希值存储 在区块链的最新区块上,并使所述数据审计端生成对应于所述原始数据的哈希值的键值对,并根据所述键值对审计对应于所述原始数据的目标数据是否与原始数据一致。The first obtaining module is used to obtain the hash value of the original data for the original data in the original data terminal, and send the hash value to the block chain, so that the block chain stores the hash value On the latest block of the blockchain, and make the data audit terminal generate a key-value pair corresponding to the hash value of the original data, and audit the target data corresponding to the original data according to the key-value pair Whether it is consistent with the original data.
应用本发明实施例,将原始数据的哈希值保存在区块链上,利用区块链的不可篡改性保证原始数据的哈希值的正确性,进而以使进行数据审计的数据审计端根据区块链上存储的哈希值进行与原始数据对应的目标数据的审计,进而可以验证数据是否被篡改。By applying the embodiment of the present invention, the hash value of the original data is stored on the blockchain, and the non-tamperable modification of the blockchain is used to ensure the correctness of the hash value of the original data, so that the data audit terminal that conducts the data audit can be based on The hash value stored on the blockchain is audited for the target data corresponding to the original data, and then it can be verified whether the data has been tampered with.
在本发明实施例的一种具体实施方式中,所述装置还包括:In a specific implementation of the embodiment of the present invention, the device further includes:
第二获取模块,用于获取原始数据端获取原始数据时的时间戳,并将所述时间戳发送至区块链,以使区块链将该哈希值与时间戳存储在区块链的最新区块上。The second obtaining module is used to obtain the time stamp when the original data terminal obtains the original data, and send the time stamp to the blockchain, so that the blockchain stores the hash value and the time stamp in the block chain. On the latest block.
在本发明实施例的一种具体实施方式中,所述第二获取模块,用于:In a specific implementation manner of the embodiment of the present invention, the second acquisition module is configured to:
将哈希值与时间戳进行拼接,得到拼接后的结果;The hash value and the timestamp are spliced together to obtain the spliced result;
将拼接后的结果发送至区块链;Send the spliced result to the blockchain;
所述区块链将该哈希值与时间戳存储在区块链的最新区块上,包括:The block chain stores the hash value and timestamp on the latest block of the block chain, including:
区块链将拼接后的结果存储在区块链的最新区块上。The blockchain stores the spliced result in the latest block of the blockchain.
实施例8Example 8
在本发明实施例7的基础上,本发明实施例还提供了一种基于区块链的数据验证装置,应用于区块链网络,所述装置包括:On the basis of Embodiment 7 of the present invention, the embodiment of the present invention also provides a blockchain-based data verification device, which is applied to a blockchain network, and the device includes:
第一接收模块,用于接收针对原始数据的哈希值,将该哈希值存储在区块链的最新区块上。The first receiving module is used to receive the hash value for the original data, and store the hash value on the latest block of the blockchain.
进一步的,所述装置还包括:Further, the device further includes:
第二接收模块,用于接收原始数据端发送的生成原始数据的哈希值时的时间戳,将所述时间戳与所述哈希值存储在同一个区块中。The second receiving module is configured to receive the timestamp when the hash value of the original data is generated from the original data terminal, and store the timestamp and the hash value in the same block.
进一步的,所述第二接收模块,用于:Further, the second receiving module is configured to:
接收原始数据端发送的拼接结果,将拼接后的结果存储在区块链的最新区块上,其中,所述拼接结果为原始数据端将哈希值与时间戳进行拼接后得到的。Receive the splicing result sent by the original data end, and store the spliced result on the latest block of the blockchain, where the splicing result is obtained by splicing the hash value and the timestamp on the original data end.
应用本发明实施例,在将针对原始数据的哈希值存储在区块链上之后,数据审计端可以根据该哈希值对与原始数据对应的目标数据进行一致性验证。Applying the embodiment of the present invention, after storing the hash value for the original data on the blockchain, the data audit terminal can verify the consistency of the target data corresponding to the original data according to the hash value.
实施例9Example 9
对应于实施例7或8,本发明实施例9提供了一种基于区块链的数据验证装置,应用于数据验证端,所述装置包括:Corresponding to Embodiment 7 or 8, Embodiment 9 of the present invention provides a blockchain-based data verification device, which is applied to a data verification end, and the device includes:
第三获取模块,用于根据对应于原始数据的目标数据,获取所述目标数据的哈希值;The third obtaining module is configured to obtain the hash value of the target data according to the target data corresponding to the original data;
将所述哈希值编码至查询请求中,并将所述查询请求发送至数据审计端,以使数据审计端根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;若是,向数据验证端发送第一预设信息,其中,所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;若否,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值;所述数据审计端中存储有对应于目标数据的键值对,且所述键值对包括原始数据的哈希值和该哈希值在区块链上的存储地址,其中,所述原始数据为对应于所述目标数据的数据;Encode the hash value into a query request, and send the query request to the data auditing terminal, so that the data auditing terminal can determine whether it can obtain a match with the hash value in the query request according to the query request If yes, send first preset information to the data verification end, where the first preset information includes: the storage address in the key-value pair that matches the hash value in the query request; if No, send second preset information to the data verification terminal, where the preset information includes: a null value; the data audit terminal stores a key-value pair corresponding to the target data, and the key-value pair includes the original The hash value of the data and the storage address of the hash value on the blockchain, wherein the original data is data corresponding to the target data;
第三接收模块,用于接收数据审计端返回的响应结果,其中,所述响应结果包括:第一预设信息或者第二预设信息。The third receiving module is configured to receive the response result returned by the data auditing terminal, where the response result includes: the first preset information or the second preset information.
应用本发明实施例,区块链可以将针对原始数据的哈希值存储在区块中,避免该哈希值被篡改。With the application of the embodiment of the present invention, the blockchain can store the hash value for the original data in the block to prevent the hash value from being tampered with.
实施例10Example 10
对应于实施例7-9任一实施例,本发明实施例10还提供了一种基于区块链的数据验证方法,应用于数据审计端,所述装置包括:Corresponding to any one of Embodiments 7-9, Embodiment 10 of the present invention also provides a blockchain-based data verification method, which is applied to a data audit terminal, and the device includes:
第四获取模块,用于获取针对原始数据端的哈希值;The fourth obtaining module is used to obtain the hash value for the original data terminal;
生成模块,用于将所述哈希值作为主键,获取该哈希值在区块链上的存储地址并将该存储地址作为值,生成对应于所述原始数据的键值对;A generating module, configured to use the hash value as a primary key, obtain the storage address of the hash value on the blockchain, and use the storage address as a value to generate a key-value pair corresponding to the original data;
第四接收模块,用于接收数据验证端发送的数据查询请求,其中,所述查询请求中包括目标数据的哈希值,且所述目标数据为对应于所述原始数据的数据;A fourth receiving module, configured to receive a data query request sent by a data verification terminal, wherein the query request includes a hash value of target data, and the target data is data corresponding to the original data;
判断模块,应用于根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;The judging module is used to judge whether the key-value pair matching the hash value in the query request can be obtained according to the query request;
第一发送模块,用于在所述判断模块的判断结果为是的情况下,向数据验证端发送第一预设信息,其中,所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;The first sending module is configured to send first preset information to the data verification terminal when the judgment result of the judgment module is yes, where the first preset information includes: The storage address in the key-value pair matched by the hash value;
第二发送模块,用于在所述判断模块的判断结果为否的情况下,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值。The second sending module is configured to send second preset information to the data verification terminal when the judgment result of the judgment module is no, where the preset information includes: a null value.
应用本发明实施例,将原始数据的哈希值保存在区块链上,利用区块链的不可篡改性保证原始数据的哈希值的正确性,进而在进行数据审计时 根据区块链上存储的哈希值进行与原始数据对应的目标数据的审计,进而可以验证数据是否被篡改。By applying the embodiment of the present invention, the hash value of the original data is stored on the block chain, and the non-tamperable modification of the block chain is used to ensure the correctness of the hash value of the original data. The stored hash value is audited for the target data corresponding to the original data, so that it can be verified whether the data has been tampered with.
进一步的,所述第四获取模块,用于:Further, the fourth acquisition module is used to:
实时监测区块链上的区块的变化情况,在区块链上新增区块时,从所述区块中获取针对原始数据的哈希值。Real-time monitoring of the changes of blocks on the blockchain, and when a block is added to the blockchain, the hash value for the original data is obtained from the block.
实施例11Example 11
图2为本发明实施例提供的一种基于区块链的数据验证***的结构示意图,如图2所示,所述***包括:Figure 2 is a schematic structural diagram of a blockchain-based data verification system provided by an embodiment of the present invention. As shown in Figure 2, the system includes:
根据实施例1或者实施例2所述的原始数据端;The original data terminal according to Embodiment 1 or Embodiment 2;
根据实施例3所述的区块链网络;The blockchain network according to embodiment 3;
根据实施例4所述的数据验证端;The data verification terminal according to embodiment 4;
根据实施例5所述的数据验证端。According to the data verification terminal described in embodiment 5.
在实际应用中,In practical applications,
应用本发明实施例,将原始数据的哈希值保存在区块链上,利用区块链的不可篡改性保证原始数据的哈希值的正确性,进而以使进行数据审计的数据审计端根据区块链上存储的哈希值进行与原始数据对应的目标数据的审计,进而可以验证数据是否被篡改。By applying the embodiment of the present invention, the hash value of the original data is stored on the blockchain, and the non-tamperable modification of the blockchain is used to ensure the correctness of the hash value of the original data, so that the data audit terminal that conducts the data audit can be based on The hash value stored on the blockchain is audited for the target data corresponding to the original data, and then it can be verified whether the data has been tampered with.
以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。The above embodiments are only used to illustrate the technical solutions of the present invention, not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The recorded technical solutions are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims (20)
- 一种基于区块链的数据验证方法,其特征在于,应用于原始数据端,所述方法包括:A blockchain-based data verification method, characterized in that it is applied to the original data terminal, and the method includes:针对原始数据端中的原始数据,获取所述原始数据的哈希值,并将所述哈希值发送至区块链,以使区块链将该哈希值存储在区块链的最新区块上,并使所述数据审计端生成对应于所述原始数据的哈希值的键值对,并根据所述键值对审计对应于所述原始数据的目标数据是否与原始数据一致。For the original data in the original data terminal, obtain the hash value of the original data, and send the hash value to the block chain, so that the block chain stores the hash value in the latest area of the block chain Block, and make the data audit terminal generate a key-value pair corresponding to the hash value of the original data, and audit whether the target data corresponding to the original data is consistent with the original data according to the key-value pair.
- 根据权利要求1的一种基于区块链的数据验证方法,其特征在于,在将所述哈希值发送至数据审计端时,所述方法还包括:A blockchain-based data verification method according to claim 1, wherein when sending the hash value to the data audit terminal, the method further comprises:获取原始数据端获取原始数据时的时间戳,并将所述时间戳发送至区块链,以使区块链将该哈希值与时间戳存储在区块链的最新区块上。The original data terminal obtains the timestamp when the original data is obtained, and sends the timestamp to the blockchain, so that the blockchain stores the hash value and the timestamp on the latest block of the blockchain.
- 根据权利要求2所述的一种基于区块链的数据验证方法,其特征在于,所述将所述时间戳发送至区块链步骤,包括:The method for data verification based on blockchain according to claim 2, wherein the step of sending the timestamp to the blockchain comprises:将哈希值与时间戳进行拼接,得到拼接后的结果;The hash value and the timestamp are spliced together to obtain the spliced result;将拼接后的结果发送至区块链;Send the spliced result to the blockchain;所述区块链将该哈希值与时间戳存储在区块链的最新区块上,包括:The block chain stores the hash value and timestamp on the latest block of the block chain, including:区块链将拼接后的结果存储在区块链的最新区块上。The blockchain stores the spliced result in the latest block of the blockchain.
- 基于权利要求1-3任一项所述的一种基于区块链的数据验证方法,其特征在于,应用于区块链网络,所述方法包括:A blockchain-based data verification method based on any one of claims 1-3, which is characterized in that it is applied to a blockchain network, and the method comprises:接收针对原始数据的哈希值,将该哈希值存储在区块链的最新区块上。Receive the hash value for the original data, and store the hash value on the latest block of the blockchain.
- 根据权利要求4所述的一种基于区块链的数据验证方法,其特征在于,在将该哈希值存储在区块链的最新区块上时,所述方法还包括:The method for data verification based on blockchain according to claim 4, wherein when storing the hash value on the latest block of the blockchain, the method further comprises:接收原始数据端发送的生成原始数据的哈希值时的时间戳,将所述时 间戳与所述哈希值存储在同一个区块中。Receive the timestamp when the hash value of the original data is generated from the original data terminal, and store the timestamp and the hash value in the same block.
- 根据权利要求5所述的一种基于区块链的数据验证方法,其特征在于,所述将所述时间戳与所述哈希值存储在同一个区块中,包括:The method for data verification based on blockchain according to claim 5, wherein the storing the timestamp and the hash value in the same block comprises:接收原始数据端发送的拼接结果,将拼接后的结果存储在区块链的最新区块上,其中,所述拼接结果为原始数据端将哈希值与时间戳进行拼接后得到的。Receive the splicing result sent by the original data end, and store the spliced result on the latest block of the blockchain, where the splicing result is obtained by splicing the hash value and the timestamp on the original data end.
- 基于权利要求1-6任一项所述的一种基于区块链的数据验证方法,其特征在于,应用于数据验证端,所述方法包括:A blockchain-based data verification method based on any one of claims 1-6, characterized in that it is applied to a data verification terminal, and the method comprises:根据对应于原始数据的目标数据,获取所述目标数据的哈希值;Obtaining a hash value of the target data according to the target data corresponding to the original data;将所述哈希值编码至查询请求中,并将所述查询请求发送至数据审计端,以使数据审计端根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;若是,向数据验证端发送第一预设信息,其中,所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;若否,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值;所述数据审计端中存储有对应于目标数据的键值对,且所述键值对包括原始数据的哈希值和该哈希值在区块链上的存储地址,其中,所述原始数据为对应于所述目标数据的数据;Encode the hash value into a query request, and send the query request to the data auditing terminal, so that the data auditing terminal can determine whether it can obtain a match with the hash value in the query request according to the query request If yes, send first preset information to the data verification end, where the first preset information includes: the storage address in the key-value pair that matches the hash value in the query request; if No, send second preset information to the data verification terminal, where the preset information includes: a null value; the data audit terminal stores a key-value pair corresponding to the target data, and the key-value pair includes the original The hash value of the data and the storage address of the hash value on the blockchain, wherein the original data is data corresponding to the target data;接收数据审计端返回的响应结果,其中,所述响应结果包括:第一预设信息或者第二预设信息。Receive the response result returned by the data audit terminal, where the response result includes: the first preset information or the second preset information.
- 基于权利要求1-7任一项所述的一种基于区块链的数据验证方法,其特征在于,应用于数据审计端,所述方法包括:A blockchain-based data verification method based on any one of claims 1-7, which is characterized in that it is applied to a data audit terminal, and the method comprises:获取针对原始数据端的哈希值;Obtain the hash value for the original data terminal;将所述哈希值作为主键,获取该哈希值在区块链上的存储地址并将该存储地址作为值,生成对应于所述原始数据的键值对;Using the hash value as a primary key, obtaining the storage address of the hash value on the blockchain and using the storage address as a value to generate a key-value pair corresponding to the original data;接收数据验证端发送的数据查询请求,其中,所述查询请求中包括目标数据的哈希值,且所述目标数据为对应于所述原始数据的数据;Receiving a data query request sent by a data verification terminal, wherein the query request includes a hash value of target data, and the target data is data corresponding to the original data;根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;According to the query request, determine whether it is possible to obtain a key-value pair that matches the hash value in the query request;若是,向数据验证端发送第一预设信息,其中,所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;If yes, send first preset information to the data verification end, where the first preset information includes: a storage address in a key-value pair that matches the hash value in the query request;若否,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值。If not, send second preset information to the data verification terminal, where the preset information includes: a null value.
- 根据权利要求8所述的一种基于区块链的数据验证方法,其特征在于,所述获取针对原始数据端的哈希值,包括:The method for data verification based on blockchain according to claim 8, wherein said obtaining the hash value for the original data terminal comprises:实时监测区块链上的区块的变化情况,在区块链上新增区块时,从所述区块中获取针对原始数据的哈希值。Real-time monitoring of the changes of blocks on the blockchain, and when a block is added to the blockchain, the hash value for the original data is obtained from the block.
- 一种基于区块链的数据验证方法,其特征在于,应用于数据验证***,数据验证***包括原始数据端、区块链网络、数据验证端以及数据审计端,所述方法包括:A block chain-based data verification method is characterized in that it is applied to a data verification system. The data verification system includes an original data terminal, a blockchain network, a data verification terminal, and a data audit terminal. The method includes:原始数据端针对原始数据端中的原始数据,获取所述原始数据的哈希值,并将所述哈希值发送至区块链;The original data terminal obtains the hash value of the original data for the original data in the original data terminal, and sends the hash value to the blockchain;区块链网络接收针对原始数据的哈希值,将该哈希值存储在区块链的最新区块上;The blockchain network receives the hash value for the original data, and stores the hash value on the latest block of the blockchain;数据审计端获取针对原始数据端的哈希值;将所述哈希值作为主键, 获取该哈希值在区块链上的存储地址并将该存储地址作为值,生成对应于所述原始数据的键值对;The data audit terminal obtains the hash value for the original data terminal; uses the hash value as the primary key, obtains the storage address of the hash value on the blockchain, and uses the storage address as the value to generate the data corresponding to the original data. Key-value pair数据验证端根据对应于原始数据的目标数据,获取所述目标数据的哈希值;将所述哈希值编码至查询请求中,并将所述查询请求发送至数据审计端;The data verification terminal obtains the hash value of the target data according to the target data corresponding to the original data; encodes the hash value into a query request, and sends the query request to the data audit terminal;数据审计端接收数据验证端发送的数据查询请求,根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;若是,向数据验证端发送第一预设信息,其中,所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;若否,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值;所述数据审计端中存储有对应于目标数据的键值对,且所述键值对包括原始数据的哈希值和该哈希值在区块链上的存储地址,其中,所述原始数据为对应于所述目标数据的数据;The data audit terminal receives the data query request sent by the data verification terminal, and determines whether it can obtain the key-value pair matching the hash value in the query request according to the query request; if so, sends the first preset to the data verification terminal Information, wherein the first preset information includes: the storage address in the key-value pair that matches the hash value in the query request; if not, the second preset information is sent to the data verification end, where all The preset information includes: a null value; the data audit terminal stores a key-value pair corresponding to the target data, and the key-value pair includes the hash value of the original data and the hash value on the blockchain A storage address, wherein the original data is data corresponding to the target data;接收数据审计端返回的响应结果,其中,所述响应结果包括:第一预设信息或者第二预设信息。Receive the response result returned by the data audit terminal, where the response result includes: the first preset information or the second preset information.
- 一种基于区块链的数据验证装置,其特征在于,应用于原始数据端,所述装置包括:A block chain-based data verification device is characterized in that it is applied to the original data terminal, and the device includes:第一获取模块,用于针对原始数据端中的原始数据,获取所述原始数据的哈希值,并将所述哈希值发送至区块链,以使区块链将该哈希值存储在区块链的最新区块上,并使所述数据审计端生成对应于所述原始数据的哈希值的键值对,并根据所述键值对审计对应于所述原始数据的目标数据是否与原始数据一致。The first obtaining module is used to obtain the hash value of the original data for the original data in the original data terminal, and send the hash value to the block chain, so that the block chain stores the hash value On the latest block of the blockchain, and make the data audit terminal generate a key-value pair corresponding to the hash value of the original data, and audit the target data corresponding to the original data according to the key-value pair Whether it is consistent with the original data.
- [根据细则91更正 02.04.2020]
根据权利要求11的一种基于区块链的数据验证装置,其特征在于,所述装置还包括:第二获取模块,用于获取原始数据端获取原始数据时的时间戳,并将所述时间戳发送至区块链,以使区块链将该哈希值与时间戳存储在区块链的最新区块上。[Corrected according to Rule 91 02.04.2020]
A block chain-based data verification device according to claim 11, wherein the device further comprises:The second obtaining module is used to obtain the time stamp when the original data terminal obtains the original data, and send the time stamp to the blockchain, so that the blockchain stores the hash value and the time stamp in the block chain. On the latest block. - [根据细则91更正 02.04.2020]
根据权利要求12所述的一种基于区块链的数据验证装置,其特征在于,所述第二获取模块,用于:将哈希值与时间戳进行拼接,得到拼接后的结果;将拼接后的结果发送至区块链;所述区块链将该哈希值与时间戳存储在区块链的最新区块上,包括:区块链将拼接后的结果存储在区块链的最新区块上。[Corrected according to Rule 91 02.04.2020]
The block chain-based data verification device according to claim 12, wherein the second acquisition module is configured to:The hash value and the timestamp are spliced together to obtain the spliced result;Send the spliced result to the blockchain;The block chain stores the hash value and timestamp on the latest block of the block chain, including:The blockchain stores the spliced result in the latest block of the blockchain. - [根据细则91更正 02.04.2020]
基于权利要求11-13任一项所述的一种基于区块链的数据验证装置,其特征在于,应用于区块链网络,所述装置包括:第一接收模块,用于接收针对原始数据的哈希值,将该哈希值存储在区块链的最新区块上。[Corrected according to Rule 91 02.04.2020]
A blockchain-based data verification device according to any one of claims 11-13, which is characterized in that it is applied to a blockchain network, and the device comprises:The first receiving module is used to receive the hash value for the original data, and store the hash value on the latest block of the blockchain. - [根据细则91更正 02.04.2020]
根据权利要求14所述的一种基于区块链的数据验证装置,其特征在于,所述装置还包括:第二接收模块,用于接收原始数据端发送的生成原始数据的哈希值时的时间戳,将所述时间戳与所述哈希值存储在同一个区块中。[Corrected according to Rule 91 02.04.2020]
The block chain-based data verification device according to claim 14, wherein the device further comprises:The second receiving module is configured to receive the timestamp when the hash value of the original data is generated from the original data terminal, and store the timestamp and the hash value in the same block. - [根据细则91更正 02.04.2020]
根据权利要求15所述的一种基于区块链的数据验证装置,其特征在于,所述第二接收模块,用于:接收原始数据端发送的拼接结果,将拼接后的结果存储在区块链的最 新区块上,其中,所述拼接结果为原始数据端将哈希值与时间戳进行拼接后得到的。[Corrected according to Rule 91 02.04.2020]
The block chain-based data verification device according to claim 15, wherein the second receiving module is configured to:Receive the splicing result sent by the original data end, and store the spliced result on the latest block of the blockchain, where the splicing result is obtained by splicing the hash value and the timestamp on the original data end. - [根据细则91更正 02.04.2020]
基于权利要求11-16任一项所述的一种基于区块链的数据验证装置,其特征在于,应用于数据验证端,所述装置包括:第三获取模块,用于根据对应于原始数据的目标数据,获取所述目标数据的哈希值;将所述哈希值编码至查询请求中,并将所述查询请求发送至数据审计端,以使数据审计端根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;若是,向数据验证端发送第一预设信息,其中,所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;若否,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值;所述数据审计端中存储有对应于目标数据的键值对,且所述键值对包括原始数据的哈希值和该哈希值在区块链上的存储地址,其中,所述原始数据为对应于所述目标数据的数据;第三接收模块,用于接收数据审计端返回的响应结果,其中,所述响应结果包括:第一预设信息或者第二预设信息。[Corrected according to Rule 91 02.04.2020]
A block chain-based data verification device based on any one of claims 11-16, characterized in that, applied to a data verification terminal, the device comprises:The third obtaining module is configured to obtain the hash value of the target data according to the target data corresponding to the original data;Encode the hash value into a query request, and send the query request to the data auditing terminal, so that the data auditing terminal can determine whether it can obtain a match with the hash value in the query request according to the query request If yes, send first preset information to the data verification end, where the first preset information includes: the storage address in the key-value pair that matches the hash value in the query request; if No, send second preset information to the data verification terminal, where the preset information includes: a null value; the data audit terminal stores a key-value pair corresponding to the target data, and the key-value pair includes the original The hash value of the data and the storage address of the hash value on the blockchain, wherein the original data is data corresponding to the target data;The third receiving module is configured to receive the response result returned by the data auditing terminal, where the response result includes: the first preset information or the second preset information. - [根据细则91更正 02.04.2020]
基于权利要求11-17任一项所述的一种基于区块链的数据验证装置,其特征在于,应用于数据审计端,所述装置包括:第四获取模块,用于获取针对原始数据端的哈希值;生成模块,用于将所述哈希值作为主键,获取该哈希值在区块链上的存储地址并将该存储地址作为值,生成对应于所述原始数据的键值对;第四接收模块,用于接收数据验证端发送的数据查询请求,其中,所 述查询请求中包括目标数据的哈希值,且所述目标数据为对应于所述原始数据的数据;判断模块,应用于根据所述查询请求,判断是否能够获取与所述查询请求中的哈希值匹配的键值对;第一发送模块,用于在所述判断模块的判断结果为是的情况下,向数据验证端发送第一预设信息,其中,所述第一预设信息包括:与所述查询请求中的哈希值匹配的键值对中的存储地址;第二发送模块,用于在所述判断模块的判断结果为否的情况下,向数据验证端发送第二预设信息,其中,所述预设信息包括:空值。[Corrected according to Rule 91 02.04.2020]
A blockchain-based data verification device based on any one of claims 11-17, which is characterized in that it is applied to a data audit terminal, and the device comprises:The fourth obtaining module is used to obtain the hash value for the original data terminal;A generating module, configured to use the hash value as a primary key, obtain the storage address of the hash value on the blockchain, and use the storage address as a value to generate a key-value pair corresponding to the original data;A fourth receiving module, configured to receive a data query request sent by a data verification terminal, wherein the query request includes a hash value of target data, and the target data is data corresponding to the original data;The judging module is used to judge whether the key-value pair matching the hash value in the query request can be obtained according to the query request;The first sending module is configured to send first preset information to the data verification terminal when the judgment result of the judgment module is yes, where the first preset information includes: The storage address in the key-value pair matched by the hash value;The second sending module is configured to send second preset information to the data verification terminal when the judgment result of the judgment module is no, where the preset information includes: a null value. - [根据细则91更正 02.04.2020]
根据权利要求18所述的一种基于区块链的数据验证装置,其特征在于,所述第四获取模块,用于:实时监测区块链上的区块的变化情况,在区块链上新增区块时,从所述区块中获取针对原始数据的哈希值。[Corrected according to Rule 91 02.04.2020]
The block chain-based data verification device according to claim 18, wherein the fourth acquisition module is configured to:Real-time monitoring of the changes of blocks on the blockchain, and when a block is added to the blockchain, the hash value for the original data is obtained from the block. - [根据细则91更正 02.04.2020]
一种基于区块链的数据验证***,其特征在于,所述***包括;根据权利要求11-13所述的原始数据端;根据权利要求14-16所述的区块链网络;根据权利要求17所述的数据验证端;根据权利要求18或者19所述的数据验证端。[Corrected according to Rule 91 02.04.2020]
A data verification system based on blockchain, characterized in that, the system includes;The original data terminal according to claims 11-13;The blockchain network according to claims 14-16;The data verification terminal according to claim 17;The data verification terminal according to claim 18 or 19.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/078038 WO2021174499A1 (en) | 2020-03-05 | 2020-03-05 | Blockchain-based data verification method, apparatus and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2020/078038 WO2021174499A1 (en) | 2020-03-05 | 2020-03-05 | Blockchain-based data verification method, apparatus and system |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021174499A1 true WO2021174499A1 (en) | 2021-09-10 |
Family
ID=77613781
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/078038 WO2021174499A1 (en) | 2020-03-05 | 2020-03-05 | Blockchain-based data verification method, apparatus and system |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2021174499A1 (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114172922A (en) * | 2021-11-08 | 2022-03-11 | 北京标信智链科技有限公司 | Sharing method and sharing device for credit data of transaction main body based on block chain |
CN114579581A (en) * | 2022-05-05 | 2022-06-03 | 武汉北大高科软件股份有限公司 | Data supervision method and device based on block chain |
CN114629892A (en) * | 2022-03-02 | 2022-06-14 | 杭州趣链科技有限公司 | Work comment method, system, electronic device and storage medium |
CN117221015A (en) * | 2023-11-09 | 2023-12-12 | 北京东方森太科技发展有限公司 | Industrial control host safety management method based on block chain technology |
GB2622906A (en) * | 2022-09-28 | 2024-04-03 | K4 Security Co Ltd | Device and method for data high-speed processing blockchain-based |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109101577A (en) * | 2018-07-19 | 2018-12-28 | 清华大学 | A kind of data circulation method, apparatus and system |
CN109639410A (en) * | 2018-10-31 | 2019-04-16 | 阿里巴巴集团控股有限公司 | Data based on block chain deposit card method and device, electronic equipment |
US20190266146A1 (en) * | 2016-11-10 | 2019-08-29 | Saavha, Inc. | Secure auditing system based on verified hash algorithm |
CN110399338A (en) * | 2019-04-13 | 2019-11-01 | 西安电子科技大学 | Distributed document directory system and method, cloud storage service device based on block chain |
-
2020
- 2020-03-05 WO PCT/CN2020/078038 patent/WO2021174499A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20190266146A1 (en) * | 2016-11-10 | 2019-08-29 | Saavha, Inc. | Secure auditing system based on verified hash algorithm |
CN109101577A (en) * | 2018-07-19 | 2018-12-28 | 清华大学 | A kind of data circulation method, apparatus and system |
CN109639410A (en) * | 2018-10-31 | 2019-04-16 | 阿里巴巴集团控股有限公司 | Data based on block chain deposit card method and device, electronic equipment |
CN110399338A (en) * | 2019-04-13 | 2019-11-01 | 西安电子科技大学 | Distributed document directory system and method, cloud storage service device based on block chain |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114172922A (en) * | 2021-11-08 | 2022-03-11 | 北京标信智链科技有限公司 | Sharing method and sharing device for credit data of transaction main body based on block chain |
CN114629892A (en) * | 2022-03-02 | 2022-06-14 | 杭州趣链科技有限公司 | Work comment method, system, electronic device and storage medium |
CN114629892B (en) * | 2022-03-02 | 2024-05-03 | 杭州趣链科技有限公司 | Work comment method, system, electronic device and storage medium |
CN114579581A (en) * | 2022-05-05 | 2022-06-03 | 武汉北大高科软件股份有限公司 | Data supervision method and device based on block chain |
GB2622906A (en) * | 2022-09-28 | 2024-04-03 | K4 Security Co Ltd | Device and method for data high-speed processing blockchain-based |
US12013833B2 (en) | 2022-09-28 | 2024-06-18 | K4-security.co., Ltd | Blockchain-based high-speed data processing device and method thereof |
CN117221015A (en) * | 2023-11-09 | 2023-12-12 | 北京东方森太科技发展有限公司 | Industrial control host safety management method based on block chain technology |
CN117221015B (en) * | 2023-11-09 | 2024-01-05 | 北京东方森太科技发展有限公司 | Industrial control host safety management method based on block chain technology |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021174499A1 (en) | Blockchain-based data verification method, apparatus and system | |
CN110912937B (en) | Block chain-based digital certificate storage platform and certificate storage method | |
US11270308B2 (en) | Shared blockchain data storage | |
US10892898B2 (en) | Shared blockchain data storage | |
US10944567B2 (en) | Shared blockchain data storage | |
CN111414649B (en) | Data verification method and system based on block chain | |
CN110933163B (en) | Block chain contract deployment method, device, equipment and storage medium | |
US20190130190A1 (en) | Media authentication using distributed ledger | |
CN111539750A (en) | Commodity traceability system based on block chain and big data technology | |
CN109002725A (en) | Data processing system based on block chain | |
US11250428B2 (en) | Managing transaction requests in ledger systems | |
CN105933374B (en) | A kind of mobile terminal data backup method, system and mobile terminal | |
WO2022193984A1 (en) | Cross-chain data transmission method and apparatus, and computer device, storage medium and computer program product | |
US11455631B2 (en) | Managing transaction requests in ledger systems | |
US11194792B2 (en) | Taking snapshots of blockchain data | |
CN111429136A (en) | Data auditing method and device based on block chain | |
CN115225409A (en) | Cloud data safety deduplication method based on multi-backup joint verification | |
CN111414418B (en) | Data storage method and device based on block chain | |
CN117633843A (en) | Data encryption storage method and system based on blockchain | |
CN105391739B (en) | A kind of cloud calamity is for data integrity verifying method | |
Wu et al. | MEChain: A multi-layer blockchain structure with hierarchical consensus for secure EHR system | |
US11455297B2 (en) | Managing transaction requests in ledger systems | |
CN114499896B (en) | Real name authentication method and system based on block chain | |
US20240275619A1 (en) | Data Backups Using Multiple Blockchains | |
CN118297594A (en) | Resource processing method, device, computer equipment and blockchain system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20922806 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20922806 Country of ref document: EP Kind code of ref document: A1 |