Blockchain-based on-chain and off-chain data consistency verification method and related device

CN115544040BActive Publication Date: 2026-10-30TSINGHUA UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211289503.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-20
Publication Date
2026-10-30
Estimated Expiration
2042-10-20

AI Technical Summary

Technical Problem

[0004]基于上述问题,本申请提供了一种基于区块链的链上链下数据一致性验证方法及相关设备,以解决链上链下数据一致性验证时破坏区块链中心化节点性质、效率低、耗时长和成本高的问题

Benefits of technology

[0036]本申请公开的一种基于区块链的链上链下数据一致性验证方法,由于原始数据对应的数据评价信息存储在链下的描述文档源中,原始数据对应的元数据状态信息存证于区块链平台上。当需要验证链上链下数据一致性时,利用数据评价信息和元数据状态信息便能对链上链下数据的一致性进行验证,能够在避免引入中心化信任节点的同时保证链上链下数据的一致性。通过共识节点维护每个原始数据的元数据状态信息,避免验证时需要从头遍历所有区块,提高了验证效率,减少了验证时间,进而节省了验证成本。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115544040B_ABST
    Figure CN115544040B_ABST
Patent Text Reader

Abstract

The application discloses a blockchain-based on-chain and off-chain data consistency verification method and related equipment, comprising: in response to a verification request of the user for original data, the description document source sends a description document corresponding to the original data to the user; the user hashes an evaluation field in the data evaluation information to generate a plurality of hash values corresponding to the evaluation field; a target hash value is determined from the plurality of hash values; the user verifies an evaluation hash field in metadata state information corresponding to the original data on the blockchain according to the target hash value to obtain a consistency verification result of the target hash value and the evaluation hash field. The method of the application can verify the consistency of on-chain and off-chain data while avoiding the introduction of a centralized trust node, improve the efficiency of the verification process, reduce the time consumed in the verification process, and thus save the verification cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, and in particular to a blockchain-based on-chain and off-chain data consistency verification method and related equipment. Background Technology

[0002] The development of blockchain technology and smart contracts has provided new possibilities for the circulation of trusted data elements. Its decentralized, immutable, and traceable characteristics resolve the centralized trust issues inherent in traditional third-party data platforms. However, the trustworthiness of blockchain technology is built on a "consensus" mechanism that consumes significant computing and network resources, directly leading to poor scalability in large-scale applications. Therefore, transferring complex computations and queries off-chain, and storing only necessary evidence in on-chain consensus nodes, has become a current trend in blockchain technology applications. This also places demands on the consistency of on-chain and off-chain data.

[0003] Currently, the consistency of on-chain and off-chain data in blockchains is typically verified through blockchain explorers or oracles. In existing schemes, reading and organizing block information from the blockchain is a necessary step to verify the synchronization between off-chain and on-chain data. However, this step is executed on nodes with a centralized structure, introducing a new centralized trust node and undermining the decentralized nature of the blockchain. Furthermore, the immutability of blockchain technology is determined by the digest generation algorithm required to generate block data. This property dictates that the correctness of each block in the blockchain depends on the previous block, meaning that verifying the correctness of off-chain data requires traversing all on-chain blocks. This results in an inefficient, time-consuming, and costly verification process. Summary of the Invention

[0004] To address the aforementioned issues, this application provides a blockchain-based on-chain and off-chain data consistency verification method and related equipment, thereby resolving the problems of disrupting the centralized nature of blockchain nodes, low efficiency, long processing time, and high cost during on-chain and off-chain data consistency verification.

[0005] The embodiments of this application disclose the following technical solutions:

[0006] In a first aspect, embodiments of this application provide a blockchain-based on-chain and off-chain data consistency verification method, applied to a blockchain system. The blockchain system is a blockchain system used for data transactions, and includes: an authorizing party, a data source, a description document source, a user, and a blockchain platform. The method includes:

[0007] In response to the user's verification request for the original data, the description document source sends the description document corresponding to the original data to the user; wherein, the description document includes data evaluation information, and the description document corresponds one-to-one with the original data;

[0008] The user performs hash processing on the evaluation field in the data evaluation information to generate multiple hash values ​​corresponding to the evaluation field;

[0009] Determine the target hash value from the plurality of hash values;

[0010] The user verifies the evaluation hash field in the metadata status information corresponding to the original data on the blockchain based on the target hash value, so as to obtain the consistency verification result between the target hash value and the evaluation hash field.

[0011] Furthermore, the description document includes metadata information;

[0012] Before the description document source sends the description document corresponding to the original data to the user in response to the user's verification request for the original data, the method further includes:

[0013] In response to the user's metadata information query request, the description document source sends the query results corresponding to the metadata information query request to the user;

[0014] The user obtains the hash value of the metadata information from the blockchain platform;

[0015] The user uses the hash value of the metadata information to verify the query result, so as to obtain a consistency verification result between the hash value of the metadata information and the query result.

[0016] Furthermore, after obtaining the consistency verification result between the hash value of the metadata information and the query result, the method further includes:

[0017] In response to the user's data usage request, the data source verifies the user's authorization token and usage token;

[0018] Once both the authorization token and the usage token have been verified, the user obtains the right to use the original data.

[0019] Furthermore, the method also includes:

[0020] When it is determined that there is new evaluation information in the original data in the block to be packaged, the consensus node hashes the current evaluation hash field, the evaluation time and evaluation score contained in the new evaluation information to obtain a new evaluation hash field.

[0021] The consensus node uses the new evaluation hash field to update the metadata status information;

[0022] The consensus node uses a Merkle state tree to store the updated metadata state information.

[0023] Furthermore, before the data source verifies the user's authorization token and usage token in response to the user's data usage request, the method further includes:

[0024] The authorizing party sends the metadata of the original data to the data source, and the data source generates metadata information corresponding to the original data based on the metadata.

[0025] The data source performs hash processing on the metadata information and stores the hashed metadata information on the blockchain for on-chain verification.

[0026] The data source generates the description document based on the metadata information of the original data, and sends the description document to the description document source;

[0027] The description document source stores the description document.

[0028] Furthermore, the metadata information includes at least one of the following: the authorizing party's public key, the original data ID, the original data location, and / or the original data digest.

[0029] Furthermore, the data evaluation information includes at least one of the following: data usage frequency, data usage rate, and / or data usage score.

[0030] Secondly, embodiments of this application provide a blockchain system, including: an authorizing party, a data source, a description document source, a user, and a blockchain platform, wherein...

[0031] The description document source is configured to send a description document corresponding to the original data to the user in response to the user's verification request for the original data; wherein, the description document includes data evaluation information, and the description document corresponds one-to-one with the original data;

[0032] The user is configured to perform hash processing on the evaluation field in the data evaluation information to generate multiple hash values ​​corresponding to the evaluation field, determine a target hash value from the multiple hash values, and verify the evaluation hash field in the metadata status information corresponding to the original data on the blockchain based on the target hash value, so as to obtain a consistency verification result between the target hash value and the evaluation hash field.

[0033] Thirdly, embodiments of this application provide a blockchain-based on-chain and off-chain data consistency verification device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the method described in the first aspect.

[0034] Fourthly, embodiments of this application provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method described in the first aspect.

[0035] Compared with the prior art, this application has the following beneficial effects:

[0036] This application discloses a blockchain-based method for verifying on-chain and off-chain data consistency. Since the data evaluation information corresponding to the original data is stored in the off-chain description document source, and the metadata state information corresponding to the original data is stored on the blockchain platform, when it is necessary to verify the consistency of on-chain and off-chain data, the data evaluation information and metadata state information can be used to verify the consistency of on-chain and off-chain data. This ensures the consistency of on-chain and off-chain data while avoiding the introduction of centralized trust nodes. By maintaining the metadata state information of each piece of original data through consensus nodes, the need to traverse all blocks from the beginning during verification is avoided, improving verification efficiency, reducing verification time, and thus saving verification costs. Attached Figure Description

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

[0038] Figure 1A A schematic diagram of a blockchain-based on-chain and off-chain data consistency verification method provided for embodiments of this application;

[0039] Figure 1B This is a schematic diagram of the verification metadata query result process provided in the embodiments of this application;

[0040] Figure 1C This is a schematic diagram illustrating the process for determining the usage rights of the original data provided in the embodiments of this application;

[0041] Figure 1D This is a schematic diagram of the data evaluation information maintenance process provided in the embodiments of this application;

[0042] Figure 1E This is a schematic diagram of the original data registration process provided in the embodiments of this application;

[0043] Figure 2 A schematic diagram of the structure of a blockchain system provided in this application embodiment;

[0044] Figure 3 This is a schematic diagram of the electronic device structure provided in an embodiment of this application. Detailed Implementation

[0045] As described earlier, current blockchain solutions for verifying on-chain and off-chain data consistency are insufficient to meet the needs. Two-way trusted interaction between on-chain and off-chain data is a necessary condition for establishing data consistency between them. Related technologies typically utilize blockchain explorers or oracles to verify the consistency of on-chain and off-chain data.

[0046] A blockchain explorer is an application used to visualize blocks, transactions, and blockchain network metrics, typically existing as a web application. This application extracts data from the blockchain via APIs and blockchain nodes, arranges it in a database, and presents it to the user in a searchable format. Through a blockchain explorer, users can view block information (e.g., block height, confirmation status, miner rewards), transaction information (e.g., transaction ID, transaction time, transaction objects and their signatures), and perform complex queries using the database's search functionality (e.g., wallet balance, transaction information for specific accounts), enabling the verification of off-chain data and preventing double-spending transactions.

[0047] Oracles are third-party services that connect on-chain smart contracts with off-chain data. They resolve the conflict between the need for "static" on-chain block data and the need for "dynamic" off-chain data sources in native blockchain technology. Oracles are primarily used to retrieve information from off-chain sources and write it onto the blockchain. They also support synchronizing and verifying data output from the blockchain to off-chain sources. Oracles obtain data through trusted APIs or dedicated off-chain enterprise channels and relay it to blockchain nodes, thereby enabling the querying, authentication, and verification of off-chain data sources.

[0048] The inventors discovered through research that the verification of on-chain and off-chain data consistency in existing solutions is based on centralized nodes, thus introducing new centralized trust nodes and undermining the decentralized nature of the blockchain. Since verifying the correctness of off-chain data requires traversing all blocks on the blockchain from the beginning, the efficiency of on-chain and off-chain data consistency verification is low, resulting in a large amount of verification time and high verification costs.

[0049] In view of this, this application provides a method for verifying the consistency of on-chain and off-chain data, so as to verify the consistency of on-chain and off-chain data without introducing a centralized trust node, thereby ensuring that the decentralized nature of the blockchain is not compromised.

[0050] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0051] For details, see Figure 1A This embodiment discloses a blockchain-based on-chain and off-chain data consistency verification method, applied to a blockchain system. The blockchain system is used for data transactions and includes: an authorizing party, a data source, a description document source, a user, and a blockchain platform. The method specifically includes the following steps:

[0052] In step S101, in response to the user's verification request for the original data, the description document source sends the description document corresponding to the original data to the user.

[0053] In this step, the description document source provides a distributed, decentralized storage method for the description documents and offers query and modification functions for both the authorizing party and the user. By submitting the unique ID of the original data to the description document source, the user can obtain the document containing that original data. When the authorizing party needs to actively change the public information of the original data, the authorizing party must record the modification behavior through an on-chain smart contract, and then the description document source receives the modification request, verifies the on-chain record, and completes the modification.

[0054] The description document includes data evaluation information, and the description document corresponds one-to-one with the original data. Data evaluation information refers to the evaluation information generated after a user uses the data through the blockchain platform. Specifically, data evaluation information includes at least one of the following: data usage frequency, data usage rate, and / or data usage score.

[0055] It should be noted that the data evaluation information can be set according to the actual situation, and no specific restrictions are made here.

[0056] In step S102, the user performs hash processing on the evaluation field in the data evaluation information to generate multiple hash values ​​corresponding to the evaluation field.

[0057] In this step, the user can calculate Hash0 to Hash3 based on the evaluation field in the data evaluation information returned by the off-chain description document source. Specifically, for example:

[0058] Hash0: H(0,t1,1)

[0059] Hash1: H(Hash0,t2,4)

[0060] Hash2: H(Hash1,t3,3)

[0061] Hash3: H(Hash2,t4,6)

[0062] Step S103: Determine the target hash value from the plurality of hash values.

[0063] In this step, the user can select Hash3 as the target hash value from Hash0 to Hash3.

