Blockchain-based reconciliation method and apparatus

By pre-setting smart contracts on the blockchain and using hash algorithms for data sharding and comparison, the problems of low efficiency and poor security in existing blockchain accounting verification technologies are solved, realizing an automated and standardized reconciliation process and improving the credibility and efficiency of reconciliation results.

CN116263925BActive Publication Date: 2025-11-18THE PEOPLES BANK OF CHINA DIGITAL CURRENCY INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111537494.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-15
Publication Date
2025-11-18
Estimated Expiration
2041-12-15

AI Technical Summary

Technical Problem

Existing blockchain-based accounting reconciliation solutions fail to fully leverage the technological advantages of blockchain, exhibiting issues such as performance impact, data security risks, and low reconciliation efficiency.

Method used

By pre-setting smart contracts on the blockchain and using hash algorithms for data sharding and comparison, automated and standardized reconciliation can be achieved. Combining data sharding algorithms and smart contracts improves the credibility and efficiency of reconciliation results.

Benefits of technology

It enables automatic reconciliation on the blockchain, improving the credibility and efficiency of reconciliation results, reducing human intervention, lowering the data storage space requirement, and enhancing the accuracy and security of reconciliation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116263925B_ABST
    Figure CN116263925B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on blockchain reconciliation method and device, it is related to blockchain technical field.The specific embodiment of the method includes: in response to receiving the hash message digest of the fragment of the data to be reconciled that reconciliation participant is chained, trigger smart contract to compare the hash message digest of the fragment, smart contract is pre-deployed on blockchain, and the hash message digest of the fragment is obtained by carrying out hash operation to each fragment after the data to be reconciled is fragmented;In the case where the hash message digest of the fragment is inconsistent, notify reconciliation participant to carry out the on-chain of the detailed hash message digest of transaction data;In response to receiving the detailed hash message digest that reconciliation participant is chained, trigger smart contract to compare the detailed hash message digest.This embodiment can realize the automatic reconciliation based on blockchain, realize the automation and standardization of reconciliation process, improve the credibility of reconciliation result, strengthen data privacy protection, and improve reconciliation speed.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of blockchains, and in particular to a reconciliation method and device based on a blockchain. BACKGROUND

[0002] With the development of blockchain technology, the concept of "everyone records" using a blockchain can achieve unalterable account data and full-process traceability, which helps to improve information transparency and promote information sharing and collaborative operation among multiple parties. This technical feature is naturally suitable for account reconciliation.

[0003] There are many practices in the industry that use blockchain technology for account reconciliation. However, these technical solutions for account reconciliation based on a blockchain are only limited to using a blockchain as a channel for data sharing and distribution, which is no different from the traditional centralized account reconciliation and error handling mode of issuing reconciliation files to reconciliation participants. The technical advantages of a blockchain are not fully realized. In addition, in the blockchain reconciliation scheme, the performance impact caused by the increasing number of nodes participating in reconciliation and the increasing amount of reconciliation data, as well as the financial data security risks caused by distributed ledgers, also need to be considered.

[0004] Therefore, how to safely, efficiently and accurately reconcile accounts based on blockchain technology is a technical problem that needs to be solved at present. SUMMARY

[0005] Therefore, the embodiments of the present application provide a reconciliation method and device based on a blockchain, which can realize automatic reconciliation based on a blockchain, realize the automation and standardization of the reconciliation process, improve the credibility of the reconciliation result, strengthen data privacy protection, and improve the reconciliation speed.

[0006] To achieve the above-mentioned purpose, according to an aspect of an embodiment of the present application, a reconciliation method based on a blockchain is provided.

[0007] A reconciliation method based on a blockchain includes:

[0008] In response to receiving a sharded hash message digest of to-be-reconciled data uploaded by a reconciliation participant, triggering a smart contract to perform comparison of the sharded hash message digest, wherein the smart contract is pre-deployed on the blockchain, and the sharded hash message digest is obtained by sharding the to-be-reconciled data and performing hash operation on each shard;

[0009] In the case of inconsistent comparison of the sharded hash message digest, notifying the reconciliation participant to upload the detailed hash message digest of the transaction data included in the shard with inconsistent comparison;

[0010] In response to receiving the detail hash message digest chained by the reconciliation participant, triggering the smart contract to perform comparison of the detail hash message digest to find inconsistent transaction data, and generating a reconciliation result.

[0011] Optionally, the method further comprises:

[0012] In a case where the comparison of the slice hash message digest is consistent, directly generating the reconciliation result.

[0013] Optionally, the reconciliation participant comprises a reconciliation institution and a reconciliation center end, and the method further comprises:

[0014] sending the inconsistent transaction data to an error processing platform, so that the error processing platform performs error processing by calling the reconciliation institution and obtains an error processing result fed back by the reconciliation institution.

[0015] Optionally, before sending the inconsistent transaction data to the error processing platform, the method further comprises:

[0016] annotating an error category of the inconsistent transaction data according to a preset business rule;

[0017] sending the inconsistent transaction data to the error processing platform further comprises:

[0018] sending the error category of the inconsistent transaction data to the error processing platform.

[0019] Optionally, the preset business rule is implemented as an automatic error smart contract, and annotating the error category of the inconsistent transaction data according to the preset business rule comprises:

[0020] calling the automatic error smart contract to annotate the error category of the inconsistent transaction data in combination with a specific transaction scenario and a failure cause.

[0021] Optionally, the reconciliation institution performs error processing according to an error processing procedure corresponding to the error category of the inconsistent transaction data.

[0022] Optionally, the transaction data has time information, and the to-be-reconciled data is sliced based on the time information.

[0023] Optionally, the transaction data has an ordered message identification number, and the slice hash message digest is obtained by incrementally sorting the transaction data of each slice in the message identification number and performing hash operation after slicing the to-be-reconciled data.

