Transaction data processing method and device, electronic equipment and storage medium

By grouping and classifying blockchain transaction data and combining collaborative storage technology, the problem of low transaction data processing and storage efficiency in blockchain is solved, and more efficient data processing and secure storage solutions are achieved.

CN119760020APending Publication Date: 2025-04-04TRAVELSKY TECHNOLOGY LIMITED
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411843225.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The efficiency of transaction data processing and storage in blockchain is low, resulting in data inflation and increased storage demand.

Method used

By grouping the original transaction data, it is determined that the on-chain storage data and off-chain storage data are stored, and the on-chain off-chain collaborative storage technology is used to optimize data storage and access efficiency.

Benefits of technology

It improves the efficiency and accuracy of transaction data processing, reduces data storage pressure, enhances storage security, optimizes data access and management efficiency, and improves the overall performance and user experience of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760020A_ABST
    Figure CN119760020A_ABST
Patent Text Reader

Abstract

The invention discloses a transaction data processing method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring original data required by transaction processing; performing grouping processing on the original data to obtain a plurality of grouped data; transaction processing is carried out based on the multiple pieces of grouped data, transaction process data are obtained, and the transaction process data are used for representing flow data generated in the transaction processing process; on-chain storage data and off-chain storage data are determined based on the transaction process data, and the data volume of the on-chain storage data is smaller than the data volume of the off-chain storage data; the on-chain storage data is stored to the on-chain storage system, the off-chain storage data is stored to the off-chain storage system, and the safety of the off-chain storage system is higher than that of the on-chain storage system. According to the method and the device, the technical problem of relatively low efficiency of processing and storing the transaction data in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of transaction data processing, and in particular to a transaction data processing method, device, electronic device and storage medium. Background Art

[0002] The storage of blockchain is an important part of ensuring the reliability and security of data in a decentralized system. The blockchain connects blocks in sequence through a chain structure. Each block contains a series of transaction data and a hash value pointing to the previous block, thus forming an unalterable chain.

[0003] In blockchain, serial transaction execution means processing each transaction one by one in the order of transactions. Each node will execute in a consistent transaction order, ensuring that the ledger status of all nodes in the system is consistent. The execution of each transaction depends on the result of the previous transaction, so it needs to be performed one by one. This method avoids data conflicts caused by concurrent transactions and ensures that there will be no double payments or data inconsistencies when the transaction order is determined. After the transaction is confirmed by the consensus process, all nodes update their respective ledgers in the same order to ensure the security and reliability of the blockchain. As the business gradually expands, blockchain data will generate data expansion. Over time, the increasing number of transactions in the blockchain will lead to a rapid increase in the amount of data, and the demand for data processing and storage will continue to increase, resulting in low efficiency in the processing and storage of transaction data in related technologies.

[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present invention provide a transaction data processing method, device, electronic device and storage medium to at least solve the technical problem of low efficiency in processing and storing transaction data in related technologies.

[0006] According to one aspect of an embodiment of the present application, a method for processing transaction data is provided, including: acquiring original data required for transaction processing; performing group processing on the original data to obtain multiple grouped data; performing transaction processing based on the multiple grouped data to obtain transaction process data, wherein the transaction process data is used to represent the flow data generated during the transaction processing; determining on-chain storage data and off-chain storage data based on the transaction process data, wherein the amount of data of the on-chain storage data is less than the amount of data of the off-chain storage data; storing the on-chain storage data in an on-chain storage system, and storing the off-chain storage data in an off-chain storage system, wherein the security of the off-chain storage system is greater than the security of the on-chain storage system.

[0007] Optionally, the original data is grouped and processed to obtain multiple grouped data, including: in response to receiving transaction request information, determining dependencies between transactions based on the transaction request information, wherein the dependencies include at least one of the following: transaction account information, transaction contract information, and transaction conflict information; and the original data is grouped and processed based on the dependencies to obtain multiple grouped data.

[0008] Optionally, transaction processing is performed based on multiple grouped data to obtain transaction process data, including: based on transaction request information, selecting data to be processed from multiple grouped data; performing data distribution comparison between the data to be processed and the multiple grouped data to obtain comparison results; dividing the data to be processed based on the comparison results to obtain intra-group data and inter-group data; performing transaction processing on the intra-group data and the inter-group data to obtain transaction process data.

[0009] Optionally, transaction processing is performed on the intra-group data and the inter-group data to obtain transaction process data, including: performing serial transaction processing on the intra-group data and performing parallel transaction processing on the inter-group data to obtain transaction process data.

[0010] Optionally, determining on-chain storage data and off-chain storage data based on transaction process data includes: compressing the transaction process data to obtain compressed transaction data, wherein the data bit width of the compressed transaction data is smaller than the data bit width of the transaction process data; and determining on-chain storage data and off-chain storage data based on the compressed transaction data.

[0011] Optionally, based on the compressed transaction data, determining the on-chain storage data and the off-chain storage data includes: obtaining index information and hash values ​​of the compressed transaction data; determining the on-chain storage data based on the index information and the hash values; determining the off-chain storage data based on the index information and the compressed transaction data.

[0012] According to another aspect of an embodiment of the present invention, a transaction data processing device is also provided, including: an acquisition module, used to acquire original data required for transaction processing; a grouping module, used to group the original data to obtain multiple grouped data; a transaction processing module, used to perform transaction processing based on the multiple grouped data to obtain transaction process data, wherein the transaction process data is used to represent the flow data generated in the transaction processing process; a determination module, used to determine on-chain storage data and off-chain storage data based on the transaction process data, wherein the amount of on-chain storage data is less than the amount of off-chain storage data; a storage module, used to store on-chain storage data in an on-chain storage system, and store off-chain storage data in an off-chain storage system, wherein the security of the off-chain storage system is greater than the security of the on-chain storage system.

[0013] According to another aspect of an embodiment of the present invention, there is further provided an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the method in each embodiment of the present invention is executed when the program is running.

[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.

[0015] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0016] According to another aspect of an embodiment of the present invention, a computer program product is provided, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0017] According to another aspect of the embodiments of the present invention, a computer program is provided. When the computer program is executed by a processor, the methods in the embodiments of the present invention are implemented.

