Blockchain-based data verification method, device, equipment, medium and program product

By using a master-slave chain structure and a hash reference mechanism, the problems of resource waste and redundant storage in blockchain data verification are solved, achieving efficient data processing and secure storage.

CN122133196APending Publication Date: 2026-06-02INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2025-08-25
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

In blockchain technology, existing data integrity verification methods lead to resource waste and redundant storage, failing to meet the refined data privacy requirements in complex business scenarios.

Method used

The system adopts a master-slave chain structure, storing the metadata of the sub-chain through the master chain. It uses data processing nodes, sub-chains, and processing stage identifiers to calculate temporary hash values, performs consistency comparisons, and performs data uploading operations after the comparisons pass, thereby reducing redundant calculations and storage.

Benefits of technology

It reduces computing resource consumption, decreases on-chain data redundancy, improves storage efficiency and data processing throughput, and ensures data security and traceability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122133196A_ABST
    Figure CN122133196A_ABST
Patent Text Reader

Abstract

This application provides a blockchain-based data verification method applicable to both blockchain and fintech fields. The blockchain includes a main chain and at least one sub-chain. The main chain stores metadata for the sub-chains. The blockchain-based data verification method includes: responding to a data processing request by determining the data processing node, the sub-chain to which the data belongs, and a data status identifier, where the data status identifier includes a data processing stage identifier and a data processing type identifier; calculating a temporary hash value for the input data; obtaining an on-chain hash value based on the data processing node, the sub-chain to which the data belongs, and the data processing stage identifier; performing a consistency comparison between the temporary hash value and the on-chain hash value; and, after confirming that the consistency comparison is successful, performing an on-chain operation on the output data corresponding to the input data based on the data processing type identifier. This application also provides a blockchain-based data verification device, equipment, storage medium, and program product.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of blockchain technology, specifically to the field of data integrity verification, and more specifically to a blockchain-based data verification method, apparatus, device, medium, and program product. Background Technology

[0002] In blockchain technology applications, a common method for verifying blockchain data integrity typically involves first uploading the raw data to the blockchain, then processing the hash value of the raw data and storing it in a smart contract on a blockchain like Ethereum. When user data integrity verification is required, the target data to be verified is encrypted using a hash algorithm similar to the raw data, resulting in a hash value. This hash value is then compared with the hash value of the raw data stored on the blockchain, thus leveraging the characteristics of the hash value to verify the integrity of the target user data. However, in real-world data processing scenarios, especially during dynamic data processing, the direct uploading of large amounts of raw data to the blockchain leads to resource waste. The same data generated at different data processing stages results in the need to repeatedly store the same data or hash values ​​on the blockchain, causing redundancy issues. Furthermore, the lack of consideration for data isolation makes it difficult to meet the refined data privacy requirements of complex business scenarios. Summary of the Invention

[0003] In view of the above problems, this application provides a blockchain-based data verification method, apparatus, device, medium and program product that reduces redundant computation and redundant storage.

[0004] According to a first aspect of this application, a blockchain-based data verification method is provided, the blockchain including a main chain and at least one sub-chain, the main chain storing metadata of the sub-chains, the method comprising: in response to a data processing request, determining a data processing node, a sub-chain to which the data belongs, and a data status identifier for input data, the data status identifier including a data processing stage identifier and a data processing type identifier; calculating a temporary hash value for the input data; obtaining an on-chain hash value based on the data processing node, the sub-chain to which the data belongs, and the data processing stage identifier; performing a consistency comparison between the temporary hash value and the on-chain hash value, wherein the temporary hash value and the on-chain hash value are at the same data processing stage; and after determining that the consistency comparison is successful, performing an on-chain operation on the output data corresponding to the input data based on the data processing type identifier.

[0005] According to an embodiment of this application, the step of performing on-chain operation on the output data corresponding to the input data based on the data processing type identifier includes: if it is determined from the data processing type identifier that the input data has not undergone calculation and / or transformation operations in the current data processing stage, referencing the on-chain hash value of the previous data processing stage as the first output data hash value, and updating the data processing stage identifier; and encrypting the first output data hash value, the sub-chain identifier, the data processing stage identifier, the data processing node, and the timestamp using the private key of the processing node and recording them in the sub-chain.

