Multi-partition-based blockchain data management optimization method and system

CN117911028BActive Publication Date: 2026-08-07NAT UNIV OF DEFENSE TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NAT UNIV OF DEFENSE TECH
Filing Date
2023-12-08
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0005]本发明提供一种基于多分区的区块链数据管理优化方法及系统,以解决降低交易数据集数据管理成本的同时会降低区块验证效率的问题

Benefits of technology

[0076]This invention utilizes the transaction interval and number of transactions from historical transactions under the same address to predict the probability that address-related unspent transaction output data will appear as transaction output in the next transaction block. Unspent transaction output data with high probability is stored in a cache to accelerate the verification of these transactions; unspent transaction output data with low probability is stored on disk to reduce memory usage. In this way, full nodes do not need to frequently access unspent transaction output data on disk, thus reducing memory consumption. Simultaneously, utilizing a small unspent transaction output cache accelerates block verification time and achieves efficient data management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117911028B_ABST
    Figure CN117911028B_ABST
Patent Text Reader

Abstract

The application provides a multi-partition-based blockchain data management optimization method and system, which comprises the following steps: obtaining a target transaction address in a plurality of transaction blocks that uses a UTXO data set for transaction; reading a transaction timestamp and a transaction frequency of the target transaction address; creating a UTXO cache area in the blockchain system for storing UTXO data in the UTXO data set; combining the transaction timestamp and the transaction frequency to predict the predicted use probability of all the UTXO data in a new transaction block of the blockchain system; and saving all the UTXO data to the local memory, the auxiliary disk memory and the UTXO cache area according to the predicted use probability. The application has the effect of reducing the data management cost of the transaction data set while improving the block verification efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of blockchain technology, specifically relating to a method and system for optimizing blockchain data management based on multiple partitions. Background Technology

[0002] The continued development of blockchain technology relies on its unique characteristics such as decentralization, traceability, and high privacy. Blockchain technology can be flexibly applied to various application scenarios in other industries. Blockchain nodes can be divided into light nodes and full nodes. Light nodes are responsible for processing and verifying a portion of transactions and blocks, and do not need to store the complete blockchain data. Full nodes need to store the complete blockchain data to maintain system operation. Specifically, a group of full nodes competing for the right to record transactions are called accounting nodes. The distributed storage of blockchain system data allows nodes to communicate peer-to-peer without a third party, but this convenience comes at the cost of full node storage space; full nodes need to download all data to complete independent verification. Consequently, as blockchain systems become more popular, the data stored by the system and full nodes is destined to continue to grow. A blockchain system contains a massive distributed ledger, with accounting nodes continuously recording data on the ledger. All nodes jointly build the blockchain. After a user proposes a transaction, it is uploaded to the chain and broadcast. Transaction recipients verify the transaction, and only verified transactions are stored in their own mempool.

[0003] Unspent Transaction Outputs (UTXOs) are part of the transaction dataset. The data management capabilities, storage methods, and space consumption of UTXOs significantly impact the operational efficiency and verification performance of a blockchain system. Especially with the widespread adoption of blockchain technology, the related UTXO datasets are constantly growing, making it nearly impossible to store all the data completely in local memory. How to store and manage this UTXO transaction data is a problem that blockchain systems need to solve. To ensure verification performance, full nodes need to load the complete UTXO set into their local memory, which consumes a significant amount of memory. Currently, with the rapid increase in UTXO sets, storing the entire set in memory is very costly, so sometimes a portion of the UTXOs is stored on slow hard drives. However, since disk access latency is several orders of magnitude longer than local memory access, transaction verification takes 100 times longer.

[0004] Block verification includes version verification, simple input verification, signature verification, and lock time verification. Among these, accessing the unspent transaction output set, ECC (Elliptic Curves Cryptography) decryption, and SHA-2 hashing are the three most time-consuming steps. An evaluation of the time consumed by these operations on a general-purpose PC shows that if the entire unspent transaction output set is in local memory, the verification speed is primarily driven by ECC decryption time, approximately 105µs, with a throughput of 10,000 TPS. However, if we read the unspent transaction output database from disk, the access time increases to 10 milliseconds, resulting in a verification speed of only 100 TPS. This significant difference impacts the efficiency of blockchain node verification and data management. Summary of the Invention

[0005] This invention provides a multi-partition-based blockchain data management optimization method and system to solve the problem that reducing transaction dataset data management costs will reduce block verification efficiency.

[0006] In a first aspect, the present invention provides a multi-partition-based blockchain data management optimization method applied to a blockchain node device. The node device has local memory and auxiliary disk memory. The node device is used to mount a transaction-based blockchain system, which includes multiple transaction blocks and an unspent transaction output dataset. The method includes the following steps:

[0007] Obtain the target transaction addresses that use the unspent transaction output dataset to conduct transactions in multiple of the aforementioned transaction blocks;

[0008] Read the transaction timestamp and transaction frequency of the target transaction address;

[0009] In the blockchain system, an unspent transaction output cache is created to store the unspent transaction output data in the unspent transaction output dataset.

[0010] By combining the transaction timestamps and the transaction frequency, predict the predicted usage probability of all the unspent transaction output data in the new transaction block of the blockchain system;

[0011] Based on the predicted usage probability, all the unspent transaction output data are saved to the local memory, the auxiliary disk memory, and the unspent transaction output cache, respectively.

[0012] Optionally, the step of combining the transaction timestamp and the transaction frequency to predict the predicted usage probability of all the unspent transaction output data in the new transaction block of the blockchain system includes the following steps:

[0013] Calculate the transaction time interval between every two transactions based on the transaction timestamp;

[0014] By combining the transaction time interval and the transaction frequency, and using statistical analysis, the transaction time interval threshold and the optimal transaction frequency are calculated.

[0015] Sort all the unspent transaction output data according to the transaction time interval or the transaction frequency;

[0016] Combining the transaction time interval threshold and the optimal transaction frequency, the predicted usage probability of the unspent transaction output data in the new transaction block of the blockchain system is predicted one by one in the sorting order.

[0017] Optionally, the step of combining the transaction time interval and the transaction frequency, and calculating the transaction time interval threshold and the optimal transaction frequency through statistical analysis, includes the following steps:

[0018] Sort all the transaction time intervals according to their magnitude;

[0019] The sorted transaction time intervals are grouped using multiple preset quantiles to obtain various grouping methods, in which the transaction time intervals are divided into two data groups.

