Blockchain-based reconciliation method, device, and system

By obtaining and comparing hash values ​​on the blockchain and using smart contracts for automatic comparison and error handling, the problems of data privacy, insufficient storage space and low reconciliation efficiency in the cross-institutional transaction reconciliation system are solved, and efficient and tamper-proof reconciliation results are achieved.

CN116263926BActive Publication Date: 2025-10-03THE PEOPLES BANK OF CHINA DIGITAL CURRENCY INST
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111537495.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2025-10-03
Estimated Expiration
2041-12-15

AI Technical Summary

Technical Problem

The existing cross-institutional transaction reconciliation system has problems with data privacy, insufficient blockchain storage space, low reconciliation efficiency, and tamperable reconciliation results.

Method used

By obtaining the batch hash values, shard hash values, and record hash values ​​of institutions and transaction reconciliation platforms, and utilizing blockchain smart contracts for automatic comparison and error handling, only hash data is stored to address privacy issues. Efficiency is improved through sharding and hash value comparison to ensure that reconciliation results cannot be tampered with.

Benefits of technology

It saves the storage space of the blockchain, significantly improves the reconciliation efficiency, ensures the non-tamperability of the reconciliation results, and solves the problem of data privacy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116263926B_ABST
    Figure CN116263926B_ABST
Patent Text Reader

Abstract

The present invention discloses a blockchain-based reconciliation method, device, and system, relating to the field of blockchain technology. A specific implementation of the method includes: obtaining batch hash values ​​corresponding to reconciliation batch transaction records uploaded to the chain by the institution to be reconciled and the transaction reconciliation platform; performing a first comparison on the batch hash values; if the first comparison is inconsistent, notifying the institution and the transaction reconciliation platform to upload the shard hash values ​​corresponding to the reconciliation batch transaction records to the chain; performing a second comparison on the shard hash values ​​to obtain inconsistent shards; notifying the institution and the transaction reconciliation platform to upload the record hash values ​​to the chain; performing a third comparison on the record hash values ​​to obtain inconsistent transaction records; and notifying the institution and the transaction reconciliation platform of the inconsistent transaction records. This implementation can save blockchain storage space; greatly improve reconciliation efficiency, and the reconciliation results cannot be tampered with; and solve the problem of on-chain data privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain-based reconciliation method, device, and system. Background Art

[0002] For cross-institutional transactions, UnionPay and other cross-institutional transaction platforms (referred to as C institutions in this invention) are responsible for transferring transactions and inferring the final status of transactions. For example: there is an inter-bank transfer transaction from institution A to institution B, and the transfer amount is 6 yuan. Then, business will be generated in the three-party systems. Institution A generates a transaction in which institution A pays 6 yuan to institution B; Institution B generates a transaction in which institution B receives 6 yuan from institution A; and platform C generates a transaction in which institution A pays 6 yuan to institution B. After the transaction is completed, a reconciliation system is needed to ensure the actual occurrence and correctness of the transaction. The reconciliation system refers to a system that compares the accounts of the three transaction participants to balance their account information. For example: Institution A and Institution B reconcile transactions with platform C respectively, and the transaction data of platform C shall prevail.

[0003] The existing reconciliation process involves Platform C storing transaction data on its blockchain node. This node then forms a consortium with the blockchain nodes of institutions A and B. Leveraging the inherent data synchronization capabilities of blockchain nodes, the blockchain nodes of institutions A and B can access the data stored on Platform C. Once successfully uploaded to the blockchain, this data cannot be tampered with. The blockchain nodes of institutions A and B compare the synchronized data with their own recorded transaction data, and then use the error handling system to perform subsequent error resolution based on the comparison results.

[0004] However, the inventors found that the existing reconciliation system has problems with data privacy, blockchain storage space, reconciliation efficiency, and the tampering of reconciliation results. Summary of the Invention

[0005] In view of this, the embodiments of the present invention provide a blockchain-based reconciliation method, device and system, which can save blockchain storage space and significantly reduce and alleviate the impact of insufficient blockchain performance; the blockchain-based smart contract program can complete automatic comparison and automatic error processing, greatly improving efficiency, and the reconciliation results cannot be tampered with; and, since only hash data is stored on the chain, the hash has the function of being unable to reversely infer the original data, and this feature of the hash solves the problem of data privacy on the chain.

[0006] To achieve the above objectives, according to one aspect of an embodiment of the present invention, a blockchain-based reconciliation method is provided.

[0007] A blockchain-based reconciliation method comprises: obtaining batch hash values ​​corresponding to reconciliation batch transaction records uploaded by an institution to be reconciled and a transaction reconciliation platform, respectively, wherein the batch hash values ​​are generated based on the reconciliation batch transaction records; performing a first comparison between the batch hash values ​​uploaded by the institution and the batch hash values ​​uploaded by the transaction reconciliation platform; and in the event of inconsistency in the first comparison, notifying the institution and the transaction reconciliation platform to upload a shard hash value corresponding to the reconciliation batch transaction record to the blockchain, wherein the shard hash value is obtained by sharding the reconciliation batch transaction record. ; For each shard, generate a shard hash value of the shard based on the transaction records included in the shard; perform a second comparison on the shard hash value on the chain by the institution and the shard hash value on the chain on the transaction reconciliation platform to obtain inconsistent shards; notify the institution and the transaction reconciliation platform to perform on-chain processing on the record hash value corresponding to each transaction record included in the inconsistent shard; perform a third comparison on the record hash value on the chain by the institution and the record hash value on the chain on the transaction reconciliation platform to obtain inconsistent transaction records; notify the institution and the transaction reconciliation platform of the inconsistent transaction records.

[0008] Optionally, it also includes: sending the inconsistent transaction records to an automatic error handling system through the transaction reconciliation platform, so that the automatic error handling system performs error handling by calling an error handling interface provided by the institution, and feeds back the error handling results to the transaction reconciliation platform.

[0009] Optionally, it also includes: determining the category to which the inconsistent transaction record belongs; notifying the institution and the transaction reconciliation platform of the category to which the inconsistent transaction record belongs; and sending the category to which the inconsistent transaction record belongs to an automatic error handling system through the transaction reconciliation platform.

[0010] Optionally, the batch hash value is obtained by sequentially concatenating the shard hash values ​​corresponding to all shards included in the reconciliation batch transaction record; the shard hash value is obtained by sequentially concatenating the record hash values ​​obtained by performing a hash operation on each transaction record included in the shard.

[0011] Optionally, the transaction record has a transaction initiation time, and the reconciliation batch transaction records are sorted and segmented based on the transaction initiation time.

[0012] Optionally, the shard hash is uploaded to the blockchain node in the form of a list; and comparing the shard hash value of the institution's blockchain node with the shard hash value of the transaction reconciliation platform includes: performing a Cartesian product operation on the shard hash value list uploaded by the institution and the shard hash value list uploaded by the transaction reconciliation platform for comparison.