[0006] According to an embodiment of this application, the step of performing on-chain operation on the output data corresponding to the input data based on the data processing type identifier further includes: if it is determined from the data processing type identifier that the input data is to be calculated and / or transformed in the current data processing stage, performing a hash operation on the output data corresponding to the input data to determine the second output data hash value, and updating the data processing stage identifier; and encrypting the second output data hash value, the sub-chain identifier, the data processing stage identifier, the data processing node, and the timestamp using the private key of the processing node and recording them in the sub-chain.

[0007] According to an embodiment of this application, the method further includes: if it is determined that the consistency comparison fails, then it is determined that the input data is incorrect and the data processing process is terminated.

[0008] According to an embodiment of this application, the metadata includes a group identifier, subchain address information, and subchain node information. The group identifier is used to characterize the application group to which the subchain data belongs. The main chain and the subchain establish a mapping relationship between the subchain root hash and the shard using the group identifier as an index.

[0009] According to an embodiment of this application, the method further includes: pre-dividing the data into groups based on the upstream and downstream relationships of the application to which the data belongs, setting a unique identifier for each group; and naming the sub-chains according to the unique identifier.

[0010] A second aspect of this application provides a blockchain-based data verification device, comprising: a first determining module, configured to determine, in response to a data processing request, a data processing node, a sub-chain to which the data belongs, and a data status identifier for input data, wherein the data status identifier includes a data processing stage identifier and a data processing type identifier; a hash calculation module, configured to calculate a temporary hash value for the input data; an acquisition module, configured to acquire an on-chain hash value based on the data processing node, the sub-chain to which the data belongs, and the data processing stage identifier; a comparison module, configured to perform a consistency comparison between the temporary hash value and the on-chain hash value, wherein the temporary hash value and the on-chain hash value have the same data processing stage; and a data uploading module, configured to, after determining that the consistency comparison is successful, perform an uploading operation on the output data corresponding to the input data based on the data processing type identifier.

[0011] According to an embodiment of this application, the data uplink module includes: a first determination submodule and a first uplink submodule.

[0012] The first determining submodule is used to, if determined according to the data processing type identifier that the input data has not undergone calculation and / or transformation operations in the current data processing stage, reference the on-chain hash value of the previous data processing stage as the first output data hash value and update the data processing stage identifier; and the first on-chain submodule is used to encrypt the first output data hash value, the subchain identifier, the data processing stage identifier, the data processing node, and the timestamp using the private key of the processing node and record them to the subchain.

[0013] According to an embodiment of this application, the data on-chain module includes: a second determination submodule and a second on-chain submodule.

[0014] The second determining submodule is used to perform a hash operation on the output data corresponding to the input data if the input data is determined to be subjected to calculation and / or transformation operations in the current data processing stage according to the data processing type identifier, so as to determine the hash value of the second output data and update the data processing stage identifier; and the second uplink submodule is used to encrypt the hash value of the second output data, the subchain identifier, the data processing stage identifier, the data processing node and the timestamp using the private key of the processing node and record them to the subchain.

[0015] According to an embodiment of this application, the apparatus further includes a determining module.

[0016] The determination module is used to determine that the input data is incorrect and terminate the data processing process if the consistency comparison fails.

[0017] According to an embodiment of this application, the metadata includes a group identifier, subchain address information, and subchain node information. The group identifier is used to characterize the application group to which the subchain data belongs. The main chain and the subchain establish a mapping relationship between the subchain root hash and the shard using the group identifier as an index.

[0018] According to an embodiment of this application, the apparatus further includes a group partitioning module and a sub-chain naming module.

[0019] The group division module is used to pre-divide the data into groups based on the upstream and downstream relationships of the application to which the data belongs, and to set a unique identifier for each group; and the sub-chain naming module is used to name the sub-chains according to the unique identifier.

[0020] A third aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.

[0021] A fourth aspect of this application also provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.