[0024] Optionally, when the data amount of the data to be reconciled exceeds a first threshold, the sharding time interval is reduced and the number of shards is increased; when the data amount of the data to be reconciled is less than a second threshold, the sharding time interval is increased and the number of shards is reduced, wherein the first threshold is greater than the second threshold.

[0025] According to another aspect of the embodiments of the present application, a reconciliation device based on a blockchain is provided.

[0026] A reconciliation device based on a blockchain comprises:

[0027] A sharding hash comparison module is configured to trigger a smart contract to perform comparison of sharding hash message digests in response to receiving sharding hash message digests of data to be reconciled uploaded by a reconciliation participant, wherein the smart contract is pre-deployed on the blockchain, and the sharding hash message digests are obtained by performing hash operation on each shard after sharding the data to be reconciled;

[0028] A detail hash obtaining module is configured to notify the reconciliation participant to upload a detail hash message digest of transaction data included in a shard with inconsistent comparison in a case where the sharding hash message digests are inconsistent;

[0029] A detail hash comparison module is configured to trigger the smart contract to perform comparison of the detail hash message digest in response to receiving the detail hash message digest uploaded by the reconciliation participant, so as to find inconsistent transaction data and generate a reconciliation result.

[0030] According to still another aspect of the embodiments of the present application, a reconciliation electronic device based on a blockchain is provided.

[0031] A reconciliation electronic device based on a blockchain comprises one or more processors and a storage device configured to store one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the reconciliation method based on a blockchain provided by the embodiments of the present application.

[0032] According to still another aspect of the embodiments of the present application, a computer readable medium is provided.

[0033] A computer readable medium has a computer program stored thereon, wherein the program, when executed by a processor, implements the reconciliation method based on a blockchain provided by the embodiments of the present application.

[0034] An embodiment of the above invention has the following advantages or beneficial effects: by responding to receiving a fragment hash message digest of the to-be-reconciled data of the reconciliation participant on the chain, triggering the smart contract to perform comparison of the fragment hash message digest, wherein the smart contract is pre-deployed on the blockchain, and the fragment hash message digest is obtained by performing hash operation on each fragment after fragmenting the to-be-reconciled data; in the case of inconsistent comparison of the fragment hash message digest, notifying the reconciliation participant to chain the detailed hash message digest of the transaction data included in the inconsistent fragment; in response to receiving the detailed hash message digest of the reconciliation participant on the chain, triggering the smart contract to perform comparison of the detailed hash message digest to find inconsistent transaction data, and generating a reconciliation result, the technical scheme, by pre-setting an automatic reconciliation smart contract on the blockchain, triggering the smart contract to automatically execute after each reconciliation participant chains the data, completing data comparison, realizing automatic reconciliation based on the blockchain, and realizing automation and standardization of the reconciliation process; by generating the reconciliation result on the blockchain in real time and making it tamper-proof, the credibility of the reconciliation result is improved. Based on the theoretical basis of irreversibility and uniqueness of the hash algorithm, the to-be-reconciled data is reconciled by comparing the hash message digest, which strengthens data privacy protection. The comparison of the reconciliation data based on the data fragmentation method helps to quickly locate the error transaction and improve the reconciliation speed.

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

[0036] The accompanying drawings are used to better understand the present application and do not constitute undue limitations on the present application. Among them:

[0037] Figure 1 is a schematic diagram of the main steps of the reconciliation method based on the blockchain according to the embodiment of the present application;

[0038] Figure 2 is a schematic diagram of the main steps of the reconciliation method based on the blockchain according to the embodiment of the present application;

[0039] Figure 3 is a schematic diagram of the main steps of the reconciliation method based on the blockchain according to the embodiment of the present application;

[0040] Figure 4 is a schematic diagram of the main steps of the reconciliation method based on the blockchain according to the embodiment of the present application;

[0041] Figure 5 is a schematic diagram of the main steps of the reconciliation method based on the blockchain according to the embodiment of the present application;

[0042] Figure 6 is an exemplary system architecture diagram to which the embodiment of the present application can be applied;

[0043] Figure 7 is a structural schematic diagram of a computer system of a terminal device or a server suitable for implementing embodiments of the present application. DETAILED DESCRIPTION

[0044] Exemplary embodiments of the present application are described herein below with reference to the accompanying drawings, in which various details of the embodiments of the present application are set forth in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Also, the description set forth in the following description of the embodiments of the present application is not limitative in nature and merely set forth a variety of illustrative embodiments each of which is provided by way of explanation. Accordingly, it will be appreciated that the embodiments described herein can be used in a variety of applications.

[0045] In the introduction of the embodiments of the present application, the following terms are defined as follows:

[0046] Digital currency: a digital form of legal tender issued by the central bank, operated by designated operating agencies, based on a broad account system, supporting bank account decoupling functions, equivalent to physical currency, with value characteristics and legal compensation;

[0047] Interconnection platform: a digital currency financial infrastructure established by the central bank, responsible for issuing digital currency to commercial banks as designated operating agencies and managing the entire life cycle;

[0048] Operating agency: a commercial bank authorized by the central bank to directly provide digital currency exchange and circulation services to the public;

[0049] Cooperating bank: a commercial bank that is not an operating agency and can cooperate with operating agencies to provide circulation services to the public under the premise of centralized management by the central bank;

[0050] Receiving agency: an agency that provides digital currency consumption transaction services for merchants, which can be a third-party payment agency, a commercial bank, or a merchant with platform characteristics and public utilities;

[0051] Smart contract: a computer protocol designed to disseminate, verify, or execute contracts in an information-based manner. Smart contracts allow trusted transactions without third parties, which are traceable and irreversible.