[0013] Optionally, before respectively obtaining the batch hash values ​​corresponding to the reconciliation batch transaction records on the chain by the institution to be reconciled and the transaction reconciliation platform, the method further includes: performing on-chain processing of the batch hash values ​​corresponding to the reconciliation batch transaction records by the institution and the transaction reconciliation platform; wherein the on-chain processing of the batch hash values ​​and the shard hash values ​​includes: calling the smart contract of the blockchain node to store the batch hash values ​​and the shard hash values ​​on the chain in the attributes of the smart contract of the blockchain node.

[0014] Optionally, a consensus algorithm is used to compare the batch hash value with the shard hash value.

[0015] According to another aspect of an embodiment of the present invention, a blockchain-based reconciliation device is provided.

[0016] A blockchain-based reconciliation device comprises: a batch hash acquisition module for respectively acquiring batch hash values ​​corresponding to reconciliation batch transaction records on-chain by an institution to be reconciled and a transaction reconciliation platform, wherein the batch hash values ​​are generated based on the reconciliation batch transaction records; a batch hash comparison module for performing a first comparison between the batch hash values ​​on-chain by the institution and the batch hash values ​​on-chain by the transaction reconciliation platform; a shard hash on-chain module for notifying the institution and the transaction reconciliation platform to perform on-chain processing of the shard hash values ​​corresponding to the reconciliation batch transaction records if the first comparison is inconsistent, wherein the shard hash values ​​are obtained by: sharding the reconciliation batch transaction records; sharding each shard a shard, generating a shard hash value of the shard according to the transaction records included in the shard; a shard hash comparison module, used to perform a second comparison between the shard hash value on the chain of the institution and the shard hash value on the chain of the transaction reconciliation platform to obtain inconsistent shards; a record hash on-chain module, used to notify the institution and the transaction reconciliation platform to perform on-chain processing of the record hash value corresponding to each transaction record included in the inconsistent shard; a record hash comparison module, used to perform a third comparison between the record hash value on the chain of the institution and the record hash value on the chain of the transaction reconciliation platform to obtain inconsistent transaction records; a transaction record notification module, used to notify the institution and the transaction reconciliation platform of the inconsistent transaction records.

[0017] According to another aspect of an embodiment of the present invention, a blockchain-based reconciliation method is provided.

[0018] A blockchain-based reconciliation method, comprising: the institution to be reconciled and the transaction reconciliation platform respectively upload batch hash values ​​corresponding to the reconciliation batch transaction records to the chain, wherein the batch hash values ​​are generated based on the reconciliation batch transaction records; in response to the reconciliation processing instruction, triggering the smart contract to respectively obtain the batch hash values ​​uploaded by the institution and the transaction reconciliation platform, and performing a first comparison between the batch hash values ​​uploaded by the institution and the batch hash values ​​uploaded by the transaction reconciliation platform; if the first comparison is inconsistent, notifying the institution and the transaction reconciliation platform to upload the shard hash values ​​corresponding to the reconciliation batch transaction records to the chain; the institution and the transaction reconciliation platform perform the on-chain processing of the shard hash values, wherein the shard hash values ​​are obtained by: performing a shard hash on the reconciliation batch transaction records Sharding; for each shard, generating a shard hash value of the shard according to the transaction records included in the shard; in response to receiving the shard hash value, the smart contract performs a second comparison between the shard hash value on the chain of the institution and the shard hash value on the chain of the transaction reconciliation platform to obtain inconsistent shards; and notifies the institution and the transaction reconciliation platform to perform on-chain processing of the record hash value corresponding to each transaction record included in the inconsistent shard; the institution and the transaction reconciliation platform perform on-chain processing of the record hash value; in response to receiving the record hash value, the smart contract performs a third comparison between the record hash value on the chain of the institution and the record hash value on the chain of the transaction reconciliation platform to obtain inconsistent transaction records; and notifies the institution and the transaction reconciliation platform of the inconsistent transaction records.

[0019] Optionally, it also includes: the transaction reconciliation platform sends the inconsistent transaction records to the automatic error handling system, so that the automatic error handling system performs error handling by calling the error handling interface provided by the institution, and feeds back the error handling results to the transaction reconciliation platform; the transaction reconciliation platform processes the error handling results on the chain.

[0020] Optionally, after each on-chain processing by the institution and the transaction reconciliation platform, the data on the chain by the institution is synchronized to the blockchain node of the transaction reconciliation platform based on the data synchronization function of the blockchain; the smart contract obtains the data on the chain by the institution and the transaction reconciliation platform from the blockchain node of the transaction reconciliation platform.

[0021] According to another aspect of an embodiment of the present invention, a blockchain-based reconciliation system is provided.

[0022] A reconciliation system based on blockchain includes an institution and a transaction reconciliation platform, wherein a smart contract is deployed on the transaction reconciliation platform, and the institution and the transaction reconciliation platform are used to: upload the batch hash value corresponding to the reconciliation batch transaction record to the chain; upon receiving a notification from the smart contract to upload the shard hash value corresponding to the reconciliation batch transaction record to the chain, upload the shard hash value to the chain; upon receiving a notification from the smart contract to upload the record hash value corresponding to each transaction record included in an inconsistent shard, upload the record hash value to the chain; the batch hash value is generated based on the reconciliation batch transaction record; the shard hash value is obtained by: sharding the reconciliation batch transaction record; for each shard, generating the shard hash value of the shard based on the transaction record included in the shard; the smart contract is used to: obtain, in response to the reconciliation processing instruction, Take the batch hash values ​​on the chain by the institution and the transaction reconciliation platform, and perform a first comparison between the batch hash values ​​on the chain by the institution and the batch hash values ​​on the chain on the transaction reconciliation platform; if the first comparison is inconsistent, notify the institution and the transaction reconciliation platform to perform on-chain processing of the shard hash values ​​corresponding to the reconciliation batch transaction records; in response to receiving the shard hash values, perform a second comparison between the shard hash values ​​on the chain by the institution and the shard hash values ​​on the chain on the transaction reconciliation platform to obtain inconsistent shards; and notify the institution and the transaction reconciliation platform to perform on-chain processing of the record hash values ​​corresponding to each transaction record included in the inconsistent shards; in response to receiving the record hash values, perform a third comparison between the record hash values ​​on the chain by the institution and the record hash values ​​on the chain on the transaction reconciliation platform to obtain inconsistent transaction records; and notify the institution and the transaction reconciliation platform of the inconsistent transaction records.

[0023] Optionally, it also includes an automatic error handling system, which is used to: perform error handling by calling the error handling interface provided by the institution, and feed back the error handling results to the transaction reconciliation platform; the transaction reconciliation platform is also used to: send the inconsistent transaction records to the automatic error handling system, receive the error handling results fed back by the automatic error handling system; and upload the error handling results to the chain.

[0024] According to yet another aspect of an embodiment of the present invention, an electronic device based on blockchain reconciliation is provided.

[0025] A blockchain-based reconciliation electronic device includes: one or more processors; and a storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the blockchain-based reconciliation method provided in an embodiment of the present invention.

[0026] According to yet another aspect of an embodiment of the present invention, a computer-readable medium is provided.

[0027] A computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the blockchain-based reconciliation method provided in an embodiment of the present invention is implemented.

