Hash-based reconciliation method and device

Through hash calculation and the Merkel tree to generate reconciliation files, the problem of high reconciliation resources in the bank system is solved, fast reconciliation and efficient reconciliation are achieved, and the time-consuming and resource consumption of reconciliation is significantly reduced.

CN112785408BActive Publication Date: 2024-12-06INDUSTRIAL AND COMMERCIAL BANK OF CHINA

Patent Information

Application Number
CN202110214747.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-26
Publication Date
2024-12-06
Estimated Expiration
2041-02-26

AI Technical Summary

Technical Problem

When the banking system conducts reconciliation, the resource consumption is too high due to the large amount of data, which causes reconciliation to take time and waste of resources. The existing asynchronous reconciliation method has not fundamentally solved the problem.

Method used

Using hash-based reconciliation method, convert transaction data into hash value through hash calculation, generate Merkel tree and multiple reconciliation files, and use hash ring and cache server to achieve fast indexing and data verification, reducing the need The amount of data to be checked.

Benefits of technology

Effectively reduce the size of transaction data, reduce the difficulty of data reconciliation, improve reconciliation efficiency, reduce resource consumption, and significantly reduce reconciliation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112785408B_ABST
    Figure CN112785408B_ABST
Patent Text Reader

Abstract

The present invention provides a hash-based reconciliation method and device, which relates to the field of big data technology. The hash-based reconciliation method includes: obtaining transaction data to be checked; calculating the hash value corresponding to each transaction data in the transaction data and generating a leaf node of a Merkle tree based on the hash value; generating multiple reconciliation files according to the leaf nodes of the Merkle tree; and performing reconciliation based on multiple reconciliation files generated by an upstream system and a downstream system. The present invention converts transaction data into a hash value through hash calculation, effectively reducing transaction data of any length to a fixed size, and reducing the difficulty of data verification; by generating a Merkle tree and multiple reconciliation files, the amount of data that needs to be checked is effectively reduced, and the efficiency of reconciliation is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of banking business, the transaction volume and data volume of banking systems have increased by leaps and bounds. At the same time, the transaction process and business functions are split, and the banking system is constantly and meticulously divided into many business subsystems, so there will be many sub-service systems involved in a transaction process. In order to improve performance, banking systems are increasingly dependent on distributed system technology, which has led to a large number of scenarios in banking systems that need to check the consistency of upstream and downstream data, and the system resources consumed for reconciliation have also continued to grow. The current commonly used methods are as follows: the downstream system generates a full file based on the log records and transmits it to each upstream system. The upstream system filters out the data related to the system and sorts it, then obtains the local data and sorts it once, and then checks it two by two to find out the errors.

[0003] As can be seen from the above process, because all log records need to be transmitted and sorted, the network bandwidth, storage, computing and other system resources are consumed greatly. As the amount of data increases, this problem will become increasingly prominent. At present, it takes about two hours on average to reconcile tens of millions of data, and the error rate found in actual reconciliation is generally within 1%, which means that the resource cost invested in finding a small number of errors is huge, which greatly affects the normal operation of the banking system. In order to reduce the impact of the above problems, the general banking system adopts the method of asynchronous reconciliation at the end of the day to avoid affecting online business. However, this method does not fundamentally solve the problem of resource consumption in reconciliation.

[0004] Therefore, there is an urgent need for a reconciliation method or device that has high reconciliation efficiency and low reconciliation resource consumption. Summary of the invention

[0005] In view of the problems in the prior art, the present invention provides a hash-based reconciliation method and device, which utilizes a hash tree to achieve fast indexing, thereby achieving fast reconciliation, thereby improving reconciliation efficiency and reducing reconciliation time.