[0022] The fifth aspect of this application also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description

[0023] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0024] Figure 1 This illustration schematically depicts an application scenario of a blockchain-based data verification method according to an embodiment of this application.

[0025] Figure 2 A schematic diagram of a master-slave chain structure according to an embodiment of this application is shown.

[0026] Figure 3 A flowchart illustrating a blockchain-based data verification method according to an embodiment of this application is shown in the schematic diagram.

[0027] Figure 4 This schematically illustrates a structural block diagram of a blockchain-based data verification device according to an embodiment of this application; and

[0028] Figure 5 A block diagram illustrating an electronic device suitable for implementing a blockchain-based data verification method according to an embodiment of this application is shown. Detailed Implementation

[0029] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0030] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0031] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0032] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0033] This application provides a blockchain-based data verification method. The blockchain includes a main chain and at least one sub-chain. The main chain stores the metadata of the sub-chains. The method includes: in response to a data processing request, determining the data processing node of the input data, the sub-chain to which the data belongs, and a data status identifier, wherein the data status identifier includes a data processing stage identifier and a data processing type identifier; calculating a temporary hash value of the input data; obtaining an on-chain hash value based on the data processing node, the sub-chain to which the data belongs, and the data processing stage identifier; performing a consistency comparison between the temporary hash value and the on-chain hash value, wherein the temporary hash value and the on-chain hash value have the same data processing stage; and, after determining that the consistency comparison is successful, performing an on-chain operation on the output data corresponding to the input data based on the data processing type identifier.

[0034] Figure 1 The diagram illustrates an application scenario of a blockchain-based data verification method according to an embodiment of this application.

[0035] like Figure 1 As shown, application scenario 100 according to this embodiment may include a data processing result integrity verification scenario. Network 104 is used as a medium to provide a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0036] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0037] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0038] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0039] It should be noted that the blockchain-based data verification method provided in this application embodiment can generally be executed by server 105. Correspondingly, the blockchain-based data verification device provided in this application embodiment can generally be located in server 105. The blockchain-based data verification method provided in this application embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the blockchain-based data verification device provided in this application embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0040] It should be understood that Figure 1The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0041] It should be noted that the blockchain-based data verification method and apparatus determined in the embodiments of this disclosure can be used in the field of blockchain technology, the field of financial technology, and any field other than the financial field. The application fields of the blockchain-based data verification method and apparatus determined in the embodiments of this disclosure are not limited.

[0042] Figure 2 A schematic diagram of a master-slave chain structure according to an embodiment of this application is shown. Firstly, in conjunction with... Figure 2 The blockchain sharding technology used in the embodiments of this application will be explained.

[0043] like Figure 2 As shown, the blockchain includes a main chain and at least one sub-chain (sub-chain A / sub-chain B / sub-chain C).

[0044] According to an embodiment of this application, the main chain stores the metadata of the sub-chain, which includes a group identifier, sub-chain address information, and sub-chain node information. The group identifier is used to characterize the application group to which the sub-chain data belongs. The main chain and the sub-chain establish a mapping relationship between the sub-chain root hash and the shard using the group identifier as an index.

[0045] According to an embodiment of this application, groups are pre-divided based on the upstream and downstream relationships of the application to which the data belongs, and a unique identifier is set for each group; the sub-chains are named according to the unique identifier.