[0028] An embodiment of the above invention has the following advantages or beneficial effects: by respectively obtaining the batch hash values ​​corresponding to the reconciliation batch transaction records on the chain of the institution and the transaction reconciliation platform; performing a first comparison of the batch hash values; in the event of inconsistency in the first comparison, notifying the institution and the transaction reconciliation platform to perform on-chain processing of the shard hash values ​​corresponding to the reconciliation batch transaction records; performing a second comparison of the shard hash values ​​to obtain inconsistent shards; the institution and the transaction reconciliation platform perform on-chain processing of the record hash values ​​corresponding to each transaction record included in the inconsistent shards; performing a third comparison of the record hash values ​​to obtain inconsistent transaction records; and notifying the institution and the transaction reconciliation platform of the inconsistent transaction records. The technical solution can save storage space of the blockchain and significantly reduce and alleviate the impact of insufficient blockchain performance; the blockchain-based smart contract program can complete automatic comparison and trigger automatic error processing, greatly improving efficiency, and the reconciliation results cannot be tampered with; and since only hash data is stored on the chain, the hash has the function of being unable to reversely infer the original data. This feature of the hash solves the problem of on-chain data privacy.

[0029] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings are provided for a better understanding of the present invention and are not intended to limit the present invention.

[0031] Figure 1 1 is a schematic diagram of the main steps of the blockchain-based reconciliation method according to an embodiment of the present invention;

[0032] Figure 2 This is a schematic diagram of the framework of the reconciliation system according to an embodiment of the present invention;

[0033] Figure 3 1 is a schematic diagram of the reconciliation process according to an embodiment of the present invention;

[0034] Figure 4 2 is a schematic diagram of the main modules of a blockchain-based reconciliation device according to an embodiment of the present invention;

[0035] Figure 5 1 is a schematic diagram of the main steps of a blockchain-based reconciliation method according to another embodiment of the present invention;

[0036] Figure 6is an exemplary system architecture diagram in which embodiments of the present invention may be applied;

[0037] Figure 7 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0038] The following description of exemplary embodiments of the present invention is made in conjunction with the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0039] There are three problems in the existing blockchain-based reconciliation system design:

[0040] 1. Because blockchain data is fully peer-to-peer and shared between nodes, and the data uploaded to the chain is transaction details, although the original data is encrypted using a symmetric key, there is still a risk that the symmetric key can be cracked, allowing all transaction details of non-institutions to be obtained. This is the first problem: data privacy.

[0041] 2. The transaction reconciliation platform will support more third-party partners, and preliminary statistics show that the number will reach thousands. If cross-institutional transactions are copied to each institution and then stored on the chain, the blockchain's storage space will be bottlenecked. This is the second problem: the blockchain storage space problem;

[0042] 3. The existing reconciliation process involves institutions obtaining data from the transaction reconciliation platform's blockchain and then performing off-chain comparisons. This essentially repeats the same reconciliation logic across various operating institutions and partners on the transaction reconciliation platform. This leads to the third problem: reconciliation efficiency.

[0043] 4. Since reconciliation is done offline, it is impossible to audit and verify the institution's reconciliation process. This is the fourth problem: the reconciliation results can be tampered with.

[0044] To address the technical problems existing in the above-mentioned prior art, the present invention provides a blockchain-based reconciliation method that can solve data privacy issues, optimize storage, achieve high reconciliation efficiency, and ensure that reconciliation results cannot be tampered with. In the reconciliation system of the present invention, the blockchains of both the institution and the transaction reconciliation platform include two parts: blockchain nodes and an on-chain system. The blockchain nodes are built on a consortium chain and support Turing-complete smart contract operations. They drive changes to ledger data by calling smart contracts, and ledger data changes must be completed through a consensus algorithm to achieve ledger consistency. Blockchain nodes are divided into two types: consensus nodes and read-only nodes. Consensus nodes participate in consensus, that is, they can perform write operations on the ledger to drive state changes in the ledger. Read-only nodes only have data read permissions, that is, they have the function of synchronizing data from consensus nodes. The number of read-only nodes cannot exceed f = (N-1) / 3, where N is the total number of blockchain nodes. The on-chain system of the blockchain records the transaction records of the reconciliation batch in three dimensions: batch summary → shard summary → shard details, and interacts with the blockchain nodes on the chain and off the chain. The following describes in detail the implementation principle of the process of on-chain and off-chain interaction according to the above-mentioned total-point logic.

[0045] For example, if transaction reconciliation is performed hourly, each hour's transaction records form a batch. Since each transaction record's detailed data includes the transaction initiation time, and this time is the same across all three parties (the institution and the transaction reconciliation platform), transaction records can be sharded based on the transaction initiation time. Sharding rules can be dynamically adjusted based on specific business needs, but the institution and the transaction forwarding platform should maintain consistent sharding rules for the same batch of transaction records. For example, if sharding is performed based on transaction initiation time, with every 10 minutes as a shard, then the transaction records for an hour can be divided into a total of six shards, each containing the detailed transaction records belonging to its shard. Next, a hash operation is performed on the detailed transaction records in each shard to obtain a record hash value. The record hash values ​​of all transaction records included in that shard are then concatenated to obtain the shard hash value for that shard. Finally, concatenation is performed based on the shard hash values ​​to obtain an hourly batch hash value. The detailed data of the transaction record may include, for example: batch number, transaction initiation time, message number, message identification number, initiating institution, paying institution, receiving institution, amount, business status, etc.

[0046] Figure 1 Schematic diagram of the main steps of the blockchain-based reconciliation method according to an embodiment of the present invention. Figure 1 As shown, the blockchain-based reconciliation method of an embodiment of the present invention mainly includes the following steps S101 to S107.

[0047] Step S101: Obtaining batch hash values ​​corresponding to the reconciliation batch transaction records on the chain from the institution to be reconciled and the transaction reconciliation platform, respectively. The batch hash values ​​are generated based on the reconciliation batch transaction records;

[0048] Step S102: performing a first comparison between the batch hash values ​​on the chain of the institution and the batch hash values ​​on the chain of the transaction reconciliation platform;

[0049] Step S103: If the first comparison is inconsistent, the institution and the transaction reconciliation platform are notified to upload the shard hash values ​​corresponding to the reconciliation batch transaction records to the blockchain, wherein the shard hash values ​​are obtained by sharding the reconciliation batch transaction records; and for each shard, generating a shard hash value for the shard based on the transaction records included in the shard.

[0050] Step S104: performing a second comparison between the shard hash value on the chain of the institution and the shard hash value on the chain of the transaction reconciliation platform to obtain inconsistent shards;

[0051] Step S105: Notify the institution and the transaction reconciliation platform to upload the hash value of each transaction record included in the inconsistent shards to the blockchain;

[0052] Step S106: performing a third comparison between the hash value of the record on the chain of the institution and the hash value of the record on the chain of the transaction reconciliation platform to obtain inconsistent transaction records;

[0053] Step S107: Notify the institution and the transaction reconciliation platform of the inconsistent transaction records.