[0018] In an embodiment of the present invention, a method for processing transaction data is provided, including: acquiring original data required for transaction processing; performing group processing on the original data to obtain multiple grouped data; performing transaction processing based on the multiple grouped data to obtain transaction process data, wherein the transaction process data is used to represent the flow data generated during the transaction processing; determining on-chain storage data and off-chain storage data based on the transaction process data, wherein the amount of data of the on-chain storage data is less than the amount of data of the off-chain storage data; storing the on-chain storage data in an on-chain storage system, and storing the off-chain storage data in an off-chain storage system, wherein the security of the off-chain storage system is greater than the security of the on-chain storage system. It is easy to notice that the present application groups the acquired raw data so that the system can perform transaction processing according to the grouped data and execute the corresponding transaction logic and calculations. By processing the data in groups, the system can better avoid transaction conflicts and errors and ensure the correctness and consistency of the transaction data, thereby providing better support for the transaction data processing of the system; and classify and divide the data according to the generated transaction process data, and determine the on-chain storage data and off-chain storage data. By classifying and dividing the data, the system can reasonably allocate storage resources according to the importance and security requirements of the data, balance the privacy protection and openness and transparency of the data, reduce the storage pressure of the data, improve the storage security, and optimize the data access and management efficiency at the same time, improve the overall performance of the system and the user experience, thereby solving the technical problem of low efficiency in processing and storing transaction data in related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0020] Figure 1 is a flow chart of a method for processing transaction data according to an embodiment of the present invention;

[0021] Figure 2 is a schematic diagram of comparing the efficiency of group processing according to an embodiment of the present invention;

[0022] Figure 3 is a schematic diagram of comparing the efficiency of bit width compression according to an embodiment of the present invention;

[0023] Figure 4 It is a schematic diagram of a transaction data processing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0026] According to an embodiment of the present invention, an embodiment of a method for processing transaction data is provided. It can be explained that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0027] Figure 1 is a flow chart of a method for processing transaction data according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0028] Step S102, obtaining the original data required for transaction processing.

[0029] Step S104, grouping the original data to obtain a plurality of grouped data.

[0030] In an optional embodiment, the system can obtain the original data required for the transaction from different data sources according to the needs and rules of the transaction. These data may include information of the transaction participants, transaction amount, transaction time, transaction content, etc. The process of obtaining the original data may include operations such as data extraction, transmission, and analysis to ensure the integrity and accuracy of the data. Then, the system can group the acquired original data. The original data can be classified and organized through group processing for subsequent processing and analysis. It can include operations such as screening, sorting, and aggregation of data, and divide the original data into multiple groups according to specific attributes or rules. In the above process, by grouping the original data, the data can be organized according to a certain logical structure, reducing the complexity of data processing and improving processing efficiency. The system can process and analyze the grouped data more efficiently and speed up the transaction processing. The system can dynamically adjust the data grouping strategy according to the actual situation to better meet the transaction processing needs in different scenarios.

[0031] Step S106, performing transaction processing based on the multiple grouped data to obtain transaction process data.

[0032] Among them, transaction process data is used to represent the flow data generated during the transaction processing.

[0033] Step S108, determining the on-chain storage data and the off-chain storage data based on the transaction process data.

[0034] In an optional embodiment, the system can first perform transaction processing based on the grouped data, and execute the corresponding transaction logic and calculation. Each grouped data can represent a group of related transactions. The system can process these grouped data in a certain order, execute transaction operations and generate transaction process data. The transaction process data records the flow data generated in the transaction processing, including the specific content of the transaction, information of the participating parties, transaction time, etc., which can reflect the complete process and results of the transaction and is the basis for subsequent storage and management. Then, based on the generated transaction process data, the system can classify and divide the data to determine which data can be stored on the chain and which data can be stored off the chain. The data stored on the chain can include metadata, summary information, transaction hash values, etc. of the transaction, and the amount of data is relatively small; the data stored off the chain can include detailed information of the transaction, attachment files, pictures, videos, and other large amounts of data. By classifying and dividing the data, the system can reasonably allocate storage resources according to the importance and security requirements of the data.

[0035] Among them, the amount of data stored on the chain is smaller than the amount of data stored off the chain.

[0036] Step S110, store the on-chain storage data in the on-chain storage system, and store the off-chain storage data in the off-chain storage system.

[0037] Among them, the security of the off-chain storage system is greater than that of the on-chain storage system.