[0046] In one example, the blockchain architecture provided in this application embodiment is designed with a master-slave chain structure. The master chain, as the management core of the entire network, does not directly participate in the processing of business data, but rather undertakes the coordination and supervision responsibilities for the various sub-chains. Sub-chains are divided into different groups based on the type and process of financial business. For example, "transaction processing groups," "account management groups," and "risk assessment groups" can be established. Each group corresponds to one or more sub-chains, which are specifically responsible for processing the business data of their respective groups. The master chain stores the metadata of each sub-chain, including group identifiers, sub-chain address information, and sub-chain node information. The sub-chain address information points to the specific sub-chain's location in the network, and the sub-chain node information includes the network address, public key, etc., of each node that makes up the sub-chain. Group identifiers are assigned unique IDs based on the upstream and downstream relationships of the application to which the data belongs, thus distinguishing different data groups. Group identifiers represent different business categories or stages of business processes. For example, the "Transaction Processing Group" identifier indicates that this subchain primarily handles data related to financial transactions, including data related to order generation, execution, and settlement. The "Account Management Group" identifier indicates that the corresponding subchain is responsible for data related to account opening, modification, closure, and account fund management. Group identifiers also define the access permissions of different participants; different financial institutions, departments, or positions have different data access permissions. For instance, traders may only be able to access and manipulate data on the "Transaction Processing Group" subchain, while financial personnel primarily interact with the "Account Management Group" subchain. Through group identifiers, the system can quickly identify and verify the access permissions of users or nodes, ensuring data security and confidentiality.

[0047] In one example, the metadata stored on the main chain for each sub-chain helps the main chain to fully understand the basic situation and data status of each sub-chain. For instance, the main chain records the address of the "transaction processing group" sub-chain, the information of each node on that sub-chain (such as different transaction servers), and the root hash value of that sub-chain. The sub-chains are the actual executors of data processing. Taking the "transaction processing group" sub-chain as an example, when a new transaction is generated, the transaction data is sent to the corresponding sub-chain. The nodes on that sub-chain process the transaction data according to preset rules and procedures, including calculating the transaction hash value and verifying the legality of the transaction.

[0048] In one example, the main chain employs a BFT-like consensus mechanism to ensure global consistency; lightweight metadata avoids storing all data. Each shard corresponds to an independent sub-chain, storing all data hashes and processing metadata (such as timestamps and processor IDs) for its group; performing data integrity checks within the group; and managing node access permissions within the group. The sub-chain uses a lightweight consensus mechanism (such as RAFT), which can be selected by different groups as needed, and is only responsible for storing the hashes and processing metadata (such as processor IDs and timestamps) of that shard. The main chain monitors the data status of the sub-chains by periodically obtaining updates to the root hashes of the sub-chains. When cross-sub-chain data verification or interaction is required, the main chain uses the metadata of the sub-chains to quickly locate the relevant sub-chains and verifies the consistency and integrity of the data by comparing the root hashes of the sub-chains. For example, during transaction clearing and settlement, it may be necessary to verify and process data across multiple sub-chains (such as the "transaction processing group" and the "account management group"). The main chain quickly finds the corresponding sub-chain through the group identifier and uses the sub-chain's root hash for data verification, ensuring the accuracy and reliability of clearing and settlement.

[0049] The master-slave sharding technology provided in this application enables different financial business data to be processed in parallel on their respective sub-chains, significantly improving data processing throughput. For example, during peak securities trading periods, the "trading processing group" sub-chain can focus on processing large amounts of trading data without waiting for other business data to complete, thereby shortening transaction processing time. Data isolation and access control implemented through group identifiers ensure that financial data can only be accessed and operated by authorized institutions and personnel. This effectively guarantees data security, prevents data from being illegally tampered with, and protects the interests of financial institutions and customers.

[0050] In one example, when a node joins the slave chain, the CA within the chain allocates public-private key pairs PublicKey_GroupA_nodei and PrivateKey_GroupA_nodei (i=1,2,..., representing different nodes) for in-chain data encryption and synchronization to all nodes within the chain. Before performing data processing in stage n+1, nodes within GroupA first calculate the hash value of the obtained input data; they retrieve the record with status_id=n from the ledger and, based on the node of that record, find the corresponding public key to decrypt the obtained hash value; they compare the two hash values, and if they are equal, the processing node enters stage n+1 of data processing; if the hash values ​​are not equal, it means that the input data in stage n+1 is incorrect, and the data processing process is terminated. In the data on-chain operation, in order to reduce on-chain data redundancy, only the data processing result is recorded on the chain. Assuming the original data is data_1, the data processing type identifier TransOrNot (bool value type) is set, the hash value h=Hash(data_1) is calculated, and the original data hash value Hash(data), the data's sub-chain identifier chain_id, the data processing stage identifier stage_id=0 (0 represents the original data), the data processing node node (the value of this field in the original data is the node that provided the input data), and the timestamp timestamp are encrypted with the private key and recorded in the sub-chain.

[0051] The following will be based on Figure 1 The scene described and Figure 2 The architecture, combined Figure 3 A blockchain-based data verification method according to embodiments of this application will be described in detail.

[0052] Figure 3 A flowchart illustrating a blockchain-based data verification method according to an embodiment of this application is shown. Figure 3 As shown, the blockchain-based data verification method in this embodiment includes operations S210 to S250.

[0053] In operation S210, in response to a data processing request, the data processing node of the input data, the sub-chain to which the data belongs, and the data status identifier are determined. The data status identifier includes a data processing stage identifier and a data processing type identifier.

[0054] In one example, suppose a bank's blockchain system receives a request to process a new resource application. After responding to this request, the system first determines that the processing node for this resource application is server node A, which is responsible for resource approval at the bank. Then, it determines that the sub-chain to which the data belongs is the "resource business chain," and next, it determines the data status identifier, where the data processing stage identifier is stage=0, indicating that this is the original resource application submission stage.

[0055] In operation S220, a temporary hash value for the input data is calculated.

[0056] In one example, the resource request data above is hashed using a hash algorithm such as SHA-256. Assuming the resource request data includes basic customer information, resource amount, resource duration, etc., this data is integrated and hashed to obtain a unique temporary hash value h'=Hash(data_1').

[0057] In operation S230, the on-chain hash value is obtained based on the data processing node, the sub-chain to which the data belongs, and the data processing stage identifier.

[0058] In one example, based on the previously determined processing node A, its sub-chain "Resource Business Chain", and the data processing stage identifier stage=0, the corresponding on-chain hash value is searched on the blockchain. If this is the first time the resource application data is uploaded to the chain, an initial hash value may be obtained from the main chain or other relevant initial records in stage=0. For example, the standard initial hash value of "Resource Business Chain" recorded on the main chain in stage=0 is h= Hash(data_1).

[0059] In operation S240, the temporary hash value is compared with the on-chain hash value for consistency. The temporary hash value and the on-chain hash value are processed in the same way.

[0060] In operation S250, after confirming that the consistency comparison has passed, the output data corresponding to the input data is put on the chain based on the data processing type identifier.

[0061] According to an embodiment of this application, if the consistency comparison fails, the input data is determined to be incorrect, and the data processing process ends.

[0062] In one example, the temporary hash value calculated by operation S220 is compared with the on-chain hash value obtained from the chain at stage=0. If they match, it means that the currently input resource request data is complete and has not been tampered with at stage=0, and the subsequent processing can continue; if the comparison result is inconsistent, it is determined that there is a problem with the data, such as an error that may have occurred during transmission or generation, which will trigger the subsequent operation to terminate the data processing process.

[0063] According to an embodiment of this application, if it is determined from the data processing type identifier that the input data has not been calculated and / or transformed in the current data processing stage, the on-chain hash value of the previous data processing stage is used as the first output data hash value, and the data processing stage identifier is updated; the first output data hash value, the sub-chain identifier, the data processing stage identifier, the data processing node, and the timestamp are encrypted using the private key of the processing node and recorded in the sub-chain.

[0064] In one example, in a bank's resource management process, resource application data enters the review stage (stage=1) after initial entry (stage=0). Assume that in stage=1, only simple format and integrity checks are performed on the resource application data, without any calculations or transformations. At this point, the data processing type identifier TransOrNot=0. Based on the data processing type identifier (TransOrNot=0), the system determines that no calculations or transformations have been performed on the data in this stage. Therefore, it uses the on-chain hash value from stage=1 (let's say "H1=abc456...") as the first output data hash value. Simultaneously, the data processing stage identifier is updated to stage=2, indicating that the data is about to enter the next processing stage. The system encrypts the first output data hash value "H1=abc456...", its sub-chain identifier "Resource Business Chain", the updated data processing stage identifier stage=2, the data processing node (assumed to be audit server node B), and the current timestamp (e.g., 2024-11-13 11:20:30) using the private key of audit server node B. Then, the encrypted data is recorded on the "Resource Business Chain," completing the data on-chain operation for this stage, facilitating data processing and verification in subsequent stages. This operation avoids repeated hashing of unchanged data, saving computational resources and improving data processing efficiency. By referencing the hash value on the chain and updating the relevant identifiers, the continuity and consistency of data across different processing stages are maintained, ensuring data integrity and traceability.