[0052] In the traditional centralized account reconciliation and error processing mode, first, the transaction data is stored in the file system by the central bank end system and the participating institutions for reconciliation, and is encrypted by a symmetric key, and the encrypted file is uploaded to the secure file transfer (SFTP) server. In this process, although the file system uses symmetric key encryption, there is still a possibility of being cracked, thereby causing data security and privacy problems; second, the participating institutions for reconciliation obtain the transaction data from the SFTP server and compare it with the transaction data within the participating institutions. The account reconciliation of this process is carried out locally in the participating institution end, which has the disadvantages of low reconciliation efficiency, unregulated reconciliation process, and no closed-loop feedback of the reconciliation result; third, in the traditional mode, if an error occurs during the reconciliation process, human intervention is usually required, and the error processing has a high dependence on manual work and a long processing time. Therefore, the traditional centralized account reconciliation and error processing mode has the problems of insufficient data privacy, large data storage space, low reconciliation efficiency, tamperable reconciliation result, and high dependence on manual error processing.

[0053] However, the existing technical solutions for using blockchain for account reconciliation in the industry are only limited to using blockchain as a data sharing and distribution channel, which is no different from the way of issuing reconciliation files to reconciliation participants in the traditional centralized account reconciliation and error processing mode, and does not fully reflect the technical advantages of blockchain. In addition, in the existing blockchain reconciliation technical solution, the performance impact caused by the increasing number of nodes participating in reconciliation and the increasing reconciliation data, as well as the financial data security risks caused by distributed ledgers, also need to be considered.

[0054] To solve the above technical problems, the present application provides a blockchain-based reconciliation method based on the following considerations:

[0055] First, based on the theoretical basis of blockchain technology, the participating subjects are equal, the data is credible, and the smart contract is supported, a multi-party consensus reconciliation mode is established. The central bank end and the institution end participating in reconciliation reconcile together, that is, the centralized node and the participating node reconcile the data on the chain together. By pre-deploying a blockchain smart contract, the account reconciliation process is automated and standardized; by generating real-time reconciliation results on the chain and making them tamper-proof, the credibility of the reconciliation results is improved;

[0056] Second, based on the theoretical basis of the irreversibility and uniqueness of the hash algorithm, data privacy protection is strengthened. The irreversibility and uniqueness of the hash algorithm are used to replace the transaction information plaintext with a hash message digest for on-chain automatic reconciliation, which realizes the isolation of reconciliation data between different participating institutions and eliminates the impact of symmetric encryption reconciliation data on the performance and efficiency of the blockchain. This is reflected in the following two aspects: First, the original transaction information can generate a unique hash message digest, which cannot be restored to the original transaction information plaintext. Using the hash message digest instead of the transaction information plaintext can achieve the privacy protection effect of transaction information; Second, the same original transaction information will generate the same hash message digest, which can ensure the consistency of the hash message digest and the original transaction information. The hash message digest is chained and reconciled automatically by the smart contract according to the preset strategy, which improves the reconciliation efficiency;

[0057] Third, based on the theoretical basis of "binary search" quick positioning and the equal length characteristics of the hash message digest, the blockchain reconciliation efficiency and scalability are improved. First, based on the "binary search" idea, a flexible data sharding algorithm is used to process the original transaction information, which helps to quickly locate the error transaction information and improve the search speed. Second, the hash message digest is generated based on the original transaction information of each shard, and the fixed length (flexibly set, for example, 32 bytes) of the hash message digest is much smaller than the length of the original transaction information. Replacing the original transaction information with the hash message digest can greatly reduce the storage space of the blockchain. Finally, the sharding algorithm supports adaptive adjustment to avoid data capacity fluctuations in a single shard caused by excessive or insufficient business volume, which in turn affects reconciliation efficiency;

[0058] Fourth, based on the characteristics of digital currency as central bank liabilities and payment settlement, an automatic error handling method is proposed. Digital currency is the direct liability of the central bank to the public, and in the double-layer operation system, the operation agency records the public's holding of digital currency on behalf of the central bank. Based on the "payment settlement" feature of digital currency, cross-institution transactions do not exist in the traditional payment system. Therefore, the essence of digital currency system error handling is to ensure that the operation agency correctly records the public's digital currency wallet. Therefore, the heterogeneity of each operation agency's internal system can be abandoned, and the consistency of transaction results with the interconnection platform can be maintained as the basic principle. By developing a standardized and automated error handling process, automatic error handling can be achieved, which can significantly shorten the error handling time, improve user fund safety, and effectively reduce the cost of manual error handling and the financial risk caused by delayed error handling.

[0059] The application organically combines the characteristics of hash algorithm, such as universality, certainty, irreversibility and anti-collision, and the consensus mechanism of the block chain, the binary search algorithm and the smart contract, and provides standard and unified automatic reconciliation and error processing services for participating institutions accessing the digital currency interconnection platform based on the traditional "summary reconciliation-detailed reconciliation" mode. The central bank and participating institutions are trusted nodes accessing the digital currency block chain ledger, and through the application programming interface, the respective digital currency transaction data is chained. The automatic reconciliation smart contract is preset on the chain, and the central bank and the operating institution trigger the smart contract to automatically execute after the data is chained, and complete the data comparison. If the data comparison is successful, the smart contract will mark the transaction as successful reconciliation, and if the data comparison fails, the smart contract will mark the transaction as failed reconciliation. For the failed transaction, the pre-set automatic error smart contract is used, the error transaction is marked with the failure type according to the specific transaction scenario and the failure reason, the pre-developed automatic error processing application programming interface of the participating institution is called, and the automatic error processing is completed according to the pre-set error processing standard process.

[0060] The specific implementation process of the application will be described below in conjunction with specific embodiments.