[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a hash-based reconciliation method, comprising:

[0008] Obtain transaction data to be verified;

[0009] Calculate the hash value corresponding to each transaction data in the transaction data and generate a leaf node of the Merkle tree based on the hash value;

[0010] Generate multiple reconciliation files according to the leaf nodes of the Merkle tree;

[0011] Reconciliation is performed based on multiple reconciliation documents generated by the upstream and downstream systems.

[0012] The step of calculating the hash value corresponding to each transaction data in the transaction data includes:

[0013] A hash calculation is performed based on the reconciliation primary key of each transaction data to obtain the hash value corresponding to each transaction data.

[0014] Wherein, multiple reconciliation files are generated according to the leaf nodes of the Merkle tree, including:

[0015] Performing hash calculations between two leaf nodes of the Merkle tree to obtain iterated leaf nodes and a reconciliation file;

[0016] Perform hash calculations between the two leaf nodes after the iteration to obtain the leaf nodes after the second iteration and a reconciliation file;

[0017] After repeated iterations, multiple reconciliation files are obtained.

[0018] The checking of multiple reconciliation files generated by the upstream system and the downstream system respectively includes:

[0019] Verify the reconciliation files corresponding to the root nodes of the upstream and downstream systems;

[0020] If the verification results of the two reconciliation documents are consistent, the reconciliation is completed;

[0021] If the verification results of the two reconciliation files are inconsistent, the multiple reconciliation files generated by the upstream system and the downstream system are verified in pairs to determine the inconsistent leaf nodes and the transaction data corresponding to the inconsistent leaf nodes.

[0022] Furthermore, after calculating the hash value corresponding to each transaction data in the transaction data, the method further includes:

[0023] Storing the hash value corresponding to the transaction data in each partition of the target hash ring;

[0024] Cache the target hash ring in a cache server;

[0025] The cache slot corresponding to the cache server is consistent with the position of the partition on the hash ring.

[0026] In a second aspect, the present invention provides a hash-based account reconciliation device, comprising:

[0027] An acquisition unit, used for acquiring transaction data to be verified;

[0028] A calculation unit, configured to calculate a hash value corresponding to each transaction data in the transaction data and generate a leaf node of a Merkle tree based on the hash value;

[0029] A processing unit, configured to generate a plurality of reconciliation files according to the leaf nodes of the Merkle tree;

[0030] The reconciliation unit is used to perform reconciliation based on multiple reconciliation files generated by the upstream system and the downstream system respectively.

[0031] Wherein, the computing unit comprises:

[0032] The calculation subunit is used to perform hash calculation based on the reconciliation primary key of each transaction data to obtain the hash value corresponding to each transaction data.

[0033] Wherein, the processing unit includes:

[0034] A first computing subunit is used to perform hash calculations between two leaf nodes of the Merkle tree to obtain iterated leaf nodes and a reconciliation file;

[0035] The second computing subunit is used to perform hash calculation between the iterated leaf nodes to obtain the leaf nodes after the second iteration and a reconciliation file;

[0036] The iterative subunit is used to obtain multiple reconciliation files after repeated iterations.

[0037] Wherein, the reconciliation unit includes:

[0038] The reconciliation subunit is used to check the reconciliation files corresponding to the root nodes of the upstream system and the downstream system;

[0039] If the verification results of the two reconciliation documents are consistent, the reconciliation is completed;

[0040] If the verification results of the two reconciliation files are inconsistent, the multiple reconciliation files generated by the upstream system and the downstream system are verified in pairs to determine the inconsistent leaf nodes and the transaction data corresponding to the inconsistent leaf nodes.

[0041] Furthermore, it also includes:

[0042] A storage unit, used to store the hash value corresponding to the transaction data in each partition of the target hash ring;

[0043] A cache unit, used for caching the target hash ring into a cache server;

[0044] The cache slot corresponding to the cache server is consistent with the position of the partition on the hash ring.

[0045] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the hash-based reconciliation method when executing the program.

[0046] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the hash-based reconciliation method.

[0047] It can be seen from the above technical solution that the present invention provides a hash-based reconciliation method and device, which converts transaction data into hash values ​​through hash calculation, effectively reduces transaction data of any length to a fixed size, and reduces the difficulty of data verification; by generating a Merkle tree and multiple reconciliation files, the amount of data that needs to be verified is effectively reduced, and the efficiency of reconciliation is effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 This is a structural diagram of the upstream and downstream systems for account reconciliation.

[0050] Figure 2 The first flowchart of the hash-based reconciliation method in an embodiment of the present invention is shown.

[0051] Figure 3 Schematic diagram of the second process of the hash-based reconciliation method in an embodiment of the present invention.

[0052] Figure 4 Schematic diagram of the redistribution of reconciliation data through the hash ring.

[0053] Figure 5 This is a schematic diagram of the process of converting reconciliation data from cache to file.

[0054] Figure 6 This is a schematic diagram of the reconciliation process.

[0055] Figure 7 A schematic diagram of the structure of a hash-based reconciliation device in an embodiment of the present invention.

[0056] Figure 8 Schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0058] An embodiment of the present invention provides a hash-based reconciliation method, which stores and quickly indexes data by caching, generates and splits reconciliation files, and achieves fast reconciliation, thereby solving the problem of time-consuming and resource-consuming pairwise verification of upstream and downstream data in a banking system.