[0065] According to an embodiment of this application, if it is determined that the input data is to be calculated and / or transformed in the current data processing stage based on the data processing type identifier, a hash operation is performed on the output data corresponding to the input data to determine the hash value of the second output data and update the data processing stage identifier; and the hash value of the second output data, the sub-chain identifier, the data processing stage identifier, the data processing node, and the timestamp are encrypted using the private key of the processing node and recorded in the sub-chain.

[0066] In one example, still using bank resource business as an example, when the resource application data enters the risk assessment stage (stage=3), the system needs to perform risk assessment calculations based on the resource applicant's financial status, credit history, and other data to generate a new risk assessment score. At this time, the data processing type identifier TransOrNot=1, indicating that the input data has been calculated and transformed. The system performs a hash operation on the output data obtained after the risk assessment calculation (i.e., the risk assessment score and related information) to obtain the second output data hash value (let's assume it's "H3=def789..."), and updates the data processing stage identifier to stage=4, indicating that the data enters the next processing stage. After completing the data processing in the risk assessment stage, the system encrypts the calculated second output data hash value "H3=def789...", the sub-chain identifier "Resource Business Chain", the updated data processing stage identifier stage=4, the data processing node (let's assume it's the risk assessment server node C), and the current timestamp (e.g., 2024-11-13 14:05:15) using the private key of the risk assessment server node C. Subsequently, the encrypted data is recorded on the "resource business chain" to ensure the integrity and traceability of the data processing results at this stage, providing a reliable basis for subsequent data processing and decision-making.

[0067] According to an embodiment of this application, when the hash value of the input data in stage n+1 is inconsistent with the hash value of the output data in stage n obtained from the chain, the IP address of the processing node in the previous stage can be quickly obtained based on the metadata recorded on the chain. This facilitates the direct retrieval of the correct data file without the need for large-scale data investigation. If the interruption of the data processing process is not detected in time, hash backtracking can be performed based on the corresponding subchain root hash value recorded on the main chain to roll back to the most recent valid state, quickly finding the problematic node, greatly improving the efficiency of fault location and reducing the time cost of fault investigation.

[0068] The blockchain-based data verification method provided in this application, by introducing a hash reference mechanism, avoids redundant hash operations and data storage when data is transferred between different processing stages without transformation. This not only reduces the consumption of computing resources but also reduces on-chain data redundancy and improves storage efficiency. Through master-slave chain sharding technology, isolated data storage is achieved. Data from different groups is stored separately in their respective sub-chains, and each sub-chain has an independent access control mechanism. Multiple sub-chains process their respective data simultaneously, greatly improving data processing throughput and speed.

[0069] Based on the aforementioned blockchain-based data verification method, this application also provides a blockchain-based data verification device. The following will combine... Figure 4 The device is described in detail.

[0070] Figure 4 A schematic block diagram of a blockchain-based data verification device according to an embodiment of this application is shown.

[0071] like Figure 4 As shown, the blockchain-based data verification device 400 of this embodiment includes a first determination module 410, a hash calculation module 420, an acquisition module 430, a comparison module 440, and a data upload module 450.

[0072] The first determining module 410 is configured to, in response to a data processing request, determine the data processing node of the input data, the sub-chain to which the data belongs, and the data status identifier, wherein the data status identifier includes a data processing stage identifier and a data processing type identifier. In one embodiment, the first determining module 410 may be used to perform the operation S210 described above, which will not be repeated here.

[0073] The hash calculation module 420 is used to calculate a temporary hash value of the input data. In one embodiment, the hash calculation module 420 can be used to perform the operation S220 described above, which will not be repeated here.

