Aggregate storage method of transaction data, electronic equipment and computer readable medium
By generating transaction fingerprints on the blockchain and verifying them through consensus, the issues of data integrity and responsibility attribution in the data aggregation process of cross-border payments are resolved, achieving efficient and secure transaction data storage and verification.
Patent Information
- Application Number
- CN202610122222.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-29
- Publication Date
- 2026-03-03
AI Technical Summary
In the field of cross-border payments, the data aggregation process between multiple heterogeneous transaction systems faces problems such as the inability to guarantee data integrity, the difficulty in verifying the aggregation logic, the lack of source system confirmation mechanisms, and the ambiguity of data responsibility.
Transaction fingerprints are generated and blocks are constructed using blockchain technology. The transaction fingerprints are stored on the blockchain through a consensus verification mechanism to ensure data integrity. The concept of zero-knowledge proof is introduced to simplify the verification process.
It improves the credibility of aggregated data, simplifies the verification process, reduces storage requirements, is suitable for large-scale transaction scenarios, enhances security and compliance, and enables accountability.
Smart Images

Figure CN121599768A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cross-border payment technology, specifically to a method for aggregating and storing transaction data, electronic devices, and computer-readable media. Background Technology
[0002] In the field of cross-border payments, differences in technical architecture and data formats among multiple foreign exchange transaction systems often lead to data fragmentation and inconsistent interpretations, which can easily cause problems such as inefficient reconciliation and lagging risk control. Data aggregation refers to the process of collecting, processing, and summarizing raw data from multiple data sources and expressing it in an aggregated form. It can break down the barriers between multiple heterogeneous transaction systems and is a key link in ensuring the security and operational efficiency of cross-border payments.
[0003] However, in the current process of data aggregation between multiple heterogeneous trading systems, whether data is aggregated offline or in real time, there are many problems such as the inability to guarantee data integrity, the difficulty in verifying the aggregation logic, the lack of source system confirmation mechanisms, and the ambiguity of data responsibility. Summary of the Invention
[0004] This invention aims to address, to a certain extent, one of the technical problems in related technologies. To this end, this invention provides a method for aggregating and storing transaction data, an electronic device, and a computer-readable medium, which have the advantages of ensuring data integrity, improving the credibility of aggregated data, increasing the verification efficiency of the data source system and simplifying the verification process, and improving the visibility of data responsibility.
[0005] To achieve the above objectives, the present invention adopts the following technical solution: A method for aggregating and storing transaction data, used in an aggregation system node in a blockchain network, comprising: The system receives aggregated transaction data reported by various transaction system nodes in the blockchain network. The aggregated transaction data includes a transaction information field and a transaction fingerprint field. The transaction fingerprint field is generated by the transaction system node based on the transaction information field and a preset fingerprint generation algorithm. The transaction information field is obtained by the transaction system node transforming the original transaction data according to the aggregated transaction data template specified by the aggregation system node. Based on the aggregated transaction data, a transaction fingerprint record is generated; Candidate blocks are periodically constructed using the transaction fingerprint records generated in the current period, and the candidate blocks, after being signed by themselves, are broadcast to the blockchain network. If more than a preset proportion of transaction system nodes pass the consensus verification of the candidate block, the candidate block will be stored on the blockchain main chain, and the on-chain information will be broadcast to the blockchain network.
[0006] Optionally, the transaction fingerprint record includes a transaction fingerprint field, and the periodic construction of candidate blocks using the transaction fingerprint record generated in the current period includes: Periodically acquire transaction fingerprint records generated in the current period and construct a transaction fingerprint record set; A Merkle tree is constructed by using the transaction fingerprint field of each element in the transaction fingerprint record set as a leaf node. Calculate the Merkle root for the Merkle tree; Candidate blocks are constructed based on the Merkle root and the set of transaction fingerprint records.
[0007] Optionally, constructing candidate blocks based on the Merkle root and the transaction fingerprint record set includes: The block header of the candidate block is constructed based on the Merkle root; wherein the block header includes the previous block hash field, timestamp field, Merkle root field, block version field and block sequence number field; The block body of the candidate block is constructed based on the set of transaction fingerprint records.
[0008] Optionally, the transaction information fields include a transaction ID field, a user ID field, a currency pair field, a selling currency field, a selling amount field, a buying currency field, a buying amount field, a transaction price field, a transaction time field, a settlement date field, a transaction type field, a transaction source field, and a business scenario field. The transaction fingerprint record includes a transaction ID field, a transaction fingerprint field, a transaction source field, and a synchronization time field.
[0009] The transaction data aggregation and storage method provided by this invention can ensure the integrity of transaction data throughout the entire processing flow by storing transaction fingerprints on the blockchain, leveraging the immutability of the blockchain to prevent unauthorized modifications and guarantee data integrity. It can significantly improve the credibility of aggregated data by introducing a consensus verification mechanism involving the source transaction systems, ensuring joint confirmation of the aggregation results by the source transaction systems. It can also protect the privacy of transaction data and improve verification efficiency and simplify the verification process by employing a zero-knowledge proof verification method, allowing verification nodes to complete verification without obtaining complete transaction data. Furthermore, by storing only transaction fingerprints instead of complete transaction data on the blockchain, it significantly reduces storage requirements, making it suitable for large-scale transaction scenarios and lowering storage costs. When data inconsistencies occur, it can accurately locate the problematic link and responsible party by comparing historical transaction fingerprints with the current transaction fingerprints of each transaction system, facilitating accountability. Finally, storing transaction fingerprints on the blockchain allows for subsequent verification and auditing of transaction data at any time, improving the security and compliance of transaction data storage and enhancing security auditing capabilities.
[0010] Furthermore, this invention also provides a method for aggregating and storing transaction data for transaction system nodes in a blockchain network, comprising: Based on the aggregated transaction data template specified by the aggregation system node in the blockchain network, the original transaction data is transformed to obtain the transaction information field; A transaction fingerprint field is generated based on the transaction information field and the preset fingerprint generation algorithm; The system reports aggregated transaction data consisting of the transaction information field and the transaction fingerprint field to the aggregation system node, so that the aggregation system node generates transaction fingerprint records based on the aggregated transaction data, periodically uses the transaction fingerprint records generated in this period to construct candidate blocks, and broadcasts the candidate blocks signed by itself to the blockchain network. The received candidate blocks undergo consensus verification so that if more than a preset proportion of transaction system nodes pass the consensus verification of the candidate blocks, the aggregation system node stores the candidate blocks on the blockchain main chain and broadcasts the on-chain information to the blockchain network.
[0011] Optionally, generating a transaction fingerprint field based on the transaction information field and a preset fingerprint generation algorithm includes: The transaction information fields are grouped according to their field types to obtain multiple field groups; wherein, the transaction information fields include the transaction ID field, user ID field, currency pair field, selling currency field, selling amount field, buying currency field, buying amount field, transaction price field, transaction time field, settlement date field, transaction type field, transaction source field, and business scenario field; For each of the aforementioned field groups, a hash operation is performed on each field to obtain the hash value of each field; For each field group, the hash values of each field are concatenated and then hashed to obtain the group hash of that field group; The group hashes of each field group are concatenated according to the set order to obtain the concatenated group hash; The transaction fingerprint field is obtained by performing a hash operation on the concatenated hash group.
[0012] Optionally, the candidate block includes a block header and a block body, the block body including a set of transaction fingerprint records, the transaction fingerprint records including a transaction ID field, a transaction fingerprint field, a transaction source field, and a synchronization time field; the consensus verification of the received candidate block includes: Formal verification is performed on the candidate blocks; For each transaction fingerprint record in the transaction fingerprint record set, if the transaction source field indicates that this node is not the data source, the corresponding transaction system node is requested to perform content verification on the transaction fingerprint record based on the transaction ID field. If the transaction fingerprint record passes the content verification of the corresponding transaction system node, it is determined that the transaction fingerprint record has passed the content verification. For each transaction fingerprint record in the transaction fingerprint record set, if the current node is identified as its data source based on the transaction source field, the corresponding original transaction data is obtained based on the transaction ID field to generate a local transaction fingerprint field according to the preset fingerprint generation algorithm. If the local transaction fingerprint field is consistent with the transaction fingerprint field of the transaction fingerprint record, the transaction fingerprint record is determined to have passed the content verification. Once the candidate block passes formal verification and it is determined that all transaction fingerprint records in the transaction fingerprint record set have passed content verification, a consensus verification pass message is broadcast to the blockchain network.
[0013] Optionally, the block header includes a previous block hash field, a timestamp field, a Merkle root field, a block version field, and a block sequence number field; the formal verification of the candidate block includes: Verify the structural integrity of the candidate blocks; The correctness of the Merkle tree calculation is verified based on the Merkle root field and the transaction fingerprint record set; wherein, the Merkle tree is constructed by using the transaction fingerprint field of the elements in the transaction fingerprint record set as leaf nodes; Verify the correctness of the aforementioned front block hash field; Verify the signature validity of the candidate block.
[0014] The method for aggregating and storing transaction data for transaction system nodes provided by this invention is similar to the reasoning process of the aforementioned method for aggregating and storing transaction data for aggregation system nodes, and will not be repeated here.
[0015] Furthermore, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the above-described method for aggregating and storing transaction data.
[0016] In addition, the present invention also provides a computer-readable medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the aggregated storage method for transaction data described in any of the above claims.
[0017] These features and advantages of the present invention will be disclosed in detail in the following specific embodiments and accompanying drawings. The preferred embodiments or means of the present invention will be shown in detail in conjunction with the accompanying drawings, but are not intended to limit the technical solutions of the present invention. In addition, each of these features, elements and components appearing in the following text and drawings is a plurality of, and different symbols or numbers are used for convenience of representation, but all represent parts with the same or similar construction or function. Attached Figure Description
[0018] The present invention will be further described below with reference to the accompanying drawings: Figure 1 A flowchart illustrating one embodiment of the method for aggregating and storing transaction data executed on the node side of an aggregation system, as provided in this invention. Figure 2 This is an architecture diagram of one implementation of the blockchain system provided in this invention. Figure 3 A flowchart illustrating another implementation of the method for aggregating and storing transaction data executed on the node side of an aggregation system, as provided in this embodiment of the invention; Figure 4 A flowchart illustrating another embodiment of the method for aggregating and storing transaction data executed on the node side of an aggregation system provided in this invention; Figure 5 A flowchart illustrating one embodiment of the method for aggregating and storing transaction data executed on the node side of a transaction system, as provided in this invention. Figure 6 A flowchart illustrating another implementation of the method for aggregating and storing transaction data executed on the node side of a transaction system provided in this invention; Figure 7 A flowchart illustrating another embodiment of the method for aggregating and storing transaction data executed on the node side of a transaction system provided in this invention; Figure 8 A flowchart illustrating another embodiment of the method for aggregating and storing transaction data executed on the node side of a transaction system provided in this invention; Figure 9 A schematic diagram illustrating one embodiment of the electronic device provided in this invention; Figure 10 A schematic diagram of a computer-readable medium provided in an embodiment of the present invention; Explanation of reference numerals in the attached figures 101: Processor; 102: Memory 103: I / O interface; 104: Bus. Detailed Implementation
[0019] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described are intended to explain the present invention and should not be construed as limiting the invention.
[0020] The terms "an embodiment," "example," or "trademark" used in this specification refer to a particular feature, structure, or characteristic described in connection with the embodiment itself that may be included in at least one embodiment disclosed in this invention. The phrase "in an embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment.
[0021] In the field of cross-border payments, differences in technical architecture and data formats among multiple foreign exchange transaction systems often lead to data fragmentation and inconsistent interpretations, which can easily cause problems such as inefficient reconciliation and lagging risk control. Data aggregation refers to the process of collecting, processing, and summarizing raw data from multiple data sources and expressing it in an aggregated form. It can break down the barriers between multiple heterogeneous transaction systems and is a key link in ensuring the security and operational efficiency of cross-border payments.
[0022] However, the inventors of this invention have discovered that in the current process of data aggregation between multiple heterogeneous transaction systems, whether data aggregation is performed using offline data synchronization or real-time data push, there are many problems such as the inability to guarantee data integrity, the difficulty in verifying aggregation logic, the lack of source system confirmation mechanisms, and the ambiguity of data responsibility.
[0023] To this end, the inventors of this invention propose that blockchain technology can be used to generate a unique fingerprint for each transaction data based on a preset fingerprint generation algorithm, thereby constructing a block and storing it on the blockchain. This enables the integrity verification and accountability of transaction data throughout the entire process from collection and transmission from the source transaction system to aggregation and processing.
[0024] As a first aspect of the present invention, a method for aggregating and storing transaction data is provided for use in aggregation system nodes in a blockchain network, such as... Figure 1 As shown, the method includes: In step S110, aggregated transaction data reported by various transaction system nodes in the blockchain network is received; wherein, the aggregated transaction data includes a transaction information field and a transaction fingerprint field, the transaction fingerprint field is generated by the transaction system node based on the transaction information field and a preset fingerprint generation algorithm; the transaction information field is obtained by the transaction system node by converting the original transaction data according to the aggregated transaction data template specified by the aggregation system node; In step S120, a transaction fingerprint record is generated based on the aggregated transaction data; In step S130, candidate blocks are periodically constructed using the transaction fingerprint records generated in the current period, and the candidate blocks, after being signed by themselves, are broadcast to the blockchain network. In step S140, if more than a preset proportion of transaction system nodes pass the consensus verification of the candidate block, the candidate block is stored on the blockchain main chain, and the on-chain information is broadcast to the blockchain network.
[0025] The transaction data aggregation and storage method provided in this embodiment of the invention can be applied to blockchain systems. For example, as... Figure 2 The diagram illustrates one implementation of the blockchain system provided in this invention. This blockchain system may include an aggregation system node M (NodeM) and transaction system nodes A (NodeA), B (NodeB), and C (NodeC), each maintained by its respective transaction system. These nodes can communicate via the blockchain network, and transaction system nodes A (NodeA), B (NodeB), and C (NodeC) can synchronize data with the aggregation system node M. This blockchain system uses a division-of-labor consensus model: the aggregation system node M is responsible for generating blocks, while the remaining transaction system nodes are verification nodes, eliminating the need for miners and reducing unnecessary system overhead.
[0026] It should be noted that, Figure 2 This is merely an illustrative example; the blockchain system described in this embodiment is not limited to... Figure 2 The diagram shows three trading system nodes; the number of trading system nodes depends on the actual number of trading systems.
[0027] In this invention, aggregation system nodes can publicly disclose aggregated transaction data templates, specifying that each transaction system node reports aggregated transaction data to the aggregation system node according to a unified data format. This can initially improve aggregation processing efficiency. This embodiment of the invention does not impose specific limitations on how the aggregation system node publicly discloses the aggregated transaction data template. For example, the aggregation system node can broadcast the aggregated transaction data template to the blockchain network, or it can send the aggregated transaction data template directly to the transaction system nodes.
[0028] In the aggregated transaction data template, both transaction information fields and transaction fingerprint fields are specified. The transaction system node first learns from the aggregated transaction data template which transaction information fields need to be reported, then obtains the transaction information fields by transforming the original transaction data, then generates the transaction fingerprint fields according to the transaction information fields and the preset fingerprint generation algorithm, and finally combines the transaction information fields and transaction fingerprint fields to obtain aggregated transaction data for reporting.
[0029] As can be understood, transaction fingerprint records include transaction fingerprint fields, as well as the specific source of the transaction fingerprint, synchronization time, and so on. Constructing candidate blocks using transaction fingerprint records essentially involves storing the transaction fingerprints on the blockchain main chain.
[0030] In this process, after receiving aggregated transaction data, the aggregation system node stores the aggregated transaction data locally and marks it as unavailable. The data is only marked as available after the candidate block is stored on the blockchain main chain and the blockchain network is broadcast the on-chain information. This ensures that aggregated transaction data that has not yet generated a block or whose block has not passed consensus verification is in an unqueryable state, thus guaranteeing the security of the data source.
[0031] In this embodiment of the invention, the preset ratio is not specifically limited. For example, the preset ratio can be set to 50%, 60%, 70%, etc.
[0032] The consensus verification performed by transaction system nodes on candidate blocks can include both formal verification of the candidate blocks and content verification of the block bodies within the candidate blocks. After a transaction system node successfully verifies a candidate block's consensus, it can broadcast the verification success message on the blockchain network so that the aggregation system nodes can statistically analyze the proportion of transaction system nodes that have successfully verified the candidate block's consensus.
[0033] The transaction data aggregation and storage method provided in this invention can ensure the integrity of transaction data throughout the entire processing flow by storing transaction fingerprints on the blockchain, leveraging the immutability of the blockchain to prevent unauthorized modifications and guarantee data integrity. It can significantly improve the credibility of aggregated data by introducing a consensus verification mechanism involving the source transaction systems, ensuring joint confirmation of the aggregation results by the source transaction systems. It can also protect the privacy of transaction data and improve verification efficiency and simplify the verification process by employing a zero-knowledge proof verification method, allowing verification nodes to complete verification without obtaining complete transaction data. Furthermore, by storing only transaction fingerprints instead of complete transaction data on the blockchain, it significantly reduces storage requirements, making it suitable for large-scale transaction scenarios and lowering storage costs. When data inconsistencies occur, it can accurately locate the problematic link and responsible party by comparing historical transaction fingerprints with the current transaction fingerprints of each transaction system, facilitating accountability. Finally, storing transaction fingerprints on the blockchain allows for subsequent verification and auditing of transaction data at any time, improving the security and compliance of transaction data storage and enhancing security auditing capabilities.
[0034] The inventors of this invention further propose that by periodically collecting transaction fingerprint records, constructing a Merkle tree with the transaction fingerprint field in the transaction fingerprint records as leaf nodes and calculating the root value, and combining the root value with the set of transaction fingerprint records to construct candidate blocks, it is possible to achieve secure and structured storage of blockchain transaction data and efficient block generation.
[0035] Accordingly, in some embodiments, the transaction fingerprint record includes a transaction fingerprint field, such as... Figure 3 As shown, the periodic construction of candidate blocks using the transaction fingerprint records generated in the current period (i.e., the step involved in S130) may include: In step S210, transaction fingerprint records generated in the current period are periodically acquired to construct a transaction fingerprint record set; In step S220, the transaction fingerprint field of each element in the transaction fingerprint record set is used as a leaf node to construct a Merkle tree; In step S230, the Merkle root is calculated for the Merkle tree; In step S240, candidate blocks are constructed based on the Merkle root and the transaction fingerprint record set.
[0036] In this embodiment of the invention, the transaction fingerprint field generated by the transaction system node based on the transaction information field and the preset fingerprint generation algorithm is essentially a hash value. By directly using the transaction fingerprint field as the leaf node to construct the Merkle tree and calculate the Merkle root, additional hash processing can be reduced, further reducing computational overhead.
[0037] This invention utilizes the cryptographic properties of Merkle trees to ensure the integrity and traceability of transaction data, efficiently generating candidate blocks that conform to blockchain storage specifications, and providing secure and reliable basic data units for subsequent block consensus and on-chain processing.
[0038] The inventors of this invention further propose that by constructing a candidate block header containing specified fields such as the previous block hash and timestamp based on Merkle root, and constructing the block body with a set of transaction fingerprint records, standardized candidate block construction can be achieved.
[0039] Accordingly, in some embodiments, such as Figure 4 As shown, the step of constructing candidate blocks (i.e., involved in step S240) based on the Merkle root and the transaction fingerprint record set may include: In step S310, the block header of the candidate block is constructed according to the Merkle root; wherein, the block header includes a previous block hash field, a timestamp field, a Merkle root field, a block version field, and a block sequence number field; In step S320, the block body of the candidate block is constructed based on the transaction fingerprint record set.
[0040] The structure of a candidate block includes a block header and a block body. The block body is a set of transaction fingerprint records, while the block header includes the previous block hash field, timestamp field, Merkle root field, block version field, and block sequence number field. For example, the block header is {"previous block hash":"0x...","timestamp":1743507790000,"Merkle root":"0x...","block version":1,"block sequence number":42}.
[0041] The embodiments of the present invention construct the block header of the candidate block according to the Merkle root and construct the block body of the candidate block according to the transaction fingerprint record set. This enables the candidate block structure to conform to the blockchain storage specifications. The correspondence between the block header and the block body ensures the consistency of transaction data and provides an efficient and secure structural foundation for subsequent block verification and consensus on-chaining.
[0042] The inventors of this invention further propose that by defining a multi-field transaction information template covering the core business dimensions of transactions, and a simplified transaction fingerprint record structure containing core identifiers such as transaction ID and transaction fingerprint, combined with the aggregation and conversion, fingerprint generation, block construction and consensus verification process, it is possible to achieve standardized collection and trusted on-chaining of transaction data by the blockchain.
[0043] Accordingly, in some embodiments, the transaction information fields include a transaction ID field, a user ID field, a currency pair field, a selling currency field, a selling amount field, a buying currency field, a buying amount field, a transaction price field, a transaction time field, a settlement date field, a transaction type field, a transaction source field, and a business scenario field. The transaction fingerprint record includes a transaction ID field, a transaction fingerprint field, a transaction source field, and a synchronization time field.
[0044] This invention provides a comprehensive solution for business traceability and analysis by specifying multi-dimensional transaction information fields. The 13 transaction information fields ensure accurate mapping between transaction fingerprints and original transaction data, and the streamlined transaction fingerprint record fields balance storage efficiency and data verification requirements. This not only guarantees the integrity and traceability of transaction data but also improves the efficiency of blockchain data processing and storage, adapting to the management needs of complex transaction scenarios.
[0045] As a second aspect of the present invention, a method for aggregating and storing transaction data is provided for transaction system nodes in a blockchain network, such as... Figure 5 As shown, the method includes: In step S410, the original transaction data is transformed to obtain the transaction information field according to the aggregated transaction data template specified by the aggregation system node in the blockchain network; In step S420, a transaction fingerprint field is generated based on the transaction information field and a preset fingerprint generation algorithm; In step S430, aggregated transaction data consisting of the transaction information field and the transaction fingerprint field is reported to the aggregation system node, so that the aggregation system node generates transaction fingerprint records based on the aggregated transaction data, periodically uses the transaction fingerprint records generated in this period to construct candidate blocks, and broadcasts the candidate blocks signed by itself to the blockchain network. In step S440, consensus verification is performed on the received candidate blocks so that if more than a preset proportion of transaction system nodes pass the consensus verification of the candidate blocks, the aggregation system node stores the candidate blocks on the blockchain main chain and broadcasts the on-chain information to the blockchain network.
[0046] The process of the aggregation and storage method for this transaction data has been described in detail above, so it will not be repeated here.
[0047] The transaction data aggregation and storage method provided in this invention can ensure the integrity of transaction data throughout the entire processing flow by storing transaction fingerprints on the blockchain, leveraging the immutability of the blockchain to prevent unauthorized modifications and guarantee data integrity. It can significantly improve the credibility of aggregated data by introducing a consensus verification mechanism involving the source transaction systems, ensuring joint confirmation of the aggregation results by the source transaction systems. It can also protect the privacy of transaction data and improve verification efficiency and simplify the verification process by employing a zero-knowledge proof verification method, allowing verification nodes to complete verification without obtaining complete transaction data. Furthermore, by storing only transaction fingerprints instead of complete transaction data on the blockchain, it significantly reduces storage requirements, making it suitable for large-scale transaction scenarios and lowering storage costs. When data inconsistencies occur, it can accurately locate the problematic link and responsible party by comparing historical transaction fingerprints with the current transaction fingerprints of each transaction system, facilitating accountability. Finally, storing transaction fingerprints on the blockchain allows for subsequent verification and auditing of transaction data at any time, improving the security and compliance of transaction data storage and enhancing security auditing capabilities.
[0048] The inventors of this invention further propose that by grouping transaction information containing 13 core business fields according to field type, and through a hierarchical recursive hash operation process of "field hash → group hash → concatenated group hash → final hash", a unique corresponding transaction fingerprint field can be generated, which can achieve accurate identification and encrypted verification of transaction data.
[0049] Accordingly, in some embodiments, such as Figure 6 As shown, generating a transaction fingerprint field (i.e., the one involved in step S420) based on the transaction information field and a preset fingerprint generation algorithm may include: In step S510, the transaction information fields are grouped according to field type to obtain multiple field groups; wherein, the transaction information fields include transaction ID field, user ID field, currency pair field, selling currency field, selling amount field, buying currency field, buying amount field, transaction price field, transaction time field, settlement date field, transaction type field, transaction source field, and business scenario field; In step S520, for each of the field groups, a hash operation is performed on each field to obtain the hash value of each field; In step S530, for each field group, the hash values of each field are concatenated and then hashed to obtain the group hash of the field group. In step S540, the group hashes of each field group are concatenated in a set order to obtain the concatenated group hash. In step S550, a hash operation is performed on the concatenated group hash to obtain the transaction fingerprint field.
[0050] In this embodiment of the invention, the transaction information fields are first grouped according to field type, for example: Group A: Identity-related fields, including Transaction ID and User ID fields; Group B: Asset-related fields, including currency pair field, selling currency field, and buying currency field; Group C: Amount-related fields, including selling amount field, buying amount field, and transaction price field; Group D: Time-related fields, including transaction time field and settlement date field; Group E: Scenario-related fields, including transaction type field, transaction source field, and business scenario field.
[0051] Furthermore, this embodiment of the invention performs hierarchical recursive hashing: First layer: Hash each field separately within each field group; The second layer: Within each field group, concatenate the hashes of each field and then hash them again to obtain the group hash of the field group; The third layer: The group hashes of each field group are mixed and concatenated according to A||E||B||D||C to obtain the concatenated group hash; Fourth layer: Hash the concatenated group hash to obtain the transaction fingerprint field.
[0052] This invention generates transaction fingerprint fields using a preset fingerprint generation algorithm. The field grouping design balances computational efficiency and data verification granularity. The preset fingerprint generation algorithm exhibits an avalanche effect, meaning that any minute change can lead to significant differences in the transaction fingerprint fields. Furthermore, the fingerprint generation logic is not easily perceptible, thus preventing the transaction fingerprint fields from being forged. This enhances the tamper resistance and uniqueness of transaction fingerprints, significantly improves the security of transaction fingerprint fields, ensures data integrity, and facilitates the verification of data correctness and the tracing of data responsibility.
[0053] The inventors of this invention further propose that, for candidate blocks containing a block header and a set of transaction fingerprint records (including fields such as transaction ID and transaction fingerprint), a layered verification logic of "formal verification + content verification" is adopted. Based on the differences in the transaction source field of the transaction fingerprint record, non-data source nodes request verification from the original transaction system node, and data source nodes generate fingerprints locally for comparison verification. After both verifications pass, a consensus pass message is broadcast, which can achieve accurate consensus verification of candidate blocks.
[0054] Accordingly, in some embodiments, the candidate block includes a block header and a block body, the block body including a set of transaction fingerprint records, and the transaction fingerprint records including a transaction ID field, a transaction fingerprint field, a transaction source field, and a synchronization time field; such as Figure 7 As shown, the consensus verification of the received candidate blocks (i.e., the step involved in S440) may include: In step S610, the candidate block is formally verified; In step S620, for each transaction fingerprint record in the transaction fingerprint record set, if the transaction source field identifies that this node is not its data source, the corresponding transaction system node is requested to perform content verification on the transaction fingerprint record based on the transaction ID field. If the transaction fingerprint record passes the content verification of the corresponding transaction system node, it is determined that the transaction fingerprint record has passed the content verification. In step S630, for each transaction fingerprint record in the transaction fingerprint record set, if the local node is identified as its data source based on the transaction source field, the corresponding original transaction data is obtained based on the transaction ID field to generate a local transaction fingerprint field according to the preset fingerprint generation algorithm. If the local transaction fingerprint field is consistent with the transaction fingerprint field of the transaction fingerprint record, the transaction fingerprint record is determined to have passed content verification. In step S640, if the candidate block passes formal verification and it is determined that all transaction fingerprint records in the transaction fingerprint record set have passed content verification, a consensus verification pass message is broadcast to the blockchain network.
[0055] Upon receiving candidate blocks broadcast by the aggregation system node, the transaction system node can identify whether the data source of each transaction fingerprint record belongs to this node based on the transaction source field carried by each transaction fingerprint record in the block body of the candidate block. When the data source of the transaction fingerprint record belongs to this node, the node can retrieve the original transaction data from the database, calculate the local transaction fingerprint field using a preset fingerprint generation algorithm, and compare it with the transaction fingerprint field of the transaction fingerprint record. If they match, the transaction fingerprint record can be confirmed as reliable. When the data source of the transaction fingerprint record does not belong to this node, the node can further request content verification from the corresponding transaction system node based on the order number (i.e., the transaction ID field).
[0056] This invention provides a layered verification approach that balances the compliance of the block structure with the authenticity of transaction data. Differentiated verification logic adapts to different node roles to improve verification efficiency, ensure the accuracy and reliability of consensus verification, and provide solid support for the secure on-chaining of candidate blocks.
[0057] The inventors of this invention further propose that a multi-dimensional formal verification process, which includes structural integrity verification, Merkle tree calculation correctness verification based on transaction fingerprint fields, front block hash correctness verification, and signature validity verification, can achieve comprehensive verification of the formal compliance of candidate blocks.
[0058] Accordingly, in some embodiments, the block header includes a previous block hash field, a timestamp field, a Merkle root field, a block version field, and a block sequence number field; such as Figure 8 As shown, the formal verification of the candidate block (i.e., the step involved in S610) may include: In step S710, the structural integrity of the candidate block is verified; In step S720, the correctness of the Merkle tree calculation is verified based on the Merkle root field and the transaction fingerprint record set; wherein, the Merkle tree is constructed by using the transaction fingerprint fields of the elements in the transaction fingerprint record set as leaf nodes; In step S730, the correctness of the previous block hash field is verified; In step S740, the signature validity of the candidate block is verified.
[0059] This invention provides a comprehensive multi-dimensional formal verification that covers key aspects such as block structure, data association, on-chain continuity, and source legitimacy. This ensures that candidate blocks are formatted correctly, data associations are accurate, and sources are trustworthy, thus laying a solid foundation for formal compliance for subsequent content verification and secure on-chain storage. It also enhances the security and standardization of blockchain network transaction data storage.
[0060] Furthermore, the inventors of this invention propose that, under normal circumstances, transaction data will not change after it is generated. However, changes may still occur under certain special circumstances. After the changes, the transaction data will also be synchronized to the aggregation system nodes and will still be aggregated and stored by the aggregation system nodes. In this case, multiple transaction fingerprints with the same transaction ID will exist on the blockchain. For this situation where data updates are repeatedly uploaded to the chain, the order can be determined based on the block sequence number or timestamp in the block.
[0061] The inventors of this invention also propose that when data inconsistency is discovered (as opposed to data being repeatedly uploaded to the chain, it may be due to tampering in the process), the latest transaction fingerprint record on the blockchain can be queried, and then each transaction system node can recalculate the local transaction fingerprint field. By comparing the difference between the local transaction fingerprint field and the transaction fingerprint field on the chain, the link where the problem occurred and the responsible party can be determined.
[0062] As a third aspect of this application, an electronic device is provided, such as Figure 9 As shown, the electronic device includes: One or more processors 101; The memory 102 stores one or more computer programs that, when executed by the one or more processors 101, cause the one or more processors 101 to implement the aggregated storage method for transaction data provided by the first or second aspect of the present invention.
[0063] The electronic device may also include one or more I / O interfaces 103 connected between the processor 101 and the memory 102, configured to enable information interaction between the processor 101 and the memory 102.
[0064] The processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); the I / O interface (read-write interface) is connected between the processor and the memory, enabling information exchange between the processor and the memory, including but not limited to a data bus (Bus).
[0065] In some embodiments, the processor 101, memory 102, and I / O interface 103 are interconnected via bus 104, and thus connected to other components of the computing device.
[0066] As a fourth aspect of the present invention, such as Figure 10As shown, a computer-readable medium is provided, on which a computer program is stored, which, when executed by a processor, implements the method for aggregated storage of transaction data provided in the first or second aspect of the present invention.
[0067] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. Accordingly, the computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can implement the methods of any of the above embodiments. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0068] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Those skilled in the art should understand that the present invention includes, but is not limited to, the contents described in the accompanying drawings and the specific embodiments above. Any modifications that do not depart from the functional and structural principles of the present invention will be included within the scope of the claims.
Claims
1. A method for aggregating and storing transaction data, used in aggregation system nodes in a blockchain network, characterized in that, include: The system receives aggregated transaction data reported by various transaction system nodes in the blockchain network. The aggregated transaction data includes a transaction information field and a transaction fingerprint field. The transaction fingerprint field is generated by the transaction system node based on the transaction information field and a preset fingerprint generation algorithm. The transaction information field is obtained by the transaction system node transforming the original transaction data according to the aggregated transaction data template specified by the aggregation system node. Based on the aggregated transaction data, a transaction fingerprint record is generated; Candidate blocks are periodically constructed using the transaction fingerprint records generated in the current period, and the candidate blocks, after being signed by themselves, are broadcast to the blockchain network. If more than a preset proportion of transaction system nodes pass the consensus verification of the candidate block, the candidate block will be stored on the blockchain main chain, and the on-chain information will be broadcast to the blockchain network.
2. The method according to claim 1, characterized in that, The transaction fingerprint record includes a transaction fingerprint field, and the periodic construction of candidate blocks using the transaction fingerprint record generated in this period includes: Periodically acquire transaction fingerprint records generated in the current period and construct a transaction fingerprint record set; A Merkle tree is constructed by using the transaction fingerprint field of each element in the transaction fingerprint record set as a leaf node. Calculate the Merkle root for the Merkle tree; Candidate blocks are constructed based on the Merkle root and the set of transaction fingerprint records.
3. The method according to claim 2, characterized in that, The step of constructing candidate blocks based on the Merkle root and the transaction fingerprint record set includes: The block header of the candidate block is constructed based on the Merkle root; wherein the block header includes the previous block hash field, timestamp field, Merkle root field, block version field and block sequence number field; The block body of the candidate block is constructed based on the set of transaction fingerprint records.
4. The method according to claim 1, characterized in that, The transaction information fields include the transaction ID field, user ID field, currency pair field, selling currency field, selling amount field, buying currency field, buying amount field, transaction price field, transaction time field, settlement date field, transaction type field, transaction source field, and business scenario field; The transaction fingerprint record includes a transaction ID field, a transaction fingerprint field, a transaction source field, and a synchronization time field.
5. A method for aggregating and storing transaction data, used in transaction system nodes in a blockchain network, characterized in that, include: Based on the aggregated transaction data template specified by the aggregation system node in the blockchain network, the original transaction data is transformed to obtain the transaction information field; A transaction fingerprint field is generated based on the transaction information field and the preset fingerprint generation algorithm; The system reports aggregated transaction data consisting of the transaction information field and the transaction fingerprint field to the aggregation system node, so that the aggregation system node generates transaction fingerprint records based on the aggregated transaction data, periodically uses the transaction fingerprint records generated in this period to construct candidate blocks, and broadcasts the candidate blocks signed by itself to the blockchain network. The received candidate blocks undergo consensus verification so that if more than a preset proportion of transaction system nodes pass the consensus verification of the candidate blocks, the aggregation system node stores the candidate blocks on the blockchain main chain and broadcasts the on-chain information to the blockchain network.
6. The method according to claim 5, characterized in that, The step of generating a transaction fingerprint field based on the transaction information field and a preset fingerprint generation algorithm includes: The transaction information fields are grouped according to their field types to obtain multiple field groups; wherein, the transaction information fields include the transaction ID field, user ID field, currency pair field, selling currency field, selling amount field, buying currency field, buying amount field, transaction price field, transaction time field, settlement date field, transaction type field, transaction source field, and business scenario field; For each of the aforementioned field groups, a hash operation is performed on each field to obtain the hash value of each field; For each field group, the hash values of each field are concatenated and then hashed to obtain the group hash of that field group; The group hashes of each field group are concatenated according to the set order to obtain the concatenated group hash; The transaction fingerprint field is obtained by performing a hash operation on the concatenated hash group.
7. The method according to claim 5, characterized in that, The candidate block includes a block header and a block body. The block body includes a set of transaction fingerprint records, and each transaction fingerprint record includes a transaction ID field, a transaction fingerprint field, a transaction source field, and a synchronization time field. The consensus verification of the received candidate blocks includes: Formal verification is performed on the candidate blocks; For each transaction fingerprint record in the transaction fingerprint record set, if the transaction source field indicates that this node is not the data source, the corresponding transaction system node is requested to perform content verification on the transaction fingerprint record based on the transaction ID field. If the transaction fingerprint record passes the content verification of the corresponding transaction system node, it is determined that the transaction fingerprint record has passed the content verification. For each transaction fingerprint record in the transaction fingerprint record set, if the current node is identified as its data source based on the transaction source field, the corresponding original transaction data is obtained based on the transaction ID field to generate a local transaction fingerprint field according to the preset fingerprint generation algorithm. If the local transaction fingerprint field is consistent with the transaction fingerprint field of the transaction fingerprint record, the transaction fingerprint record is determined to have passed the content verification. Once the candidate block passes formal verification and it is determined that all transaction fingerprint records in the transaction fingerprint record set have passed content verification, a consensus verification pass message is broadcast to the blockchain network.
8. The method according to claim 7, characterized in that, The block header includes a previous block hash field, a timestamp field, a Merkle root field, a block version field, and a block sequence number field; the formal verification of the candidate block includes: Verify the structural integrity of the candidate blocks; The correctness of the Merkle tree calculation is verified based on the Merkle root field and the transaction fingerprint record set; wherein, the Merkle tree is constructed by using the transaction fingerprint field of the elements in the transaction fingerprint record set as leaf nodes; Verify the correctness of the aforementioned front block hash field; Verify the signature validity of the candidate block.
9. An electronic device, characterized in that, include: One or more processors; A memory having stored one or more computer programs thereon, which, when executed by one or more processors, cause the one or more processors to implement the aggregated storage method for transaction data as described in any one of claims 1 to 8.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method for aggregated storage of transaction data as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Distributed electric quantity transaction block chain storage method and device based on Merkel tree
CN112600875A
Transaction information storage method and device, equipment and medium
CN118799069A
Heterogeneous transaction system data near-real-time aggregation method and system
CN120407613A
Data aggregation method and device, computer equipment, storage medium and computer program product
CN120541148A
Transaction recording device, transaction recording method, and transaction recording program
JP2021048430A