[0059] The embodiment of the present invention provides a specific structure of an upstream system and a downstream system, see Figure 1 As shown, the upstream system and downstream system involved in the embodiment of the present invention specifically include the following equipment or devices.

[0060] Upstream database server [1.1], used to store data records in the upstream transaction process.

[0061] The upstream application server [1.2] is used to process transactions upstream, access the database server to save transaction data, and call the downstream server to complete the transaction. In the reconciliation process, it accesses the cache server to save the reconciliation data and accesses the file server to generate the reconciliation file.

[0062] The upstream cache server [1.3] is used to store temporary original reconciliation data processed in the upstream reconciliation process.

[0063] The upstream file server [1.4] is used to store the data files to be reconciled generated by the upstream application server, and to store the data files to be reconciled received from the downstream server.

[0064] Downstream database server [1.5], used to store data records in downstream transaction processes.

[0065] Downstream application server [1.6] is used to receive and process upstream transaction call requests, access the database server to save transaction data, access the cache server to save reconciliation data during the reconciliation process, and access the file server to generate reconciliation files.

[0066] The downstream cache server [1.7] is used to store temporary original reconciliation data that has been processed in the downstream reconciliation process.

[0067] The downstream file server [1.8] is used to store the data files to be reconciled generated by the downstream application server so as to be sent upstream.

[0068] Based on the above upstream system and downstream system, the present invention provides an embodiment of a hash-based reconciliation method, see Figure 2 The hash-based reconciliation method specifically includes the following contents:

[0069] S101: Acquire transaction data to be verified;

[0070] S102: Calculate a hash value corresponding to each transaction data in the transaction data and generate a leaf node of a Merkle tree based on the hash value;

[0071] In this step, the hash value corresponding to each transaction data in the transaction data is calculated, including:

[0072] A hash calculation is performed based on the reconciliation primary key of each transaction data to obtain the hash value corresponding to each transaction data.

[0073] S103: Generate multiple reconciliation files according to the leaf nodes of the Merkle tree;

[0074] In this step, hash calculation is performed between each pair of leaf nodes of the Merkle tree to obtain iterated leaf nodes and a reconciliation file;

[0075] Perform hash calculations between the two leaf nodes after the iteration to obtain the leaf nodes after the second iteration and a reconciliation file;

[0076] After repeated iterations, multiple reconciliation files are obtained.

[0077] S104: Checking based on multiple reconciliation files generated by the upstream system and the downstream system respectively.

[0078] In this step, the reconciliation files corresponding to the root nodes of the upstream system and the downstream system are checked;

[0079] If the verification results of the two reconciliation documents are consistent, the reconciliation is completed;

[0080] If the verification results of the two reconciliation files are inconsistent, the multiple reconciliation files generated by the upstream system and the downstream system are verified in pairs to determine the inconsistent leaf nodes and the transaction data corresponding to the inconsistent leaf nodes.

[0081] In this embodiment, the downstream application server [1.6] sends the reconciliation file [3.2] to the upstream application server [1.2], and the upstream application server [1.2] generates the reconciliation file [4.1] using the same process. As can be seen from the above process, since the ring size is fixed, the number of leaf nodes of the generated tree is fixed, and the position of the same data remains unchanged, the depth of the Merkle tree generated by the upstream and downstream is consistent, and the final reconciliation of the original data can be transformed into a comparison of the tree.

[0082] The upstream application server [1.2] checks the 23 files in pairs. Ideally, if the accounts are consistent, only file 23 needs to be checked and the hashes compared once to obtain a successful reconciliation result.

[0083] Generally, if there are inconsistent records, you need to scan 23 files sequentially to find the inconsistent Merkle trees leaf nodes. During the tree comparison process, only the tree access paths caused by the inconsistent leaf nodes need to be compared, and other tree nodes do not need to be compared.

[0084] Based on the comparison results, the upstream application then notifies the downstream application to generate the original data file [4.2] according to the inconsistent Merkle trees leaf nodes to verify the specific data and find out the inconsistent records.

[0085] From the above description, it can be seen that the hash-based reconciliation method provided in the embodiment of the present invention converts transaction data into hash values ​​through hash calculation, effectively reducing transaction data of any length to a fixed size, thereby reducing the difficulty of data verification; by generating a Merkle tree and multiple reconciliation files, the amount of data that needs to be verified is effectively reduced, thereby effectively improving the efficiency of reconciliation.