[0074] The acquisition module 430 is used to obtain the on-chain hash value based on the data processing node, the sub-chain to which the data belongs, and the data processing stage identifier. In one embodiment, the acquisition module 430 can be used to perform the operation S230 described above, which will not be repeated here.

[0075] The comparison module 440 is used to obtain the on-chain hash value based on the data processing node, the sub-chain to which the data belongs, and the data processing stage identifier. In one embodiment, the comparison module 440 can be used to perform the operation S240 described above, which will not be repeated here.

[0076] The data uploading module 450 is used to obtain the on-chain hash value based on the data processing node, the sub-chain to which the data belongs, and the data processing stage identifier. In one embodiment, the data uploading module 450 can be used to perform the operation S250 described above, which will not be repeated here.

[0077] According to an embodiment of this application, the data uplink module includes: a first determination submodule and a first uplink submodule.

[0078] The first determining submodule is used to, if determined according to the data processing type identifier that the input data has not undergone calculation and / or transformation operations in the current data processing stage, reference the on-chain hash value of the previous data processing stage as the first output data hash value and update the data processing stage identifier; and the first on-chain submodule is used to encrypt the first output data hash value, the subchain identifier, the data processing stage identifier, the data processing node, and the timestamp using the private key of the processing node and record them to the subchain.

[0079] According to an embodiment of this application, the data on-chain module includes: a second determination submodule and a second on-chain submodule.

[0080] The second determining submodule is used to perform a hash operation on the output data corresponding to the input data if the input data is determined to be subjected to calculation and / or transformation operations in the current data processing stage according to the data processing type identifier, so as to determine the hash value of the second output data and update the data processing stage identifier; and the second uplink submodule is used to encrypt the hash value of the second output data, the subchain identifier, the data processing stage identifier, the data processing node and the timestamp using the private key of the processing node and record them to the subchain.

[0081] According to an embodiment of this application, the apparatus further includes a determining module.

[0082] The determination module is used to determine that the input data is incorrect and terminate the data processing process if the consistency comparison fails.

[0083] According to an embodiment of this application, the metadata includes a group identifier, subchain address information, and subchain node information. The group identifier is used to characterize the application group to which the subchain data belongs. The main chain and the subchain establish a mapping relationship between the subchain root hash and the shard using the group identifier as an index.

[0084] According to an embodiment of this application, the apparatus further includes a group partitioning module and a sub-chain naming module.

[0085] The group division module is used to pre-divide the data into groups based on the upstream and downstream relationships of the application to which the data belongs, and to set a unique identifier for each group; and the sub-chain naming module is used to name the sub-chains according to the unique identifier.

[0086] According to embodiments of this application, any multiple modules among the first determination module 410, hash calculation module 420, acquisition module 430, comparison module 440, and data uplink module 450 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules can be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of this application, at least one of the first determination module 410, hash calculation module 420, acquisition module 430, comparison module 440, and data uplink module 450 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or any other reasonable means of integrating or packaging the circuitry, or implemented in software, hardware, or firmware, or in any one of the three implementation methods, or in a suitable combination of any of them. Alternatively, at least one of the first determination module 410, hash calculation module 420, acquisition module 430, comparison module 440 and data uplink module 450 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.

[0087] Figure 5 A block diagram illustrating an electronic device suitable for implementing a blockchain-based data verification method according to an embodiment of this application is shown.

[0088] like Figure 5 As shown, an electronic device 500 according to an embodiment of this application includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage portion 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of this application.

[0089] RAM 503 stores various programs and data required for the operation of electronic device 500. Processor 501, ROM 502, and RAM 503 are interconnected via bus 504. Processor 501 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 502 and / or RAM 503. It should be noted that the programs may also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.

[0090] According to embodiments of this application, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to a bus 504. The electronic device 500 may also include one or more of the following components connected to the input / output (I / O) interface 505: an input section 506 including a keyboard, mouse, etc.; an output section 507 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output (I / O) interface 505 as needed. A removable medium 511, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 510 as needed so that computer programs read from it can be installed into the storage section 508 as needed.