[0038] In an optional embodiment, the on-chain storage data can be stored in an on-chain storage system, which can be a node in the blockchain network or other specialized storage devices. The amount of data stored in the on-chain storage system is relatively small, and can be mainly used to verify the authenticity and integrity of transactions. The off-chain storage data can be stored in an off-chain storage system, which can be a distributed storage system, a cloud storage service, etc. The off-chain storage system is more secure than the on-chain storage system, and can store a large amount of transaction details and attachment information, and can provide a higher level of security protection.

[0039] Through the above steps, the adaptive on-chain and off-chain collaborative storage technology is adopted. The on-chain storage data can be mainly used to verify the legitimacy and integrity of the transaction and provide open and transparent information; the off-chain storage data can store more detailed information and attachment data to achieve data privacy protection. Such a setting can balance the needs of data openness, transparency and privacy protection. Storing most of the transaction detail data in the off-chain system can effectively reduce the storage pressure of on-chain data and improve the query and verification efficiency of on-chain data. At the same time, the high capacity and high performance of the off-chain storage system can better support large-scale data storage needs. Storing data in layers according to importance and security helps to improve data access efficiency and management efficiency. The on-chain storage system stores a small amount of data, which can quickly verify the validity of the transaction; the large amount of detailed data stored in the off-chain storage system can provide more comprehensive information support and provide more options for data analysis and management. This application adopts the adaptive on-chain and off-chain collaborative storage technology to balance data privacy protection and openness and transparency, reduce the storage pressure of on-chain data, improve storage security, and optimize data access and management efficiency, providing a more secure, efficient and flexible storage solution for transaction data processing, and improving the overall performance and user experience of the system.

[0040] In an embodiment of the present invention, a method for processing transaction data is provided, including: acquiring original data required for transaction processing; performing group processing on the original data to obtain multiple grouped data; performing transaction processing based on the multiple grouped data to obtain transaction process data, wherein the transaction process data is used to represent the flow data generated during the transaction processing; determining on-chain storage data and off-chain storage data based on the transaction process data, wherein the amount of data of the on-chain storage data is less than the amount of data of the off-chain storage data; storing the on-chain storage data in an on-chain storage system, and storing the off-chain storage data in an off-chain storage system, wherein the security of the off-chain storage system is greater than the security of the on-chain storage system. It is easy to notice that the present application groups the acquired raw data so that the system can perform transaction processing according to the grouped data and execute the corresponding transaction logic and calculations. By processing the data in groups, the system can better avoid transaction conflicts and errors and ensure the correctness and consistency of the transaction data, thereby providing better support for the transaction data processing of the system; and classify and divide the data according to the generated transaction process data, and determine the on-chain storage data and off-chain storage data. By classifying and dividing the data, the system can reasonably allocate storage resources according to the importance and security requirements of the data, balance the privacy protection and openness and transparency of the data, reduce the storage pressure of the data, improve the storage security, and optimize the data access and management efficiency at the same time, improve the overall performance of the system and the user experience, thereby solving the technical problem of low efficiency in processing and storing transaction data in related technologies.

[0041] Optionally, the original data is grouped and processed to obtain multiple grouped data, including: in response to receiving transaction request information, determining dependencies between transactions based on the transaction request information, wherein the dependencies include at least one of the following: transaction account information, transaction contract information, and transaction conflict information; and the original data is grouped and processed based on the dependencies to obtain multiple grouped data.

[0042] The above-mentioned transaction account information may refer to the fund transfer or transaction association between accounts. The system may group the relevant transaction data according to the relationship between the transaction accounts. Based on the transaction account information, the system can better understand the association between transactions and improve the efficiency and accuracy of data processing.

[0043] The transaction contract information mentioned above may refer to that in the blockchain system, different transactions may involve different smart contracts. The system may group the relevant transaction data according to the smart contract information involved in the transaction to facilitate contract execution and verification.

[0044] The transaction conflict information mentioned above may mean that some transactions may have conflicts, such as double spending or data inconsistency. The system can group related transaction data according to the conflict relationship between transactions to ensure that conflicting transactions can be executed in a certain order to avoid problems such as data inconsistency or double spending.

[0045] In an optional embodiment, first, the system receives transaction request information, which may include account information of transaction participants, contract information of the transaction, timestamp of the transaction, transaction content, etc. Based on these transaction request information, the system can determine the dependencies between transactions so as to reasonably group and process the original data. The dependencies may include transaction account information, transaction contract information, and transaction conflict information. Based on the transaction request information, the system determines the dependencies between transactions, and the system can group and process the original data to obtain multiple grouped data. The system can classify the relevant data into corresponding groups according to the relationship between transactions, ensuring that there are no conflicts or dependency issues between the data in each group. In this way, the transaction data can be better managed and processed, and the processing efficiency and accuracy of the system can be improved. Through the above steps, by reasonably grouping the relevant transaction data, the system can process the transaction data more effectively, avoid data conflicts and dependency issues, and improve the efficiency and accuracy of data processing. Grouping the transaction data according to certain dependencies is conducive to the system to better understand and process the correlation between transactions and optimize the performance and efficiency of the system. By processing data in groups, the system can better avoid transaction conflicts and errors, ensure the correctness and consistency of transaction data, and improve the stability and reliability of the system. Grouping the raw data and determining the dependencies between transactions based on transaction request information can help improve data processing efficiency, optimize system performance, avoid data conflicts and errors, and thus provide better support for the system's transaction data processing.