[0061] Figure 1 is a schematic diagram of the main steps of the block chain-based reconciliation method according to an embodiment of the application. As shown in Figure 1 , the block chain-based reconciliation method according to an embodiment of the application mainly includes the following steps S101 to S103.

[0062] Step S101: in response to receiving the sharded hash message digest of the to-be-reconciled data chained by the reconciliation participant, triggering the smart contract to perform comparison of the sharded hash message digest, wherein the smart contract is pre-deployed on the block chain, and the sharded hash message digest is obtained by sharding the to-be-reconciled data and then hashing each shard;

[0063] Step S102: in the case of inconsistent sharded hash message digest, notifying the reconciliation participant to chain the detailed hash message digest of the transaction data included in the inconsistent shard;

[0064] Step S103: in response to receiving the detailed hash message digest chained by the reconciliation participant, triggering the smart contract to perform comparison of the detailed hash message digest to find inconsistent transaction data and generate a reconciliation result.

[0065] According to the steps S101-S103, by presetting the automatic reconciliation smart contract on the blockchain, the data of each reconciliation participant is chained to trigger the smart contract to automatically execute, complete data comparison, realize automatic reconciliation based on the blockchain, realize the automation and standardization of the reconciliation process, and improve the credibility of the reconciliation result by generating the reconciliation result on the blockchain in real time and making it tamper-proof. Based on the theoretical basis of the irreversibility and uniqueness of the hash algorithm, the reconciliation is performed by comparing the hash message digest of the data to be reconciled, thereby strengthening the data privacy protection. The data comparison is performed based on the data sharding method, which helps to quickly locate the error transaction and improve the reconciliation speed.

[0066] According to an embodiment of the present application, in the case of consistent sharding hash message digest comparison, the reconciliation result is directly generated. In the case of consistent sharding hash message digest comparison, it can be considered that the data to be reconciled of each reconciliation participant is consistent, the reconciliation is passed, and the reconciliation result can be directly generated.

[0067] According to an embodiment of the present application, the reconciliation participants include reconciliation institutions and reconciliation center terminals. The reconciliation institutions are, for example, commercial banks participating in reconciliation, and the reconciliation center terminals are, for example, central bank terminals participating in reconciliation. The data of the reconciliation center terminals has absolute credibility, and the reconciliation center terminals are also used for transaction switching between the reconciliation institutions and record transaction data. According to an embodiment of the present application, the reconciliation method further includes: sending the inconsistent transaction data to an error processing platform to enable the error processing platform to call the reconciliation institutions for error processing and obtain error processing results fed back by the reconciliation institutions. After the reconciliation based on the sharding hash message digest and / or detailed hash message digest of the data to be reconciled chained by each reconciliation participant, if there is inconsistent transaction data, it needs to be sent to the error processing platform so that error processing can be performed. When the error processing platform calls the reconciliation institutions for error processing, it can specifically call the automatic error processing application programming interface provided by the reconciliation institutions. After the reconciliation institutions complete the error processing, the error processing results are returned to the error processing platform, and the error processing platform updates the status of the error processing to “processing completed” after receiving the feedback. For the transaction data whose error processing result is not fed back in time, the error processing platform performs alarm processing.

[0068] According to one of the embodiments of the present application, before the inconsistent transaction data is sent to the error processing platform, the inconsistent transaction data can also be marked with an error category according to a preset business rule. When the inconsistent transaction data is sent to the error processing platform, the error category of the inconsistent transaction data is sent to the error processing platform. For inconsistent transaction data, the inconsistent transaction data can be classified and marked with an error category in combination with a specific transaction scenario and a reason for the account reconciliation failure. For each error category, a corresponding error processing process can be preset in the account reconciliation institution to process errors. The account reconciliation institution processes errors according to the error processing process corresponding to the error category of the inconsistent transaction data.

[0069] According to another embodiment of the present application, the preset business rule is implemented as an automatic error smart contract. Marking the inconsistent transaction data with an error category according to the preset business rule includes invoking the automatic error smart contract to mark the inconsistent transaction data with an error category in combination with a specific transaction scenario and a failure reason. In this way, the error category can be classified based on the preset automatic error smart contract, saving human resources and improving classification efficiency.

[0070] To improve the account reconciliation performance and fault tolerance of the blockchain, the present application uses a flexibly configurable data sharding algorithm to perform sharding processing on the to-be-reconciled data based on the binary search idea. The essence of account reconciliation is to find inconsistent error transaction data in massive data, so improving the search speed is the key to improving the account reconciliation performance and efficiency. The hash message digest generated by the same data must be the same, and according to this principle, as many data as possible are constructed into a shard, which can greatly improve the account reconciliation efficiency. Based on this, the present application designs an account reconciliation data sharding algorithm, that is, according to the business running situation, the account error rate, the number of participating institutions, and the digital currency system unitization technical architecture, and the like, flexibly adjusts the specific data sharding algorithm parameters to divide the to-be-reconciled data into several parts.

[0071] According to the embodiments of the present application, the transaction data has time information, and the to-be-reconciled data is sharded based on the time information. In the to-be-reconciled data of one transaction batch, the to-be-reconciled data of the account reconciliation institution and the account reconciliation center end is sorted according to the time information such as the business processing time or the transaction completion time of each transaction, and then sharded according to the time interval, so that the to-be-reconciled data corresponding to a plurality of shards can be obtained.

[0072] In the embodiment of the present application, the transaction data has an ordered message identification number; and the shard hash message digest is obtained by performing hash operation on the transaction data of each shard after the to-be-reconciled data is sharded, and the transaction data of each shard is sequentially sorted according to the message identification number. For each shard, the transaction data included in the shard is sorted before the hash operation is performed, so as to ensure that the order of the transaction data of each reconciliation institution is completely consistent, and then the sorted transaction data is subjected to hash operation, so as to obtain the shard hash message digest. For example, in a transaction batch (for example, the transaction data within 1 hour), the to-be-reconciled data of the reconciliation institution is sequentially sorted according to the “business processing time” or “transaction completion time” of each transaction, and is divided into 6 parts (that is, divided at intervals of 10 minutes), each of which is the transaction data occurring within 10 minutes. For each part of transaction data (that is, each shard), the transaction data is sequentially sorted according to the message identification number, and a hash message digest thereof is generated according to a hash algorithm, and finally 6 shard hash message digests are obtained.

