Movatterモバイル変換


[0]ホーム

URL:


CN114266578B - Transaction reconciliation method and system based on Merker tree - Google Patents

Transaction reconciliation method and system based on Merker tree

Info

Publication number
CN114266578B
CN114266578BCN202111402571.4ACN202111402571ACN114266578BCN 114266578 BCN114266578 BCN 114266578BCN 202111402571 ACN202111402571 ACN 202111402571ACN 114266578 BCN114266578 BCN 114266578B
Authority
CN
China
Prior art keywords
hash
reconciliation
transaction
node
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111402571.4A
Other languages
Chinese (zh)
Other versions
CN114266578A (en
Inventor
孟祥乾
佛宇航
王惠平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Aisino Corp
Original Assignee
Aisino Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Aisino CorpfiledCriticalAisino Corp
Priority to CN202111402571.4ApriorityCriticalpatent/CN114266578B/en
Publication of CN114266578ApublicationCriticalpatent/CN114266578A/en
Application grantedgrantedCritical
Publication of CN114266578BpublicationCriticalpatent/CN114266578B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

Translated fromChinese

本发明公开了一种基于默克尔树的交易对账方法和系统,包括:对帐双方根据预设的hash算法、交易数据和对账发起时间,生成每笔交易对应的hash值;所述hash值为交易时间段对应的默克尔树的叶子节点;将两个叶子节点的hash值进行哈希运算,生成默克尔树中间节点对应的hash值,将两个中间节点的hash值进行哈希运算,生成默克尔树根节点对应的hash值;比较对帐双方默克尔树根据节点对应的hash值,若比较结果为一致,则对帐结果为平帐;若比较结果为不一致,获取比较结果不一致的叶子节点hash值;根据所述叶子节点hash值,获取对应的交易数据;对账双方根据所述交易数据进行交易对账。解决现有的人工对帐方式,无法快速确定双方交易信息是否一致,导致对账的效率低下的问题。

The invention discloses a transaction reconciliation method and system based on Merkle tree, comprising: the two parties of reconciliation generate a hash value corresponding to each transaction according to a preset hash algorithm, transaction data and reconciliation initiation time; the hash value is a leaf node of the Merkle tree corresponding to the transaction time period; the hash values of two leaf nodes are hashed to generate a hash value corresponding to the middle node of the Merkle tree, and the hash values of two middle nodes are hashed to generate a hash value corresponding to the root node of the Merkle tree; the hash values corresponding to the nodes of the Merkle tree of the two parties of reconciliation are compared, and if the comparison result is consistent, the reconciliation result is balanced; if the comparison result is inconsistent, the hash value of the leaf node with inconsistent comparison result is obtained; according to the hash value of the leaf node, the corresponding transaction data is obtained; the two parties of reconciliation perform transaction reconciliation according to the transaction data. The existing manual reconciliation method can solve the problem that it is impossible to quickly determine whether the transaction information of both parties is consistent, resulting in low efficiency of reconciliation.

Description

Transaction reconciliation method and system based on Merker tree
Technical Field
The application relates to the technical field of data processing, in particular to a transaction reconciliation method and system based on a merck tree.
Background
Transaction reconciliation refers to the process of two-party confirmation of transaction information or billing data over a period of time between two parties to a transaction or between the upstream and downstream of the transaction, including but not limited to, individuals or institutions such as consumers, sellers, three-party payment institutions, banks, banked, and the like.
The current mainstream transaction reconciliation method comprises the steps of obtaining a reconciliation document, analyzing the reconciliation document, reconciliation processing and error reconciliation processing. The general method for acquiring the reconciliation document is to upload or download the upstream reconciliation data document under the special network environment through a timing task. The obtained file is decoded and read to the memory of the computer through the file analysis program, and then is restored to the database or the data cache. The reconciliation process needs to make a reconciliation rule according to the dimensions of payment state, transaction amount, transaction time, transaction data benchmark and the like, and then the data-by-data comparison is carried out on transaction information in a database or a data cache through the reconciliation rule. When the data comparison shows that the error account such as multi-account, short account and the like appears, automatic or manual account checking is performed to solve the problem of the error account of the transaction. The existing manual account checking mode cannot quickly determine whether the transaction information of the two parties is consistent, so that the account checking efficiency is low.
Disclosure of Invention
In order to solve the above problems, the present application provides a transaction reconciliation method based on merck tree, comprising:
The method comprises the steps that a reconciliation party generates a hash value corresponding to each transaction according to a preset hash algorithm, transaction data and reconciliation initiating time, wherein the hash value is a leaf node of a merck tree corresponding to a transaction time period;
Hash operation is carried out on the hash values of the two leaf nodes to generate hash values corresponding to the intermediate nodes of the merck tree, and hash operation is carried out on the hash values of the two intermediate nodes to generate hash values corresponding to the root nodes of the merck tree;
Comparing the hash values of the merck trees generated by the two parties of the reconciliation according to the nodes, if the comparison results are consistent, the reconciliation results are flat accounts, if the comparison results are inconsistent, comparing the hash values of the leaf nodes corresponding to the merck trees of the two parties of the reconciliation to obtain the hash values of the leaf nodes inconsistent in the comparison results, obtaining corresponding transaction data according to the hash values of the leaf nodes, and carrying out transaction reconciliation according to the transaction data by the two parties of the reconciliation.
Preferably, the generating, by the reconciliation parties, a hash value corresponding to each transaction according to a preset hash algorithm, transaction data and reconciliation initiation time includes:
Selecting any one of the hash algorithms including MD5, sha1, sha256, crc32 and haval as a hash algorithm according to the preset by the two parties of the reconciliation;
and running the transaction data and the account checking initiating time through the hash algorithm to generate a hash value corresponding to each transaction.
Preferably, the transaction data includes payee, payer, transaction amount, transaction status, transaction type, transaction time, and transaction voucher number.
Preferably, hash operation is performed on hash values of two leaf nodes to generate hash values corresponding to intermediate nodes of the merck tree, hash operation is performed on hash values of two intermediate nodes, hash values corresponding to Cheng Moke r tree root nodes, and the method includes:
Pairing two adjacent leaf nodes, carrying out hash operation on hash values of the two adjacent leaf nodes, and generating a hash value corresponding to a Merker tree intermediate node;
If the number of the intermediate nodes is more than two, pairing the two adjacent intermediate nodes, carrying out hash operation on the hash values of the two adjacent intermediate nodes, and generating a hash value corresponding to a new intermediate node of the merck tree until the hash value generated by the intermediate node is unique, wherein the node corresponding to the unique hash value is the root node of the merck tree.
Preferably, the method further comprises:
If the leaf node or the intermediate node is not paired, carrying out hash operation on the leaf node or the intermediate node by a preset default hash value.
Preferably, the transaction checking is performed by the checking parties according to the transaction data, including:
And the account checking and settling parties perform confirmation and settling processing on the places where the transaction data are inconsistent.
The application also provides a transaction reconciliation system based on the merck tree, which comprises:
The system comprises a leaf node generation module, a transaction time period generation module and a transaction time period generation module, wherein the leaf node generation module is used for generating a hash value corresponding to each transaction according to a preset hash algorithm, transaction data and the transaction initiation time by the two parties;
The Merker tree generation module is used for carrying out hash operation on the hash values of the two leaf nodes to generate hash values corresponding to the intermediate nodes of the Merker tree, carrying out hash operation on the hash values of the two intermediate nodes to generate hash values corresponding to the root nodes of the Merker tree;
The reconciliation module is used for comparing hash values corresponding to the merck tree root nodes generated by the reconciliation parties, if the comparison results are consistent, the reconciliation results are the reconciliation, if the comparison results are inconsistent, the hash values of the leaf nodes corresponding to the merck tree of the reconciliation parties are compared, the hash values of the leaf nodes inconsistent in the comparison results are obtained, corresponding transaction data are obtained according to the hash values of the leaf nodes, and the reconciliation parties conduct transaction reconciliation according to the transaction data.
Preferably, the merck tree generating module includes:
the leaf node pairing submodule is used for pairing two adjacent leaf nodes, carrying out hash operation on hash values of the two adjacent leaf nodes and generating a hash value corresponding to a merck tree intermediate node;
And the intermediate node pairing submodule is used for pairing two adjacent intermediate nodes if the intermediate nodes are more than two, carrying out hash operation on the hash values of the two adjacent intermediate nodes to generate a hash value corresponding to a new intermediate node of the merck tree until the hash value generated by the intermediate nodes is unique, wherein the node corresponding to the unique hash value is the root node of the merck tree.
Preferably, the method further comprises:
and the default pairing submodule is used for carrying out hash operation on the leaf node or the intermediate node by a preset default hash value if the leaf node or the intermediate node fails to pair.
Preferably, the reconciliation module comprises:
And the processing sub-module is used for confirming and settling the places where the transaction data are inconsistent by the account checking and accounting parties.
Drawings
FIG. 1 is a schematic flow chart of a transaction reconciliation method based on the merck tree provided by the application;
FIG. 2 is a block diagram of a data structure and a process diagram of generating a transaction reconciliation merck tree in accordance with the application;
fig. 3 is a schematic structural diagram of a transaction reconciliation system based on a merck tree according to the application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. The present application may be embodied in many other forms than those herein described, and those skilled in the art will readily appreciate that the present application may be similarly embodied without departing from the spirit or essential characteristics thereof, and therefore the present application is not limited to the specific embodiments disclosed below.
Fig. 1 is a flow chart of a transaction reconciliation method based on the merck tree provided by the application, and the method provided by the application is described in detail below with reference to fig. 1.
Step S101, according to a preset hash algorithm, transaction data and account checking initiation time, the account checking parties generate a hash value corresponding to each transaction, wherein the hash value is a leaf node of a merck tree corresponding to a transaction time period.
The Merker tree is also called a hash tree, and essentially is a tree-shaped data structure, and consists of data blocks, leaf nodes, intermediate nodes and root nodes, wherein any father node of the tree-shaped data structure is equal to the result of hashing after adding data of left and right child nodes, and the topmost node is called the Merker tree root, is a binary tree and has the characteristics of certainty, irreversibility, uniform length and high-efficiency retrieval ratio. Hash (hash) is a function of mapping arbitrary length data into fixed length data, including but not limited to MD5, sha1, sha256, crc32, haval, etc., and the original data is arbitrarily changed, the hash value will be changed drastically.
The method comprises the steps of selecting any one of the hash algorithms including MD5, sha1, sha256, crc32 and haval by the two parties of the reconciliation as the hash algorithm of the two parties of the reconciliation, running transaction data and reconciliation initiating time through the hash algorithm, and generating a hash value corresponding to each transaction. The hash value is a leaf node of the merck tree corresponding to the transaction time period. The transaction data comprises a payee, a payer, a transaction amount, a transaction state, a transaction type, a transaction time and a transaction voucher number.
Step S102, hash operation is carried out on the hash values of the two leaf nodes, so that hash values corresponding to the intermediate nodes of the merck tree are generated, hash operation is carried out on the hash values of the two intermediate nodes, and hash values corresponding to the root nodes of the merck tree are generated.
Pairing two adjacent leaf nodes, carrying out hash operation on hash values of the two adjacent leaf nodes to generate hash values corresponding to the Merker tree intermediate nodes, pairing the two adjacent intermediate nodes if the intermediate nodes are more than two, carrying out hash operation on the hash values of the two adjacent intermediate nodes to generate hash values corresponding to new intermediate nodes of the Merker tree until the hash values generated by the intermediate nodes are unique, wherein the unique hash value corresponds to the root node of the Merker tree.
If the leaf node or the intermediate node is not paired, carrying out hash operation on the leaf node or the intermediate node by a preset default hash value.
Step S103, comparing the hash values of the merck tree corresponding to the merck tree generated by the reconciliation parties according to the nodes, if the comparison results are consistent, the reconciliation results are flat, if the comparison results are inconsistent, comparing the hash values of the leaf nodes corresponding to the merck tree of the reconciliation parties to obtain the hash values of the leaf nodes inconsistent in the comparison results, obtaining corresponding transaction data according to the hash values of the leaf nodes, and carrying out transaction reconciliation by the reconciliation parties according to the transaction data
And when the comparison result is inconsistent, according to the acquired corresponding transaction data, confirming and translating the place where the transaction data are inconsistent by the account checking and accounting parties.
Specific examples of applications are as follows:
The main functions of the application are account checking setting, hash generation, account checking hash tree generation and account checking execution. The reconciliation setting is used for setting transaction fields for generating hash values, and comprises the setting of reconciliation types, field names, field sequences, dictionary value conversion, connectors, hash default values, reconciliation time and the like, and the customized setting can be carried out according to the dimensions of the transaction types, the transaction states, the reconciliation time and the like, so that centralized standardized management of different business reconciliation is realized. The hash generation module is triggered at the set checking time point, and performs hash calculation on the corresponding transaction records according to rules set by checking to obtain a corresponding hash value of each transaction. The generated hash values are subjected to hash calculation again in pairs, the transaction hashes which cannot be paired in pairs are paired by the hash default value set by the system, and finally a hash tree containing the whole reconciliation transaction, namely a reconciliation hash tree is generated. The downstream organization acquires the reconciliation hash tree generated by the upstream organization, firstly acquires a root node, and judges whether the root node is consistent with the root node of the reconciliation hash tree generated by the downstream organization. And according to the certainty and the irreversibility of the merck tree, if the certainty and the irreversibility are consistent, the transaction information of the two parties is consistent, and the reconciliation work is finished. If the transaction information is inconsistent, and the account is required to be settled. And then, performing subsequent traversal on the double-party account checking hash tree, comparing the traversal results, outputting leaf nodes corresponding to inconsistent hash values, further matching transaction information records corresponding to the leaf node hash, triggering a manual processing flow, and ending the account checking work.
The reconciliation setting function flow specifically comprises:
and (3) newly adding a checking setting record to the click system function page, setting information such as checking type, field name, field sequence, dictionary value conversion, connector, hash default value, hash algorithm, checking time and the like, and storing the information. When the checking record is selected and set to be effective, the system background records the setting and generates a timing task according to the checking time of the record. When the account checking record is selected and set to be invalid, the system background does not generate a timing task and only records the setting.
The hash generation function flow specifically comprises the following steps:
after the timing task generated by the checking setting module is started at a specific checking time point, the transaction information is spliced in a selective and orderly mode according to field items set by the checking, after the splicing is completed, batch processing is carried out through a agreed hash algorithm, a transaction hash value corresponding to each transaction is generated, the transaction hash value is stored in a computer, and storage positions comprise memories, caches, databases, files and the like.
The reconciliation hash tree generation function flow specifically comprises the following steps:
The adjacent transaction hash values are paired in pairs, and less than two transaction hash default values are paired with the account checking set. After the pairing connection, the hash is performed again. And taking the adjacent transaction hash as a leaf node, and taking a result obtained by re-hashing as a father node to create the merck tree. The pairing connection of the parent nodes is performed again, and the result after the pairing connection is hashed is used as a new parent node. And repeating the steps to finally obtain the reconciliation hash tree, wherein the detail is shown in figure 2.
The account checking execution function flow specifically comprises the following steps:
The downstream reconciliation mechanism obtains the data file or the character string containing the reconciliation hash tree through network request, mailbox notification and the like in an online or offline mode. Analyzing a data file or character string of the reconciliation hash tree, converting the data file or character string into a program object of a tree structure, reading a root node, judging whether the data file or character string is consistent with the root node of the reconciliation hash tree generated by the mechanism, outputting a reconciliation result as a reconciliation, ending the reconciliation execution, if the data file or character string is inconsistent, traversing the reconciliation hash tree in a subsequent traversing mode, comparing the data file or character string with the reconciliation hash tree of the mechanism, removing intermediate nodes, and outputting inconsistent leaf node transaction hashes in the reconciliation hash tree of the mechanism. And outputting the account checking result and the corresponding detail record according to the specific transaction detail record corresponding to the transaction hash query summary, and ending the account checking execution.
In the above embodiments, when both parties transact, the transaction systems of both parties splice key transaction information such as the payee, the payer, the transaction amount, the transaction state, the transaction type, the transaction time, the transaction certificate number, and the like according to the transaction data item and the data dictionary agreed in advance, and then perform hash operation in real time to obtain the unique hash value of the transaction. And then carrying out hash operation on the transaction hashes in pairs again, and generating the merck tree of the transaction information hash in a certain period according to the creation rule of the merck tree. If the transaction data of both transaction parties are completely consistent in the transaction period, namely the hash value of each transaction data is consistent, the finally generated merck tree root of the time period is necessarily consistent. According to the certainty and irreversibility of the merck tree, if the finally generated merck tree root is inconsistent, the transaction data of both transaction parties can be stated to have error account necessarily. And traversing Merck trees of both sides, searching and comparing branches with inconsistent transaction hashes, traversing the branches, determining specific transaction data hashes related to the branches, locking a specific error transaction, and triggering automatic or manual form of account checking to solve the occurring transaction error account.
According to the transaction reconciliation method provided by the application, the complex and huge transaction reconciliation file is converted into the concise and safe binary tree data format with unified format and open standard, the transmission, analysis and comparison processes are greatly improved compared with the prior processes, the network dependence is reduced, less calculation resources are consumed, the standardized analysis enables the upstream and downstream butt joint to be more convenient and efficient, and due to the certainty and irreversibility of the hash value, the data is ensured not to be tampered, so that the data reconciliation processing is safer and more accurate.
Based on the same inventive concept, the present application also provides a transaction reconciliation system 300 based on the merck tree, as shown in fig. 3, comprising:
The leaf node generating module 310 is configured to generate a hash value corresponding to each transaction according to a preset hash algorithm, transaction data and accounting initiation time, where the hash value is a leaf node of the merck tree corresponding to the transaction time period;
the merck tree generating module 320 is configured to perform hash operation on hash values of two leaf nodes to generate hash values corresponding to intermediate nodes of the merck tree, and perform hash operation on hash values of two intermediate nodes to generate hash values corresponding to root nodes of the merck tree;
The reconciliation module 330 is configured to compare hash values corresponding to the merck tree generated by the reconciliation parties according to the nodes, if the comparison results are consistent, the reconciliation results are flat, if the comparison results are inconsistent, compare leaf node hash values corresponding to the merck tree of the reconciliation parties to obtain leaf node hash values inconsistent in comparison results, obtain corresponding transaction data according to the leaf node hash values, and the reconciliation parties perform transaction reconciliation according to the transaction data.
Preferably, the merck tree generating module includes:
the leaf node pairing submodule is used for pairing two adjacent leaf nodes, carrying out hash operation on hash values of the two adjacent leaf nodes and generating a hash value corresponding to a merck tree intermediate node;
And the intermediate node pairing submodule is used for pairing two adjacent intermediate nodes if the intermediate nodes are more than two, carrying out hash operation on the hash values of the two adjacent intermediate nodes to generate a hash value corresponding to a new intermediate node of the merck tree until the hash value generated by the intermediate nodes is unique, wherein the node corresponding to the unique hash value is the root node of the merck tree.
Preferably, the method further comprises:
and the default pairing submodule is used for carrying out hash operation on the leaf node or the intermediate node by a preset default hash value if the leaf node or the intermediate node fails to pair.
Preferably, the reconciliation module comprises:
And the processing sub-module is used for confirming and settling the places where the transaction data are inconsistent by the account checking and accounting parties.
Finally, it should be noted that the above-mentioned embodiments are only for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the above-mentioned embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the specific embodiments of the present invention without departing from the spirit and scope of the present invention, and any modifications and equivalents are intended to be encompassed in the scope of the claims of the present invention.

Claims (8)

Translated fromChinese
1.一种基于默克尔树的交易对账方法,其特征在于,包括:1. A transaction reconciliation method based on Merkle tree, characterized by comprising:对账双方根据预设的hash算法、交易数据和对账发起时间,生成每笔交易对应的hash值;所述hash值为交易时间段对应的默克尔树的叶子节点;The two parties to the reconciliation generate a hash value corresponding to each transaction based on the preset hash algorithm, transaction data and reconciliation initiation time; the hash value is the leaf node of the Merkle tree corresponding to the transaction time period;将两个叶子节点的hash值进行哈希运算,生成默克尔树中间节点对应的hash值,将两个中间节点的hash值进行哈希运算,生成默克尔树根节点对应的hash值;Hash the hash values of the two leaf nodes to generate the hash value corresponding to the middle node of the Merkle tree. Hash the hash values of the two middle nodes to generate the hash value corresponding to the root node of the Merkle tree.比较对账双方生成的默克尔树根节点对应的hash值, 若比较结果为一致,则对账结果为平账;若比较结果为不一致,则将对账双方默克尔树对应的叶子节点hash值进行比较,获取比较结果不一致的叶子节点hash值;根据所述叶子节点hash值,获取对应的交易数据;对账双方根据所述交易数据进行交易对账;Compare the hash values corresponding to the root nodes of the Merkle trees generated by the two parties to the reconciliation. If the comparison result is consistent, the reconciliation result is a balance; if the comparison result is inconsistent, compare the hash values of the leaf nodes corresponding to the Merkle trees of the two parties to the reconciliation, and obtain the hash values of the leaf nodes with inconsistent comparison results; obtain the corresponding transaction data according to the hash values of the leaf nodes; the two parties to the reconciliation perform transaction reconciliation according to the transaction data;将两个叶子节点的hash值进行哈希运算,生成默克尔树中间节点对应的hash值,将两个中间节点的hash值进行哈希运算,成默克尔树根节点对应的hash值,包括:The hash values of the two leaf nodes are hashed to generate the hash value corresponding to the intermediate node of the Merkle tree. The hash values of the two intermediate nodes are hashed to generate the hash value corresponding to the root node of the Merkle tree, including:将两个相邻叶子节点配对,将所述两个相邻叶子节点的hash值进行哈希运算,生成默克尔树中间节点对应的hash值;Pair two adjacent leaf nodes, perform a hash operation on the hash values of the two adjacent leaf nodes, and generate a hash value corresponding to the middle node of the Merkle tree;若所述中间节点为两个以上,则将两个相邻中间节点配对,将所述两个相邻中间节点的hash值进行哈希运算,生成默克尔树新的中间节点对应的hash值,直至中间节点生成的hash值唯一;唯一的hash值对应的节点为默克尔树的根节点。If there are more than two intermediate nodes, two adjacent intermediate nodes are paired, and the hash values of the two adjacent intermediate nodes are hashed to generate a hash value corresponding to the new intermediate node of the Merkle tree until the hash value generated by the intermediate node is unique; the node corresponding to the unique hash value is the root node of the Merkle tree.2.根据权利要求1所述的方法,其特征在于,对账双方根据预设的hash算法、交易数据和对账发起时间,生成每笔交易对应的hash值,包括:2. The method according to claim 1 is characterized in that the two parties to the reconciliation generate a hash value corresponding to each transaction according to a preset hash algorithm, transaction data and the time when the reconciliation is initiated, including:选取包括MD5、sha1、sha256、crc32、haval中任一种hash算法,作为对账双方根据预设的hash算法;Select any hash algorithm including MD5, sha1, sha256, crc32, and haval as the preset hash algorithm for both parties to reconcile;将交易数据和对账发起时间,通过所述hash算法进行运行,生成每笔交易对应的hash值。The transaction data and the time when the reconciliation was initiated are run through the hash algorithm to generate a hash value corresponding to each transaction.3.根据权利要求1所述的方法,其特征在于,交易数据,包括:收款方、付款方、交易金额、交易状态、交易类型、交易时间、交易凭证号。3. The method according to claim 1 is characterized in that the transaction data includes: payee, payee, transaction amount, transaction status, transaction type, transaction time, and transaction voucher number.4.根据权利要求1所述的方法,其特征在于,还包括:4. The method according to claim 1, further comprising:若所述叶子节点或所述中间节点,未能配对,则由预设的默认hash值与所述叶子节点或所述中间节点进行哈希运算。If the leaf node or the intermediate node cannot be paired, a hash operation is performed on the leaf node or the intermediate node using a preset default hash value.5.根据权利要求1所述的方法,其特征在于,对账双方根据所述交易数据进行交易对账,包括:5. The method according to claim 1, characterized in that the two parties to the transaction reconciliation perform the transaction reconciliation according to the transaction data, including:对账双方将交易数据不一致的地方进行确认和平账处理。The two parties to the reconciliation will confirm and reconcile any inconsistencies in the transaction data.6.一种基于默克尔树的交易对账系统,其特征在于,包括:6. A transaction reconciliation system based on Merkle tree, characterized by comprising:叶子节点生成模块,用于对账双方根据预设的hash算法、交易数据和对账发起时间,生成每笔交易对应的hash值;所述hash值为交易时间段对应的默克尔树的叶子节点;The leaf node generation module is used for the two parties to generate the hash value corresponding to each transaction according to the preset hash algorithm, transaction data and the time of initiation of reconciliation; the hash value is the leaf node of the Merkle tree corresponding to the transaction time period;默克尔树生成模块,用于将两个叶子节点的hash值进行哈希运算,生成默克尔树中间节点对应的hash值,将两个中间节点的hash值进行哈希运算,生成默克尔树根节点对应的hash值;The Merkle tree generation module is used to perform a hash operation on the hash values of the two leaf nodes to generate a hash value corresponding to the middle node of the Merkle tree, and to perform a hash operation on the hash values of the two middle nodes to generate a hash value corresponding to the root node of the Merkle tree;对账模块,用于比较对账双方生成的默克尔树根节点对应的hash值, 若比较结果为一致,则对账结果为平账;若比较结果为不一致,则将对账双方默克尔树对应的叶子节点hash值进行比较,获取比较结果不一致的叶子节点hash值;根据所述叶子节点hash值,获取对应的交易数据;对账双方根据所述交易数据进行交易对账;The reconciliation module is used to compare the hash values corresponding to the root nodes of the Merkle trees generated by the two parties to the reconciliation. If the comparison result is consistent, the reconciliation result is a balance; if the comparison result is inconsistent, the hash values of the leaf nodes corresponding to the Merkle trees of the two parties to the reconciliation are compared to obtain the hash values of the leaf nodes with inconsistent comparison results; according to the hash values of the leaf nodes, the corresponding transaction data is obtained; the two parties to the reconciliation perform transaction reconciliation according to the transaction data;默克尔树生成模块,包括:Merkle tree generation module, including:叶子节点配对子模块,用于将两个相邻叶子节点配对,将所述两个相邻叶子节点的hash值进行哈希运算,生成默克尔树中间节点对应的hash值;The leaf node pairing submodule is used to pair two adjacent leaf nodes, perform hash operations on the hash values of the two adjacent leaf nodes, and generate hash values corresponding to the intermediate nodes of the Merkle tree;中间节点配对子模块,用于若所述中间节点为两个以上,则将两个相邻中间节点配对,将所述两个相邻中间节点的hash值进行哈希运算,生成默克尔树新的中间节点对应的hash值,直至中间节点生成的hash值唯一;唯一的hash值对应的节点为默克尔树的根节点。The intermediate node pairing submodule is used to pair two adjacent intermediate nodes if there are more than two intermediate nodes, perform hash operation on the hash values of the two adjacent intermediate nodes, and generate a hash value corresponding to the new intermediate node of the Merkle tree until the hash value generated by the intermediate node is unique; the node corresponding to the unique hash value is the root node of the Merkle tree.7.根据权利要求6所述的系统,其特征在于,还包括:7. The system according to claim 6, further comprising:默认配对子模块,用于若所述叶子节点或所述中间节点,未能配对,则由预设的默认hash值与所述叶子节点或所述中间节点进行哈希运算。The default pairing submodule is used to perform a hash operation on the leaf node or the intermediate node using a preset default hash value if the leaf node or the intermediate node fails to pair.8.根据权利要求6所述的系统,其特征在于,对账模块,包括:8. The system according to claim 6, wherein the reconciliation module comprises:处理子模块,用于对账双方将交易数据不一致的地方进行确认和平账处理。The processing submodule is used to confirm and reconcile inconsistencies in transaction data between the two parties in the reconciliation.
CN202111402571.4A2021-11-232021-11-23Transaction reconciliation method and system based on Merker treeActiveCN114266578B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111402571.4ACN114266578B (en)2021-11-232021-11-23Transaction reconciliation method and system based on Merker tree

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111402571.4ACN114266578B (en)2021-11-232021-11-23Transaction reconciliation method and system based on Merker tree

Publications (2)

Publication NumberPublication Date
CN114266578A CN114266578A (en)2022-04-01
CN114266578Btrue CN114266578B (en)2025-07-25

Family

ID=80825416

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111402571.4AActiveCN114266578B (en)2021-11-232021-11-23Transaction reconciliation method and system based on Merker tree

Country Status (1)

CountryLink
CN (1)CN114266578B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115393082A (en)*2022-08-152022-11-25中国工商银行股份有限公司 A blockchain-based transaction data reconciliation processing method and device
CN115564437A (en)*2022-11-072023-01-03中国邮政储蓄银行股份有限公司 Account reconciliation method, account reconciliation system, computer-readable storage medium and banking system
CN118115337A (en)*2024-03-202024-05-31中国银联股份有限公司Carbon account data management system, method, device, equipment and medium
CN120508583B (en)*2025-07-182025-09-30杭州乒乓智能技术有限公司Foreign exchange transaction open statistical method, electronic equipment and computer readable medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112785408A (en)*2021-02-262021-05-11中国工商银行股份有限公司Account checking method and device based on Hash

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106055597B (en)*2016-05-242022-05-20布比(北京)网络技术有限公司Digital transaction system and account information query method used for same
KR101998507B1 (en)*2017-11-022019-07-10단국대학교 산학협력단Method and apparatus for autheticating transaction using one time password
CN108494775B (en)*2018-03-262020-12-15四川长虹电器股份有限公司Method for preventing network attack by using legal data or tampering legal data
CN110264187B (en)*2019-01-232021-06-04腾讯科技(深圳)有限公司Data processing method and device, computer equipment and storage medium
CN109559234B (en)*2019-01-312020-10-23杭州复杂美科技有限公司Block chain state data storage method, equipment and storage medium
CN109919756B (en)*2019-02-222023-04-18西南财经大学Transfer system, checking method and transaction method based on Merkle tree backtracking positioning technology
CN110278211B (en)*2019-06-242023-04-07深圳前海微众银行股份有限公司Data inspection method and device based on block chain
US11113272B2 (en)*2019-07-312021-09-07Advanced New Technologies Co., Ltd.Method and apparatus for storing blockchain state data and electronic device
US10992459B2 (en)*2019-08-302021-04-27Advanced New Technologies Co., Ltd.Updating a state Merkle tree
CN113329031B (en)*2019-10-102023-06-13深圳前海微众银行股份有限公司 A method and device for generating a state tree of a block
CN110825755B (en)*2019-10-302021-05-04北京海益同展信息科技有限公司 Consensus method, consensus node, electronic equipment, storage medium of blockchain
CN111861482B (en)*2020-09-222021-07-06支付宝(杭州)信息技术有限公司Block chain account checking method and system
CN112560093B (en)*2020-12-172023-03-14杭州趣链科技有限公司File management method, device, equipment and storage medium based on block chain
CN113254450B (en)*2021-05-282022-07-22山大地纬软件股份有限公司Method and system for storing account state of incremental MPT (message passing test) tree based on block chain

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112785408A (en)*2021-02-262021-05-11中国工商银行股份有限公司Account checking method and device based on Hash

Also Published As

Publication numberPublication date
CN114266578A (en)2022-04-01

Similar Documents

PublicationPublication DateTitle
CN114266578B (en)Transaction reconciliation method and system based on Merker tree
JP6865851B2 (en) Blockchain World State Markle Patricia Tri Tree Subtree Construction
CN108846659B (en)Block chain-based transfer method and device and storage medium
KR102455884B1 (en) Data processing method and apparatus, computer device, and storage medium
US20200012631A1 (en)Comparing data stores using hash sums on disparate parallel systems
US20170331635A1 (en)System and method for file time-stamping using a blockchain network
CN101236554B (en)Database mass data comparison process
CN112785408A (en)Account checking method and device based on Hash
CN111858467B (en)File data processing method, device, equipment and medium based on artificial intelligence
Wang et al.Ess: An efficient storage scheme for improving the scalability of bitcoin network
CN113361236A (en)Method and device for editing document
CN116483803A (en)Data verification method, device, server and storage medium
WO2023051308A1 (en)Data verification method and apparatus, device and storage medium
CN111309809A (en) A kind of block header preservation method and device thereof
CN111866134B (en)Method and system for generating hash value and address of block chain transaction and storage medium
CN110851343A (en) A test method and device based on decision tree
US11228441B2 (en)System for automated data verification
CN117349253A (en) Decentralized storage system, method, equipment and storage medium for multi-version files
CN114595279B (en)Block chain data processing method and device
CN114490415B (en) Business testing method, computer device, storage medium and computer program product
CN111897490B (en) Method and device for deleting data
CN117667837A (en)Data archiving method, device, computer equipment and storage medium
CN114238270B (en) Database operation method, device, computer equipment and readable storage medium
CN120151352B (en) Node proxy service system and construction method, device and medium for blockchain network
CN114817144A (en)Directory processing method and device in distributed file system

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp