Blockchain-based data verification method and apparatus

By using a blockchain-based data verification method combined with zero-knowledge proof technology, the privacy issue in data validity evaluation is resolved, and reliable data circulation is achieved.

CN116366343BActive Publication Date: 2026-06-30INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2023-03-31
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

In existing technologies, it is difficult to evaluate the validity of data without compromising the privacy of the data owner, which hinders the flow of data.

Method used

A blockchain-based data verification method is adopted. By receiving data verification information from clients, using verification nodes and smart contracts in the blockchain network, and combining zero-knowledge proof technology, the validity of the data is evaluated, and transaction certificates are generated and broadcast on the chain to ensure data privacy.

Benefits of technology

It enables the evaluation of data validity without compromising data privacy, protects the rights of data holders, and ensures the reliability of data circulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116366343B_ABST
    Figure CN116366343B_ABST
Patent Text Reader

Abstract

This invention provides a blockchain-based data verification method and apparatus, relating to the field of blockchain technology and applicable to the financial technology field or other technical fields. The blockchain-based data verification method includes: receiving data verification information from a client; wherein the data verification information includes data to be tested, a data model, an expected value, and an error value; determining the actual data based on the data to be tested and the data model; determining the verification result based on the actual data, the expected value, and the error value; and sending the verification result to the client. This invention can achieve data validity evaluation while protecting the privacy of the data holder's data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of blockchain technology, and more specifically, to a data verification method and apparatus based on blockchain. Background Technology

[0002] With the rapid development of the internet, data has become a key element of the digital economy and one of the five major factors of production. However, data faces challenges such as difficulty in establishing trust, difficulty in confirming ownership, and ease of copying. People cannot ascertain the validity of data before acquiring it, and once acquired, the data owner has already lost ownership, making it difficult for truly valuable data to circulate and benefit the public. Therefore, there is an urgent need for a value assessment system that, using technologies such as blockchain, privacy computing, and cryptographic algorithms, can evaluate the value of data even without ownership rights, protecting the rights of data owners and promoting data sharing and circulation.

[0003] Currently, there is no mature decentralized data evaluation system in the industry. The authenticity and validity of data are generally guaranteed by the following methods:

[0004] 1. Method 1: External certification. The value of the data is endorsed by an authoritative institution. The collected data is evaluated and analyzed through data models. The testing has certain costs and requires investment of human and financial resources. At the same time, the testing party and the tested party usually have a legal contract to prevent the risk of data leakage.

[0005] 2. Method Two: Self-certification by the organization. Similar to Method One, the data value is endorsed by the owner, and the user can only assess the data value through indirect means such as the organization's social influence.

[0006] Under normal circumstances, data owners do not publish all of their data. Instead, they calculate the results based on statistical models provided by data users to protect their own interests. In recent years, privacy computing technology has been proposed to further protect the privacy of data owners and users, separating the right to use data from the right to own it. However, this technology only addresses data privacy; it cannot solve the problem of data validity.

[0007] In conclusion, the main pain point that hinders data flow is the lack of a good way for data users to objectively evaluate the data quality of data owners without leaking the data. Summary of the Invention

[0008] The main objective of this invention is to provide a blockchain-based data verification method and apparatus to evaluate the validity of data while protecting the privacy of the data holder's data.

[0009] To achieve the above objectives, embodiments of the present invention provide a blockchain-based data verification method, applied to verification nodes, which constitute a blockchain network; the blockchain-based data verification method includes:

[0010] Receive data verification information from the client; the data verification information includes the data to be detected, the data model, the expected value, and the error value.

[0011] The actual data is determined based on the data to be tested and the data model.

[0012] The verification results are determined based on actual data, expected values, and error values.

[0013] Send the verification result to the client.

[0014] In one embodiment, determining the verification result based on actual data, expected value, and error value includes:

[0015] Determine the actual error based on actual data and expected values;

[0016] The verification result is determined based on the actual error and the error value.

[0017] In one embodiment, determining the actual data based on the data to be detected and the data model includes:

[0018] Extract fingerprints from the data to be tested;

[0019] When the comparison result between the fingerprint of the data to be detected and the fingerprint of the registered data meets the preset requirements, the actual data is determined based on the data to be detected and the data model.

[0020] In one embodiment, it further includes:

[0021] Transaction credentials are generated based on the verification results and data verification information, and then broadcast on the blockchain so that each node can verify the transaction credentials.

[0022] The verification result in the Easy Certificate is updated based on feedback from each node in the blockchain network.

[0023] In one embodiment, updating the verification result in the easy credential based on feedback from nodes in the blockchain network includes:

[0024] Update the verification results in the transaction certificate based on fraud proofs from various nodes in the blockchain network; or

[0025] The verification results in the transaction certificate are updated based on the voting information from each node in the blockchain network.

[0026] In one embodiment, it further includes:

[0027] Receive shared data registration transactions from clients and retrieve the data to be registered from the data source in the shared data registration transactions;

[0028] Generate registration data fingerprints based on the data to be registered.

[0029] This invention also provides a blockchain-based data verification device, comprising:

[0030] The receiving module receives data verification information from the client; this data verification information includes the data to be detected, the data model, the expected value, and the error value.

[0031] The actual data determination module is used to determine the actual data based on the data to be detected and the data model.

[0032] The verification module is used to determine the verification results based on actual data, expected values, and error values.

[0033] The sending module is used to send the verification result to the client.

[0034] In one embodiment, the verification module includes:

[0035] The actual error unit is used to determine the actual error based on the actual data and the expected value.

[0036] The verification result unit is used to determine the verification result based on the actual error and the error value.

[0037] In one embodiment, the actual data determination module includes:

[0038] The data fingerprint extraction unit is used to extract the fingerprint of the data to be detected based on the data to be detected.

[0039] The actual data determination unit is used to determine the actual data based on the data to be detected and the data model when the comparison result between the fingerprint of the data to be detected and the fingerprint of the registered data meets the preset requirements.

[0040] In one embodiment, it further includes:

[0041] The transaction certificate module is used to generate transaction certificates based on the verification results and data verification information, and broadcast the transaction certificates on the blockchain so that each node can verify the transaction certificates;

[0042] The verification result update module is used to update the verification result in the transaction certificate based on the feedback results from each node in the blockchain network.

[0043] In one embodiment, the verification result update module includes:

[0044] The first verification result update unit is used to update the verification result in the easy credential based on fraud proofs from each node in the blockchain network; or

[0045] The second verification result update unit is used to update the verification result in the easy certificate based on the voting information from each node in the blockchain network.

[0046] In one embodiment, it further includes:

[0047] The module for acquiring data to be registered is used to receive shared data registration transactions from clients and acquire the data to be registered from the data source in the shared data registration transactions;

[0048] The data fingerprint registration module is used to generate registration data fingerprints based on the data to be registered.

[0049] This invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the blockchain-based data verification method.

[0050] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the blockchain-based data verification method.

[0051] This invention also provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the blockchain-based data verification method.

[0052] The blockchain-based data verification method and apparatus of this invention first determines the actual data based on the data to be tested and the data model from the client, and then determines the verification result based on the actual data, expected value and error value before returning it to the client. This can realize the validity evaluation of the data while protecting the privacy of the data holder's data. Attached Figure Description

[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 This is a schematic diagram of the network topology of the blockchain-based data verification method in this embodiment of the invention;

[0055] Figure 2This is a flowchart of a blockchain-based data verification method in an embodiment of the present invention;

[0056] Figure 3 This is a flowchart of the data validity proof in an embodiment of the present invention;

[0057] Figure 4 This is a flowchart of data fraud proof in an embodiment of the present invention;

[0058] Figure 5 This is a flowchart of the registration data in an embodiment of the present invention;

[0059] Figure 6 This is a flowchart of S102 in an embodiment of the present invention;

[0060] Figure 7 This is a flowchart of S103 in an embodiment of the present invention;

[0061] Figure 8 This is a flowchart of updating the verification result in an embodiment of the present invention;

[0062] Figure 9 This is a flowchart of S402 in an embodiment of the present invention;

[0063] Figure 10 This is a structural block diagram of a blockchain-based data verification device in an embodiment of the present invention;

[0064] Figure 11 This is a structural diagram of a blockchain node in an embodiment of the present invention;

[0065] Figure 12 This is a structural diagram of the verification node in an embodiment of the present invention;

[0066] Figure 13 This is a schematic diagram of off-chain computation and on-chain verification in an embodiment of the present invention;

[0067] Figure 14 This is a schematic block diagram illustrating the system configuration of an electronic device 9600 according to an embodiment of this application. Detailed Implementation

[0068] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0069] Those skilled in the art will recognize that embodiments of the present invention can be implemented as a system, apparatus, device, method, or computer program product. Therefore, this disclosure can be specifically implemented in the following forms: entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.

[0070] The acquisition, storage, use, and processing of data in this application comply with relevant laws and regulations.

[0071] The terms involved in this invention are explained as follows:

[0072] Consortium blockchain: A consortium blockchain is a form between public and private blockchains, in which several organizations jointly maintain the same blockchain.

[0073] Trusted Execution Environment (TEE): A TEE is an independent processing environment with computation and storage capabilities, providing security and integrity protection. Its basic idea is to allocate a separate, isolated memory block within the hardware for sensitive data. All computations on sensitive data are performed within this memory block, and no other part of the hardware can access the information in this isolated memory block except through authorized interfaces, thereby achieving privacy-preserving computations on sensitive data.

[0074] Zero-knowledge proof: Zero-knowledge proof is a highly secure cryptographic technique. In proving one's right to a certain right, the prover reveals no useful information to the outside world; the outside world has zero knowledge of the relevant information. The verifier, besides verifying the validity of the prover's statement, receives no other useful information.