[0054] In an embodiment of the present invention, a reconciliation batch of transaction records, for example, is a set of transaction records from the last hour, and the batch hash value is the hash value corresponding to the transaction records of the reconciliation batch. Subsequently, the transaction records of the reconciliation batch are sharded, and shard hash records are generated based on all transaction records included in the shards. In an embodiment of the present invention, by uploading the batch hash value and the shard hash value to the blockchain and comparing them to achieve reconciliation, even if data is obtained from the blockchain node, the transaction data between institutions cannot be obtained, thus resolving data privacy issues and improving data privacy within the blockchain node.

[0055] According to the technical solution of an embodiment of the present invention, before respectively obtaining the batch hash values ​​corresponding to the reconciliation batch transaction records uploaded to the chain by the institution to be reconciled and the transaction reconciliation platform, the batch hash values ​​corresponding to the reconciliation batch transaction records are also uploaded to the chain by the institution and the transaction reconciliation platform. Particularly, when the batch hash values ​​and subsequent shard hash values ​​and record hash values ​​are uploaded to the chain, the batch hash values, shard hash values ​​and record hash values ​​can be uploaded to the chain and stored in the attributes of the smart contract of the blockchain node by calling the smart contract of the blockchain node. In an embodiment of the present invention, the blockchain node is built based on the consortium chain, so it can support smart contract operations, and the transaction records are read, calculated and changed through the smart contract. Particularly, when the smart contract is executed, the batch hash values ​​and shard hash values ​​corresponding to the transaction records are calculated and compared through the consensus algorithm. By using smart contracts to compare the batch hash values, shard hash values, and record hash values ​​of transaction records, reconciliation processing based on the same operational logic is achieved on the blockchain. This not only solves the problem of low reconciliation efficiency caused by the need for on-chain and off-chain reconciliation, but also solves the problem of tampering with reconciliation results, thereby improving reconciliation efficiency and ensuring the accuracy of reconciliation results.

[0056] In one embodiment of the present invention, the batch hash value is obtained by sequentially concatenating the shard hash values ​​corresponding to all shards included in the reconciliation batch transaction record. The shard hash value is obtained by sequentially concatenating the record hash values ​​obtained by performing a hash operation on each transaction record included in the shard. Those skilled in the art should know that when the batch hash value and the shard hash value in the present invention are used to determine whether the transaction records of the institution and the transaction reconciliation platform are consistent, the batch hash value and the shard hash value can also be obtained by directly performing a hash operation on the reconciliation batch transaction record or the transaction records included in the shard, which does not affect the implementation of the technical solution of the present invention.

[0057] In one embodiment of the present invention, the transaction record has a transaction initiation time, and the reconciliation batch transaction records are sorted and sharded based on the transaction initiation time. The reconciliation batch is, for example, a batch of transaction records set within the last hour. According to the transaction initiation time of the transaction record, the transaction records with different transaction initiation times can be sharded. When splicing the record hash values ​​corresponding to the transaction records, the transaction records can be sorted according to the transaction initiation time of the transaction records and then the record hash values ​​can be spliced ​​in sequence; similarly, when splicing the shard hash values, the shards are also sorted according to the transaction initiation time of the corresponding transaction records in each shard, and then the shard hash values ​​are spliced ​​in sequence.

[0058] According to another embodiment of the present invention, shard hashes are uploaded to the blockchain node in the form of a list. Furthermore, when comparing the shard hash values ​​of the institution's blockchain node with the shard hash values ​​of the transaction reconciliation platform, the comparison can be performed by performing a Cartesian product operation on the shard hash value list of the institution's blockchain node and the shard hash value list of the transaction reconciliation platform. By comparing the shard hash values, inconsistent shards can be identified. The transaction reconciliation platform then further compares the record hash values ​​corresponding to each transaction record included in the inconsistent shards to obtain different transaction records. The transaction reconciliation platform can then notify the institution and the transaction reconciliation platform of the inconsistent transaction records.

[0059] According to one embodiment of the present invention, after notifying the institution and the transaction reconciliation platform of inconsistent transaction records, the transaction reconciliation platform can also send the inconsistent transaction records to an off-chain automatic error handling system. The automatic error handling system then performs error handling by invoking the error handling interface provided by the institution and feeds the error handling results back to the transaction reconciliation platform. Finally, the transaction accounting platform performs on-chain processing of the error handling results, storing them in the blockchain node.

[0060] According to another embodiment of the present invention, after obtaining inconsistent transaction records, it is also possible to determine the category to which the inconsistent transaction records belong; notify the institution and the transaction reconciliation platform of the category to which the inconsistent transaction records belong; and, send the category to which the inconsistent transaction records belong to the automatic error handling system through the transaction reconciliation platform. By classifying inconsistent transaction records, the processing efficiency of the institution and the transaction reconciliation platform can be improved, as well as the error handling efficiency of the automatic error handling system. In particular, when classifying inconsistent transaction records, the classification standards between each institution and the transaction reconciliation platform can be followed. For example, they can be divided into food payments, travel payments, entertainment payments, and so on. In this way, it is convenient for each institution and the transaction reconciliation platform to find out which specific business has a fault or error, so as to improve the efficiency of error handling and reduce the probability of the error occurring again.

[0061] According to the technical solution of the present invention, a hash value is only 32 bytes, while the original transaction record may be 104 bytes. After adopting this solution, taking a 10% reconciliation error rate as an example and taking a shard with 10,000 transaction data as an example, the space saved can be calculated as follows: the blockchain space occupied by the existing technology is: 104 bytes × 10,000 = 1,040,000 bytes; the blockchain space occupied by this solution is: 32 + 10% × 10,000 × 32 = 32,032 bytes; the space saved = 1 - 32,032 / 1,040,000 ≈ 96.92%. That is: calculated based on a 10% reconciliation error rate and a sharding algorithm for 10,000 transactions, this solution can save approximately 96.92% of blockchain storage space compared to the original solution, significantly reducing and alleviating the impact of insufficient blockchain performance; blockchain-based smart contract programs can complete automatic comparison and automatic error processing, greatly improving efficiency, and the reconciliation results cannot be tampered with; and, since only hash data is stored on the chain, the hash has the function of being unable to reverse the original data, and this feature of the hash solves the problem of on-chain data privacy.

[0062] Figure 2 This is a schematic diagram of the framework of the reconciliation system according to an embodiment of the present invention. Figure 2 As shown, in the reconciliation system of an embodiment of the present invention, the blockchains of institutions A, B, and C's transaction reconciliation platform each include a blockchain node and an on-chain system. The blockchain nodes and the on-chain system can interact on and off the chain based on events. The blockchain nodes of institutions A, B, and C's transaction reconciliation platform have data synchronization capabilities. A client deploys a smart contract on the blockchain node of the C transaction reconciliation platform. This smart contract is used to automatically compare data within the blockchain node. This smart contract is synchronized to the blockchain nodes of institutions A and B through the blockchain node's inherent data synchronization capabilities. If inconsistent transaction records are discovered after reconciliation, the C transaction reconciliation platform sends the inconsistent transaction records to the automatic error handling system via the on-chain system for error handling. After error handling is complete, the C transaction reconciliation platform uploads the error handling results to the blockchain node of the C transaction reconciliation platform via the on-chain system and stores them on the blockchain. These results are then synchronized to the blockchain nodes of institutions A and B through the blockchain's data synchronization capabilities. Institutions A, B, and C's transaction reconciliation platform then modify the reconciliation status of the transaction data in their blockchain node ledgers using the smart contract.