[0046] Optionally, transaction processing is performed based on multiple grouped data to obtain transaction process data, including: based on transaction request information, selecting data to be processed from multiple grouped data; performing data distribution comparison between the data to be processed and the multiple grouped data to obtain comparison results; dividing the data to be processed based on the comparison results to obtain intra-group data and inter-group data; performing transaction processing on the intra-group data and the inter-group data to obtain transaction process data.

[0047] In an optional embodiment, the system selects data to be processed from multiple grouped data according to the received transaction request information. These data may include transaction records that can be processed, information about transaction participants, transaction amounts, etc. According to the characteristics and requirements of the transaction request information, the system selects appropriate data for processing. After selecting the data to be processed, the system compares the data distribution with multiple grouped data. The data distribution comparison can determine the relevance and difference between the data to be processed and the existing data. The system can compare and analyze the data to obtain comparison results, including information such as data matching and similarity. Based on the comparison results, the system divides the data to be processed to obtain intra-group data and inter-group data. Finally, the system performs transaction processing on the intra-group data and inter-group data obtained by the division. Transaction process data can be generated during the transaction processing process to record the detailed process and results of the transaction. In the above steps, by comparing and dividing the data to be processed with multiple grouped data, the system can process data more effectively, avoid repeated calculations and redundant operations, improve the efficiency and accuracy of data processing, perform transaction processing based on multiple grouped data and obtain transaction process data. By comparing, dividing and processing data, it can improve data processing efficiency, optimize system performance, avoid data conflicts and errors, and thus provide better support for the system's transaction data processing.

[0048] Optionally, transaction processing is performed on the intra-group data and the inter-group data to obtain transaction process data, including: performing serial transaction processing on the intra-group data and performing parallel transaction processing on the inter-group data to obtain transaction process data.

[0049] In an optional embodiment, first, the system can perform serial transaction processing on the data within the group. The system can process the data within the group one by one in a certain order to ensure the consistency and correctness of the data. Each data within the group can contain a group of related transactions, and the system can execute them step by step according to the dependency and logical order of the transactions to ensure the smooth progress of the transactions. During the serial processing process, the system can gradually update the transaction status, account book information, etc., and generate corresponding transaction process data. At the same time, the system can perform parallel transaction processing on the data between groups. The data between groups can be processed in parallel to improve the processing efficiency of the system. The system can process multiple data between groups at the same time, and different data between groups do not interfere with each other, thereby speeding up the overall transaction processing speed. Parallel processing can make full use of system resources and improve the throughput and concurrent processing capabilities of the system. In the above process, by serial processing of data within the group and parallel processing of data between groups, the system can more effectively utilize system resources and improve the efficiency and speed of transaction processing. Serial processing ensures the consistency and correctness of data, and parallel processing improves the concurrent processing capability of the system and speeds up transaction processing. Serial processing of data within the group and parallel processing of data between groups help optimize the performance and resource utilization of the system. The system can reasonably arrange the processing order according to the characteristics and dependencies of the transactions, and improve the overall performance and efficiency of the system. Serial processing of data within a group can ensure that the dependencies between transactions are correctly processed, avoiding data conflicts and errors; parallel processing of data between groups can improve the throughput and concurrent processing capabilities of the system, and avoid resource competition and blocking between transactions. This application adopts contract grouping and parallel processing technology, analyzes data read and write conflicts between transactions, reasonably groups transactions, and executes them serially within the group and in parallel between groups, thereby improving the processing efficiency of the system.

[0050] Optionally, determining on-chain storage data and off-chain storage data based on transaction process data includes: compressing the transaction process data to obtain compressed transaction data, wherein the data bit width of the compressed transaction data is smaller than the data bit width of the transaction process data; and determining on-chain storage data and off-chain storage data based on the compressed transaction data.

[0051] In an optional embodiment, the system can perform data compression processing on the transaction process data. Data compression can compress and encode the original data through certain algorithms and technologies to reduce the storage space occupied by the data. The compressed transaction data obtained after compression has a data bit width that is smaller than the data bit width of the transaction process data. The compression technology can use lossless compression or lossy compression, and select a suitable compression algorithm for processing according to the characteristics of the data. Then, based on the compressed transaction data, the system can determine which part of the data can be stored on the chain and which part of the data can be stored off the chain. In the above process, by compressing the transaction process data, the system can reduce the storage space occupied and improve storage efficiency and space utilization. The compressed data has a small bit width and occupies less storage space, which helps to optimize the utilization of storage resources. Data compression technology can reduce the waste of storage space and reduce storage costs. The data bit width of compressed transaction data is small, the amount of data is reduced, and it is conducive to improving the read and write performance of data. Storing compressed data can speed up the reading speed of data, reduce the cost and delay of data transmission, and improve the storage efficiency and processing speed of the blockchain system. Through data bit width compression and aggregation storage technology, the system can effectively optimize the utilization of storage resources, reduce the waste of storage space, reduce storage costs, and improve data reading and writing performance, thereby providing better support for the storage efficiency and overall performance of the blockchain system.

[0052] Optionally, based on the compressed transaction data, determining the on-chain storage data and the off-chain storage data includes: obtaining index information and hash values ​​of the compressed transaction data; determining the on-chain storage data based on the index information and the hash values; determining the off-chain storage data based on the index information and the compressed transaction data.