[0020] The distribution of unspent transaction output data usage is calculated using statistical analysis to identify the pre-selected data group with the smallest data volume among all the grouping methods.

[0021] By combining the usage distribution of the unspent transaction output data with the corresponding transaction frequency, it is determined whether there is a correlation between the usage frequency of the unspent transaction output data and the transaction frequency in each of the pre-selected data groups;

[0022] If there is a correlation between the usage frequency of the unspent transaction output data and the transaction frequency, then the corresponding pre-selected data group is used as the target data group, and the quantile corresponding to the target data group is used as the transaction time interval threshold.

[0023] Test the data hit rate for each of the stated trading frequencies, and select the trading frequency with the highest data hit rate as the optimal trading frequency.

[0024] Optionally, the step of combining the transaction time interval threshold and the optimal transaction frequency to predict the predicted usage probability of the unspent transaction output data in the new transaction block of the blockchain system in sorted order includes the following steps:

[0025] The transaction frequency of the unspent transaction output data is determined one by one according to the sorting order, and whether the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold.

[0026] If the transaction frequency is the optimal transaction frequency, and the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold, then it is determined whether the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area;

[0027] If the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area, then the predicted probability of the corresponding unspent transaction output data being used in the new transaction block of the blockchain system is the first predicted probability of use.

[0028] If the data cache length of the unspent transaction output data is greater than or equal to the cache space of the unspent transaction output cache area, then the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system is the second predicted usage probability, and the first predicted usage probability is greater than the second predicted usage probability.

[0029] If the transaction frequency is greater than a preset frequency threshold, and the transaction time interval of the unspent transaction output data is greater than or equal to the transaction time interval threshold, then it is determined whether the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk memory, and the frequency threshold is greater than the optimal transaction frequency;

[0030] If the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk memory, then the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system is the third predicted usage probability, which is less than the second predicted usage probability.

[0031] If the disk storage length of the unspent transaction output data is greater than or equal to the memory space of the auxiliary disk memory, then the predicted probability of the corresponding unspent transaction output data being used in the new transaction block of the blockchain system is the second predicted probability.

[0032] If the transaction frequency is less than the frequency threshold and is not the optimal transaction frequency.

[0033] or,

[0034] If the transaction frequency is the optimal transaction frequency, and the transaction time interval of the unspent transaction output data is greater than or equal to the transaction time interval threshold, then the predicted probability of the corresponding unspent transaction output data being used in a new transaction block in the blockchain system is the second predicted probability of use.

[0035] Optionally, the step of saving all the unspent transaction output data to the local memory, the auxiliary disk memory, and the unspent transaction output cache according to the predicted usage probability includes the following steps:

[0036] The predicted usage probability of the unspent transaction output data is determined to be the first predicted usage probability, the second predicted usage probability, or the third predicted usage probability;

[0037] If the unspent transaction output data is the first predicted usage probability, then the unspent transaction output data is saved to the unspent transaction output cache area;

[0038] If the unspent transaction output data is the second predicted usage probability, then the unspent transaction output data is saved to the local memory;

[0039] If the unspent transaction output data is the third predicted usage probability, then the unspent transaction output data is saved to the auxiliary disk memory.

[0040] Secondly, the present invention provides a multi-partition-based blockchain data management optimization system, mounted on a blockchain node device. The node device has local memory and auxiliary disk memory. The node device is used to mount a transaction-based blockchain system, which includes multiple transaction blocks and an unspent transaction output dataset. The system comprises:

[0041] An address acquisition subsystem is used to acquire the target transaction addresses of multiple transaction blocks that use the unspent transaction output dataset for transactions.

[0042] The address reading subsystem is used to read the transaction timestamp and transaction frequency of the target transaction address;

[0043] A cache creation subsystem is used to create an unspent transaction output cache area in the blockchain system for storing unspent transaction output data in the unspent transaction output dataset.

[0044] A probability prediction subsystem is used to combine the transaction timestamp and the transaction frequency to predict the predicted usage probability of all the unspent transaction output data in the new transaction block of the blockchain system.

[0045] The partition management subsystem is used to save all the unspent transaction output data to the local memory, the auxiliary disk memory, and the unspent transaction output cache area respectively according to the predicted usage probability.

[0046] Optionally, the probability prediction subsystem includes:

[0047] An interval calculation module is used to calculate the transaction time interval between every two transaction times based on the transaction timestamp.

[0048] The frequency calculation module is used to combine the transaction time interval and the transaction frequency, and calculate the transaction time interval threshold and the optimal transaction frequency through statistical analysis.

[0049] The data sorting module is used to sort all the unspent transaction output data according to the transaction time interval or the transaction frequency;

[0050] The probability prediction module is used to combine the transaction time interval threshold and the optimal transaction frequency to predict the predicted usage probability of the unspent transaction output data in the new transaction block of the blockchain system in sorted order.

[0051] Optionally, the frequency calculation module includes:

[0052] A data sorting unit is used to sort all the transaction time intervals according to the size of the transaction time interval;

[0053] The data grouping unit is used to group all the sorted transaction time intervals using multiple preset quantiles to obtain multiple grouping methods, in which the transaction time interval is divided into two data groups in each grouping method;

[0054] The data calculation unit is used to calculate the distribution of unspent transaction output data usage corresponding to the pre-selected data group with the smallest data volume among the various grouping methods using statistical analysis methods;

[0055] The correlation determination unit is used to combine the usage distribution of the unspent transaction output data and the corresponding transaction frequency to determine whether there is a correlation between the usage frequency of the unspent transaction output data and the transaction frequency in each of the pre-selected data groups;

[0056] The interval threshold confirmation unit, when the judgment result of the association judgment unit is that there is an association between the usage frequency of the unspent transaction output data and the transaction frequency, is used to take the corresponding pre-selected data group as the target data group and take the quantile corresponding to the target data group as the transaction time interval threshold.

[0057] The optimal frequency confirmation unit is used to test the data hit rate of each of the transaction frequencies and to take the transaction frequency with the highest data hit rate as the optimal transaction frequency.

[0058] Optionally, the probability prediction module includes:

[0059] The first condition judgment unit is used to judge, in order of sorting, whether the transaction frequency of the unspent transaction output data is the optimal transaction frequency, and whether the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold.