[0064] In step S104, the user verifies the evaluation hash field in the metadata status information corresponding to the original data on the blockchain based on the target hash value, so as to obtain the consistency verification result between the target hash value and the evaluation hash field.

[0065] In this step, since the user has selected Hash3 as the target hash value, Hash3 can be compared with the evaluation hash field (EvaluationHash field) in the metadata status information provided by the on-chain consensus node. When the evaluationHash is the same as Hash3, the user can assume that the data provided by the off-chain description document source is consistent with the on-chain data.

[0066] Specifically, the EvaluationHash field is represented as follows:

[0067] Evaluation: {t1,1,t2,2,t3,3,t4,6}

[0068] It is easy to see that EvaluationHash is the same as Hash3, meaning that on-chain and off-chain data are consistent.

[0069] As can be seen, the blockchain-based on-chain and off-chain data consistency verification method provided in this embodiment utilizes data evaluation information corresponding to the original data stored in an off-chain description document source, while metadata status information corresponding to the original data is stored on the blockchain platform. When it is necessary to verify the consistency of on-chain and off-chain data, the data evaluation information and metadata status information can be used to verify the consistency of on-chain and off-chain data, ensuring the consistency of on-chain and off-chain data while avoiding the introduction of centralized trust nodes.

[0070] In some embodiments, reference Figure 1B The description document includes metadata information. For step S101 in the foregoing embodiments, it may further include the following steps beforehand:

[0071] Step S201: In response to the user's metadata information query request, the description document source sends the query result corresponding to the metadata information query request to the user.

[0072] In this step, once the data is registered on the blockchain, the user can submit a request to the source of the description document to query the metadata information corresponding to that data.

[0073] Step S202: The user obtains the hash value of the metadata information from the blockchain platform.

[0074] In this step, the user obtains the hash value of metadata information through the data hash query contract on the blockchain platform.

[0075] Step S203: Use the hash value of the metadata information to verify the query result, so as to obtain a consistency verification result between the hash value of the metadata information and the query result.

[0076] In this step, if the query result matches the hash value of the metadata information, it demonstrates the consistency between on-chain and off-chain data, laying the foundation for the user to contact the authorizing party to obtain data usage rights.

[0077] In this embodiment, the metadata information corresponding to the original data is stored in the off-chain description document source, and the hash value of the metadata information corresponding to the original data is stored on the blockchain platform. When it is necessary to verify the consistency of on-chain and off-chain data, the consistency of on-chain and off-chain data can be verified by using the metadata information and its hash value, which can ensure the consistency of on-chain and off-chain data while avoiding the introduction of centralized trust nodes.

[0078] In some embodiments, reference Figure 1C For step S203 in the foregoing embodiments, the following steps may also be included:

[0079] Step S301: In response to the user's data usage request, the data source verifies the user's authorization token and usage token.

[0080] In this step, after the licensor and user reach a transaction, the user authorizes another party through a data authorization / revocation contract on the blockchain platform and queries the authorization token through an authorization query contract. The authorization process protects the privacy of both the licensor and user using cryptographic methods. The authorized user can generate a usage token using the authorization token issued by the licensor. Specifically, the user can generate a data usage token using the authorization token through a data usage contract. The usage token serves as a record of the user's usage on the blockchain platform and also as a basis for the user to evaluate the data.

[0081] Step S302: After both the authorization token and the usage token are verified, the user obtains the right to use the original data.

[0082] In this step, after the user's usage token is stored on the blockchain platform, the user can send a data usage request to the data source. The data source will then provide data services to the user after granting the user the authorization token and usage token for the data they wish to use.

[0083] It should be noted that after the data usage ends, the data source signs the data usage token through the data usage contract to indicate that the data usage process has ended, and also to indicate that the user can evaluate the data afterward.

[0084] Similarly, it should be noted that users can evaluate the data through a data evaluation contract after the data usage ends (the data usage token is signed). When evaluating the data used, users need the previous data usage tokens as evidence, and this evidence is stored on the blockchain platform. The description document source needs to update the data evaluation information in the description document only after the user has evaluated the data; the consistency of the updates is guaranteed by the evaluation records on the blockchain platform.

[0085] In some embodiments, reference Figure 1D The on-chain and off-chain data consistency verification method based on blockchain may also include the following steps:

[0086] Step S401: When it is determined that there is new evaluation information of the original data in the block to be packaged, the consensus node performs hash processing on the current evaluation hash field, the evaluation time and evaluation score contained in the new evaluation information, and obtains a new evaluation hash field.

[0087] In this step, the consensus nodes in the blockchain platform establish a corresponding metadata state list for each piece of data. This metadata state list stores information generated by user evaluations. Taking a rating-based evaluation method as an example, this information includes, but is not limited to, the total score, the total number of uses, and the hash value composed of all evaluations. For a single piece of data, its metadata state list may include the following information:

[0088]

[0089] In step S402, the consensus node updates the metadata status information using the new evaluation hash field.

[0090] Step S403: The consensus node uses the Merkle state tree to store the updated metadata state information.

[0091] In this step, after the metadata state information is modified, the consensus node aggregates the metadata state information of all data using a Merkle Tree aggregation method, and publishes the result to the block as the global data state for other nodes to reach a consensus.

[0092] In some embodiments, reference Figure 1E For step S301 in the foregoing embodiments, the following steps may be included prior to it:

[0093] In step S501, the authorizing party sends the metadata of the original data to the data source, and the data source generates metadata information corresponding to the original data based on the metadata.

[0094] In this step, when the licensor registers the original data, the licensor can either provide the metadata of the original data or generate the metadata of the original data at the data source.

[0095] It is easy to understand that the data source stores metadata information in the description document corresponding to the original data, and then the data evaluation information of the original data is also stored in the description document.

[0096] In step S502, the data source performs hash processing on the metadata information and stores the hashed metadata information on the blockchain.

[0097] In this step, the data source stores the hash value of the metadata information on the blockchain platform through a data modification / registration contract.

[0098] Step S503: The data source generates the description document based on the metadata information of the original data, and sends the description document to the description document source.

[0099] Step S504: The description document source stores the description document.

[0100] In this embodiment, since the hash value of the metadata information is stored on the blockchain, the source of the description document can verify the consistency of the submitted description document through the data hash query contract.

[0101] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components indicated as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0102] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0103] Based on the same inventive concept, corresponding to any of the above embodiments, this application also provides a blockchain system.

[0104] refer to Figure 2 The blockchain system includes: an authorizing party, a data source, a description document source, a user, and a blockchain platform.

[0105] The description document source is configured to send a description document corresponding to the original data to the user in response to the user's verification request for the original data; wherein the description document includes data evaluation information and the description document corresponds one-to-one with the original data.

[0106] The user is configured to perform hash processing on the evaluation field in the data evaluation information to generate multiple hash values ​​corresponding to the evaluation field, determine a target hash value from the multiple hash values, and verify the evaluation hash field in the metadata status information corresponding to the original data on the blockchain based on the target hash value, so as to obtain a consistency verification result between the target hash value and the evaluation hash field.

[0107] The apparatus described above is used to implement the corresponding blockchain-based on-chain and off-chain data consistency verification method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0108] As an optional embodiment, the description document source is also configured to respond to the user's metadata information query request and send the query results corresponding to the metadata information query request to the user.

[0109] As an optional embodiment, the user is further configured to obtain the hash value of the metadata information from the blockchain platform; and use the hash value of the metadata information to verify the query result to obtain a consistency verification result between the hash value of the metadata information and the query result.

[0110] As an optional embodiment, the data source is configured to verify the user's authorization token and usage token in response to the user's data usage request; and when both the authorization token and the usage token are verified, the user is granted the right to use the original data.

[0111] As an optional embodiment, the licensor is configured to send the metadata of the original data to the data source.

[0112] As an optional embodiment, the data source is further configured to generate metadata information corresponding to the original data based on the metadata; hash the metadata information and store the hashed metadata information on the blockchain; and generate the description document based on the metadata information of the original data and send the description document to the description document source.

[0113] As an optional embodiment, the description document source is also configured to store the description document.

[0114] As an optional embodiment, the metadata information includes at least one of the following: the authorizing party's public key, the original data ID, the original data location, and / or the original data digest.

[0115] As an optional embodiment, the data evaluation information includes at least one of the following: data usage frequency, data usage rate, and / or data usage score.

[0116] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the blockchain-based on-chain and off-chain data consistency verification method described in any of the above embodiments.

[0117] Figure 3 This embodiment illustrates a more specific hardware structure diagram of a blockchain-based on-chain and off-chain data consistency verification device. The device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.