[0086] In one embodiment of the present invention, see Figure 3 After step S101 of the hash-based reconciliation method, the following contents are specifically included:

[0087] S105: storing the hash value corresponding to the transaction data in each partition of the target hash ring;

[0088] S106: Cache the target hash ring in a cache server;

[0089] The cache slot corresponding to the cache server is consistent with the position of the partition on the hash ring.

[0090] In this embodiment, the process of generating a reconciliation file: The reconciliation data is first redistributed into the cache through the hash ring, and then the merkle trees reconciliation file is generated:

[0091] See also Figure 4 , Figure 5 and Figure 6 First, query all transaction data (100 million in this example) from the downstream database server [1.5], calculate the hash value for the reconciliation key of each data, and correspond to a 2 to the 22th power hash ring [2.1], that is, 100 million records are distributed into 4 million (4194304) partitions, with an average of about 23 records per partition. Since the number of partitions is 1 / 20 of the total number of data, according to the specific hash, it can be considered that each partition has a high probability of containing records, that is, the possibility of wasting partitions is extremely low.

[0092] After calculating the hash ring partition to which the transaction data belongs, the transaction data is saved in the downstream cache server [1.7]. The corresponding cache slot is consistent with the position of the hash partition, thereby ensuring that the same record must be located in a fixed slot.

[0093] Records at the same position in the cache are sorted and saved using chains [2.2], thereby ensuring that the same record is always located in a fixed order position within a specified slot.

[0094] After all records are in the cache, the cache can be accessed sequentially to calculate the hash value of each slot, generate the leaf nodes of the Merkle trees[3.1], and record them sequentially in file 1[3.2]. Then, file 1[3.2] is scanned, and the hash values ​​of the records in it are calculated pairwise to generate file 2[3.2]. After 23 cycles, the root node file 23[3.2] representing the Merkle trees[3.1] can be obtained.

[0095] From the above description, it can be seen that the hash-based reconciliation method provided in the embodiment of the present invention reduces the size of the data by calculating the hash value of the data to be checked, and reduces the amount of data to be checked by utilizing the characteristic of hash to retain data features, and further utilizes the hash tree to achieve fast indexing, thereby achieving fast reconciliation and solving the problem of time-consuming and resource-consuming reconciliation.

[0096] To further illustrate the present solution, the present invention provides a hash-based reconciliation method in which the size of the hash ring and the length of the cache chain need to be dynamically adjusted according to actual conditions to achieve the optimal effect, for example:

[0097] 1. Generally, the length of a hash value is 19 characters, while in banking business, at least the reconciliation fields include the card number, account number, event number, and amount. That is, if a hash value is used to represent a record, the maximum length is only 1 / 3 of the original.

[0098] 2. According to 100 million (10 8 ) data volume;

[0099] 3. Calculated based on the general error rate of 1%, that is, 1 million (106 ) pieces of error data;

[0100] 1. If a hash ring of 2 to the power of 22 (less than 100 million) is used, then:

[0101] Data transfer is 23% of the original;

[0102] (2^23×1 / 3+10^8×1%×20) / 10^8;

[0103] Number of tree nodes × length ratio + error data × chain length / amount of original data;

[0104] The number of data comparisons is 25% of the original number;

[0105] (2^21+(23-20)×10^6+10^6×20) / 10^8;

[0106] 1 million error data, all nodes below the tree depth of 20 need to be visited once and only once;

[0107] At tree depths above 20, each layer is visited with 1 million error nodes;

[0108] 1 million error data must be fully accessed each time in chain length 20;

[0109] 2. If a hash ring of 2 to the power of 27 (greater than 100 million) is used, then:

[0110] (1) Data transmission is 66% of the original;

[0111] (200 million × 1 / 3) / 100 million;

[0112] Number of valid tree nodes × length ratio / amount of original data;

[0113] (2) The number of data comparisons is 10% of the original number;

[0114] (2^21+(28-20)×10^6) / 10^8;

[0115] 1 million error data, all nodes below the tree depth of 20 need to be visited once and only once;

[0116] At tree depths above 20, each layer is visited with 1 million error nodes.

[0117] The embodiment of the present invention provides a specific implementation of a Hash-based reconciliation device that can implement all the contents of the Hash-based reconciliation method, see Figure 7 The hash-based reconciliation device specifically includes the following contents:

[0118] An acquisition unit 10, used to acquire transaction data to be verified;