[0060] The cache judgment unit is used to determine whether the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area when the judgment result of the first condition judgment unit is that the transaction frequency is the optimal transaction frequency and the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold.

[0061] The first probability prediction unit, when the judgment result of the cache judgment unit is that the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area, is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the first predicted usage probability.

[0062] The second probability prediction unit, when the judgment result of the cache judgment unit is that the data cache length of the unspent transaction output data is greater than or equal to the cache space of the unspent transaction output cache area, is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the second predicted usage probability, where the first predicted usage probability is greater than the second predicted usage probability.

[0063] The second condition judgment unit is used to determine whether the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk memory when the judgment result of the first condition judgment unit is that the transaction frequency is greater than a preset frequency threshold and the transaction time interval of the unspent transaction output data is greater than or equal to the transaction time interval threshold. The frequency threshold is greater than the optimal transaction frequency.

[0064] The third probability prediction unit, when the judgment result of the second condition judgment unit is that the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk memory, is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the third predicted usage probability, which is less than the second predicted usage probability.

[0065] When the judgment result of the second condition judgment unit is that the disk storage length of the unspent transaction output data is greater than or equal to the memory space of the auxiliary disk memory,

[0066] or,

[0067] When the judgment result of the first condition judgment unit is that the transaction frequency is less than the frequency threshold and is not the optimal transaction frequency,

[0068] or,

[0069] When the judgment result of the first condition judgment unit is that the transaction frequency is the optimal transaction frequency, and the transaction time interval of the unspent transaction output data is greater than or equal to the transaction time interval threshold, the second probability prediction unit is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the second predicted usage probability.

[0070] Optionally, the partition management subsystem includes:

[0071] The probability judgment module is used to determine whether the predicted usage probability of the unspent transaction output data is the first predicted usage probability, the second predicted usage probability, or the third predicted usage probability.

[0072] The first allocation module, when the probability judgment module determines that the unspent transaction output data is the first predicted usage probability, is used to save the unspent transaction output data to the unspent transaction output cache area.

[0073] The second allocation module, when the probability judgment module determines that the unspent transaction output data is the second predicted usage probability, is used to save the unspent transaction output data to the local memory.

[0074] The third allocation module, when the probability judgment module determines that the unspent transaction output data is the third predicted usage probability, is used to save the unspent transaction output data to the auxiliary disk memory.

[0075] The beneficial effects of this invention are:

[0076] This invention utilizes the transaction interval and number of transactions from historical transactions under the same address to predict the probability that address-related unspent transaction output data will appear as transaction output in the next transaction block. Unspent transaction output data with high probability is stored in a cache to accelerate the verification of these transactions; unspent transaction output data with low probability is stored on disk to reduce memory usage. In this way, full nodes do not need to frequently access unspent transaction output data on disk, thus reducing memory consumption. Simultaneously, utilizing a small unspent transaction output cache accelerates block verification time and achieves efficient data management. Attached Figure Description

[0077] Figure 1 This is a schematic diagram illustrating the application scenario of the blockchain system in this invention.

[0078] Figure 2 This is a flowchart illustrating the multi-partition-based blockchain data management optimization method of the present invention.

[0079] Figure 3 This is a schematic diagram illustrating the statistical analysis method used in this invention to analyze the correlation between usage frequency and transaction frequency.

[0080] Figure 4 This is a schematic diagram of the test results for data hit rate in this invention.

[0081] Figure 5 This is an age distribution chart of the unspent transaction output data used in the experiments of this invention.

[0082] Figure 6 This is a transaction frequency distribution diagram of the output related addresses of input unspent transactions in this invention.

[0083] Figure 7 This is a transaction frequency distribution diagram of the addresses related to the output of unspent transactions in this invention. Detailed Implementation

[0084] This invention discloses a multi-partition-based optimization method for blockchain data management. The method is applied to blockchain node devices, which have local memory and secondary disk memory. These devices are used to host a transaction-based blockchain system, which includes multiple transaction blocks and an Unspent Transaction Output (UTXO) dataset. The data management capabilities, storage methods, and space requirements of the UTXO dataset significantly impact the operational efficiency and verification performance of the blockchain system.

[0085] Reference Figure 1 , Figure 1As shown in the application scenario diagram of a blockchain system, blockchain nodes can be divided into light nodes and full nodes. Light nodes are responsible for processing and verifying a portion of transactions and blocks, and do not need to store the complete blockchain data. Full nodes need to store the complete blockchain data to maintain system operation. In particular, a group of full nodes competing for the right to record transactions are called accounting nodes. The distributed storage of blockchain system data allows nodes to communicate peer-to-peer without the need for a third party, but this convenience comes at the cost of the full nodes' storage space, as full nodes need to download all data to complete independent verification.

[0086] Reference Figure 2 The blockchain data management optimization method based on multi-partitioning disclosed in this invention specifically includes the following steps:

[0087] S101. Obtain the target transaction address for transactions using the unspent transaction output dataset in multiple transaction blocks.

[0088] Unspent transaction output data is widely used in transaction-based blockchain systems, which differ from account-based transaction models. In a transaction-based model, a transaction can have one or more inputs and one or more outputs. Whenever a new transaction is initiated, the transaction initiator needs to select some previous unspent transaction output data as inputs and use them to create new unspent transaction output data for the recipient. Each unspent transaction output data may belong to a different owner and can be used as input in subsequent transactions. In traditional account-based systems, the system directly records the balance of each account. However, the transaction-based model obtains the balance of a specific account differently. It needs to aggregate all unspent transaction output data associated with that account and sum them (using digital wallets, etc.) to obtain the total balance. For convenient dataset analysis, the most recently generated transaction block in the blockchain can be downloaded, and the five most recent transaction records of the addresses contained in that block can be collected.

[0089] S102. Read the transaction timestamp and transaction frequency of the target transaction address.

[0090] After collecting the five most recent transaction records of the addresses contained in the transaction block, the transaction timestamps and transaction frequencies of these target transaction addresses can be read. This allows for analysis of the relationship between the transaction frequencies and time intervals of addresses related to unspent transaction outputs.

[0091] S103. Create an unspent transaction output cache in the blockchain system to store the unspent transaction output data in the unspent transaction output dataset.