[0073] According to another embodiment of the present application, when the data volume of the to-be-reconciled data exceeds a first threshold value, the shard time interval is reduced and the number of shards is increased; and when the data volume of the to-be-reconciled data is less than a second threshold value, the shard time interval is increased and the number of shards is reduced, wherein the first threshold value is greater than the second threshold value. In the embodiment of the present application, by using the adaptive adjustment shard algorithm, when the business volume is too large or too small, the data volume of a single shard can be prevented from being excessively fluctuated, so as to affect the reconciliation efficiency. Specifically, when the business volume is too large, in order to prevent the reconciliation fault tolerance from being low due to too much data in a shard, the shard time interval is shortened and the number of shards is increased, so that the data of each shard remains consistent with that in normal times; and when the business volume is too small, in order to prevent the reconciliation efficiency from being low due to too little data in a shard, the shard time interval is lengthened and the number of shards is reduced, so that the data volume of each shard remains stable. Thus, the influence of the unbalanced data volume on the reconciliation efficiency can be avoided; and the fault tolerance of the reconciliation method can also be improved. For example, when the business volume is large, if the data volume of each shard is too large, when an error occurs in a transaction, all the data of the entire shard needs to be subjected to detailed reconciliation; and by using the adaptive adjustment algorithm of the present embodiment, the shard is adjusted to multiple shards (for example, N shards), so that when an error occurs in a transaction, only the data of the shard to which the transaction data belongs needs to be subjected to detailed reconciliation, and the reconciliation data volume is 1 / N of that before the adaptive adjustment. In this way, the reconciliation efficiency is greatly improved, and the occurrence of reconciliation errors due to too much data is avoided, so that the fault tolerance of the reconciliation is improved.

[0074] Figure 2 is a schematic diagram of the framework of the reconciliation system of the embodiment of the present application. As shown in Figure 2As shown, the blockchain of the reconciliation participant A institution, the B institution and the C center end in the reconciliation system of the embodiment of the present application all include a blockchain node and a chain system, and the blockchain node and the chain system can interact on-chain and off-chain based on an event, and the blockchain nodes of the A institution, the B institution and the C center end have a data synchronization function. The client deploys a smart contract for the blockchain node of the C center end, and the smart contract is used for automatic comparison of data in the blockchain node. Through the data synchronization function of the blockchain node itself, the smart contract is synchronized to the blockchain nodes of the A institution and the B institution. When inconsistent transaction data is found after reconciliation, the C center end sends the inconsistent transaction data to the error processing platform through the chain system for error processing, and after the error processing is completed, the C center end stores the error processing result in the blockchain node of the C center end through the chain system, and then synchronizes the error processing result to the blockchain nodes of the A institution and the B institution through the data synchronization function of the blockchain, and the A institution, the B institution and the C center end modify the reconciliation state of the transaction data in the account book of the blockchain node through the smart contract.

[0075] Figure 3 is an automatic reconciliation data layer interaction schematic diagram of the embodiment of the present application. As shown in the figure, Figure 3 The reconciliation institutions participating in reconciliation include, for example, digital currency operating institutions, cooperative banks, receiving institutions or merchants, etc.; the business interaction layer includes, for example, an interconnection platform, a reconciliation blockchain, etc.; and the center end management layer is, for example, a reconciliation management platform of the center end (central bank) and the like. Among them, the reconciliation blockchain is used to obtain the sharding hash message digest and the detail hash message digest of the to-be-reconciled data chained by the reconciliation institutions and the center end reconciliation management platform, and to reconcile, and to send the transaction data of the reconciliation error to the center end reconciliation management platform. The center end reconciliation management platform sends the transaction data of the reconciliation error to the reconciliation institution through the interconnection platform, so that the reconciliation institution performs error processing on the inconsistent transaction data included in the error processing request after receiving the error processing request from the interconnection platform, and returns the error processing result to the center end reconciliation management platform through the interconnection platform to update the state of the transaction data of the reconciliation error. In the embodiment of the present application, the center end reconciliation management platform includes an error processing platform for performing error processing, and a transaction data aggregation platform for aggregating the full amount of to-be-reconciled data of the reconciliation institution through the interconnection platform.

[0076] Figure 4 is a schematic diagram of a sharding-based automatic reconciliation process of the embodiment of the present application. As shown in the figure, Figure 4 The sharding-based automatic reconciliation process of the embodiment of the present application mainly includes the following steps:

[0077] 1. To-be-reconciled data processing: the blockchain reconciliation service of the center-end reconciliation management platform obtains all full-to-be-reconciled data of all reconciliation institutions through the interconnection platform in a timely manner;

[0078] 2. Data sharding processing: based on the "binary search" idea, the to-be-reconciled data of a transaction batch of the center-end and the reconciliation institution is sharded. Specifically, the transaction data is sharded according to the time information, and the transaction data of each shard is sorted according to the message identifier. In an embodiment of the present application, for example, the to-be-reconciled data of a transaction batch is divided into 6 shards;

[0079] 3. Sharding hash message digest on-chain: after the center-end and the reconciliation institution end generate sharding data according to the same sharding rule, the sharding data is hashed to generate a sharding hash message digest and is uploaded to the chain. In the foregoing embodiment, the center-end and the reconciliation institution end both upload 6 sharding hash message digests to the chain;