[0075] Validity proof: This is a mathematical proof that uses zero-knowledge proof cryptographic algorithms to ensure the validity of a transaction.

[0076] Fraud Proof: This proof introduces a mechanism called Dispute Time Delay (DTD). This protocol allows for objections to the erroneous status within a disputed period. If no evidence of fraud is submitted within the DTD, the data is considered correct; otherwise, the violating party will be penalized. Generally, the longer the DTD, the higher the probability of detecting the error.

[0077] Given the current lack of a mature decentralized data evaluation system in the industry, this invention provides a blockchain-based data verification method and apparatus. By combining blockchain and zero-knowledge proof technology, it achieves data validity evaluation while protecting the data privacy of the data holder. The invention will be described in detail below with reference to the accompanying drawings.

[0078] Figure 1 This is a schematic diagram of the network topology of the blockchain-based data verification method in an embodiment of the present invention. Figure 1 As shown, the network topology includes "Data Evaluation Network 1", "Blockchain Node 2", "Proof Smart Contract 3", "Verification Node 4", "Data Source 5" and "Client Node 6".

[0079] "Data Evaluation Network 1" is a blockchain value assessment network jointly operated by multiple participants. Each participant deploys "Blockchain Node 2" and "Verification Node 4". The "Blockchain Node 2" nodes are interconnected and a "Proof Smart Contract 3" is also deployed. The "Verification Node 4" nodes can access each other and their own "Data Source 5". Each participant can have one or more "Client Nodes 6" to receive the data evaluation results or raise doubts about the authenticity of the data.

[0080] Unlike traditional blockchain nodes, “Blockchain Node 2” not only provides evidence storage functions for tracing data source fingerprints, validity proofs, and fraud proofs, but also provides off-chain computing on-chain trust capabilities, with on-chain data shared among all nodes in a transparent and open manner.

[0081] "Proof Smart Contract 3" is used to store information such as data source fingerprints, validity proofs, and fraud proofs.

[0082] Verification Node 4 primarily performs three functions:

[0083] 1) Register data source: This is used to register a shared data source on the blockchain network. Registration requires providing the data fingerprint of the data source, which is stored on the chain to prevent the data from being maliciously tampered with after sharing, causing data distortion.

[0084] 2) Authenticity detection: "Verification Node 4" will periodically scan the data source and calculate the fingerprint of the off-chain data source. If it is inconsistent with the information stored on the chain, it will notify all participants that the data has changed, and the data provider will need to re-register.

[0085] 3) Generate proofs, used to generate proofs of validity and proofs of fraud:

[0086] 1. Validity proof: Proving the authenticity of the data to be verified. There are two types of proof methods: 1) Common mathematical statistical models, such as summation, mean, variance, standard deviation, extreme values, etc.; 2) Custom data statistical models, with input parameters for validity proof methods in the form of:

[0087] function(data_source,verify_method,expected_value,error_value){...}

[0088] The meanings of these four parameters are as follows:

[0089] data_source: The data source, i.e. the data to be evaluated. Each participant will store the data they want to share in "data source 5", which is usually a database or file system.

[0090] verify_method: The verification method can use general data model statistical methods such as summation, mean, variance, standard deviation, extreme values, etc., or a custom data model can be used.

[0091] expected_value: The expected value refers to the value predicted by the proof method after calculating the data.

[0092] error_value: Error value, which is the absolute value of the difference between the expected value and the actual value calculated from the data to be evaluated.

[0093] For example, to assess the authenticity and validity of Chinese census data held by an organization, a method for proving validity could be based on the male-to-female ratio (e.g., a ratio of 104:100, with 100 females), with an error margin of 0.1. The pseudocode would be:

[0094] function(data source of a certain institution, percentage, 1.04, 0.1){ ...

[0096] if(|Vmale:Vfemale-1.04|≤0.1)

[0097] return"{"result":"true","proof":"..."}"

[0098] else

[0099] return"{"result":"false","proof":"..."}" ...

[0101] }

[0102] 2. Fraud Proof: This method is used to suspect that a validity proof is fraudulent (invalid). Compared with the validity proof, the fraud proof has an additional proof parameter, "proof". The input parameters of the method are shown below. If the fraud proof passes and is approved by the votes of all participants, the data provider will be penalized.

[0103] function(proof,verify_method,expected_value,error_value)

[0104] Proof: A proof credential is a unique key returned to the client after validity verification. This unique key allows you to query relevant information about the validity proof on the blockchain, such as the data source, proof method, and proof itself.

[0105] "Data Source 5" is the carrier of shared data for each participant, usually a database or file system. The data in the data source is stored in an encrypted manner, and the key is kept by each participant.

[0106] "Client Node 6" is the initiator of the validity proof and fraud proof transactions. At the same time, each client has the right to vote on the fraud proof on the chain.

[0107] Figure 2 This is a flowchart of a blockchain-based data verification method in an embodiment of the present invention. Figure 3 This is a flowchart of the data validity verification in an embodiment of the present invention. Figure 4 This is a flowchart illustrating the data fraud proof in an embodiment of the present invention. For example... Figures 2 to 4 As shown, the blockchain-based data verification method is applied to verification nodes, which constitute a blockchain network; the data verification method includes:

[0108] S101: Receive data verification information from the client.

[0109] The data validation information includes the data to be tested, the data model, the expected value, and the error value.

[0110] When a participant wants to evaluate the validity of data, they will initiate a data validity verification transaction through the client, executed asynchronously. If a user suspects the validity verification is fraudulent, they can raise doubts about the verification proof.

[0111] like Figures 3-4 As shown, in practice, the client displays a data list (when proving data validity, the data list is the list of registered data; when proving data fraud, the data list is the list of valid proof credentials) and initiates a registration data query transaction. The verification node (data evaluator) receives the transaction and verifies the correctness of the message. After successful verification, it calls the on-chain module to query the data list and assemble it into a transaction message.

[0112] Blockchain nodes receive transaction messages from validating nodes and verify their correctness. Simultaneously, they invoke smart contracts to query the shared data information (data list, data verification information) registered on the chain and return the shared data list through the validating nodes (data evaluators).

[0113] The client displays a list of shared data, and the user selects data for verification and initiates a verification transaction (when verifying data validity, the user selects data for validity verification; when verifying data fraud, the user selects an unaccepted proof to initiate fraud verification).

[0114] After receiving the client's transaction, the verification node (data evaluator) initiates an on-chain transaction.

[0115] Blockchain nodes record data verification information (evaluation information when proving data validity; suspicion information when proving data fraud), such as the data source (data to be tested), data model, expected value, and error value. Then, verification messages are delivered asynchronously (validity verification messages when proving data validity; fraud verification messages when proving data fraud) and the results are returned to the client.

[0116] The client receives the delivery information response and waits for the data verification result (validity verification message or fraud verification message).

[0117] Figure 5 This is a flowchart of the registration data in an embodiment of the present invention. For example... Figure 5 As shown, only after shared data is registered on the blockchain can other participants assess its validity and use it. The transaction process is triggered by the data holder's client. Blockchain-based data verification methods also include:

[0118] Receive shared data registration transactions from clients, retrieve data to be registered from the data source in the shared data registration transactions, and generate registration data fingerprints based on the data to be registered.

[0119] In practice, the data holder client initiates a shared data registration transaction. In addition to including the data source and dataset, the transaction can also specify the number of checks and suspicions, reducing the risk of inferring data values ​​due to multiple model calculations.

[0120] The verification node receives client information and verifies the correctness of transaction messages. It then calls the data registry module to initiate the shared data registration logic. Next, it calls the data acquisition module to access a data source, which can be a database or a file system. Finally, it calls the trusted execution environment scheduler to transfer the data to be registered to the trusted execution environment for hash calculation, generating a data fingerprint. After assembling the transaction message, it calls the on-chain module to register the shared data.

[0121] Blockchain nodes receive transactions uploaded to the chain, inspect the transaction messages, and then invoke smart contracts to store registration information on the chain, such as: <data source ID, data fingerprint, number of times it can be inspected, data provider, data validity, data consistency, etc.>. Afterwards, the shared data registration results are returned to the verification nodes.

[0122] The verification node initiates an authenticity verification module for newly registered data sources. This module periodically scans the newly registered data, and if the on-chain fingerprint differs from the off-chain fingerprint, the on-chain data state is rewritten. The node then returns the shared data registration result to the client, which receives the registration result.

[0123] S102: Determine the actual data based on the data to be tested and the data model.

[0124] The executing entity of S102 is the verification node (data holder). In this invention, the verification node (data holder) and the verification node (data evaluator) can be the same verification node. The verification node (data holder) holds the previously registered data fingerprint.

[0125] Figure 6 This is a flowchart of S102 in an embodiment of the present invention. For example... Figure 6 As shown, S102 includes:

[0126] S201: Extract the fingerprint of the data to be tested based on the data to be tested.

[0127] In practice, the verification node (data holder) receives the data to be tested, checks the correctness of the message, and then calls the data acquisition module to collect verification data (extract the fingerprint of the data to be tested).

[0128] S202: When the comparison result between the fingerprint of the data to be detected and the fingerprint of the registered data meets the preset requirements, the actual data is determined according to the data to be detected and the data model.

[0129] S103: Determine the verification results based on actual data, expected values, and error values.

[0130] Figure 7 This is a flowchart of S103 in an embodiment of the present invention. For example... Figure 7 As shown, S103 includes:

[0131] S301: Determine the actual error based on the actual data and the expected value.

[0132] S302: Determine the verification result based on the actual error and the error value.

[0133] Figure 8 This is a flowchart illustrating the updating of verification results in an embodiment of the present invention. For example... Figure 8 As shown, blockchain-based data verification methods also include:

[0134] S401: Generate a transaction certificate based on the verification results and data verification information, and broadcast the transaction certificate on the blockchain so that each node can verify the transaction certificate.

[0135] In practice, the verification node (data holder) calculates the data result (verification result, which can be a validity verification result or a fraud verification result) in a trusted execution environment, generates a transaction certificate, and initiates an on-chain notarization request. The certificate content includes: <certificate ID, data source, data fingerprint, verification model, expectation, error, actual value, proof result...>.

[0136] S402: Update the verification result in the Easy Certificate based on the feedback results from each node in the blockchain network.

[0137] If no fraud proof is received within the specified time, it indicates that all parties agree on the data. At this point, the on-chain module is invoked to update the on-chain certificate status.

[0138] Figure 9 This is a flowchart of S402 in an embodiment of the present invention. For example... Figure 9 As shown, S402 includes:

[0139] S501: Update the verification results in the transaction certificate based on fraud proofs from each node in the blockchain network; or

[0140] When proving the validity of data, the blockchain node calls the smart contract to record the validity verification result on the chain and waits for the fraud proof. If it is not received within the specified time, the data is considered valid, indicating that all parties agree.

[0141] S502: Update the verification result in the transaction certificate based on the voting information from each node in the blockchain network.

[0142] When proving data fraud, blockchain nodes call smart contracts to record the fraud verification results on the chain and wait for confirmation by all participants. If a majority of network nodes vote, the suspicion is considered valid, and the on-chain certificate status is updated to be suspicious.

[0143] S104: Send the verification result to the client.

[0144] In one embodiment, a validity verification message or fraud verification message can be pushed to the client through a verification node (data evaluator), and the client receives the validity verification result information or fraud verification message.

[0145] Figure 2 The execution entity of the blockchain-based data verification method shown can be a verification node. The verification node, blockchain node, and proof smart contract all reside on the same host. Figure 2As shown in the process, the blockchain-based data verification method of this invention first determines the actual data based on the data to be tested and the data model from the client, and then determines the verification result based on the actual data, expected value and error value and returns it to the client. This can realize the validity evaluation of the data, while protecting the privacy of the data holder's data.

[0146] Based on the same inventive concept, this invention also provides a blockchain-based data verification device. Since the principle of this device in solving the problem is similar to that of the blockchain-based data verification method, the implementation of this device can refer to the implementation of the method, and the repeated parts will not be described again.

[0147] Figure 10 This is a structural block diagram of a blockchain-based data verification device in an embodiment of the present invention. Figure 10 As shown, a blockchain-based data verification device is used in verification nodes, which constitute a blockchain network; the data verification device includes:

[0148] The receiving module receives data verification information from the client; this data verification information includes the data to be detected, the data model, the expected value, and the error value.

[0149] The actual data determination module is used to determine the actual data based on the data to be detected and the data model.

[0150] The verification module is used to determine the verification results based on actual data, expected values, and error values.

[0151] The sending module is used to send the verification result to the client.

[0152] In one embodiment, the verification module includes:

[0153] The actual error unit is used to determine the actual error based on the actual data and the expected value.

[0154] The verification result unit is used to determine the verification result based on the actual error and the error value.

[0155] In one embodiment, the actual data determination module includes:

[0156] The data fingerprint extraction unit is used to extract the fingerprint of the data to be detected based on the data to be detected.

[0157] The actual data determination unit is used to determine the actual data based on the data to be detected and the data model when the comparison result between the fingerprint of the data to be detected and the fingerprint of the registered data meets the preset requirements.

[0158] In one embodiment, it further includes:

[0159] The transaction certificate module is used to generate transaction certificates based on the verification results and data verification information, and broadcast the transaction certificates on the blockchain so that each node can verify the transaction certificates;

[0160] The verification result update module is used to update the verification result in the transaction certificate based on the feedback results from each node in the blockchain network.

[0161] In one embodiment, the verification result update module includes:

[0162] The first verification result update unit is used to update the verification result in the easy credential based on fraud proofs from each node in the blockchain network; or

[0163] The second verification result update unit is used to update the verification result in the easy certificate based on the voting information from each node in the blockchain network.

[0164] In one embodiment, it further includes:

[0165] The module for acquiring data to be registered is used to receive shared data registration transactions from clients and acquire the data to be registered from the data source in the shared data registration transactions;

[0166] The data fingerprint registration module is used to generate registration data fingerprints based on the data to be registered.

[0167] Figure 11 This is a structural diagram of a blockchain node in an embodiment of the present invention. Figure 12 This is a structural diagram of the verification node in an embodiment of the present invention. Figure 13 This is a schematic diagram illustrating off-chain computation and on-chain verification in an embodiment of the present invention. For example... Figure 11-13 As shown, in practical applications, blockchain-based data verification devices include:

[0168] A blockchain node includes a transaction receiving module, a logic control module, an off-chain transaction verifier, a smart contract executor, an event notification module, and a transaction response module. The logic control module and the off-chain transaction verifier are newly proposed modules in this invention.