[0063] Figure 3 This is a schematic diagram of the reconciliation process of an embodiment of the present invention. Figure 3 As shown, in an embodiment of the present invention, the reconciliation process mainly includes the following steps:

[0064] 1. The institution's on-chain system first calculates the batch hash value corresponding to the transaction records of the batch to be reconciled (for example, within the last hour), and then calls the smart contract for automatic comparison to store the calculated batch hash value on-chain. Among them, the smart contract is equivalent to a program with properties and methods. The institution's on-chain system will save the batch hash value to the properties of the smart contract so that the smart contract can use the batch hash value for calculations;

[0065] 2. The transaction reconciliation platform's on-chain system also calculates the batch hash value corresponding to the transaction records of the batch to be reconciled (for example, within the last hour), and then calls the smart contract for automatic comparison to store the batch hash value calculated by the institution on-chain;

[0066] 3. The transaction reconciliation platform's on-chain system triggers or schedules the execution of a smart contract for automatic comparison, comparing the batch hash values ​​on-chain by each institution with the batch hash values ​​on-chain on the transaction reconciliation platform. If they are consistent, the reconciliation is completed;

[0067] 4. If there is any inconsistency, the institution and the transaction reconciliation platform need to be notified to chain the shard hash value corresponding to the transaction record of the reconciliation batch;

[0068] 5. The transaction reconciliation platform and the institutional end's on-chain system upload the shard hash value to the chain respectively;

[0069] 6. The smart contract finds the inconsistent shards in the shard hash values ​​on the transaction reconciliation platform and the institution's end, and notifies the institution and the transaction reconciliation platform to on-chain the record hash value corresponding to each transaction record included in the inconsistent shard;

[0070] 7. The transaction reconciliation platform and the institution’s on-chain system each record the hash value on-chain;

[0071] 8. The smart contract finds the inconsistent record hash values ​​between the transaction reconciliation platform and the institution's end-to-end record hash values, and classifies the inconsistent transaction records to determine their classification;

[0072] 9. Notify the institution and the trading reconciliation platform of the record hashes of inconsistent transaction records, and notify the institution and the trading reconciliation platform's on-chain systems of the classification of inconsistent transaction records;

[0073] 10. The transaction reconciliation platform's on-chain system sends the inconsistent classifications and detailed data of the inconsistent transaction records to the automatic error handling system for error processing. The automatic error handling system calls the error handling interface API provided by the institution or approved by the institution to perform error processing and feedback the error handling results to the transaction reconciliation platform so that the transaction reconciliation platform's on-chain system can upload the error handling results to the chain.

[0074] Figure 4 Schematic diagram of the main modules of the blockchain-based reconciliation device according to an embodiment of the present invention. Figure 4 As shown, the blockchain-based reconciliation device 400 of an embodiment of the present invention mainly includes a batch hash acquisition module 401, a batch hash comparison module 402, a shard hash chain module 403, a shard hash comparison module 404, a record hash chain module 405, a record hash comparison module 406 and a transaction record notification module 407.

[0075] Batch hash acquisition module 401, used to respectively obtain batch hash values ​​corresponding to reconciliation batch transaction records from the institution to be reconciled and the transaction reconciliation platform, wherein the batch hash values ​​are generated based on the reconciliation batch transaction records;

[0076] A batch hash comparison module 402 is configured to perform a first comparison between the batch hash values ​​on the chain of the institution and the batch hash values ​​on the chain of the transaction reconciliation platform;

[0077] The shard hash on-chain module 403 is configured to notify the institution and the transaction reconciliation platform to perform on-chain processing of the shard hash value corresponding to the reconciliation batch transaction record if the first comparison is inconsistent, wherein the shard hash value is obtained by sharding the reconciliation batch transaction record; and generating a shard hash value for each shard based on the transaction records included in the shard;

[0078] The shard hash comparison module 404 is used to perform a second comparison between the shard hash value on the chain of the institution and the shard hash value on the chain of the transaction reconciliation platform to obtain inconsistent shards;

[0079] The record hash on-chain module 405 is used to notify the institution and the transaction reconciliation platform to process the record hash value corresponding to each transaction record included in the inconsistent shards on-chain;

[0080] A record hash comparison module 406 is configured to perform a third comparison between the hash value of the record on the chain of the institution and the hash value of the record on the chain of the transaction reconciliation platform to obtain inconsistent transaction records;

[0081] The transaction record notification module 407 is configured to notify the institution and the transaction reconciliation platform of the inconsistent transaction records.

[0082] According to one embodiment of the present invention, the blockchain-based reconciliation device 400 further includes a transaction record sending module (not shown in the figure) for:

[0083] The inconsistent transaction records are sent to the automatic error handling system through the transaction reconciliation platform, so that the automatic error handling system performs error handling by calling the error handling interface provided by the institution, and feeds back the error handling results to the transaction reconciliation platform.

[0084] According to another embodiment of the present invention, the blockchain-based reconciliation device 400 further includes a transaction classification processing module (not shown in the figure) configured to:

[0085] determining the category to which the inconsistent transaction record belongs;

[0086] Notifying the institution and the transaction reconciliation platform of the category to which the inconsistent transaction record belongs;

[0087] Furthermore, the category to which the inconsistent transaction record belongs is sent to an automatic error handling system through the transaction reconciliation platform.

[0088] According to another embodiment of the present invention, the batch hash value is obtained by sequentially concatenating shard hash values ​​corresponding to all shards included in the reconciliation batch transaction record;

[0089] The shard hash value is obtained by sequentially concatenating the record hash values ​​obtained by performing a hash operation on each transaction record included in the shard.

[0090] According to another embodiment of the present invention, the transaction record has a transaction initiation time, and the reconciliation batch transaction records are sorted and fragmented based on the transaction initiation time.

[0091] According to another embodiment of the present invention, the shard hash is uploaded to the blockchain node in the form of a list; and the shard hash comparison module 404 can also be used to:

[0092] A Cartesian product operation is performed on the shard hash value list on the chain of the institution and the shard hash value list on the chain of the transaction reconciliation platform for comparison.

[0093] According to another embodiment of the present invention, the blockchain-based reconciliation device 400 further includes a batch hashing module (not shown in the figure) configured to:

[0094] Before obtaining the batch hash values ​​corresponding to the reconciliation batch transaction records on the chain from the institution to be reconciled and the transaction reconciliation platform, the batch hash values ​​corresponding to the reconciliation batch transaction records are uploaded to the chain by the institution and the transaction reconciliation platform;

[0095] The on-chain processing of the batch hash value and the shard hash value includes:

[0096] The smart contract of the blockchain node is called to store the batch hash value and the shard hash value on the chain in the attributes of the smart contract of the blockchain node.

[0097] According to yet another embodiment of the present invention, a comparison between batch hash values ​​and shard hash values ​​is performed using a consensus algorithm.