[0080] 4. Summary reconciliation processing: an automatic reconciliation smart contract is deployed on the reconciliation blockchain in advance, the smart contract is triggered and automatically executed to check the sharding hash message digests of the center-end and the sharding hash message digests of the reconciliation institution end, and if the sharding hash message digests are consistent, the transaction data of the shard is reconciled successfully; if the sharding hash message digests are inconsistent, the shard automatically enters the detailed reconciliation stage;

[0081] 5. Detailed hash message digest on-chain: for the sharding reconciliation failed shard, the center-end and the reconciliation institution end both calculate the detailed hash message digest of each transaction data in the shard and upload it to the reconciliation blockchain;

[0082] 6. Detailed reconciliation processing: the automatic reconciliation smart contract deployed on the reconciliation blockchain in advance is triggered, and the detailed hash message digests of the center-end and the detailed hash message digests of the reconciliation institution end are automatically executed to check, and if the detailed hash message digests are consistent, the detailed reconciliation is successful; if the detailed hash message digests are inconsistent, the automatic error processing flow is automatically entered;

[0083] 7. Automatic error processing: after each reconciliation institution completes reconciliation, the batch reconciliation result of the institution is generated, and the transaction data of the detailed reconciliation failure is classified according to the relevant business rules uniformly formulated by the center-end, and the error details data of the batch reconciliation failure of the participating institutions and the interconnection platform is generated. The reconciliation error processing platform receives the reconciliation error data, filters the error data required to be processed, notifies the relevant reconciliation institution of the error data through the reconciliation error automatic processing interface provided by the reconciliation institution, and the reconciliation institution processes the error according to the error processing standard process uniformly provided by the center-end, and replies to the reconciliation error processing platform after the processing is completed. After receiving the reply, the reconciliation error processing platform updates the error processing state to "processing completed". For the transaction that has not fed back the processing result within the time limit, the reconciliation error processing platform performs alarm processing.

[0084] Figure 5 is a schematic diagram of main modules of a blockchain-based reconciliation device according to an embodiment of the present application. As shown in Figure 5 the blockchain-based reconciliation device 500 according to an embodiment of the present application mainly comprises a shard hash comparison module 501, a detail hash obtaining module 502 and a detail hash comparison module 503.

[0085] The shard hash comparison module 501 is configured to, in response to receiving a shard hash message digest of to-be-reconciled data uploaded by a reconciliation participant, trigger a smart contract to perform comparison of the shard hash message digest, wherein the smart contract is pre-deployed on a blockchain, and the shard hash message digest is obtained by performing hash operation on each shard after the to-be-reconciled data is sharded.

[0086] The detail hash obtaining module 502 is configured to, in a case where the comparison of the shard hash message digest is inconsistent, notify the reconciliation participant to upload a detail hash message digest of transaction data included in a shard with inconsistent comparison.

[0087] The detail hash comparison module 503 is configured to, in response to receiving the detail hash message digest uploaded by the reconciliation participant, trigger the smart contract to perform comparison of the detail hash message digest to find inconsistent transaction data and generate a reconciliation result.

[0088] According to an embodiment of the present application, the blockchain-based reconciliation device 500 can further comprise a reconciliation result generating module (not shown in the figure) configured to:

[0089] in a case where the comparison of the shard hash message digest is consistent, directly generate a reconciliation result.

[0090] According to another embodiment of the present application, the reconciliation participant comprises a reconciliation institution and a reconciliation center end; the blockchain-based reconciliation device 500 can further comprise an error processing module (not shown in the figure) configured to:

[0091] send the inconsistent transaction data to an error processing platform, so that the error processing platform performs error processing by calling the reconciliation institution and obtains an error processing result fed back by the reconciliation institution.

[0092] According to still another embodiment of the present application, the blockchain-based reconciliation device 500 can further comprise an error classification module (not shown in the figure) configured to:

[0093] before sending the inconsistent transaction data to the error processing platform, mark the inconsistent transaction data with an error classification according to a preset business rule.

[0094] The blockchain-based reconciliation device 500 can further comprise an error classification sending module (not shown in the figure) for:

[0095] When sending the inconsistent transaction data to the error handling platform, the error classification of the inconsistent transaction data is sent to the error handling platform.

[0096] According to another embodiment of the present application, the preset business rules are implemented as an automatic error smart contract; the error classification module (not shown in the figure) can be further used for

[0097] The automatic error smart contract is called to label the error classification of the inconsistent transaction data in combination with the specific transaction scenario and the failure reason.

[0098] According to another embodiment of the present application, the reconciliation institution performs error handling according to the error handling process corresponding to the error classification of the inconsistent transaction data.

[0099] According to another embodiment of the present application, the transaction data has time information, and the to-be-reconciled data is fragmented based on the time information.

[0100] According to another embodiment of the present application, the transaction data has an ordered message identification number; and the fragmented hash message digest is obtained by incrementally sorting the transaction data of each fragment in the message identification number and performing hash operation after fragmenting the to-be-reconciled data.

[0101] According to another embodiment of the present application, when the data volume of the to-be-reconciled data exceeds a first threshold value, the fragmentation time interval is reduced and the number of fragments is increased; when the data volume of the to-be-reconciled data is less than a second threshold value, the fragmentation time interval is increased and the number of fragments is reduced, wherein the first threshold value is greater than the second threshold value.

[0102] According to the technical scheme of the embodiment of the present application, the smart contract is triggered to perform comparison of the sharded hash message digest in response to receiving the sharded hash message digest of the to-be-audited data uploaded by the audit participant, wherein the smart contract is pre-deployed on the blockchain, and the sharded hash message digest is obtained by performing hash operation on each shard after sharding the to-be-audited data; in the case that the comparison of the sharded hash message digest is inconsistent, the audit participant is notified to upload the detailed hash message digest of the transaction data included in the shard with inconsistent comparison; the smart contract is triggered to perform comparison of the detailed hash message digest in response to receiving the detailed hash message digest uploaded by the audit participant, so as to find the inconsistent transaction data and generate the audit result. The technical scheme realizes automatic audit based on the blockchain, realizes automation and standardization of the audit process, and improves the credibility of the audit result by generating the audit result on the blockchain in real time and making it tamper-proof. Based on the theoretical basis of irreversibility and uniqueness of the hash algorithm, the audit is performed by comparing the hash message digest of the to-be-audited data, thereby strengthening the data privacy protection. The comparison of the audit data is performed based on the data sharding method, which helps to quickly locate the error transaction and improve the audit speed.

[0103] According to the technical scheme of the present application, the following beneficial effects can be achieved:

[0104] First, the hash algorithm is used to ensure the security of distributed ledger data. The present application uses hash message digest instead of traditional transaction details in plaintext, uses the characteristics of hash algorithm that cannot be reversely deduced to original information, realizes data isolation between different audit institutions, and ensures the security of financial data.

[0105] Second, the hash algorithm and the data sharding algorithm are used to improve the data storage performance and the audit efficiency. For example, a hash message digest is only 32 bytes, while a piece of original transaction data information is more than 104 bytes. Taking 10% of the audit error rate as an example, it is calculated that the present application can save about 96.92% of the blockchain storage space. Combined with the data sharding algorithm, the audit method of first summarizing the audit and then auditing the details can effectively reduce the algorithm complexity and greatly improve the audit efficiency.

[0106] Third, the smart contract technology based on the blockchain ensures that the audit result is tamper-proof. The smart contract automatically audits the transaction verification on each blockchain node and the consensus among the blockchain nodes. The consensus algorithm ensures that the audit result is stored in a distributed manner, thereby ensuring that the audit data is tamper-proof.

[0107] Through the above three aspects of innovation, the application is expected to have good application prospects. In terms of application field, the application can be applied to a financial market infrastructure to provide reconciliation services for participants, and a financial institution to provide transaction right service for peer institutions or large customers; in terms of application degree, the application can completely replace the traditional centralized reconciliation mode; in terms of application expected benefits, the application can reduce the consumption of hardware storage devices and network resources in the traditional reconciliation mode, and can further reduce the labor cost of enterprises for business operation such as reconciliation; in terms of application effect, the application can improve the infrastructure reconciliation efficiency and the reconciliation automation level, and further improve the external service level and market competitiveness of the infrastructure; in terms of regulatory governance, by improving the real-time and accuracy of reconciliation, it is conducive for the financial regulatory authorities to better conduct penetrating supervision.

[0108] Figure 6 An exemplary system architecture 600 of the blockchain-based reconciliation method or the blockchain-based reconciliation apparatus to which the embodiments of the application can be applied is shown.

[0109] As shown in Figure 6 , the system architecture 600 can include terminal devices 601, 602, 603, a network 604 and a server 605. The network 604 is used to provide a communication link medium between the terminal devices 601, 602, 603 and the server 605. The network 604 can include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0110] Users can use the terminal devices 601, 602, 603 to interact with the server 605 through the network 604 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as commercial bank applications, digital currency applications, digital currency wallet applications, etc. (only as examples).

[0111] The terminal devices 601, 602, 603 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers and desktop computers, etc.

[0112] The server 605 can be a server providing various services, for example, a background management server (only for example) providing support for a user using a terminal device 601, 602, 603 to send an account request. The background management server can trigger the smart contract to perform comparison of the sharded hash message digest in response to receiving the account request and the like, in the case of inconsistent comparison of the sharded hash message digest, notify the account participants of the on-chain of the detailed hash message digest of the transaction data included in the inconsistent shard, in response to receiving the on-chain of the detailed hash message digest of the account participants, trigger the smart contract to perform comparison of the detailed hash message digest, and the like, and feed back the processing result (for example, inconsistent transaction data, account result--only for example) to the terminal device.

[0113] It should be noted that the account reconciliation method based on the blockchain provided by the embodiment of the application is generally executed by the server 605, and accordingly, the account reconciliation device based on the blockchain is generally arranged in the server 605.

[0114] It should be understood that Figure 6 The number of terminal devices, networks and servers in the above description is only illustrative. According to the needs of implementation, there can be any number of terminal devices, networks and servers.

[0115] Reference will be made to Figure 7 which shows a structural schematic diagram of a computer system 700 suitable for implementing the terminal device or server of the embodiment of the application. Figure 7 The terminal device or server shown is only an example and should not bring any limitation to the function and use range of the embodiment of the application.

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

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

[0118] In particular, the processes described above with reference to the flowcharts can be implemented as a computer software program according to embodiments of the present disclosure. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the methods illustrated by the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network by the communication part 709, and / or installed from the removable medium 711. When the computer program is executed by the central processing unit (CPU) 701, the above-described functions defined in the system of the present disclosure are executed.

[0119] It should be noted that the computer-readable medium shown in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present 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, device or component. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or component. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0120] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code containing one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different order than that shown in the drawings. For example, two blocks that are shown in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0121] The units or modules described in the embodiments of the present application can be implemented by software or hardware. The described units or modules can also be arranged in a processor, for example, a processor can be described as including a shard hash comparison module, an itemized hash obtaining module and an itemized hash comparison module. Among them, the name of these units or modules does not constitute a limitation of the unit or module itself in some cases, for example, the shard hash comparison module can also be described as "a module for triggering the smart contract to perform comparison of shard hash message digest in response to receiving the shard hash message digest of the to-be-audited data of the audit participant on the chain".