[0169] The transaction receiving module of the blockchain node is responsible for receiving blockchain transaction requests, verifying the correctness of the transaction messages, and calling the logic main control module after successful verification.

[0170] The main logic control module of the blockchain node is responsible for selecting the scheduling unit based on the transaction message. If the transaction message is related to off-chain computation, the off-chain transaction validator is scheduled; otherwise, the smart contract executor is called directly.

[0171] Off-chain transaction validators are used to ensure that the results of off-chain transaction execution have not been tampered with and are authentic and trustworthy.

[0172] The smart contract executor selects and executes different smart contracts based on different transaction messages, and finally records the execution results on the blockchain.

[0173] The mechanism of the event notification module is similar to an asynchronous message queue. When performing validity verification, the evaluator will specify a data source to be verified, and the smart contract will store the verification information on the chain and deliver it to the event notification module (message producer).

[0174] The transaction response module is responsible for returning the message delivery result, not the final proof result. The validity and fraud proof execution speed are affected by two factors: 1) data volume (the larger the data volume, the longer the model computation time); and 2) network communication time. To further improve computation speed, this invention adopts an off-chain computation and on-chain proof storage model.

[0175] The verification node is a newly introduced node in this invention, which includes a transaction receiving module, a logic master control module, a data registrar, a data acquisition module, an authenticity verification module, a trusted execution environment scheduler, a transaction on-chain module, and a transaction response module.

[0176] The transaction receiving module of the verification node includes a receiving module responsible for receiving transaction requests. Verification node transactions can be divided into three main categories: 1) data registration transactions; 2) data value assessment (validity proof) and data value doubt (fraud proof); 3) model calculation transactions. The first two categories are initiated on the client side, while the last category is initiated on the blockchain side.

[0177] The logical control module of the verification node selects the scheduling unit based on the transaction message. If it is a data registration transaction, it schedules the data registrar; if it is a data value assessment transaction, it schedules the transaction on-chain module; and if it is a model calculation transaction, it schedules the data acquisition module.

[0178] The data registrar includes a data acquisition module and a data fingerprint registration module, used to register shared data on the blockchain. During registration, the data acquisition module is first scheduled to confirm the existence of the data to be shared. If it exists, the trusted execution environment scheduler is scheduled to extract the data fingerprint and store it on the blockchain. When data is successfully registered on the blockchain, the data registrar activates an authenticity verification module. This module periodically checks the consistency between the on-chain and off-chain data fingerprints. If a discrepancy occurs, the information is uploaded to the blockchain, notifying all participants that the data has changed.

[0179] The data acquisition module is responsible for accessing the data sources of the participants and transmitting the data to the Trusted Execution Environment scheduler.

[0180] The detection module is an independent daemon process. When shared data is registered on the chain, this module will periodically detect the shared data in the data source to prevent it from being maliciously tampered with.

[0181] The Trusted Execution Environment (TEE) scheduler includes a real data determination module and a verification module. It serves as the authorized interface for the TEE; no other module has access to it. In this invention, the TEE is used to calculate the data model and data fingerprint, and generates proof credentials. Finally, it calls the transaction on-chain module to save the results onto the blockchain.

[0182] The transaction on-chain module includes a transaction certificate module and a verification result update module. It is responsible for interacting with the blockchain and saving the transaction certificates generated by the verification nodes and the verification information initiated by the client onto the chain.

[0183] The transaction response module includes a sending module, which is responsible for returning the results to the client.

[0184] This invention aims to address how to trust the authenticity and validity of data provided by others in a distrustful internet environment. Since model calculations are time-consuming, it proposes off-chain computation with on-chain verification. Credentials are generated off-chain, and the credentials are verified on-chain to ensure the authenticity and reliability of off-chain data calculations.

[0185] like Figure 13 As shown, SY011 is the message listening module of the proof node, which is used to listen for verification messages.

[0186] SY012 is the transaction module of the proof node, which collects different data based on the content of the transaction message.

[0187] SY013 is the Trusted Execution Environment scheduler, used to invoke the Trusted Execution Environment.

[0188] SY013-1 is executed in a trusted execution environment. The first step is to receive the data to be detected and extract the fingerprint.

[0189] SY013-2 is executed in a trusted execution environment. The second step is to compare it with the data fingerprint in the message. If an inconsistency is found, it indicates that the calculation is invalid, thus preventing the data source from being maliciously tampered with.

[0190] SY013-3 is executed in a trusted execution environment, using the model to calculate the actual values.

[0191] SY013-4 is executed in a trusted execution environment, comparing the actual value with the expected value to evaluate whether it is within the error range.

[0192] SY013-5 is executed in a trusted execution environment and encrypted using the public key of the blockchain side.

[0193] SY014 is a proof node that calls the on-chain evidence storage module and the off-chain transaction validator.