[0092] A blockchain system comprises a massive distributed ledger, with nodes continuously recording data. All nodes collaboratively build the blockchain. When a user submits a transaction, it is uploaded to the chain and broadcast. Receiving transactions verify them, and only verified transactions are stored in the trader's mempool (a temporary storage space for unpackaged transactions). Simultaneously, traders compete for the right to create the next block. The winner gains the right to create a new block and package transactions. To save time, traders typically select transactions from the mempool directly, as these have already been verified. Traders also receive transaction fees and rewards from the newly created block. The winning trader then broadcasts the new block to the blockchain network. When other nodes receive the block header, they verify and store the block. Afterward, traders continue with a new round of transactions based on the verified block.

[0093] Block verification includes version verification, simple input verification, signature verification, lock time verification, etc.

[20] Among them, accessing the unspent transaction output set, ECC (Elliptic Curves Cryptography) decryption, and SHA-2 hashing are the three most time-consuming steps. The time consumed by these operations on a general PC was evaluated and it was found that if the entire unspent transaction output set is in local memory, the verification speed will be mainly due to the ECC decryption time, which is about 105us, and the throughput can reach 10000TPS. However, if we read the unspent transaction output database from the secondary disk, the access time will increase to 10 milliseconds, resulting in a verification speed of only 100TPS. Therefore, the speed of block verification can be accelerated by creating an unspent transaction output cache and pre-storing a small portion of the unspent transaction output data that is very likely to be used in the unspent transaction output cache.

[0094] S104. Combining transaction timestamps and transaction frequency, predict the predicted usage probability of all unspent transaction output data in new transaction blocks of the blockchain system.

[0095] Since the unspent transaction output buffer has a small capacity, it can only store a small amount of unspent transaction output data. Therefore, it is necessary to combine transaction timestamps and transaction frequency to accurately predict the predicted usage probability of all unspent transaction output data in the new transaction block of the blockchain system, and store the unspent transaction output data with the highest predicted usage probability in the unspent transaction output buffer.

[0096] S105. Based on the predicted usage probability, save all unspent transaction output data to local memory, secondary disk memory, and unspent transaction output cache respectively.

[0097] Specifically, the unspent transaction output data with the highest predicted usage probability can be stored in the unspent transaction output cache, the unspent transaction output data with the second highest predicted usage probability can be stored in local memory, and the remaining data can be stored in secondary disk memory. This data partitioning management method can accelerate block verification time and achieve efficient data management.

[0098] The implementation principle of this method is as follows:

[0099] This invention utilizes the transaction interval and number of transactions from historical transactions under the same address to predict the probability that address-related unspent transaction output data will appear as transaction output in the next transaction block. Unspent transaction output data with high probability is stored in a cache to accelerate the verification of these transactions; unspent transaction output data with low probability is stored on disk to reduce memory usage. In this way, full nodes do not need to frequently access unspent transaction output data on disk, thus reducing memory consumption. Simultaneously, utilizing a small unspent transaction output cache accelerates block verification time and achieves efficient data management.

[0100] In one embodiment, step S104 specifically includes the following steps:

[0101] Calculate the time interval between every two transactions based on the transaction timestamp;

[0102] By combining transaction time intervals and transaction frequencies, and using statistical analysis, the transaction time interval threshold and the optimal transaction frequency are calculated.

[0103] Sort all unspent transaction output data according to transaction time interval or transaction frequency;

[0104] By combining the transaction time interval threshold and the optimal transaction frequency, the predicted usage probability of unspent transaction output data in new transaction blocks of the blockchain system is predicted one by one according to the sorting order.

[0105] In this embodiment, the step of calculating the transaction time interval threshold and the optimal transaction frequency by combining the transaction time interval and transaction frequency through statistical analysis specifically includes the following steps:

[0106] Sort all transaction time intervals according to their length;

[0107] Multiple preset quantiles are used to group all sorted transaction time intervals to obtain various grouping methods. In each grouping method, the transaction time interval is divided into two data groups.

[0108] The distribution of unspent transaction output data usage is calculated using statistical analysis to determine the pre-selected data group with the smallest data volume among all grouping methods.

[0109] By combining the usage distribution of unspent transaction output data and the corresponding transaction frequency, determine whether there is a correlation between the usage frequency of unspent transaction output data and the transaction frequency in each pre-selected data group;

[0110] If there is a correlation between the usage frequency of unspent transaction output data and the transaction frequency, then the corresponding pre-selected data group will be used as the target data group, and the quantile of the target data group will be used as the transaction time interval threshold.

[0111] Test the data hit rate for each trading frequency and select the trading frequency with the highest data hit rate as the optimal trading frequency.

[0112] In this implementation, assuming the latest generated block has a height of 801213, the timestamps of the five most recent transactions of the target transaction address contained in this block and the transaction frequency of that address are collected. All transaction time intervals are sorted according to their length, and multiple preset quantiles are used to group the sorted transaction time intervals, resulting in various grouping methods. Each grouping method divides the transaction time interval into two data groups. Statistical analysis is used to calculate the usage distribution of unspent transaction output data corresponding to the pre-selected data group with the smallest data volume in each grouping method. Combining the usage distribution of unspent transaction output data with the corresponding transaction frequency, it is determined whether there is a correlation between the usage frequency of unspent transaction output data and the transaction frequency in each pre-selected data group.

[0113] Reference Figure 3 , Figure 3 The image shows one grouping method; the pie chart on the left illustrates the time interval distribution between two different pre-selected data groups. It can be observed that input addresses with a time interval of less than 72 hours between their most recent transactions constitute the majority, while input addresses with a time interval greater than 72 hours represent only a small portion. From... Figure 3 As shown on the right, when the time interval is greater than 72 hours, the correlation between the frequency of use of unspent transaction output data and the transaction frequency can be observed. A lower address transaction frequency means a higher probability of generating new transactions, and vice versa. Therefore, the corresponding pre-selected data group can be used as the target data group, and the quantile corresponding to the target data group can be used as the transaction time interval threshold.

[0114] Reference Figure 4Considering the relatively small capacity of the unspent transaction output buffer, the data hit rate should be improved. Assume there are currently 6 blocks of unspent transaction output data, and that these unspent transaction outputs all follow a certain address transaction frequency distribution. In this implementation, to test the cache hit rate, four simple tests are performed using four different transaction frequencies. Figure 4 This indicates that copying the output of address-related unspent transactions with a transaction frequency of 1 from memory to the cache would help improve the cache hit rate.

[0115] In one implementation, the step of predicting the predicted usage probability of unspent transaction output data in new transaction blocks of the blockchain system, by combining a transaction time interval threshold and an optimal transaction frequency, specifically includes the following steps:

[0116] Determine whether the transaction frequency of the unspent transaction output data is the optimal transaction frequency in the sorting order, and whether the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold.

[0117] If the transaction frequency is the optimal transaction frequency and the transaction time interval for unspent transaction output data is less than the transaction time interval threshold, then determine whether the data cache length for unspent transaction output data is less than the cache space of the unspent transaction output cache area.

[0118] If the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area, then the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system is the first predicted usage probability.

[0119] If the data cache length of the unspent transaction output data is greater than or equal to the cache space of the unspent transaction output cache area, then the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system is the second predicted usage probability, and the first predicted usage probability is greater than the second predicted usage probability.

[0120] If the transaction frequency is greater than the preset frequency threshold, and the transaction time interval for unspent transaction output data is greater than or equal to the transaction time interval threshold, then it is determined whether the disk storage length for unspent transaction output data is less than the memory space of the auxiliary disk memory, and the frequency threshold is greater than the optimal transaction frequency.

[0121] If the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk, then the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system is the third predicted usage probability, which is less than the second predicted usage probability.

[0122] If the disk storage length of the unspent transaction output data is greater than or equal to the memory space of the auxiliary disk, then the predicted probability of the corresponding unspent transaction output data being used in the new transaction block of the blockchain system is the second predicted probability of use.

[0123] If the trading frequency is less than the frequency threshold and is not the optimal trading frequency.

[0124] or,

[0125] If the transaction frequency is the optimal transaction frequency, and the transaction time interval for unspent transaction output data is greater than or equal to the transaction time interval threshold, then the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system is the second predicted usage probability.

[0126] In this embodiment, step S105 specifically includes the following steps:

[0127] The predicted probability of using the output data of unspent transactions is determined as the first predicted probability of use, the second predicted probability of use, or the third predicted probability of use.

[0128] If the unspent transaction output data is the first predicted usage probability, then the unspent transaction output data is saved to the unspent transaction output cache.

[0129] If the output data of the unspent transaction is the second predicted usage probability, then the output data of the unspent transaction is saved to local memory;

[0130] If the unspent transaction output data is the third predicted usage probability, then the unspent transaction output data is saved to the secondary disk memory.

[0131] In this implementation, we assume the optimal transaction frequency is 1, the unspent transaction output buffer is cache, local memory is memory, secondary disk memory is disk, the transaction frequency is count, the transaction time interval is time, and the transaction time interval threshold is τ. time The preset frequency threshold is τ count Combining the specific implementation of the step "combining the transaction time interval threshold and the optimal transaction frequency, predicting the predicted usage probability of unspent transaction output data in the new transaction block of the blockchain system in sorted order", and the specific implementation steps of step S105 above, the following data management optimization algorithm can be obtained:

[0132]

[0133]

[0134] The main cost of a node performing block verification is transaction verification. For transaction verification, the majority of the time is spent on script verification and accessing unspent transaction outputs. Assuming there are N transaction inputs in a new block, the block verification time is T. BV Then we have the following formula:

[0135] T BV =T SV +T A +T others

[0136] Where T SV T represents the total time for script verification. A The total time for accessing unspent transaction output data. Another time T. others The time spent on verifying proof-of-work, Merkle trees, etc., can be ignored. Let the new block contain P. M If the probability distribution is in local memory, then the number of unspent transaction outputs in local memory is N. M ′, and N M =N*P M ′, P M ′ represents P before optimization M Similarly, there is P. D ′=1-P M If the probability distribution of ' is in the secondary disk memory, then the number of unspent transaction outputs distributed in the secondary disk memory is N. D =N*P D ′=N*(1-P M At this point, the time required to access the new block without spending transaction outputs is:

[0137]

[0138] Among them, t AMi The time t is the time spent accessing local memory for the i-th unspent transaction output. ADi This represents the time spent accessing secondary disk memory for the i-th unspent transaction output. And N = Ni M ′+N D Therefore, we can derive the block verification time T for a new block containing N transaction inputs. SV 'for:

[0139]

[0140] Where t SVi It is the script verification time output by the i-th unspent transaction in the new block.

[0141] Based on the above round, let P be the probability of an unspent transaction being output in the cache in the new block. cacheThen the number N cache =N*P cache Let N be the number of unspent transaction outputs distributed in local memory. M Let P be... M If the probability distribution is in local memory, then the number of unspent transaction outputs distributed in local memory is: N M =N*P M There is P D =1-P M -P cache If the probability distribution of a transaction is located in the secondary disk memory, then the number of unspent transaction outputs located in the secondary disk memory is N. D =N*P D =N*(1-P) M -P cache Therefore, for T after using the partition optimization mechanism... A For any unspent transaction output, the access time is given by the following formula:

[0142]

[0143] Where t Acachei The time spent accessing the i-th unspent transaction output in the unspent transaction output cache. And ΔN M =N M ′-N M ΔN D =N D ′-N D Then we can obtain the optimized time difference:

[0144]

[0145] It can be seen that if the optimization mechanism can be optimized reasonably, it can quickly shorten the time spent accessing unspent transaction outputs during block verification.

[0146] In one embodiment, the effectiveness of the method employed in this invention is demonstrated through designed experiments. In the designed experiments, 100,000 unspent transaction outputs were initialized to form the original unspent transaction output dataset. Different data management methods were applied to the same unspent transaction output dataset: the random experiment randomly allocated unspent transaction outputs to memory and disk without configuring a cache; the LRU / MRU experiment stored unspent transaction outputs to disk / cache using LRU / MRU; the LFU / MFU experiment stored unspent transaction outputs to disk / cache using LFU / MFU; and the final Opt experiment stored unspent transaction outputs to disk and cache using the mechanism proposed in this paper. 1000 unspent transaction outputs were selected from the original dataset to generate a new block. Furthermore, we set the cache to store N unspent transaction outputs, occupying x% of the memory space, t AMi The time is 16 μs, t ADi The time limit is 10120μs. The access time in the next experiment will also be set to this value, and the cache access time will be set to 1μs.

[0147] Reference Figure 5 Download the relevant unspent transaction output age distribution data from the browser. The vast majority of unspent transaction outputs are older than one week, even exceeding 99% of the overall unspent transaction output dataset. To better control the overall dataset size, when generating the unspent transaction output dataset in the simulation experiment, 90% of the unspent transaction outputs will be older than 72 hours and 10% will be younger than 72 hours.