[0053] In an optional embodiment, the system can extract index information and hash values ​​from the compressed transaction data. Index information can be an identifier or location information of the data, which is used to quickly locate the data; hash value can be summary information of the data, which is used to verify the integrity and immutability of the data. The system can perform hash operation on the compressed transaction data to generate a corresponding hash value, and extract index information at the same time. The system determines which part of the data can be stored on the chain based on the index information and hash value. The data stored on the chain is usually the summary information or index of the data, ensuring the integrity and security of the data. The system stores the index information and hash value on the chain for subsequent verification of the authenticity and consistency of the data. At the same time, the system determines which part of the data can be stored off the chain based on the index information and the compressed transaction data. The off-chain stored data may include compressed transaction details, attachment data, etc. The system quickly locates the compressed transaction data based on the index information to ensure the integrity and security of the data. In the above steps, the compressed transaction data is stored in the off-chain secure storage system, which effectively reduces the risk of privacy leakage. The off-chain storage system usually has a higher level of security protection measures, which can encrypt and control access to sensitive data to protect user privacy and data security. The hash value or index of the data stored on the chain can be used to verify the integrity and immutability of the data stored off the chain. By verifying the hash value of the data, the system can ensure that the data has not been tampered with and guarantee the authenticity and credibility of the data. By storing the detailed information of the data in the off-chain system and only storing summary information or indexes on the chain, the system effectively balances the privacy protection and openness and transparency of the data. Users can verify the validity of transactions through on-chain data while protecting the privacy of sensitive data. This application stores most of the transaction details in the off-chain system, effectively reducing the storage pressure of on-chain data. Only index information and hash values ​​are stored on the chain, which reduces the storage requirements of on-chain data and improves the overall storage efficiency of the system.

[0054] The technical solution proposed in this application is described below in combination with an optional embodiment. The storage of blockchain is an important part of ensuring the reliability and security of data in a decentralized system. The blockchain connects blocks in sequence through a chain structure. Each block contains a series of transaction data and a hash value pointing to the previous block, thus forming an unalterable chain. Each participating node will save a complete copy of the blockchain's ledger to ensure that the data is backed up across the entire network, and any node failure will not affect the integrity of the data. As the business gradually expands, blockchain data will produce data expansion. Over time, the increasing number of transactions in the blockchain will cause the amount of data to increase rapidly, and the storage demand will continue to increase. For example, in public chains such as Ethereum, the ledger data will continue to increase with the blocks generated by each transaction, and the nodes need to store complete on-chain data, which places high demands on storage resources. This application uses on-chain and off-chain collaborative storage technology to effectively coordinate the use of storage space, optimize storage resources, improve overall security, and enhance data utilization efficiency.

[0055] In blockchain, serial transaction execution means processing each transaction one by one in the order of transactions. Each node will execute in a consistent transaction order, thus ensuring that the ledger status of all nodes in the system is consistent. The execution of each transaction depends on the result of the previous transaction, so it needs to be carried out one by one. This method avoids data conflicts caused by concurrent transactions, ensuring that there will be no double payments or data inconsistencies when the transaction order is determined. After the transaction is confirmed by the consensus process, all nodes update their respective ledgers in the same order, which ensures the security and reliability of the blockchain. Blockchain parallel technology analyzes the dependencies between transactions and allows non-conflicting transactions to be executed simultaneously, thereby improving the processing efficiency of the system. If there is no data read and write conflict between transactions, they can be processed in parallel, avoiding the performance bottleneck of traditional serial execution. This technology improves the throughput of transactions, significantly optimizes the processing capacity of blockchain systems in high-concurrency scenarios, and ensures system performance and scalability.

[0056] This application uses data adaptive on-chain and off-chain collaborative storage technology, takes advantage of the security of blockchain storage and the efficiency of local storage, improves the overall storage efficiency and security of the system, optimizes storage resource utilization, and effectively enhances the overall efficiency of the system. Through contract grouping and parallel processing technology, data is grouped, and parallel processing technology is used between different groups to improve system efficiency. Through data bit width compression and aggregation storage technology, the space occupied by a single transaction is compressed by using data bit width compression and aggregation storage technology, so that more transaction data can be accommodated in the same storage space. Combine the above technologies to achieve optimization of smart contract systems for data sharing application scenarios.

[0057] The contract grouping and parallel processing technology of the present application analyzes the data read and write conflicts between transactions, rationally groups transactions, and executes them serially within the group and in parallel between groups, thereby improving the processing efficiency of the system. It can improve transaction throughput, reduce transaction processing time, and optimize the performance of the system in a high-concurrency environment, thereby improving the efficiency of the overall system. The present application reduces the waste of storage space by optimizing the utilization of storage units. By aggregating and storing multiple small data in one storage unit, the present technology effectively improves storage efficiency and space utilization. It reduces the storage burden of nodes and improves the overall storage capacity of the system. The technology also optimizes the read and write performance of data and improves the storage efficiency and processing speed of the blockchain system. The present application stores part of the data in a secure storage system off-chain to reduce the risk of privacy leakage; the chain can only store the hash value or index of the data to ensure the integrity and immutability of the data. This storage solution effectively balances the privacy protection and openness and transparency of the data, reduces the storage pressure of the data on the chain, improves storage security, and also optimizes the efficiency of data access and management.