[0194] SY015 is used by the off-chain transaction validator to decrypt using the node's private key. After decryption, it matches whether the credential information is consistent with the transaction information in the initiating message, such as the data source, data fingerprint, expectation, error, etc. If they are consistent, it means that the content before being passed into the trusted execution environment is consistent with the content calculated by the implementation model and has not been tampered with.

[0195] In summary, the blockchain-based data verification method and apparatus provided in this embodiment of the invention have the following beneficial effects:

[0196] (1) By using the idea of ​​zero-knowledge proof, the validity of data is evaluated by using validity proof and fraud proof, which ensures that the data holder's data will not be leaked. At the same time, the data user can evaluate the validity of the data through the data model.

[0197] (2) A scheme for off-chain computation and on-chain verification is proposed, which ensures the security of off-chain model computation through credentials and trusted execution environment;

[0198] (3) A verification node is proposed to support the functions of validity proof and fraud proof, and combined with the anti-tampering characteristics of blockchain, it prevents the forgery of shared data.

[0199] Figure 14 This is a schematic block diagram illustrating the system configuration of the electronic device 9600 according to an embodiment of this application. Figure 14 As shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It is worth noting that... Figure 14 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.

[0200] In one embodiment, the blockchain-based data verification method functionality can be integrated into the central processing unit 9100. The central processing unit 9100 can be configured to perform the following control:

[0201] Receive data verification information from the client; the data verification information includes the data to be detected, the data model, the expected value, and the error value.

[0202] The actual data is determined based on the data to be tested and the data model.

[0203] The verification results are determined based on actual data, expected values, and error values.

[0204] Send the verification result to the client.

[0205] As can be seen from the above description, the blockchain-based data verification method provided in this application first determines the actual data based on the data to be tested and the data model from the client, and then determines the verification result based on the actual data, expected value and error value and returns it to the client. This can realize the validity evaluation of the data, while protecting the privacy of the data holder's data.

[0206] In another implementation, the blockchain-based data verification device can be configured separately from the central processing unit 9100. For example, the blockchain-based data verification device can be configured as a chip connected to the central processing unit 9100, and the function of the blockchain-based data verification method can be realized through the control of the central processing unit.

[0207] like Figure 14 As shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily need to include these components. Figure 14 All components shown; in addition, the electronic device 9600 may also include Figure 14 For components not shown, please refer to existing technologies.

[0208] like Figure 14 As shown, the central processing unit 9100, sometimes also referred to as a controller or operating control, may include a microprocessor or other processor device and / or logic device, which receives inputs and controls the operation of various components of the electronic device 9600.

[0209] The memory 9140 may be, for example, one or more of a cache, flash memory, hard drive, removable media, volatile memory, non-volatile memory, or other suitable devices. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 9100 may execute the program stored in the memory 9140 to perform information storage or processing, etc.

[0210] Input unit 9120 provides input to central processing unit 9100. Input unit 9120 may be, for example, a keypad or touch input device. Power supply 9170 provides power to electronic device 9600. Display 9160 displays images and text. Display may be, for example, an LCD display, but is not limited thereto.

[0211] The memory 9140 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs. The memory 9140 can also be some other type of device. The memory 9140 includes a buffer 9141 (sometimes referred to as a buffer memory). The memory 9140 may include an application / function storage unit 9142 for storing application programs and function programs or processes for executing the operation of the electronic device 9600 via the central processing unit 9100.

[0212] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for the electronic device's communication functions and / or for performing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0213] The communication module 9110 is a transmitter / receiver 9110 that transmits and receives signals via the antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processing unit 9100 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.

[0214] Based on different communication technologies, multiple communication modules 9110 can be configured in the same electronic device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and receive audio input from the microphone 9132, thereby realizing typical telecommunications functions. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. Additionally, the audio processor 9130 is coupled to a central processing unit 9100, enabling on-device recording via the microphone 9132 and on-device playback of stored sound via the speaker 9131.

[0215] This invention also provides a computer-readable storage medium capable of implementing all steps of the blockchain-based data verification method in the above embodiments, where the execution subject is a server or client. The computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps of the blockchain-based data verification method in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0216] Receive data verification information from the client; the data verification information includes the data to be detected, the data model, the expected value, and the error value.

[0217] The actual data is determined based on the data to be tested and the data model.

[0218] The verification results are determined based on actual data, expected values, and error values.

[0219] Send the verification result to the client.

[0220] In summary, the computer-readable storage medium of this invention first determines the actual data based on the data to be detected and the data model from the client, and then determines the verification result based on the actual data, the expected value, and the error value before returning it to the client. This enables the evaluation of the validity of the data while protecting the privacy of the data holder's data.

[0221] This invention also provides a computer program product capable of implementing all steps of the blockchain-based data verification method in the above embodiments, where the execution subject is a server or client. The computer program product includes a computer program / instruction that, when executed by a processor, implements all steps of the blockchain-based data verification method in the above embodiments. For example, when the processor executes the computer program, it implements the following steps:

[0222] Receive data verification information from the client; the data verification information includes the data to be detected, the data model, the expected value, and the error value.

[0223] The actual data is determined based on the data to be tested and the data model.

[0224] The verification results are determined based on actual data, expected values, and error values.

[0225] Send the verification result to the client.

[0226] In summary, the computer program product of this invention first determines the actual data based on the data to be tested and the data model from the client, and then determines the verification result based on the actual data, expected value and error value before returning it to the client. This can achieve the validity evaluation of the data while protecting the privacy of the data holder's data.

[0227] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on its differences from other embodiments. In particular, hardware + program embodiments are relatively simple in description because they are fundamentally similar to method embodiments; relevant parts can be referred to the descriptions in the method embodiments.

[0228] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0229] While this application provides the method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive labor. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or client product execution, the methods shown in the embodiments or drawings can be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment).

[0230] While this specification provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes said elements is not excluded.

[0231] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing the embodiments of this specification, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.

[0232] Those skilled in the art will also know that, besides implementing the controller using purely computer-readable program code, the same functions can be achieved by logically programming the method steps, making the controller function as logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers (PLCs), and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the devices within it used to implement various functions can also be considered structures within that hardware component. Alternatively, the devices used to implement various functions can be considered as both software modules implementing the method and structures within a hardware component.

[0233] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0234] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0235] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0236] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0237] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0238] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0239] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, the embodiments of this specification can take the form of computer program products implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0240] The embodiments described in this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. The embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0241] The embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on its differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the embodiments in this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0242] The above description is merely an embodiment of the present specification and is not intended to limit the embodiments of the present specification. For those skilled in the art, various modifications and variations can be made to the embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of the present specification should be included within the scope of the claims of the embodiments of the present specification.

Claims

1. A data verification method based on blockchain, characterized in that, The data verification method is applied to verification nodes, which constitute a blockchain network; the data verification method includes: Receive data verification information from the client; wherein, the data verification information includes the data to be detected, the data model, the expected value, and the error value; The actual data is determined based on the data to be detected and the data model. The verification result is determined based on the actual data, the expected value, and the error value; Send the verification result to the client; The step of determining the actual data based on the data to be detected and the data model includes: Extract the fingerprint of the data to be detected based on the data to be detected; When the comparison result between the fingerprint of the data to be detected and the fingerprint of the registered data meets the preset requirements, the actual data is determined according to the data to be detected and the data model; The method further includes: receiving a shared data registration transaction from a client; obtaining data to be registered from the data source in the shared data registration transaction; and transmitting the data to be registered to a trusted execution environment to perform a hash operation to generate the registration data fingerprint. The method further includes: A transaction certificate is generated based on the verification result and the data verification information. The transaction certificate is then broadcast on the blockchain so that each node can verify the transaction certificate. The verification result includes a validity verification result or a fraud verification result. Update the verification result in the transaction certificate based on fraud proofs from each node in the blockchain network; or The verification result in the transaction certificate is updated based on the voting information from each node in the blockchain network.

2. The data verification method based on blockchain according to claim 1, characterized in that, Determining the verification result based on the actual data, the expected value, and the error value includes: The actual error is determined based on the actual data and the expected value; The verification result is determined based on the actual error and the error value.

3. A data verification device based on blockchain, characterized in that, The data verification device is applied to verification nodes, which constitute a blockchain network; the data verification device includes: The receiving module receives data verification information from the client; wherein the data verification information includes the data to be detected, the data model, the expected value, and the error value. The actual data determination module is used to determine the actual data based on the data to be detected and the data model. The verification module is used to determine the verification result based on the actual data, the expected value, and the error value. The sending module is used to send the verification result to the client; The actual data determination module includes: A data fingerprint extraction unit is used to extract a fingerprint of the data to be detected based on the data to be detected. The actual data determination unit is used to determine actual data based on the data to be detected and the data model when the comparison result between the data fingerprint to be detected and the registered data fingerprint meets the preset requirements. The device further includes: a data acquisition module for receiving a shared data registration transaction from a client and acquiring the data to be registered from the data source in the shared data registration transaction; The data fingerprint registration module is used to transmit the data to be registered to a trusted execution environment to perform hash operations and generate the registration data fingerprint; The device further includes a transaction certificate module, used to generate a transaction certificate based on the verification result and the data verification information, and broadcast the transaction certificate on the blockchain so that each node can verify the transaction certificate, wherein the verification result includes a validity verification result or a fraud verification result; The verification result update module includes a first verification result update unit, used to update the verification result in the transaction certificate based on fraud proofs from each node in the blockchain network; or a second verification result update unit, used to update the verification result in the transaction certificate based on voting information from each node in the blockchain network.

4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the blockchain-based data verification method according to any one of claims 1 to 2.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the blockchain-based data verification method according to any one of claims 1 to 2.

6. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the blockchain-based data verification method according to any one of claims 1 to 2.