[0148] For the entire block, transaction inputs and outputs convey different meanings. The packaging rules for transaction inputs are better aligned with the patterns of new block generation, while the generation rules for transaction outputs more clearly reflect the generation status of data within the unspent transaction output dataset. (See reference...) Figure 6 Taking block height 801213 as an example, addresses with 2 transactions related to unspent transaction outputs account for nearly half of the block's data. When generating a new block, transactions are categorized and packaged according to the number of transactions related to the addresses with unspent transaction outputs. Addresses with 1, 2-10, 11-100, and 101 or more transactions related to unspent transaction outputs are packaged into 55%, 15%, 15%, and 15% of the unspent transaction output set, respectively. (Refer to...) Figure 7 In this block, addresses associated with outputting unspent transactions account for the majority with 101 or more transactions, while addresses associated with only 1 transaction output account for less than 1 / 5 of the unspent transactions. This can be seen from... Figure 6 and Figure 7 The pattern of unspent transaction outputs generated in new blocks can be observed.

[0149] Cache hit rate tests and unspent transaction output access time evaluation experiments were conducted on newly generated blocks. For each data management method, four memory settings were used: 70%, 60%, 50%, and 40% of the memory space were utilized, with a full memory space capable of storing 100,000 unspent transaction outputs. To study transaction data management, the cache size ranged from 300 to 600. In the cache hit rate test, a higher cache hit rate and lower disk access count indicated better transaction dataset management. Experimental results show that although both LRU / MRU and LFU / MFU achieve good performance, the method proposed in this invention is still superior to the aforementioned methods in terms of dataset management.

[0150] Experimental results also show that, regardless of different cache sizes and memory usage settings, the method proposed in this invention achieves better performance in terms of unspent transaction output access time. The results indicate that, compared to LRU&MRU or LRU&MRU alone, the method proposed in this invention can better store the unspent transaction output dataset across different partitions. When memory usage is 70%–40%, the unspent transaction output access time of the method proposed in this invention is approximately 0.12–0.58 seconds, while the unspent transaction output access times using LRU&MRU and LRU&MRU are 0.69–1.44 seconds and 0.67–1.40 seconds, respectively. Based on the above experimental evaluation and analysis, the method proposed in this invention achieves efficient data management and reduces the unspent transaction output access time required for block verification.

[0151] This invention also discloses a multi-partition-based blockchain data management optimization system, mounted on a blockchain node device. The node device has local memory and auxiliary disk memory. The node device is used to mount a transaction-based blockchain system. The blockchain system includes multiple transaction blocks and an Unspent Transaction Output (UTXO) dataset. The system includes:

[0152] The address acquisition subsystem is used to obtain the target transaction address of a transaction that uses the unspent transaction output dataset in multiple transaction blocks;

[0153] The address reading subsystem is used to read the transaction timestamp and transaction frequency of the target transaction address;

[0154] The cache creation subsystem is used to create an unspent transaction output cache area in the blockchain system to store unspent transaction output data in the unspent transaction output dataset;

[0155] The probability prediction subsystem is used to combine transaction timestamps and transaction frequency to predict the probability of all unspent transaction output data being used in new transaction blocks in the blockchain system.

[0156] The partition management subsystem is used to save all unspent transaction output data to local memory, secondary disk memory, and unspent transaction output cache respectively, based on the predicted usage probability.

[0157] The implementation principle of this method is as follows:

[0158] By invoking the program, the aforementioned subsystems jointly execute the multi-partition-based blockchain data management optimization method disclosed in the preceding embodiments to achieve the following effects: They use the transaction interval and number of transactions from historical transactions under the same address to predict the probability that address-related unspent transaction output data will appear as transaction output in the next transaction block, and store the unspent transaction output data with high probability in a cache to accelerate the verification of these transactions; they store the unspent transaction output data with low probability on disk to reduce memory usage. In this way, full nodes do not need to frequently access the unspent transaction output data on disk, thus reducing memory usage. Simultaneously, a small unspent transaction output cache is used to accelerate block verification time and achieve efficient data management.

[0159] In one implementation, the probability prediction subsystem includes:

[0160] The interval calculation module is used to calculate the transaction time interval between every two transactions based on the transaction timestamp.

[0161] The frequency calculation module is used to combine the transaction time interval and the transaction frequency, and calculate the transaction time interval threshold and the optimal transaction frequency through statistical analysis.

[0162] The data sorting module is used to sort all unspent transaction output data according to the transaction time interval or transaction frequency;

[0163] The probability prediction module is used to combine the transaction time interval threshold and the optimal transaction frequency to predict the probability of unspent transaction output data being used in new transaction blocks of the blockchain system, one by one, in sorted order.

[0164] In one embodiment, the frequency calculation module includes:

[0165] The data sorting unit is used to sort all transaction time intervals according to their size.

[0166] The data grouping unit is used to group all sorted transaction time intervals using multiple preset quantiles to obtain multiple grouping methods. In each grouping method, the transaction time interval is divided into two data groups.

[0167] The data calculation unit is used to calculate the distribution of unspent transaction output data usage corresponding to the pre-selected data group with the smallest data volume among various grouping methods using statistical analysis methods;

[0168] The correlation judgment unit is used to determine whether there is a correlation between the usage frequency of unspent transaction output data and the transaction frequency in each pre-selected data group by combining the usage distribution of unspent transaction output data and the corresponding transaction frequency.

[0169] The interval threshold confirmation unit, when the judgment result of the correlation judgment unit is that there is a correlation between the usage frequency of unspent transaction output data and the transaction frequency, is used to take the corresponding pre-selected data group as the target data group and the quantile corresponding to the target data group as the transaction time interval threshold.

[0170] The optimal frequency confirmation unit is used to test the data hit rate of each trading frequency and select the trading frequency with the highest data hit rate as the optimal trading frequency.

[0171] In one implementation, the probability prediction module includes:

[0172] The first condition judgment unit is used to judge one by one whether the transaction frequency of the unspent transaction output data is the optimal transaction frequency according to the sorting order, and whether the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold.

[0173] The cache judgment unit is used to determine whether the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area when the judgment result of the first condition judgment unit is that the transaction frequency is the optimal transaction frequency and the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold.

[0174] The first probability prediction unit, when the judgment result of the cache judgment unit is that the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area, is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the first predicted usage probability.