[0058] The following is the process from data acquisition to final storage, which combines contract grouping and parallel processing technology, data bit width compression and aggregation storage technology, and sensitive data adaptive on-chain and off-chain collaborative storage technology. Specifically, the system obtains the data that needs to be stored through external interfaces or other channels. The system analyzes the data that needs to be stored, adaptively determines the on-chain data storage part and the off-chain data storage part, stores large-volume data off-chain, stores brief data on-chain, and indexes the on-chain and off-chain data of related data for storage. Because blockchain resources are valuable and in order to further improve the system processing capabilities, when the system data is stored in the blockchain, this method will reduce the data bit width of the data that needs to be stored, compress multiple transactions into one storage unit, reduce storage space requirements, reduce storage time, and improve system processing capabilities. The system classifies and groups the data stored on the blockchain for subsequent data processing. When the system obtains multiple users accessing and querying the data stored in the blockchain, in order to improve the overall access efficiency of the system, contract grouping and parallel processing technology are used at this time. The system processes the classified and grouped data in different ways. The access transactions between different groups use parallel processing technology and multi-threading to efficiently process transactions, while the transactions within the group are executed in sequence, which improves the overall concurrent performance of the system. Users use the data in the next step based on the result feedback provided by the system.

[0059] Transaction grouping can be the first step in parallel processing. It can divide non-conflicting transactions into multiple independent groups to create conditions for parallel execution between groups. The system receives a batch of transaction requests and divides the transactions into different transaction groups after analyzing the dependencies between transactions, such as the conflicts of accounts, contracts, and data. Each transaction group will contain non-conflicting transactions to ensure that different groups can be executed in parallel. Transactions within a group need to be executed in a traditional serial manner because these transactions are interdependent or may modify the same state. This module is responsible for ensuring the sequential execution of transactions within a group. Each transaction in a transaction group is sent to the Ethereum Virtual Machine (EVM) for execution in turn. EVM executes transactions by reading and updating global states, such as account balances and contract storage. After each transaction is executed, the next transaction in the group can start to ensure the consistency of the transaction state. The parallel execution module between groups is responsible for initiating and processing transactions from different groups at the same time. Transactions between different groups do not involve the same accounts or contracts, so data between groups can be executed in parallel.

[0060] This application adopts data width compression aggregation storage technology, and compresses the redundant or invalid data by analyzing the bit width utilization of blockchain data. When executing a smart contract, the transaction calls a function (storeInt32), and the contract sends the call request to EVM for processing. EVM is responsible for executing the bytecode instructions of the smart contract. In the native Ethereum execution mode, the Ethereum Virtual Machine (EVM) adopts a 32-byte fixed-length stack design to simplify cryptographic calculations. This design causes the actual storage mode of low-bit-width persistent storage data to become sparse, which in turn requires the relevant data read and write operations to be implemented through a large number of redundant position calculations and memory access instructions, reducing the memory access performance of smart contracts and adversely affecting the quality of services deployed on the blockchain. During the data flow process, EVM defaults to a 32-byte bit width for each storage bit. When the variable is significantly less than the 32-byte bit width, EVM will still use 32 bytes to store the variable, which not only takes up additional storage resources, but also significantly increases fuel (Gas) consumption. Data width compression and aggregation storage technology can compress the byte width when EVM uses 32-byte bit width to store small variables, convert them into low-level byte streams, reduce resource usage, improve overall efficiency, reduce Gas consumption, and significantly reduce retrieval time during later data retrieval. The data before compression occupies 32 bytes of bit width, and the compressed data occupies 4 bytes of bit width. The storage space occupied after compression aggregates multiple instructions. EVM calculates the Gas consumption of operations when processing and storing data. Gas can be a unit used to measure the computing resources required for EVM to perform each operation (OpCode). EVM calculates Gas consumption based on the complexity of each operation, storage requirements, and computing resource usage. Each opcode (OpCode) in EVM has a predefined Gas cost, which is determined by the blockchain based on the computational complexity and storage requirements of the operation.

[0061] Different data types consume different amounts of gas when processed in the EVM. A 32-byte data width requires more storage space and gas consumption than a 4-byte data width. When performing basic operations such as addition and multiplication, the processing complexity and storage space of a high data width make its gas consumption higher, while a low data width processes smaller data and consumes less gas. Each transaction or smart contract call has a specified Gas Limit, which indicates the maximum amount of gas that the transaction can consume. If the gas consumption exceeds this limit during the execution of the transaction, the transaction will fail and roll back. Even if a failure occurs, the consumed gas will not be refunded. Gas Price: This is the fee that the user is willing to pay for each unit of Gas, denominated in Ethereum's base currency ETH. Gas Price and Gas consumption together determine the cost of the transaction. Transaction Cost = Gas Consumption × Gas Price. Since data with low data widths takes up less storage space, Gas consumption can be significantly reduced.

[0062] The key to the on-chain and off-chain collaborative storage collaboration in this application is how to ensure that the on-chain and off-chain data can be related to each other and work in coordination. The on-chain data storage and the off-chain data storage are synchronized and associated through the index mechanism. Each off-chain data corresponds to an on-chain index to ensure that when accessing the on-chain data, the location of the off-chain storage can be quickly found. When the data is written, the system will automatically trigger the on-chain and off-chain collaborative storage process to ensure that the two are updated synchronously and there is no data inconsistency. In the process of collaborative storage, whether it is updating, deleting or reading data, the collaborative mechanism needs to ensure that the on-chain and off-chain data are synchronized and consistent. During the storage process, only metadata or index information is retained on the chain to ensure that the off-chain data can be quickly retrieved. When reading data, on-chain and off-chain access can be carried out in parallel, but ultimately it is necessary to achieve unified merging of data at the system level to ensure that users obtain complete and consistent results.