[0098] According to the technical solution of the embodiment of the present invention, by respectively obtaining the batch hash values ​​corresponding to the reconciliation batch transaction records on the chain of the institution and the transaction reconciliation platform; performing a first comparison of the batch hash values; in the event of inconsistency in the first comparison, notifying the institution and the transaction reconciliation platform to perform on-chain processing of the shard hash values ​​corresponding to the reconciliation batch transaction records; performing a second comparison of the shard hash values ​​to obtain inconsistent shards; performing on-chain processing of the record hash values ​​corresponding to each transaction record included in the inconsistent shards by the institution and the transaction reconciliation platform; performing a third comparison of the record hash values ​​to obtain inconsistent transaction records; and notifying the institution and the transaction reconciliation platform of the inconsistent transaction records can save the storage space of the blockchain and significantly reduce and alleviate the impact of insufficient blockchain performance; the blockchain-based smart contract program can complete automatic comparison and trigger automatic error processing, greatly improving efficiency, and the reconciliation results cannot be tampered with; and, since only hash data is stored on the chain, the hash has the function of being unable to reverse the original data, and this feature of the hash solves the problem of data privacy on the chain.

[0099] According to yet another aspect of the present invention, a blockchain-based reconciliation method is also provided. Figure 5 FIG. 1 is a schematic diagram of the main steps of a blockchain-based reconciliation method according to another embodiment of the present invention. Figure 5 As shown, in another embodiment of the present invention, the blockchain-based reconciliation method mainly includes the following steps S501 to S506.

[0100] Step S501: The institution to be reconciled and the transaction reconciliation platform each upload the batch hash value corresponding to the reconciliation batch transaction record to the blockchain. The batch hash value is generated based on the reconciliation batch transaction record.

[0101] Step S502: In response to the reconciliation processing instruction, the smart contract is triggered to obtain the batch hash values ​​uploaded by the institution and the transaction reconciliation platform, and perform a first comparison between the batch hash values ​​uploaded by the institution and the batch hash values ​​uploaded by the transaction reconciliation platform. If the first comparison is inconsistent, the institution and the transaction reconciliation platform are notified to upload the shard hash values ​​corresponding to the reconciliation batch transaction records to the chain;

[0102] Step S503: The institution and the transaction reconciliation platform perform on-chain processing of the shard hash value, wherein the shard hash value is obtained by: sharding the reconciliation batch transaction records; and generating a shard hash value for each shard based on the transaction records included in the shard.

[0103] Step S504: In response to receiving the shard hash value, the smart contract performs a second comparison between the shard hash value on the chain of the institution and the shard hash value on the chain of the transaction reconciliation platform to obtain inconsistent shards; and notifies the institution and the transaction reconciliation platform to process the record hash value corresponding to each transaction record included in the inconsistent shard on the chain;

[0104] Step S505: The institution and the transaction reconciliation platform perform on-chain processing of recording the hash value;

[0105] Step S506: In response to receiving the record hash value, the smart contract performs a third comparison between the record hash value on the chain of the institution and the record hash value on the chain of the transaction reconciliation platform to obtain inconsistent transaction records; and notifies the institution and the transaction reconciliation platform of the inconsistent transaction records.

[0106] According to one embodiment of the present invention, the blockchain-based reconciliation method further includes:

[0107] The transaction reconciliation platform sends the inconsistent transaction records to the automatic error handling system, so that the automatic error handling system performs error handling by calling the error handling interface provided by the institution and feeds back the error handling result to the transaction reconciliation platform;

[0108] The transaction reconciliation platform uploads the error processing results to the chain.

[0109] According to one embodiment of the present invention, after each on-chain process between the institution and the transaction reconciliation platform, the data on-chained by the institution is synchronized to the blockchain node of the transaction reconciliation platform based on the data synchronization function of the blockchain;

[0110] The smart contract obtains data on the institution and the transaction reconciliation platform from the blockchain node of the transaction reconciliation platform.

[0111] According to another aspect of the present invention, a blockchain-based reconciliation system is provided. The blockchain-based reconciliation system includes an institution and a transaction reconciliation platform, wherein a smart contract is deployed on the transaction reconciliation platform.

[0112] The mechanism and the transaction reconciliation platform are configured to: upload the batch hash value corresponding to the reconciliation batch transaction record to the chain; upon receiving a notification from the smart contract to upload the shard hash value corresponding to the reconciliation batch transaction record to the chain, upload the shard hash value to the chain; upon receiving a notification from the smart contract to upload the record hash value corresponding to each transaction record included in an inconsistent shard to the chain, upload the record hash value to the chain; the batch hash value is generated based on the reconciliation batch transaction record; the shard hash value is obtained by: sharding the reconciliation batch transaction record; and, for each shard, generating a shard hash value for the shard based on the transaction records included in the shard;

[0113] The smart contract is used to: in response to the reconciliation processing instruction, respectively obtain the batch hash values ​​on the chain by the institution and the transaction reconciliation platform, and perform a first comparison between the batch hash values ​​on the chain by the institution and the batch hash values ​​on the chain by the transaction reconciliation platform; in case of inconsistency in the first comparison, notify the institution and the transaction reconciliation platform to perform on-chain processing of the shard hash values ​​corresponding to the reconciliation batch transaction records; in response to receiving the shard hash values, perform a second comparison between the shard hash values ​​on the chain by the institution and the shard hash values ​​on the chain by the transaction reconciliation platform to obtain inconsistent shards; and notify the institution and the transaction reconciliation platform to perform on-chain processing of the record hash values ​​corresponding to each transaction record included in the inconsistent shards; in response to receiving the record hash values, perform a third comparison between the record hash values ​​on the chain by the institution and the record hash values ​​on the chain by the transaction reconciliation platform to obtain inconsistent transaction records; and notify the institution and the transaction reconciliation platform of the inconsistent transaction records.

[0114] According to one embodiment of the present invention, the blockchain-based reconciliation system further includes an automatic error handling system for: performing error handling by calling an error handling interface provided by the institution, and feeding back the error handling results to the transaction reconciliation platform;

[0115] In addition, the transaction reconciliation platform is also used to: send the inconsistent transaction records to the automatic error handling system, receive the error handling results fed back by the automatic error handling system; and upload the error handling results to the chain.

[0116] Figure 6 An exemplary system architecture 600 is shown, to which a blockchain-based reconciliation method or a blockchain-based reconciliation device according to an embodiment of the present invention may be applied.

[0117] like Figure 6As shown, system architecture 600 may include terminal devices 601, 602, 603, a network 604, and a server 605. Network 604 is used to provide a medium for communication links between terminal devices 601, 602, 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables.

[0118] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as banking applications, blockchain processing applications, transaction record applications, social platform software, etc. (only as examples).

[0119] The terminal devices 601 , 602 , and 603 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0120] Server 605 may be a server that provides various services, such as a backend management server (for example only) that supports reconciliation requests sent by users using terminal devices 601, 602, and 603. The backend management server may perform processing such as obtaining batch hash values ​​corresponding to reconciliation batch transaction records on the chain from the institution to be reconciled and the transaction reconciliation platform for the received reconciliation request data, and performing comparisons, as well as obtaining shard hash values ​​and comparing them to obtain inconsistent transaction records, and notifying the institution and the transaction reconciliation platform of the transaction records, and feeding back the processing results (for example, inconsistent transaction records - for example only) to the terminal device.