[0119] A calculation unit 20, configured to calculate a hash value corresponding to each transaction data in the transaction data and generate a leaf node of a Merkle tree based on the hash value;

[0120] A processing unit 30, configured to generate a plurality of reconciliation files according to the leaf nodes of the Merkle tree;

[0121] The reconciliation unit 40 is used to perform reconciliation based on a plurality of reconciliation files generated by the upstream system and the downstream system respectively.

[0122] Wherein, the computing unit comprises:

[0123] The calculation subunit is used to perform hash calculation based on the reconciliation primary key of each transaction data to obtain the hash value corresponding to each transaction data.

[0124] Wherein, the processing unit includes:

[0125] A first computing subunit is used to perform hash calculations between two leaf nodes of the Merkle tree to obtain iterated leaf nodes and a reconciliation file;

[0126] The second computing subunit is used to perform hash calculation between the iterated leaf nodes to obtain the leaf nodes after the second iteration and a reconciliation file;

[0127] The iterative subunit is used to obtain multiple reconciliation files after repeated iterations.

[0128] Wherein, the reconciliation unit includes:

[0129] The reconciliation subunit is used to check the reconciliation files corresponding to the root nodes of the upstream system and the downstream system;

[0130] If the verification results of the two reconciliation documents are consistent, the reconciliation is completed;

[0131] If the verification results of the two reconciliation files are inconsistent, the multiple reconciliation files generated by the upstream system and the downstream system are verified in pairs to determine the inconsistent leaf nodes and the transaction data corresponding to the inconsistent leaf nodes.

[0132] Furthermore, it also includes:

[0133] A storage unit, used to store the hash value corresponding to the transaction data in each partition of the target hash ring;

[0134] A cache unit, used for caching the target hash ring into a cache server;

[0135] The cache slot corresponding to the cache server is consistent with the position of the partition on the hash ring.

[0136] The embodiment of the hash-based reconciliation device provided by the present invention can be specifically used to execute the processing flow of the embodiment of the hash-based reconciliation method in the above embodiment. Its functions are not repeated here, and reference can be made to the detailed description of the above method embodiment.

[0137] From the above description, it can be seen that the hash-based reconciliation device provided in the embodiment of the present invention converts transaction data into hash values ​​through hash calculation, effectively reducing transaction data of any length to a fixed size, thereby reducing the difficulty of data verification; by generating a Merkle tree and multiple reconciliation files, the amount of data that needs to be verified is effectively reduced, thereby effectively improving the efficiency of reconciliation.

[0138] The present application provides an embodiment of an electronic device for implementing all or part of the contents of the Hash-based reconciliation method. The electronic device specifically includes the following contents:

[0139] Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between related devices; the electronic device can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the electronic device can be implemented with reference to the embodiment for realizing the hash-based reconciliation method and the embodiment for realizing the hash-based reconciliation device, and the contents thereof are incorporated herein and the repeated parts are not repeated.

[0140] Figure 8 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Figure 8 As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Figure 8 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0141] In another embodiment, the hash-based reconciliation device can be configured separately from the central processor 9100. For example, the hash-based reconciliation can be configured as a chip connected to the central processor 9100, and the hash-based reconciliation function can be implemented through the control of the central processor.

[0142] like Figure 8As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Figure 8 In addition, the electronic device 9600 may also include Figure 8 For components not shown, reference may be made to the prior art.

[0143] like Figure 8 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.

[0144] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.

[0145] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

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

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

[0148] The communication module 9110 is a transmitter / receiver 9110 that sends and receives signals via an antenna 9111. The communication module (transmitter / receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0149] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module, etc. The communication module (transmitter / receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.

[0150] Although the present invention provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, in a parallel processor or multi-threaded processing environment).

[0151] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, devices (systems) or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0152] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0153] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0154] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0155] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other in the absence of conflict. The present invention is not limited to any single aspect, nor is it limited to any single embodiment, nor is it limited to any combination and / or permutation of these aspects and / or embodiments. Moreover, each aspect and / or embodiment of the present invention can be used alone or in combination with one or more other aspects and / or embodiments thereof.

[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.

Claims

1. A hash-based reconciliation method, It is characterized in that include: Obtain transaction data to be verified; Calculate the hash value corresponding to each transaction data in the transaction data and generate a leaf node of the Merkle tree based on the hash value; Generate multiple reconciliation files according to the leaf nodes of the Merkle tree; Verify multiple reconciliation documents generated by upstream and downstream systems; After calculating the hash value corresponding to each transaction data in the transaction data, the method further includes: Storing the hash value corresponding to the transaction data in each partition of the target hash ring; Cache the target hash ring in a cache server; Among them, the cache slot corresponding to the cache server is consistent with the position of the partition on the hash ring, so that the same record must be located in a fixed slot. For records in the same position in the cache, it is ensured that the same record must be located in a fixed sequential position in the specified slot. The size of the hash ring and the length of the cache chain are dynamically adjusted according to actual conditions to achieve the optimal effect.

2. The hash-based reconciliation method according to claim 1, It is characterized in that The calculating the hash value corresponding to each transaction data in the transaction data includes: A hash calculation is performed based on the reconciliation primary key of each transaction data to obtain the hash value corresponding to each transaction data.

3. The hash-based reconciliation method according to claim 1, It is characterized in that Generate multiple reconciliation files according to the leaf nodes of the Merkle tree, including: Performing hash calculations between two leaf nodes of the Merkle tree to obtain iterated leaf nodes and a reconciliation file; Perform hash calculations between the two leaf nodes after the iteration to obtain the leaf nodes after the second iteration and a reconciliation file; After repeated iterations, multiple reconciliation files are obtained.

4. The hash-based reconciliation method according to claim 1, It is characterized in that The checking of multiple reconciliation files generated by the upstream system and the downstream system respectively includes: Verify the reconciliation files corresponding to the root nodes of the upstream and downstream systems; If the verification results of the two reconciliation documents are consistent, the reconciliation is completed; If the verification results of the two reconciliation files are inconsistent, the multiple reconciliation files generated by the upstream system and the downstream system are verified in pairs to determine the inconsistent leaf nodes and the transaction data corresponding to the inconsistent leaf nodes.

5. A hash-based reconciliation device, It is characterized in that include: An acquisition unit, used for acquiring transaction data to be verified; A calculation unit, configured to calculate a hash value corresponding to each transaction data in the transaction data and generate a leaf node of a Merkle tree based on the hash value; A processing unit, configured to generate a plurality of reconciliation files according to the leaf nodes of the Merkle tree; A reconciliation unit, used to check multiple reconciliation files generated by the upstream system and the downstream system; Also includes: A storage unit, used to store the hash value corresponding to the transaction data in each partition of the target hash ring; A cache unit, used for caching the target hash ring into a cache server; Among them, the cache slot corresponding to the cache server is consistent with the position of the partition on the hash ring, so that the same record must be located in a fixed slot. For records in the same position in the cache, it is ensured that the same record must be located in a fixed sequential position in the specified slot. The size of the hash ring and the length of the cache chain are dynamically adjusted according to actual conditions to achieve the optimal effect.

6. The hash-based reconciliation device according to claim 5, It is characterized in that The computing unit comprises: The calculation subunit is used to perform hash calculation based on the reconciliation primary key of each transaction data to obtain the hash value corresponding to each transaction data.

7. The hash-based reconciliation device according to claim 5, It is characterized in that The processing unit comprises: A first computing subunit is used to perform hash calculations between two leaf nodes of the Merkle tree to obtain iterated leaf nodes and a reconciliation file; The second computing subunit is used to perform hash calculation between the iterated leaf nodes to obtain the leaf nodes after the second iteration and a reconciliation file; The iterative subunit is used to obtain multiple reconciliation files after repeated iterations.

8. The hash-based reconciliation device according to claim 5, It is characterized in that The reconciliation unit comprises: The reconciliation subunit is used to check the reconciliation files corresponding to the root nodes of the upstream system and the downstream system; If the verification results of the two reconciliation documents are consistent, the reconciliation is completed; If the verification results of the two reconciliation files are inconsistent, the multiple reconciliation files generated by the upstream system and the downstream system are verified in pairs to determine the inconsistent leaf nodes and the transaction data corresponding to the inconsistent leaf nodes.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the hash-based reconciliation method described in any one of claims 1 to 4 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the hash-based reconciliation method described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Comparison and consensus method for block chain data

    CN106682907A

  • Metadata verification method, system server and computer readable storage medium

    CN109657499A

  • Consumption information checking method and device and storage medium

    CN109767245A

  • Distributed caching method and device supporting multiple nodes

    CN109783564A

  • Credible cloud storage method and system based on block chain

    CN110011981A

Cited By

  • Data comparison reconciliation method and system in cross-network data exchange transmission scene

    CN119676337A

  • A data comparison and reconciliation method and system in a cross-network data exchange and transmission scenario

    CN119676337B