[0118] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0119] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.

[0120] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.

[0121] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0122] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.

[0123] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.

[0124] The electronic devices described in the above embodiments are used to implement the corresponding blockchain-based on-chain and off-chain data consistency verification methods in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0125] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the blockchain-based on-chain and off-chain data consistency verification method as described in any of the above embodiments.

[0126] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, 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 magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0127] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the blockchain-based on-chain and off-chain data consistency verification method as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0128] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.

Claims

1. A blockchain-based on-chain and off-chain data consistency verification method, characterized in that, The method is applied to a blockchain system, specifically a blockchain system for data transactions, comprising: an authorizing party, a data source, a description document source, a user, and a blockchain platform. In response to the user's verification request for the original data, the description document source sends the description document corresponding to the original data to the user; wherein, the description document includes data evaluation information, and the description document corresponds one-to-one with the original data; the data evaluation information includes at least one of the following: data usage frequency, data usage rate, or data usage score; The user performs hash processing on the evaluation field in the data evaluation information to generate multiple hash values ​​corresponding to the evaluation field; Determine the target hash value from the plurality of hash values; The user verifies the evaluation hash field in the metadata status information corresponding to the original data on the blockchain based on the target hash value, so as to obtain the consistency verification result between the target hash value and the evaluation hash field. The method further includes: When it is determined that there is new evaluation information in the original data in the block to be packaged, the consensus node hashes the current evaluation hash field, the evaluation time and evaluation score contained in the new evaluation information to obtain a new evaluation hash field. The consensus node uses the new evaluation hash field to update the metadata status information; The consensus node uses a Merkle state tree to store the updated metadata state information.

2. The verification method according to claim 1, characterized in that, The description document includes metadata information; Before the description document source sends the description document corresponding to the original data to the user in response to the user's verification request for the original data, the method further includes: In response to the user's metadata information query request, the description document source sends the query results corresponding to the metadata information query request to the user; The user obtains the hash value of the metadata information from the blockchain platform; The user uses the hash value of the metadata information to verify the query result, so as to obtain a consistency verification result between the hash value of the metadata information and the query result.

3. The verification method according to claim 2, characterized in that, After obtaining the consistency verification result between the hash value of the metadata information and the query result, the method further includes: In response to the user's data usage request, the data source verifies the user's authorization token and usage token; Once both the authorization token and the usage token have been verified, the user obtains the right to use the original data.

4. The verification method according to claim 3, characterized in that, Before the data source verifies the user's authorization token and usage token in response to the user's data usage request, the method further includes: The authorizing party sends the metadata of the original data to the data source, and the data source generates metadata information corresponding to the original data based on the metadata. The data source performs hash processing on the metadata information and stores the hashed metadata information on the blockchain for on-chain verification. The data source generates the description document based on the metadata information of the original data, and sends the description document to the description document source; The description document source stores the description document.

5. The verification method according to claim 2 or 3, characterized in that, The metadata information includes at least one of the following: the authorizing party's public key, the original data ID, the original data location, or the original data digest.

6. A blockchain system, characterized in that, include: Authorizer, data source, description document source, user, and blockchain platform, among which The description document source is configured to send a description document corresponding to the original data to the user in response to the user's verification request for the original data; wherein, the description document includes data evaluation information, and the description document corresponds one-to-one with the original data; the data evaluation information includes at least one of the following: data usage frequency, data usage rate, or data usage score; The user is configured to perform hash processing on the evaluation field in the data evaluation information to generate multiple hash values ​​corresponding to the evaluation field, determine a target hash value from the multiple hash values, and verify the evaluation hash field in the metadata status information corresponding to the original data on the blockchain based on the target hash value, so as to obtain a consistency verification result between the target hash value and the evaluation hash field. The system also includes consensus nodes; When it is determined that there is new evaluation information in the original data in the block to be packaged, the consensus node hashes the current evaluation hash field, the evaluation time and evaluation score contained in the new evaluation information to obtain a new evaluation hash field. The consensus node uses the new evaluation hash field to update the metadata status information; The consensus node uses a Merkle state tree to store the updated metadata state information.

7. A blockchain-based on-chain and off-chain data consistency verification device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for inquiring comment data on block chain

    CN110232075A