[0063] The goal of collaborative storage is not only for security, but also for performance optimization. The storage space on the chain is limited, while the storage off the chain provides scalability and efficient access. Therefore, the on-chain and off-chain storage need to work together to ensure that both security requirements are met and performance is not sacrificed. Only necessary metadata and indexes are stored on the chain, which avoids overload of on-chain storage and improves the transaction processing efficiency of the blockchain system. Through the collaborative access mechanism between the on-chain and off-chain, parallel processing can be performed during reading. The data is encrypted and verified on the chain and quickly accessed off the chain, which reduces the waiting time and computing burden of the system. In data collaborative storage, data bit width aggregate storage is used as an optimization solution to further improve the efficiency of frequent data access. Traditional on-chain data needs to be read and verified one by one each time it is accessed, while aggregate storage can package and process multiple requested data blocks to reduce repeated operations. When the system writes data, it automatically triggers the on-chain and off-chain collaborative storage processes. The event mechanism on the blockchain can capture the operation of data writing and trigger the operation of the off-chain storage system through event notification. When the on-chain data is successfully written, the system sends an event notification to the off-chain system to start processing the data storage. Event-driven can respond to on-chain operations in real time, ensuring that off-chain storage is not lagging behind.

[0064] Figure 2 is a schematic diagram of comparing the efficiency of group processing according to an embodiment of the present invention. Figure 2 As shown in the figure, the horizontal axis represents time (seconds), and the vertical axis represents the number of transaction data groups. It shows the completion time comparison of the traditional serial processing ① and the grouped serial and parallel processing ② proposed in the present application under 10 groups, 20 groups and 30 groups of transaction data respectively. It can be seen that the grouped serial and parallel processing proposed in the present application improves the data processing efficiency.

[0065] Figure 3 is a schematic diagram of comparing the efficiency of bit width compression according to an embodiment of the present invention. Figure 3 As shown in the figure, the horizontal axis represents time (seconds) and the vertical axis represents the number of data groups. It shows the comparison between the traditional data processing time ① without bit width compression processing and the data processing time ② after bit width compression processing proposed in the present application under 10 and 20 groups of data respectively. It can be seen that the bit width compression proposed in the present application improves the efficiency of data processing.

[0066] According to another aspect of an embodiment of the present application, a device for processing transaction data is also provided, which can execute the method for processing transaction data of the above embodiment. The specific implementation method and preferred application scenario are the same as those of the above embodiment and will not be repeated here.

[0067] Figure 4 is a schematic diagram of a transaction data processing device according to an embodiment of the present application, such as Figure 4As shown, the device includes the following: an acquisition module 402 , a grouping module 404 , a transaction processing module 406 , a determination module 408 and a storage module 410 .

[0068] Among them, the acquisition module is used to obtain the original data required for transaction processing; the grouping module is used to group the original data to obtain multiple grouped data; the transaction processing module is used to perform transaction processing based on the multiple grouped data to obtain transaction process data, wherein the transaction process data is used to represent the flow data generated in the transaction processing process; the determination module is used to determine the on-chain storage data and the off-chain storage data based on the transaction process data, wherein the amount of the on-chain storage data is less than the amount of the off-chain storage data; the storage module is used to store the on-chain storage data in the on-chain storage system, and store the off-chain storage data in the off-chain storage system, wherein the security of the off-chain storage system is greater than the security of the on-chain storage system.

[0069] Among them, the grouping module is also used to determine the dependency between transactions based on the transaction request information in response to receiving the transaction request information, wherein the dependency includes at least one of the following: transaction account information, transaction contract information and transaction conflict information; and group the original data based on the dependency to obtain multiple grouped data.

[0070] Among them, the transaction processing module is also used to select the data to be processed from multiple grouped data based on the transaction request information; compare the data distribution of the data to be processed with the multiple grouped data to obtain the comparison result; divide the data to be processed based on the comparison result to obtain intra-group data and inter-group data; perform transaction processing on the intra-group data and inter-group data to obtain transaction process data.

[0071] Among them, the grouping module is also used to perform serial transaction processing on the data within the group, and to perform parallel transaction processing on the data between groups to obtain transaction process data.

[0072] Among them, the determination module is also used to compress the transaction process data to obtain compressed transaction data, wherein the data bit width of the compressed transaction data is smaller than the data bit width of the transaction process data; based on the compressed transaction data, the on-chain storage data and the off-chain storage data are determined.

[0073] Among them, the determination module is also used to obtain the index information and hash value of the compressed transaction data; based on the index information and hash value, determine the on-chain storage data; based on the index information and the compressed transaction data, determine the off-chain storage data.

[0074] An embodiment of the present application further provides an electronic device, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of the present invention when running.

[0075] The above-mentioned memory may refer to a device inside a computer for storing data and programs, and may include memory, hard disk, etc., wherein the memory may be used to temporarily store running programs and data, the hard disk may be used to store programs and data for a long time, and the memory may be used to enable the computer to read and write data, and execute programs; the above-mentioned processor may be responsible for executing instructions in computer programs and performing data processing, and may be responsible for controlling and executing various operations, including arithmetic operations, logical operations, data transmission, etc.