[0091] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.

[0092] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 502 and / or RAM 503 and / or one or more memories other than ROM 502 and RAM 503 described above.

[0093] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the blockchain-based data verification method provided in the embodiments of this application.

[0094] When the computer program is executed by the processor 501, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0095] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 509, and / or installed from a removable medium 511. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0096] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 509, and / or installed from removable medium 511. When the computer program is executed by processor 501, it performs the functions defined in the system of this application embodiment. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0097] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0098] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0099] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

Claims

1. A data verification method based on blockchain, characterized in that, The blockchain includes a main chain and at least one sub-chain, the main chain storing the metadata of the sub-chains, and the method includes: In response to a data processing request, the data processing node, the sub-chain to which the data belongs, and the data status identifier of the input data are determined. The data status identifier includes a data processing stage identifier and a data processing type identifier. Calculate the temporary hash value of the input data; The on-chain hash value is obtained based on the data processing node, the sub-chain to which the data belongs, and the data processing stage identifier; The temporary hash value is compared with the on-chain hash value for consistency, and the temporary hash value and the on-chain hash value have undergone the same data processing stage; and After confirming that the consistency comparison is successful, the output data corresponding to the input data is uploaded to the blockchain based on the data processing type identifier.

2. The method according to claim 1, characterized in that, The step of uploading the output data corresponding to the input data based on the data processing type identifier includes: If, based on the data processing type identifier, it is determined that the input data has not undergone calculation and / or transformation operations in the current data processing stage, the on-chain hash value from the previous data processing stage is used as the first output data hash value, and the data processing stage identifier is updated; and The hash value of the first output data, the identifier of its subchain, the identifier of the data processing stage, the data processing node, and the timestamp are encrypted using the private key of the processing node and then recorded in the subchain.

3. The method according to claim 1, characterized in that, The step of uploading the output data corresponding to the input data based on the data processing type identifier further includes: If, based on the data processing type identifier, it is determined that the input data undergoes computation and / or transformation operations in the current data processing stage, a hash operation is performed on the output data corresponding to the input data to determine the hash value of the second output data, and the data processing stage identifier is updated; and The hash value of the second output data, the identifier of its subchain, the identifier of the data processing stage, the data processing node, and the timestamp are encrypted using the private key of the processing node and then recorded in the subchain.

4. The method according to claim 1, characterized in that, The method further includes: If the consistency check fails, the input data is determined to be incorrect, and the data processing process ends.

5. The method according to any one of claims 1 to 4, characterized in that, The metadata includes group identifier, subchain address information, and subchain node information. The group identifier is used to characterize the application group to which the subchain data belongs. The main chain and the subchain establish a mapping relationship between the subchain root hash and the shard using the group identifier as an index.

6. The method according to claim 5, characterized in that, The method further includes: Pre-divide the data into groups based on the upstream and downstream relationships of the applications they belong to, and assign a unique identifier to each group; and The subchains are named according to the unique identifier.

7. The method according to claim 6, characterized in that, The subchain address information is used to indicate the location of the subchain in the network, and the subchain node information includes the network address and public key of each node that makes up the subchain.

8. A data verification device based on blockchain, characterized in that, The blockchain includes a main chain and at least one sub-chain, the main chain stores the metadata of the sub-chain, and the device includes: The first determining module is used to determine the data processing node, the sub-chain to which the data belongs, and the data status identifier of the input data in response to the data processing request. The data status identifier includes a data processing stage identifier and a data processing type identifier. The hash calculation module is used to calculate the temporary hash value of the input data; The acquisition module is used to obtain the on-chain hash value based on the data processing node, the sub-chain to which the data belongs, and the data processing stage identifier; The comparison module is used to perform a consistency comparison between the temporary hash value and the on-chain hash value, wherein the temporary hash value and the on-chain hash value have undergone the same data processing stage; and The data upload module is used to upload the output data corresponding to the input data to the blockchain based on the data processing type identifier after the consistency comparison is confirmed to be passed.

9. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.