[0175] The second probability prediction unit, when the judgment result of the cache judgment unit is that the data cache length of the unspent transaction output data is greater than or equal to the cache space of the unspent transaction output cache area, is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the second predicted usage probability, and the first predicted usage probability is greater than the second predicted usage probability.

[0176] The second condition judgment unit is used to determine whether the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk memory and the frequency threshold is greater than the optimal transaction frequency when the judgment result of the first condition judgment unit is that the transaction frequency is greater than the preset frequency threshold and the transaction time interval of the unspent transaction output data is greater than or equal to the transaction time interval threshold.

[0177] The third probability prediction unit, when the judgment result of the second condition judgment unit is that the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk memory, is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the third predicted usage probability, which is less than the second predicted usage probability.

[0178] When the judgment result of the second condition judgment unit is that the disk storage length of the unspent transaction output data is greater than or equal to the memory space of the auxiliary disk memory,

[0179] or,

[0180] When the judgment result of the first condition judgment unit is that the transaction frequency is less than the frequency threshold and is not the optimal transaction frequency,

[0181] or,

[0182] When the first condition judgment unit determines that the transaction frequency is the optimal transaction frequency and the transaction time interval of the unspent transaction output data is greater than or equal to the transaction time interval threshold, the second probability prediction unit is used to predict the second predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system.

[0183] In one implementation, the partition management subsystem includes:

[0184] The probability judgment module is used to determine whether the predicted usage probability of the output data of the unspent transaction is the first predicted usage probability, the second predicted usage probability, or the third predicted usage probability.

[0185] The first allocation module, when the probability judgment module determines that the output data of the unspent transaction is the first predicted usage probability, is used to save the output data of the unspent transaction to the unspent transaction output cache area.

[0186] The second allocation module is used to save the unspent transaction output data to local memory when the probability judgment module determines that the output data of the unspent transaction is the second predicted usage probability.

[0187] The third allocation module, when the probability judgment module determines that the output data of the unspent transaction is the third prediction probability, is used to save the output data of the unspent transaction to the auxiliary disk memory.

[0188] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of protection of this application is limited to these examples; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of one or more embodiments of this application as described above, which are not provided in detail for the sake of brevity.

[0189] One or more embodiments in this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments in this application should be included within the protection scope of this application.

Claims

1. A blockchain data management optimization method based on multi-partitioning, characterized in that, The method, applied to a blockchain node device having local memory and secondary disk memory, is used to host a transaction-based blockchain system containing multiple transaction blocks and an unspent transaction output dataset. The method includes the following steps: Obtain the target transaction addresses that use the unspent transaction output dataset to conduct transactions in multiple of the aforementioned transaction blocks; Read the transaction timestamp and transaction frequency of the target transaction address; In the blockchain system, an unspent transaction output cache is created to store the unspent transaction output data in the unspent transaction output dataset. Combining the transaction timestamp and the transaction frequency, predicting the predicted usage probability of all the unspent transaction output data in a new transaction block of the blockchain system includes: calculating the transaction time interval between every two transaction timestamps based on the transaction timestamps; combining the transaction time interval and the transaction frequency, and calculating a transaction time interval threshold and an optimal transaction frequency using statistical analysis; sorting all the unspent transaction output data according to the transaction time interval or the transaction frequency; and combining the transaction time interval threshold and the optimal transaction frequency, predicting the predicted usage probability of the unspent transaction output data in a new transaction block of the blockchain system one by one according to the sorting order. Based on the predicted usage probability, all the unspent transaction output data are saved to the local memory, the auxiliary disk memory, and the unspent transaction output cache, respectively.

2. The blockchain data management optimization method based on multi-partitions according to claim 1, characterized in that, The step of combining the transaction time interval and the transaction frequency, and calculating the transaction time interval threshold and the optimal transaction frequency through statistical analysis, includes the following steps: Sort all the transaction time intervals according to their magnitude; The sorted transaction time intervals are grouped using multiple preset quantiles to obtain various grouping methods, in which the transaction time intervals are divided into two data groups. The distribution of unspent transaction output data usage is calculated using statistical analysis to identify the pre-selected data group with the smallest data volume among all the grouping methods. By combining the usage distribution of the unspent transaction output data with the corresponding transaction frequency, it is determined whether there is a correlation between the usage frequency of the unspent transaction output data and the transaction frequency in each of the pre-selected data groups; If there is a correlation between the usage frequency of the unspent transaction output data and the transaction frequency, then the corresponding pre-selected data group is used as the target data group, and the quantile corresponding to the target data group is used as the transaction time interval threshold. Test the data hit rate for each of the stated trading frequencies, and select the trading frequency with the highest data hit rate as the optimal trading frequency.

3. The blockchain data management optimization method based on multi-partitions according to claim 1, characterized in that, The step of combining the transaction time interval threshold and the optimal transaction frequency to predict the predicted usage probability of the unspent transaction output data in the new transaction block of the blockchain system in sorted order includes the following steps: The transaction frequency of the unspent transaction output data is determined one by one according to the sorting order, and whether the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold. If the transaction frequency is the optimal transaction frequency, and the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold, then it is determined whether the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area; If the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area, then the predicted probability of the corresponding unspent transaction output data being used in the new transaction block of the blockchain system is the first predicted probability of use. If the data cache length of the unspent transaction output data is greater than or equal to the cache space of the unspent transaction output cache area, then the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system is the second predicted usage probability, and the first predicted usage probability is greater than the second predicted usage probability. If the transaction frequency is greater than a preset frequency threshold, and the transaction time interval of the unspent transaction output data is greater than or equal to the transaction time interval threshold, then it is determined whether the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk memory, and the frequency threshold is greater than the optimal transaction frequency; If the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk memory, then the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system is the third predicted usage probability, which is less than the second predicted usage probability. If the disk storage length of the unspent transaction output data is greater than or equal to the memory space of the auxiliary disk memory, then the predicted probability of the corresponding unspent transaction output data being used in the new transaction block of the blockchain system is the second predicted probability. If the transaction frequency is less than the frequency threshold and is not the optimal transaction frequency. or, If the transaction frequency is the optimal transaction frequency, and the transaction time interval of the unspent transaction output data is greater than or equal to the transaction time interval threshold, then the predicted probability of the corresponding unspent transaction output data being used in a new transaction block in the blockchain system is the second predicted probability of use.