[0076] An embodiment of the present application further provides a computer-readable storage medium, which includes a stored executable program, wherein when the executable program is running, the device where the computer-readable storage medium is located is controlled to execute the methods in various embodiments of the present invention.

[0077] The above-mentioned computer storage medium may refer to a medium in a computer memory used to store certain discontinuous physical quantities. Computer storage media mainly include semiconductors, magnetic cores, magnetic drums, magnetic tapes, laser disks, etc.; the stored program included in the computer-readable storage medium may be a set of instructions that can be recognized and executed by a computer, running on an electronic computer, and is an information tool that meets certain needs of people.

[0078] An embodiment of the present application further provides a computer program product, including a computer program, which implements the methods in various embodiments of the present invention when executed by a processor.

[0079] The above-mentioned computer program product may refer to a software program that has been written, tested and released and can be run on a computer or other device. The computer program product may include an application, an operating system, tool software, etc., which is used to implement specific functions or solve specific problems.

[0080] An embodiment of the present application further provides a computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method in each embodiment of the present invention is implemented.

[0081] The above-mentioned non-volatile computer-readable storage medium may refer to a medium for storing data. The non-volatile computer-readable storage medium can keep the data from being lost when the power is off, and can be used to store long-term data, such as operating systems, applications, and user files. The non-volatile storage medium may include hard disk drives, solid-state drives, optical disks, and flash memory storage devices, etc.

[0082] The embodiments of the present application further provide a computer program, which implements the methods in the above-mentioned embodiments of the present invention when executed by a processor.

[0083] The above-mentioned computer program may refer to a collection of instructions used to tell a computer to perform a specific task or operation. A computer program may be written by a programmer using a specific programming language and may include algorithms, data structures, logic, and control flows. A computer program may be used for a variety of purposes, including application software, operating systems, and the like.

[0084] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0085] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0086] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0087] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0088] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0089] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for processing transaction data, characterized in that: include: Obtain the raw data required for transaction processing; Performing group processing on the original data to obtain a plurality of group data; Performing transaction processing based on the plurality of grouped data to obtain transaction process data, wherein the transaction process data is used to represent flow data generated during the transaction processing; Determine on-chain storage data and off-chain storage data based on the transaction process data, wherein the amount of the on-chain storage data is less than the amount of the off-chain storage data; The on-chain storage data is stored in an on-chain storage system, and the off-chain storage data is stored in an off-chain storage system, wherein the security of the off-chain storage system is greater than the security of the on-chain storage system.

2. The method for processing transaction data according to claim 1, characterized in that: The original data is processed in groups to obtain a plurality of grouped data, including: In response to receiving the transaction request information, determining the dependency relationship between transactions based on the transaction request information, wherein the dependency relationship includes at least one of the following: transaction account information, transaction contract information, and transaction conflict information; The original data is grouped based on the dependency relationship to obtain the plurality of grouped data.

3. The method for processing transaction data according to claim 1, characterized in that: Performing transaction processing based on the plurality of grouped data to obtain transaction process data includes: Based on the transaction request information, selecting data to be processed by the transaction from the plurality of grouped data; Performing data distribution comparison on the data to be processed and the plurality of grouped data to obtain a comparison result; Dividing the data to be processed into groups based on the comparison result to obtain intra-group data and inter-group data; Transaction processing is performed on the intra-group data and the inter-group data to obtain the transaction process data.

4. The method for processing transaction data according to claim 3, characterized in that: Performing transaction processing on the intra-group data and the inter-group data to obtain the transaction process data includes: Serial transaction processing is performed on the intra-group data, and parallel transaction processing is performed on the inter-group data to obtain the transaction process data.

5. The method for processing transaction data according to claim 1, characterized in that: Determining on-chain storage data and off-chain storage data based on the transaction process data includes: Compressing the transaction process data to obtain compressed transaction data, wherein the data bit width of the compressed transaction data is smaller than the data bit width of the transaction process data; Based on the compressed transaction data, the on-chain storage data and the off-chain storage data are determined.

6. The method for processing transaction data according to claim 5, characterized in that: Determining the on-chain storage data and the off-chain storage data based on the compressed transaction data includes: Obtaining index information and hash value of the compressed transaction data; Determine the on-chain storage data based on the index information and the hash value; Based on the index information and the compressed transaction data, the off-chain storage data is determined.

7. A transaction data processing device, characterized in that: include: The acquisition module is used to obtain the original data required for transaction processing; A grouping module, used for grouping the original data to obtain a plurality of grouped data; A transaction processing module, configured to perform transaction processing based on the plurality of grouped data to obtain transaction process data, wherein the transaction process data is used to represent flow data generated during the transaction processing; A determination module, configured to determine on-chain storage data and off-chain storage data based on the transaction process data, wherein the amount of the on-chain storage data is less than the amount of the off-chain storage data; A storage module is used to store the on-chain storage data in an on-chain storage system, and to store the off-chain storage data in an off-chain storage system, wherein the security of the off-chain storage system is greater than the security of the on-chain storage system.

8. An electronic device, characterized in that: include: A memory storing an executable program; A processor is used to run the program, wherein the program, when running, executes the transaction data processing method described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored executable program, wherein when the executable program is run, the device where the storage medium is located is controlled to execute the transaction data processing method according to any one of claims 1 to 6.

10. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the transaction data processing method according to any one of claims 1 to 6.