[0122] As another aspect, the present application also provides a computer readable medium, which can be included in the device described in the above embodiments, or can exist independently without being assembled into the device. The above computer readable medium carries one or more programs, which, when executed by the device, cause the device to include: triggering the smart contract to perform comparison of shard hash message digest in response to receiving the shard hash message digest of the to-be-audited data of the audit participant on the chain, wherein the smart contract is pre-deployed on the blockchain, and the shard hash message digest is obtained by performing hash operation on each shard after the to-be-audited data is shredded; in the case of inconsistent comparison of shard hash message digest, notifying the audit participant to chain the itemized hash message digest of the transaction data included in the shard with inconsistent comparison; in response to receiving the itemized hash message digest chained by the audit participant, triggering the smart contract to perform comparison of the itemized hash message digest to find inconsistent transaction data and generate an audit result.

[0123] According to the technical scheme of the embodiment of the present application, the smart contract is triggered to perform comparison of the sharded hash message digest in response to receiving the sharded hash message digest of the to-be-accounted data chained by the accounting participant, wherein the smart contract is pre-deployed on the blockchain, and the sharded hash message digest is obtained by performing hash operation on each shard after sharding the to-be-accounted data; in the case of inconsistent sharded hash message digest, the accounting participant is notified to chain the detailed hash message digest of the transaction data included in the shard with inconsistent comparison; the smart contract is triggered to perform comparison of the detailed hash message digest in response to receiving the detailed hash message digest chained by the accounting participant, so as to find the inconsistent transaction data and generate the accounting result. The technical scheme, by pre-setting the automatic accounting smart contract on the blockchain, triggers the smart contract to automatically perform after the data is chained by each accounting participant, completes the data comparison, realizes the automatic accounting based on the blockchain, realizes the automation and standardization of the accounting process, and improves the credibility of the accounting result by generating the accounting result on the blockchain in real time and making it tamper-proof. Based on the theoretical basis of irreversibility and uniqueness of the hash algorithm, the data privacy protection is strengthened by comparing the hash message digest of the to-be-accounted data for accounting. The comparison of the accounting data based on the data sharding mode helps to quickly locate the error transaction and improve the accounting speed.

[0124] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can occur depending on design requirements and other factors. Any modification, equivalent replacement and improvement within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A blockchain-based reconciliation method, characterized in that, include: In response to receiving the sharded hash message digest of the reconciliation data uploaded to the blockchain by the reconciliation participants, the smart contract is triggered to perform the comparison of the sharded hash message digest. The smart contract is pre-deployed on the blockchain. The sharded hash message digest is obtained by sharding the reconciliation data, sorting the transaction data of each shard in ascending order by the ordered message identifier of the transaction data, and then performing a hash operation. In the event of a discrepancy between the shard hash message digests, the reconciliation participants are notified to upload the detailed hash message digests of the transaction data included in the discrepancy shards to the blockchain. In response to receiving the detailed hash message digest uploaded to the blockchain by the reconciliation participant, the smart contract is triggered to perform a comparison of the detailed hash message digests to find inconsistent transaction data and generate a reconciliation result.

2. The reconciliation method according to claim 1, characterized in that, Also includes: If the fragmented hash message digests match, the reconciliation result is generated directly.

3. The reconciliation method according to claim 1, characterized in that, The reconciliation participants include reconciliation institutions and reconciliation centers; the method further includes: The inconsistent transaction data is sent to the error processing platform, so that the error processing platform can call the reconciliation agency to perform error processing and obtain the error processing result fed back by the reconciliation agency.

4. The reconciliation method according to claim 3, characterized in that, Before sending the inconsistent transaction data to the error handling platform, the process also includes: The inconsistent transaction data are labeled with error classifications according to preset business rules; Sending the inconsistent transaction data to the error processing platform also includes: The errors in the inconsistent transaction data are categorized and sent to the error processing platform.

5. The reconciliation method according to claim 4, characterized in that, The preset business rules are implemented as automatic error-correcting smart contracts; the inconsistent transaction data is categorized into error types according to the preset business rules, including: The automatic error-correction smart contract is invoked to classify the inconsistent transaction data based on the specific transaction scenario and the reason for failure.

6. The reconciliation method according to claim 4, characterized in that, The reconciliation agency performs error processing according to the error classification corresponding to the inconsistency of the transaction data.

7. The reconciliation method according to claim 1, characterized in that, The transaction data has time information, and the data to be reconciled is segmented based on the time information.

8. The reconciliation method according to claim 1, characterized in that, When the amount of data to be reconciled exceeds a first threshold, the sharding interval is reduced and the number of shards is increased; when the amount of data to be reconciled is less than a second threshold, the sharding interval is increased and the number of shards is decreased, wherein the first threshold is greater than the second threshold.

9. A blockchain-based reconciliation device, characterized in that, include: The shard hash comparison module is used to respond to the receipt of the shard hash message digest of the reconciliation data uploaded to the blockchain by the reconciliation participants, and to trigger the smart contract to perform the comparison of the shard hash message digest. The smart contract is pre-deployed on the blockchain. The shard hash message digest is obtained by sharding the reconciliation data, sorting the transaction data of each shard in ascending order according to the ordered message identifier of the transaction data, and then performing a hash operation. The detailed hash acquisition module is used to notify the reconciliation participants to upload the detailed hash message digest of the transaction data included in the inconsistent shards when the shard hash message digests are mismatched. The detailed hash comparison module is used to respond to the receipt of the detailed hash message digest uploaded by the reconciliation participant, trigger the smart contract to perform a comparison of the detailed hash message digest, find inconsistent transaction data, and generate reconciliation results.

10. A blockchain-based reconciliation electronic device, characterized in that, include: One or more processors; 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 as described in any one of claims 1-8.

11. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Blockchain reconciliation method and system

    CN111861482A

  • Hash-based account checking method and device

    CN112785408A