4. The blockchain data management optimization method based on multi-partitions according to claim 3, characterized in that, The step of saving all the unspent transaction output data to the local memory, the auxiliary disk memory, and the unspent transaction output cache according to the predicted usage probability includes the following steps: The predicted usage probability of the unspent transaction output data is determined to be the first predicted usage probability, the second predicted usage probability, or the third predicted usage probability; If the unspent transaction output data is the first predicted usage probability, then the unspent transaction output data is saved to the unspent transaction output cache area; If the unspent transaction output data is the second predicted usage probability, then the unspent transaction output data is saved to the local memory; If the unspent transaction output data is the third predicted usage probability, then the unspent transaction output data is saved to the auxiliary disk memory.

5. A blockchain data management optimization system based on multi-partitioning, characterized in that, A blockchain node device, equipped with local memory and secondary disk memory, is used to host a transaction-based blockchain system. The blockchain system includes multiple transaction blocks and an unspent transaction output dataset. The system comprises: An address acquisition subsystem is used to acquire the target transaction addresses of multiple transaction blocks that use the unspent transaction output dataset for transactions. The address reading subsystem is used to read the transaction timestamp and transaction frequency of the target transaction address; A cache creation subsystem is used to create an unspent transaction output cache area in the blockchain system for storing unspent transaction output data in the unspent transaction output dataset. A probability prediction subsystem is used to predict the predicted usage probability of all unspent transaction output data in a new transaction block of the blockchain system by combining the transaction timestamp and the transaction frequency. The probability prediction subsystem includes: an interval calculation module for calculating the transaction time interval between every two transactions based on the transaction timestamp; a frequency calculation module for combining the transaction time interval and the transaction frequency, and calculating a transaction time interval threshold and an optimal transaction frequency using statistical analysis; a data sorting module for sorting all the unspent transaction output data according to the transaction time interval or the transaction frequency; and a probability prediction module for predicting the predicted usage probability of the unspent transaction output data in a new transaction block of the blockchain system one by one according to the sorting order, based on the transaction time interval threshold and the optimal transaction frequency. The partition management subsystem is used to save all the unspent transaction output data to the local memory, the auxiliary disk memory, and the unspent transaction output cache area respectively according to the predicted usage probability.

6. The blockchain data management optimization system based on multi-partitions according to claim 5, characterized in that, The frequency calculation module includes: A data sorting unit is used to sort all the transaction time intervals according to the size of the transaction time interval; The data grouping unit is used to group all the sorted transaction time intervals using multiple preset quantiles to obtain multiple grouping methods, in which the transaction time interval is divided into two data groups in each grouping method; The data calculation unit is used to calculate the distribution of unspent transaction output data usage corresponding to the pre-selected data group with the smallest data volume among the various grouping methods using statistical analysis methods; The correlation determination unit is used to combine the usage distribution of the unspent transaction output data and the corresponding transaction frequency to determine whether there is a correlation between the usage frequency of the unspent transaction output data and the transaction frequency in each of the pre-selected data groups; The interval threshold confirmation unit, when the judgment result of the association judgment unit is that there is an association between the usage frequency of the unspent transaction output data and the transaction frequency, is used to take the corresponding pre-selected data group as the target data group and take the quantile corresponding to the target data group as the transaction time interval threshold. The optimal frequency confirmation unit is used to test the data hit rate of each of the transaction frequencies and to take the transaction frequency with the highest data hit rate as the optimal transaction frequency.

7. The blockchain data management optimization system based on multi-partitions according to claim 5, characterized in that, The probability prediction module includes: The first condition judgment unit is used to judge, in order of sorting, whether the transaction frequency of the unspent transaction output data is the optimal transaction frequency, and whether the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold. The cache judgment unit is used to determine whether the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area when the judgment result of the first condition judgment unit is that the transaction frequency is the optimal transaction frequency and the transaction time interval of the unspent transaction output data is less than the transaction time interval threshold. The first probability prediction unit, when the judgment result of the cache judgment unit is that the data cache length of the unspent transaction output data is less than the cache space of the unspent transaction output cache area, is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the first predicted usage probability. The second probability prediction unit, when the judgment result of the cache judgment unit is that the data cache length of the unspent transaction output data is greater than or equal to the cache space of the unspent transaction output cache area, is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the second predicted usage probability, where the first predicted usage probability is greater than the second predicted usage probability. The second condition judgment unit is used to determine whether the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk memory when the judgment result of the first condition judgment unit is that the transaction frequency is greater than a preset frequency threshold and the transaction time interval of the unspent transaction output data is greater than or equal to the transaction time interval threshold. The frequency threshold is greater than the optimal transaction frequency. The third probability prediction unit, when the judgment result of the second condition judgment unit is that the disk storage length of the unspent transaction output data is less than the memory space of the auxiliary disk memory, is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the third predicted usage probability, which is less than the second predicted usage probability. When the judgment result of the second condition judgment unit is that the disk storage length of the unspent transaction output data is greater than or equal to the memory space of the auxiliary disk memory, or, When the judgment result of the first condition judgment unit is that the transaction frequency is less than the frequency threshold and is not the optimal transaction frequency, or, When the judgment result of the first condition judgment unit is that the transaction frequency is the optimal transaction frequency, and the transaction time interval of the unspent transaction output data is greater than or equal to the transaction time interval threshold, the second probability prediction unit is used to predict the predicted usage probability of the corresponding unspent transaction output data in the new transaction block of the blockchain system as the second predicted usage probability.

8. The blockchain data management optimization system based on multi-partitions according to claim 7, characterized in that, The partition management subsystem includes: The probability judgment module is used to determine whether the predicted usage probability of the unspent transaction output data is the first predicted usage probability, the second predicted usage probability, or the third predicted usage probability. The first allocation module, when the probability judgment module determines that the unspent transaction output data is the first predicted usage probability, is used to save the unspent transaction output data to the unspent transaction output cache area. The second allocation module, when the probability judgment module determines that the unspent transaction output data is the second predicted usage probability, is used to save the unspent transaction output data to the local memory. The third allocation module, when the probability judgment module determines that the unspent transaction output data is the third predicted usage probability, is used to save the unspent transaction output data to the auxiliary disk memory.

Citation Information

Patent Citations

  • Data asset configuration transaction method and device based on block chain

    CN113962810A

  • Merchant analysis method and related device

    CN114881340A