[0121] It should be noted that the blockchain-based reconciliation method provided in the embodiment of the present invention is generally executed by the server 605. Accordingly, the blockchain-based reconciliation device is generally set in the server 605.

[0122] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.

[0123] Reference below Figure 7 , which shows a schematic structural diagram of a computer system 700 of a terminal device or server suitable for implementing an embodiment of the present invention. Figure 7 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0124] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the system 700 are also stored in the RAM 703. The CPU 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0125] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, and the like; an output section 707 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 708 including a hard disk; and a communication section 709 including a network interface card such as a LAN card or a modem. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 710 as needed, so that computer programs read therefrom can be installed into the storage section 708 as needed.

[0126] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 709, and / or installed from a removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-mentioned functions defined in the system of the present invention are executed.

[0127] It should be noted that the computer-readable medium described in the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a 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. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.

[0128] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0129] The units or modules involved in the embodiments of the present invention may be implemented in software or in hardware. The units or modules described may also be provided in a processor. For example, they may be described as follows: a processor including a batch hash acquisition module, a batch hash comparison module, a shard hash on-chain module, a shard hash comparison module, a record hash on-chain module, a record hash comparison module, and a transaction record notification module. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves. For example, the batch hash acquisition module may also be described as a "module for respectively obtaining batch hash values ​​corresponding to the reconciliation batch transaction records on-chain by the institution to be reconciled and the transaction reconciliation platform."

[0130] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently and not be assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: respectively obtaining the batch hash values ​​corresponding to the reconciliation batch transaction records on the chain of the institution to be reconciled and the transaction reconciliation platform, and the batch hash values ​​are generated based on the reconciliation batch transaction records; performing a first comparison between the batch hash values ​​on the chain of the institution and the batch hash values ​​on the chain of the transaction reconciliation platform; in the event of inconsistency in the first comparison, notifying the institution and the transaction reconciliation platform to process the on-chain processing of the shard hash values ​​corresponding to the reconciliation batch transaction records, wherein the shard hash values ​​are obtained in the following manner The method comprises the following steps: sharding the transaction records of the reconciliation batch; generating a shard hash value of each shard according to the transaction records included in the shard; performing a second comparison between the shard hash value on the chain of the institution and the shard hash value on the chain of the transaction reconciliation platform to obtain inconsistent shards; notifying the institution and the transaction reconciliation platform to perform on-chain processing of the record hash value corresponding to each transaction record included in the inconsistent shard; performing a third comparison between the record hash value on the chain of the institution and the record hash value on the chain of the transaction reconciliation platform to obtain inconsistent transaction records; and notifying the institution and the transaction reconciliation platform of the inconsistent transaction records.

[0131] According to the technical solution of the embodiment of the present invention, by respectively obtaining the batch hash values ​​corresponding to the reconciliation batch transaction records on the chain of the institution and the transaction reconciliation platform; performing a first comparison of the batch hash values; in the event of inconsistency in the first comparison, notifying the institution and the transaction reconciliation platform to perform on-chain processing of the shard hash values ​​corresponding to the reconciliation batch transaction records; performing a second comparison of the shard hash values ​​to obtain inconsistent shards; performing on-chain processing of the record hash values ​​corresponding to each transaction record included in the inconsistent shards by the institution and the transaction reconciliation platform; performing a third comparison of the record hash values ​​to obtain inconsistent transaction records; and notifying the institution and the transaction reconciliation platform of the inconsistent transaction records can save the storage space of the blockchain and significantly reduce and alleviate the impact of insufficient blockchain performance; the blockchain-based smart contract program can complete automatic comparison and trigger automatic error processing, greatly improving efficiency, and the reconciliation results cannot be tampered with; and, since only hash data is stored on the chain, the hash has the function of being unable to reverse the original data, and this feature of the hash solves the problem of data privacy on the chain.

[0132] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A blockchain-based reconciliation method, characterized in that: include: Obtaining batch hash values ​​corresponding to the reconciliation batch transaction records on the chain from the institution to be reconciled and the transaction reconciliation platform, respectively. The batch hash values ​​are generated based on the reconciliation batch transaction records; Perform a first comparison between the batch hash value on the chain of the institution and the batch hash value on the chain of the transaction reconciliation platform; If the first comparison is inconsistent, the notification institution and the transaction reconciliation platform will process the on-chain processing of the shard hash value corresponding to the reconciliation batch transaction record, wherein the shard hash value is obtained by: sharding the reconciliation batch transaction record; and for each shard, generating the shard hash value of the shard based on the transaction records included in the shard; Perform a second comparison of the shard hash value on the chain of the institution and the shard hash value on the chain of the transaction reconciliation platform to obtain inconsistent shards; Notify the institution and the transaction reconciliation platform to upload the hash value of each transaction record included in the inconsistent shards to the blockchain; Performing a third comparison between the hash value of the record on the chain of the institution and the hash value of the record on the chain of the transaction reconciliation platform to obtain inconsistent transaction records; Notifying the institution and the transaction reconciliation platform of the inconsistent transaction records; Wherein, a smart contract is deployed on the transaction reconciliation platform. After each on-chain process between the institution and the transaction reconciliation platform, the data on the chain of the institution is synchronized to the blockchain node of the transaction reconciliation platform based on the data synchronization function of the blockchain; and The smart contract is used to obtain data on the institution and the transaction reconciliation platform from the blockchain node of the transaction reconciliation platform.

2. The reconciliation method according to claim 1, characterized in that: Also includes: The inconsistent transaction records are sent to the automatic error handling system through the transaction reconciliation platform, so that the automatic error handling system performs error handling by calling the error handling interface provided by the institution, and feeds back the error handling results to the transaction reconciliation platform.

3. The reconciliation method according to claim 1 or 2, characterized in that: Also includes: determining the category to which the inconsistent transaction record belongs; Notifying the institution and the transaction reconciliation platform of the category to which the inconsistent transaction record belongs; Furthermore, the category to which the inconsistent transaction record belongs is sent to an automatic error handling system through the transaction reconciliation platform.

4. The reconciliation method according to claim 1, characterized in that: The batch hash value is obtained by sequentially concatenating the shard hash values ​​corresponding to all shards included in the reconciliation batch transaction record; The shard hash value is obtained by sequentially concatenating the record hash values ​​obtained by performing a hash operation on each transaction record included in the shard.

5. The reconciliation method according to claim 1 or 4, characterized in that: The transaction record has a transaction initiation time, and the reconciliation batch transaction records are sorted and fragmented based on the transaction initiation time.

6. The reconciliation method according to claim 1, characterized in that: The shard hash is uploaded to the blockchain node in the form of a list; Comparing the shard hash value of the institution's blockchain node with the shard hash value of the transaction reconciliation platform includes: A Cartesian product operation is performed on the shard hash value list on the chain of the institution and the shard hash value list on the chain of the transaction reconciliation platform for comparison.

7. The reconciliation method according to claim 1, characterized in that: Before obtaining the batch hash values ​​corresponding to the reconciliation batch transaction records on the chain from the institution to be reconciled and the transaction reconciliation platform, it also includes: The batch hash values ​​corresponding to the reconciliation batch transaction records are uploaded to the chain by the institution and the transaction reconciliation platform; The on-chain processing of the batch hash value and the shard hash value includes: The smart contract of the blockchain node is called to store the batch hash value and the shard hash value on the chain in the attributes of the smart contract of the blockchain node.

8. The reconciliation method according to claim 1, characterized in that: The batch hash value and the shard hash value are compared through the consensus algorithm.

9. A blockchain-based reconciliation device, characterized in that: include: A batch hash acquisition module is used to obtain batch hash values ​​corresponding to the reconciliation batch transaction records on the chain from the institution to be reconciled and the transaction reconciliation platform, respectively. The batch hash values ​​are generated based on the reconciliation batch transaction records; A batch hash comparison module, configured to perform a first comparison between the batch hash values ​​on the chain of the institution and the batch hash values ​​on the chain of the transaction reconciliation platform; A shard hash on-chain module is configured to notify the institution and the transaction reconciliation platform to perform on-chain processing of the shard hash value corresponding to the reconciliation batch transaction record if the first comparison is inconsistent, wherein the shard hash value is obtained by: sharding the reconciliation batch transaction record; and generating a shard hash value for each shard based on the transaction records included in the shard; A shard hash comparison module, configured to perform a second comparison between the shard hash value on the chain of the institution and the shard hash value on the chain of the transaction reconciliation platform to obtain inconsistent shards; A record hash on-chain module is used to notify the institution and the transaction reconciliation platform to process the record hash value corresponding to each transaction record included in the inconsistent shards on-chain; A record hash comparison module, configured to perform a third comparison between the hash value of the record on the chain of the institution and the hash value of the record on the chain of the transaction reconciliation platform to obtain inconsistent transaction records; a transaction record notification module, configured to notify the institution and the transaction reconciliation platform of the inconsistent transaction records; Wherein, a smart contract is deployed on the transaction reconciliation platform. After each on-chain process between the institution and the transaction reconciliation platform, the data on the chain of the institution is synchronized to the blockchain node of the transaction reconciliation platform based on the data synchronization function of the blockchain; and The smart contract is used to obtain data on the institution and the transaction reconciliation platform from the blockchain node of the transaction reconciliation platform.

10. A blockchain-based reconciliation method, characterized in that: include: The institution to be reconciled and the transaction reconciliation platform each upload the batch hash value corresponding to the reconciliation batch transaction record to the blockchain. The batch hash value is generated based on the reconciliation batch transaction record. In response to the reconciliation processing instruction, the smart contract is triggered to obtain the batch hash values ​​uploaded by the institution and the transaction reconciliation platform respectively, and to perform a first comparison between the batch hash values ​​uploaded by the institution and the batch hash values ​​uploaded by the transaction reconciliation platform; if the first comparison is inconsistent, the institution and the transaction reconciliation platform are notified to upload the shard hash values ​​corresponding to the reconciliation batch transaction records to the chain; The institution and the transaction reconciliation platform perform on-chain processing of shard hash values, wherein the shard hash values ​​are obtained by: sharding the reconciliation batch transaction records; and generating, for each shard, a shard hash value of the shard based on the transaction records included in the shard; In response to receiving the shard hash value, the smart contract performs a second comparison between the shard hash value on the chain of the institution and the shard hash value on the chain of the transaction reconciliation platform to obtain inconsistent shards; and notifies the institution and the transaction reconciliation platform to process the record hash value corresponding to each transaction record included in the inconsistent shard on the chain; The institution and the transaction reconciliation platform record the hash value and upload it to the chain; In response to receiving the record hash value, the smart contract performs a third comparison between the record hash value on the chain of the institution and the record hash value on the chain of the transaction reconciliation platform to obtain inconsistent transaction records; and notifies the institution and the transaction reconciliation platform of the inconsistent transaction records; Wherein, after each on-chain processing between the institution and the transaction reconciliation platform, the data on-chain by the institution is synchronized to the blockchain node of the transaction reconciliation platform based on the data synchronization function of the blockchain; The smart contract obtains data on the institution and the transaction reconciliation platform from the blockchain node of the transaction reconciliation platform.

11. The reconciliation method according to claim 10, characterized in that: Also includes: The transaction reconciliation platform sends the inconsistent transaction records to the automatic error handling system, so that the automatic error handling system performs error handling by calling the error handling interface provided by the institution and feeds back the error handling result to the transaction reconciliation platform; The transaction reconciliation platform uploads the error processing results to the chain.

12. A blockchain-based reconciliation system, characterized in that: Including institutions and transaction reconciliation platforms, wherein smart contracts are deployed on the transaction reconciliation platform. The mechanism and the transaction reconciliation platform are configured to: upload the batch hash value corresponding to the reconciliation batch transaction record to the chain; upon receiving a notification from the smart contract to upload the shard hash value corresponding to the reconciliation batch transaction record to the chain, upload the shard hash value to the chain; upon receiving a notification from the smart contract to upload the record hash value corresponding to each transaction record included in an inconsistent shard to the chain, upload the record hash value to the chain; the batch hash value is generated based on the reconciliation batch transaction record; the shard hash value is obtained by: sharding the reconciliation batch transaction record; and, for each shard, generating a shard hash value for the shard based on the transaction records included in the shard; The smart contract is used to: in response to the reconciliation processing instruction, respectively obtain the batch hash values ​​on the chain by the institution and the transaction reconciliation platform, and perform a first comparison between the batch hash values ​​on the chain by the institution and the batch hash values ​​on the chain by the transaction reconciliation platform; in case of inconsistency in the first comparison, notify the institution and the transaction reconciliation platform to perform on-chain processing of the shard hash values ​​corresponding to the reconciliation batch transaction records; in response to receiving the shard hash values, perform a second comparison between the shard hash values ​​on the chain by the institution and the shard hash values ​​on the chain by the transaction reconciliation platform to obtain inconsistent shards; and notify the institution and the transaction reconciliation platform to perform on-chain processing of the record hash values ​​corresponding to each transaction record included in the inconsistent shards; in response to receiving the record hash values, perform a third comparison between the record hash values ​​on the chain by the institution and the record hash values ​​on the chain by the transaction reconciliation platform to obtain inconsistent transaction records; and notify the institution and the transaction reconciliation platform of the inconsistent transaction records.

13. The reconciliation system according to claim 12, characterized in that: It also includes an automatic error handling system for: performing error handling by calling an error handling interface provided by the institution, and feeding back the error handling results to the transaction reconciliation platform; The transaction reconciliation platform is further used to: send the inconsistent transaction records to the automatic error handling system, receive the error handling results fed back by the automatic error handling system; and upload the error handling results to the chain.

14. An electronic device based on blockchain reconciliation, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8 and / or 10 to 11.

15. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 and / or 10 to 11 is implemented.

Citation Information

Patent Citations

  • Transaction clearing method and transaction clearing system

    CN109859043A

  • Blockchain reconciliation method and system

    CN111861482A

  • Hash-based account checking method and device

    CN112785408A