Blockchain-based archival storage method and system

By dynamically evaluating archive access records and lifecycle information, calculating weight values, and adjusting index paths, the problems of uneven resource utilization and chaotic migration paths in archive storage are solved, thereby improving storage efficiency and reliability.

CN120123299BActive Publication Date: 2025-11-11SHANDONG JIANZHU UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510251931.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-11-11
Estimated Expiration
2045-03-05

AI Technical Summary

Technical Problem

In existing technologies, the lack of dynamic assessment of file access status and lifecycle leads to resource competition between high-frequency and low-frequency files, resulting in low storage efficiency, incomplete judgment of cooling data, uneven resource utilization, chaotic paths during migration, and impact on system response performance.

Method used

By calculating dynamic access weight values ​​based on archive access records and lifecycle information, and combining the capacity allocation rules of the main chain and side chains, the archive cooling status is dynamically evaluated, and the index path node structure is adjusted to optimize the data distribution strategy, thereby achieving accurate grouping and migration of archives.

Benefits of technology

It improves storage efficiency and reliability, alleviates main chain storage pressure, optimizes side chain resource utilization, reduces access latency caused by link changes, and improves overall storage performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123299B_ABST
    Figure CN120123299B_ABST
Patent Text Reader

Abstract

This invention relates to the field of distributed storage technology, specifically to a blockchain-based archive storage method and system, comprising the following steps: extracting the access time interval and access count of archives based on archive access records and lifecycle information, accumulating and summing the time interval data, and calculating weight values. In this invention, by analyzing archive access records and lifecycle information, calculating dynamic access weight values ​​and normalizing them, dynamic evaluation of data access status is achieved. Combined with the capacity allocation rules of the main chain and side chains, data distribution strategies are optimized based on weight value grouping and storage matching. Archive cooling status is dynamically evaluated and grouped and migrated accordingly, effectively alleviating main chain storage pressure, improving side chain resource utilization, adjusting the index path node structure during migration, optimizing storage path integrity and access efficiency, and reducing access latency caused by link changes. This dynamic and refined management strategy improves storage efficiency and reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed storage technology, and in particular to a blockchain-based file storage method and system. Background Technology

[0002] Distributed storage technology encompasses storage technologies centered on data distribution and management. Its primary goal is to achieve efficient data storage and retrieval through multi-node collaboration, ensuring data reliability, consistency, and availability. Based on node diversity and network connectivity, distributed storage technology involves data sharding, replica synchronization, distributed consistency protocols, and data integrity verification. This technology area covers everything from the underlying architecture design of data storage to the optimization of specific management mechanisms, including distributed file systems, distributed databases, and related data storage protocols. By distributing data across different physical nodes, distributed storage technology effectively addresses single points of failure and demonstrates its advantages in large-scale data management.

[0003] Among them, the blockchain-based archival storage method refers to an archival storage mechanism designed using the characteristics of blockchain technology. This patent primarily addresses the needs for trusted storage, traceability management, and tamper-proofing of archival data. By recording archival storage operations in a blockchain network and leveraging the immutability of a distributed ledger, secure storage of archival data is achieved. Specifically, this method divides archival data into blocks, records their storage locations, operation records, and related index information in the blockchain, ensures data consistency using a consensus mechanism, and encrypts the archival data using cryptographic methods to protect data privacy. The entire process is supported by a distributed storage infrastructure, and automated management of archival storage operations is achieved through smart contracts.

[0004] Existing technologies lack dynamic assessment of file access status and lifecycle, and data distribution fails to accurately match access demands, often leading to resource competition between high-frequency and low-frequency files, reducing storage efficiency. The fixed distribution rules of the main chain and side chains make it difficult to adjust according to access needs, easily causing uneven resource utilization. Inadequate criteria for judging "cooled-down" data prevent optimal resource allocation, reducing the availability of high-frequency files on the main chain. Insufficient adjustment of index paths during migration can cause path confusion and access delays due to link changes, impacting overall system response performance. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing a blockchain-based file storage method and system.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: a blockchain-based archive storage method, comprising the following steps:

[0007] S1: Based on the archive access records and lifecycle information, extract the access time interval and access number of the archive, accumulate and sum the time interval data and calculate the weight value, accumulate the weight value with the archive creation time and active stage, perform normalization processing on the accumulation result, and generate the archive dynamic access weight value.

[0008] S2: Based on the dynamic access weight value of the file, sort according to the weight value, combine the capacity allocation rules of the main chain and the side chain, sort and group according to the weight value, match the sorting and grouping results with the storage capacity, allocate the matched files to the main chain or the side chain, and establish a file distribution storage allocation table.

[0009] S3: Based on the file distribution storage allocation table, extract the access time data of the files in the main chain, calculate the difference between the access interval time and the current time, compare the difference with the file initial time weight accumulation value, perform a judgment mark on the file cooling status, and generate the main chain file cooling mark value;

[0010] S4: Based on the main chain file cooling mark value, extract the cooling mark files, group the files according to access interval and storage requirements, calculate the allocation ratio of the grouping results according to the available capacity of the side chain, select the migration order according to the allocation ratio, update the status of the migrated files to the side chain storage, and generate a file migration grouping table.

[0011] S5: Based on the file migration grouping table, extract the main chain and side chain index path data of the migrated files, calculate the index path node relationship change value, adjust the index node structure of the migrated files, synchronously write the adjusted index structure, and establish the main and side chain storage path index table.

[0012] The dynamic access weight value of the archives includes weight value, creation time, and active stage. The archive distribution storage allocation table includes sorting and grouping results, storage capacity allocation results, and allocation status of the main chain and side chains. The main chain archive cooling flag value includes access interval time, the difference between the current time and the initial time weight cumulative value, and cooling status flag. The archive migration grouping table includes access interval, storage requirements, allocation ratio, migration order, and archive status after migration. The main and side chain storage path index table includes the main chain index path of the migrated archives, the side chain index path, the index path node relationship change value, and the adjusted index structure.

[0013] As a further aspect of the present invention, the step of obtaining the dynamic access weight value of the archive is specifically as follows:

[0014] S101: Extract the access time interval and access count of the archive, call the access time data in the archive record, calculate and record the time interval of each access, accumulate the total time interval of each archive, calculate the ratio of the accumulated result to the access count, and generate a preliminary time weight value set.

[0015] S102: Call the preliminary time weight value set, combine it with the creation time data of each file, calculate the total time weight from the file creation time to the current time, divide the weight into segments according to the time range of the active stage, calculate the total weight of each segment, and generate the total weight of the active stage.

[0016] S103: The sum of the active phase weights and the initial time weight set are weighted and accumulated using the following formula:

[0017] ;

[0018] Calculate the dynamic access weight value of the generated archive;

[0019] in, Represents the dynamic access weight value of the archive. The cumulative access time weighting of the representative file. The weighting of the creation time of the representative file is adjusted. Represents the sum of weights during the active phase. This represents the number of active time periods currently accumulated in the archive. This represents the total number of files.

[0020] As a further aspect of the present invention, the step of obtaining the file distribution storage allocation table specifically includes:

[0021] S201: Call the dynamic access weight value of the archive, sort all archives in descending order according to the weight value, determine the sorting order by comparing the weight values ​​one by one, record the index and weight value information of the sorted archive list, and generate the sorted archive list.

[0022] S202: Call the sorted file list, group the files according to the capacity allocation rules of the main chain and side chain, accumulate the file weight value one by one and compare it with the capacity threshold, and put the files whose weight accumulation value does not exceed the capacity into the same group to generate the pre-grouping result of the files;

[0023] S203: Match the pre-grouping results of the archives with the actual available storage capacity data, using the formula:

[0024] ;

[0025] Calculate the optimal storage match for each group of files and generate a file distribution storage allocation table;

[0026] in, Representing the The stored matching value of the group file. Representing the Dynamic access weights for each file. Representing the The group's available storage capacity Representative at the Number of files in the group This represents the summation of the weight values ​​of the files within the group.

[0027] As a further aspect of the present invention, the step of obtaining the main chain archive cooling mark value specifically includes:

[0028] S301: Extract the file records of the main chain portion of the file distribution storage allocation table, read the access time data corresponding to the main chain files, calculate the access interval time of each file, save the access interval time results of all files, and generate a set of access interval times for the main chain files.

[0029] S302: Call the main chain file access interval time set, calculate the time difference of each file based on the difference between the current time and the last access time of the file, and compare the time difference with the initial time weight accumulation value of the corresponding file to generate the file time difference comparison result;

[0030] S303: Based on the comparison value of each file in the file time difference comparison results, determine whether the time difference is greater than the cooling threshold, using the formula:

[0031] ;

[0032] Calculate and generate the main chain archive cooling mark value;

[0033] in, Represents the cooling rating value. Representing the The time difference between the files Representing the The time difference between the files This represents the sum of the time differences of all archives. This represents the average time difference across all archives. This represents the cooling threshold.

[0034] As a further aspect of the present invention, the step of obtaining the file migration grouping table specifically includes:

[0035] S401: Extract the files marked as being in a cooling state from the main chain file cooling flag values, read the access interval and storage requirement data of the files, establish grouping rules according to the access interval value and storage requirement size, perform preliminary grouping of the files that meet the grouping rules, and generate a preliminary file migration candidate list.

[0036] S402: Call the preliminary file migration candidate list, extract the total storage requirement of each file group based on the dynamic monitoring data of the available capacity of the sidechain, calculate the ratio of the storage requirement of each group to the sidechain capacity, record the ratio of each file group and generate the corresponding migration ratio, and obtain the file migration ratio allocation table.

[0037] S403: Based on the percentage data in the archive migration ratio allocation table, extract the migration ratio and sidechain capacity matching parameters for archive groups, using the formula:

[0038] ;

[0039] Calculate the migration priority values ​​of multiple file groups, update the migration results to the sidechain storage status according to priority, and generate a file migration group table;

[0040] in, Representing the The migration priority value of a group of files indicates the urgency and order of group migrations. The migration rate of the representative file group reflects the proportion of migration demand during the cooling-off period. This represents the available storage capacity corresponding to the sidechain, providing a quantification of the feasibility of migration matching. It is a weighting factor for file grouping, used to adjust the flexibility and dynamic responsiveness of migration priorities. It is an adjustment factor used to ensure that the denominator is non-zero and to enhance the stability of the calculation.

[0041] As a further aspect of the present invention, the step of obtaining the main-side chain storage path index table specifically includes:

[0042] S501: Extract the main chain index path and side chain index path data of the migrated files in the file migration grouping table, call the node change record of the index path, calculate the change value of all nodes in the migration file index path, determine the adjustment requirements of each migration file in the index structure, and generate a migration file index node relationship change table.

[0043] S502: Call the migration archive index node relationship change table, adjust the main chain and side chain index structure of the migration archive according to the node change value, and generate the adjusted migration archive index structure by rearranging and adjusting the position relationship of the index nodes.

[0044] S503: Invoke the adjusted migration archive index structure, synchronously write the adjustment results to the main chain and side chain storage, and calculate the balanced distribution value of the index nodes in the main chain and side chain using the formula:

[0045] ;

[0046] The relationship between the index nodes of the main chain and the side chain is adjusted by calculating the balanced distribution value, and a main chain and side chain storage path index table is generated.

[0047] in, This represents the balanced distribution value of the main chain and side chain index nodes. Represents the first in the main chain The index capacity value of each node. Represents the first in the side chain The index capacity value of each node. This represents the total number of index nodes participating in the computation across the main chain and side chains. This represents the absolute difference between the index capacity values ​​of corresponding nodes in the main chain and the side chain.

[0048] A blockchain-based archival storage system, wherein the blockchain-based archival storage system is used to execute the aforementioned blockchain-based archival storage method, the system comprising:

[0049] The archive dynamic weight calculation module calculates the archive access time interval and access frequency, accumulates the time interval data, combines the archive creation time and active stage weight values, normalizes the accumulation calculation results, and generates the archive dynamic access weight value.

[0050] The storage allocation optimization module sorts the weight values ​​based on the dynamic access weight values ​​of the files, groups the sorting results according to the capacity parameters of the main chain and side chains, matches the grouping results with the available storage capacity, records the matching results, and generates a file distribution storage allocation table.

[0051] Based on the file distribution and storage allocation table, the main chain status monitoring module extracts the access time information of the main chain files, calculates the difference between the access interval and the current time, compares it with the cumulative calculation result of the file's initial time weight value, marks the file's cooling status, and generates a main chain file cooling mark value.

[0052] The sidechain migration management module filters files with cooling marks based on the main chain file cooling mark value, groups the files according to access interval and storage requirements, calculates the allocation ratio between the grouped files and the available capacity of the sidechain, adjusts the migration order according to the allocation ratio and updates the file storage status, and generates a file migration group table.

[0053] The index path adjustment module extracts the main and side chain index paths of the migrated files based on the file migration grouping table, calculates the index path node relationship change value, adjusts the index node structure of the migrated files, updates the adjusted index data, and generates the main and side chain storage path index table.

[0054] Compared with the prior art, the advantages and positive effects of the present invention are as follows:

[0055] This invention achieves dynamic evaluation of data access status by analyzing file access records and lifecycle information, calculating dynamic access weight values, and normalizing them. Combining main chain and side chain capacity allocation rules, data distribution strategies are optimized based on weight value grouping and storage matching. Dynamically evaluating file cooling status and grouping and migrating accordingly effectively alleviates main chain storage pressure and improves side chain resource utilization. During migration, the index path node structure is adjusted to optimize storage path integrity and access efficiency, reducing access latency caused by link changes. This dynamic and refined management strategy improves storage efficiency and reliability. Attached Figure Description

[0056] Figure 1 This is a schematic diagram of the workflow of the present invention;

[0057] Figure 2 This is a flowchart illustrating the steps for obtaining the dynamic access weight value of the archive in this invention.

[0058] Figure 3 This is a flowchart illustrating the steps for obtaining the file distribution storage allocation table of this invention.

[0059] Figure 4 This is a flowchart illustrating the steps for obtaining the cooling flag value of the main chain archive in this invention.

[0060] Figure 5 This is a flowchart illustrating the steps for obtaining the file migration grouping table in this invention.

[0061] Figure 6 This is a flowchart illustrating the steps for obtaining the main and side chain storage path index table of this invention. Detailed Implementation

[0062] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0063] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0064] Example 1

[0065] Please see Figure 1 This invention provides a technical solution: a blockchain-based archive storage method, comprising the following steps:

[0066] S1: Based on the archive access records and lifecycle information, extract the access time interval and access number of the archive, accumulate and sum the time interval data and calculate the weight value, accumulate the weight value with the archive creation time and active stage, perform normalization processing on the accumulation result, and generate the archive dynamic access weight value.

[0067] S2: Based on the dynamic access weight value of the archives, sort them according to the weight value, combine the capacity allocation rules of the main chain and the side chain, sort and group them according to the weight value, match the sorting and grouping results with the storage capacity, allocate the matched archives to the main chain or the side chain, and establish an archive distribution storage allocation table.

[0068] S3: Based on the archive distribution storage allocation table, extract the access time data of the archives in the main chain, calculate the difference between the access interval time and the current time, compare the difference with the archive's initial time weight accumulation value, perform judgment marking on the archive's cooling status, and generate the main chain archive cooling mark value;

[0069] S4: Based on the main chain archive cooling mark value, extract the cooling mark archives, group the archives according to access interval and storage requirements, calculate the allocation ratio of the grouping results according to the available capacity of the side chain, select the migration order according to the allocation ratio, update the status of the migrated archives to the side chain storage, and generate an archive migration grouping table.

[0070] S5: Based on the archive migration grouping table, extract the main chain and side chain index path data of the migrated archives, calculate the index path node relationship change value, adjust the index node structure of the migrated archives, synchronously write the adjusted index structure, and establish the main and side chain storage path index table.

[0071] The dynamic access weight value of the archive includes the weight value, creation time, and active stage. The archive distribution storage allocation table includes the sorting and grouping results, storage capacity allocation results, and the allocation status of the main chain and side chains. The main chain archive cooling mark value includes the access interval time, the difference between the cumulative weight value of the current time and the initial time, and the cooling status mark. The archive migration grouping table includes the access interval, storage requirements, allocation ratio, migration order, and the status of the archive after migration. The main and side chain storage path index table includes the main chain index path of the migrated archive, the side chain index path, the index path node relationship change value, and the adjusted index structure.

[0072] Please see Figure 2 The specific steps for obtaining the dynamic access weight value of the archive are as follows:

[0073] S101: Extract the access time interval and access count of the archive, call the access time data in the archive record, calculate and record the time interval of each access, accumulate the total time interval of each archive, calculate the ratio of the accumulated result to the access count, and generate a preliminary time weight value set.

[0074] For every two consecutive access time points in the access time series, the difference is calculated and recorded as the time interval. All time intervals are then summed to obtain the cumulative access time interval. The number of accesses for each file is counted to generate the total number of accesses. The ratio of the cumulative time interval to the number of accesses is then calculated using a specific formula. The preliminary time weight values ​​are calculated, where For the first The cumulative time interval of each file, The total number of visits and the ratio of all files are used to form a preliminary set of time weight values.

[0075] S102: Call the initial time weight value set, combine it with the creation time data of each file, calculate the total time weight from the file creation time to the current time, calculate the weight in segments according to the time range of the active phase, calculate the total weight of each segment, and generate the total weight of the active phase.

[0076] The time frame of the archives from their creation to the present is divided into multiple time periods by year. The weight of each time period is calculated. Based on the phased characteristics of archive access activity, the weight values ​​of each time period are selected and accumulated, using a formula. Calculate the sum of the active phase weights for each file, where For the first The first file Stage time weighting The total number of time periods is used to generate the sum of active phase weights.

[0077] S103: Weighted summation of active phase weights and initial time weight values ​​is performed using the following formula:

[0078] ;

[0079] Calculate the dynamic access weight value of the generated archive;

[0080] in, Represents the dynamic access weight value of the archive. The cumulative access time weighting of the representative file. The weighting of the creation time of the representative file is adjusted. Represents the sum of weights during the active phase. This represents the number of active time periods currently accumulated in the archive. This represents the total number of files.

[0081] formula:

[0082] ;

[0083] The advantage of this formula lies in its ability to improve the accuracy of calculating dynamic access weights for archives by combining the cumulative access time weight, creation time adjustment weight, and active phase weight, and by introducing a balancing factor based on the number of active time periods. Detailed formula explanation and calculation derivation: 1. Call the initial time weight value set and set... Introducing adjustment factors 1. Adjust the weight of each file; 2. Use the sum of the weights from the active phase as... When calculating dynamic access weight, it is compared with and Substitute into the formula together; 3. This indicates the number of active time periods, calculated according to... The formula is used to substitute the example values ​​one by one. , , , ,

[0084] ;

[0085] Summing all the files, we finally get... The overall value; the result shows that the dynamic access weight value of archives is generated by comprehensively considering the importance of time accumulation and active phases to balance the dynamic access characteristics of the current archives.

[0086] Please see Figure 3 The specific steps for obtaining the file distribution storage allocation table are as follows:

[0087] S201: Call the dynamic access weight value of the archives, sort all archives in descending order according to the weight value, determine the sorting order by comparing the weight values ​​one by one, record the index and weight value information of the sorted archive list, and generate the sorted archive list.

[0088] The files are sorted in descending order of their weight values. By comparing the weight values ​​of two files one by one, if the weight value of the former file is greater than that of the latter file, their positions in the sorted list are swapped. This process is repeated until the weight values ​​are sorted. At the same time, the index of the sorted files and their corresponding weight values ​​are recorded. To ensure the rationality and accuracy of the sorting, a practical scenario can be used: if file A has a weight value of 35 and file B has a weight value of 30, file A with a higher weight value is placed before file B. By sorting in this way, a sorted list of files is generated.

[0089] S202: Call the sorted list of files, group the files according to the capacity allocation rules of the main chain and side chain, accumulate the file weight value one by one and compare it with the capacity threshold, and put the files whose weight accumulation value does not exceed the capacity into the same group, generating the pre-grouping result of the files;

[0090] Files are grouped according to the capacity allocation rules of the main chain and side chains. The weight values ​​of the sorted files are read one by one and added to the total weight value of the current group. After each addition, the weight value is compared with the current storage capacity threshold. If the added weight value is less than the threshold, the weight value of the current file is added to the group. If the added weight value is equal to or exceeds the threshold, the current group is archived and the same allocation operation is performed on the next group. During this process, the group number assigned to each file is recorded. For example, if the main chain capacity threshold is 100 and the file weight values ​​in the file sorting list are 35, 30, 25, and 20 respectively, files 1, 2, and 3 are assigned to the main chain. When the total weight reaches 90, the allocation stops and the remaining files are assigned to the side chains, generating the pre-grouping results of the files.

[0091] S203: Match the pre-grouping results of the archives with the actual available storage capacity data, using the formula:

[0092] ;

[0093] Calculate the optimal storage match for each group of files and generate a file distribution storage allocation table;

[0094] in, Representing the The stored matching value of the group file. Representing the Dynamic access weights for each file. Representing the The group's available storage capacity Representative at the Number of files in the group This represents the summation of the weight values ​​of the files within the group.

[0095] formula:

[0096] ;

[0097] The advantage of the formula is that by comprehensively considering the weight values ​​of file groups and the limitations of storage capacity, the resource matching after file grouping is more accurate, thus optimizing the storage allocation efficiency.

[0098] Detailed explanation of the formula and its calculation derivation:

[0099] Representing the The stored matching value of the group file. Representing the Dynamic access weights for each file. Representing the The group's available storage capacity Representing the The number of files in the group This represents the sum of the weights of all files in the file group, calculated as follows:

[0100] Assume that the first group of files contains files A, B, and C, with weights of 35, 30, and 25 respectively, and a storage capacity of 100. The calculation process is as follows:

[0101] 1. Calculate the total weight value of the archive group:

[0102] ;

[0103] 2. Comparison with storage capacity:

[0104] ;

[0105] The results show that the total weight value of archive group 1 matches the storage capacity requirement and does not exceed the capacity. Archives A, B, and C are successfully assigned to group 1. At the same time, this matching process generates an archive distribution storage allocation table by ensuring the accurate correspondence between weight and capacity.

[0106] Please see Figure 4 The specific steps for obtaining the main chain archive cooling flag value are as follows:

[0107] S301: Extract the file records from the main chain portion of the file distribution storage allocation table, read the access time data corresponding to the main chain files, calculate the access interval time for each file, save the access interval time results for all files, and generate a set of access interval times for the main chain files.

[0108] First, the access timestamp of each file record is retrieved. The time interval between two adjacent accesses is calculated using the timestamp. The formula for calculating the interval is: ,in, Indicates time interval, This is the current timestamp. The last access timestamp is used as the basis for batch calculation of multiple access time records of the main chain archives to obtain the access time interval sequence corresponding to each archive. The access time interval results are further organized for subsequent calls and arranged in chronological order. At the same time, the archive identifier and the interval time are paired and stored, and recorded as an access time interval information table to generate the main chain archive access interval time set.

[0109] S302: Call the main chain file access interval time set, calculate the time difference of each file based on the difference between the current time and the last access time of the file, and compare the time difference with the initial time weight accumulation value of the corresponding file to generate the file time difference comparison result;

[0110] First, extract the last access timestamp and the current timestamp of each file record, and obtain the time difference by subtraction. At the same time, call the initial time weight accumulation value of the file and compare them using the following calculation formula: ,in, Indicates the time difference of the archives. This is the current timestamp. Using the last access timestamp, the calculated time difference is added to the file's initial weight accumulation value. The pairing and sorting process is performed. If the time difference is greater than the cumulative weight value, it is marked as a cooling state. At the same time, a cooling state marking table is generated. The results of the marking table are associated with the main chain file identifier and stored and sorted as the file time difference comparison results.

[0111] S303: Based on the comparison value of each file in the file time difference comparison results, determine whether the time difference is greater than the cooling threshold, using the formula:

[0112] ;

[0113] Calculate and generate the main chain archive cooling mark value;

[0114] in, Represents the cooling rating value. Representing the The time difference between the files Representing the The time difference between the files This represents the sum of the time differences of all archives. This represents the average time difference across all archives. This represents the cooling threshold.

[0115] formula:

[0116] ;

[0117] Detailed explanation of the formula and its calculation derivation:

[0118] It is a cooling flag value used to characterize whether the archive time difference meets the cooling threshold requirements;

[0119] It is the first The time difference between the two archives is obtained through the collection of archive timestamp data. For example, if the archive timestamps monitored from a certain data platform are 10:00 on January 15, 2025 and 10:05 on January 15, 2025, the time difference is 300 seconds.

[0120] It is the first The time difference between individual files is calculated in the same way. For example, if the next time difference is detected to be 400 seconds;

[0121] It is the sum of the time differences of all files. For example, if there are 5 files with time differences of 300 seconds, 400 seconds, 350 seconds, 500 seconds and 450 seconds respectively, the sum is 2000 seconds.

[0122] It is the average of the time differences of all archives, calculated by dividing the total time differences by the number of archives. For example, Second;

[0123] It is the cooling threshold, which is determined by the system settings or the technical parameters in the relevant documentation. For example, the cooling threshold is 450 seconds.

[0124] Substitute the above parameters into the formula:

[0125] ;

[0126] The first step is to calculate the absolute value of the numerator:

[0127] ;

[0128] The second step is to calculate the sum of the denominators:

[0129] ;

[0130] The third step is to calculate the time difference ratio and take its square root:

[0131] ;

[0132] Step 4: Calculate the absolute value of the cooling threshold difference:

[0133] ;

[0134] Step 5: Calculate the cooling mark value:

[0135] ;

[0136] Results analysis:

[0137] The results show that the cooling mark value is 0.004472. The lower the value, the smaller the deviation between the time difference and the cooling threshold. The time difference of the archives that meet the cooling conditions has a higher adaptability to the generated main chain archive cooling mark value. Combining all cooling mark values ​​can further generate archive cooling mark value sequences or other statistical results.

[0138] Please see Figure 5 The specific steps for obtaining the file migration grouping table are as follows:

[0139] S401: Extract files marked as being in a cooling state from the main chain file cooling flag values, read the access interval and storage requirement data of the files, establish grouping rules according to the access interval value and storage requirement size, perform preliminary grouping of files that meet the grouping rules, and generate a preliminary file migration candidate list.

[0140] Based on the file access interval and storage requirements, files are accessed one by one, and the access interval record for each file is extracted. Based on the access interval value, files with an interval period exceeding a set threshold are filtered and recorded. At the same time, the storage requirements of the files are analyzed, and their storage priority is calculated according to file size and importance, using a storage requirement weighting formula. Standardize the storage requirements for all archives, including To meet the storage needs of the archives, To determine the total number of archives to be grouped, the grouping operation is performed based on the standardization results and the access interval screening results. Each group is assigned a serial number and its archiving is recorded. Archives that meet the criteria are grouped to generate a preliminary candidate list for archive migration.

[0141] S402: Call the preliminary file migration candidate list, extract the total storage requirement of each file group based on the dynamic monitoring data of the available capacity of the sidechain, calculate the ratio of the storage requirement of each group to the sidechain capacity, record the ratio of each file group and generate the corresponding migration ratio, and obtain the file migration ratio allocation table.

[0142] Extract the total storage requirements of the grouped archives, and calculate the storage requirements of each group by summing them up using the formula. For the The total storage requirements for the group of files are calculated cumulatively, among which... For the first Total group storage requirements For the storage needs of a single file. For the first The number of files in each group is used to compare the cumulative total demand with the real-time available capacity of each sidechain, and the ratio of each group's storage demand to the total sidechain capacity is extracted. The calculation formula is as follows: ,in For the first Group storage demand percentage The real-time available capacity of the sidechain, combined with the calculated ratio. Sort the archives into groups, mark the migration priority of each group, and generate an archive migration ratio allocation table.

[0143] S403: Based on the percentage data in the archive migration ratio allocation table, extract the migration ratio of archive groups and the matching parameter of sidechain capacity, using the formula:

[0144] ;

[0145] Calculate the migration priority values ​​of multiple file groups, update the migration results to the sidechain storage status according to priority, and generate a file migration group table;

[0146] in, Representing the The migration priority value of a group of files indicates the urgency and order of group migrations. The migration rate of the representative file group reflects the proportion of migration demand during the cooling-off period. This represents the available storage capacity corresponding to the sidechain, providing a quantification of the feasibility of migration matching. It is a weighting factor for file grouping, used to adjust the flexibility and dynamic responsiveness of migration priorities. It is an adjustment factor used to ensure that the denominator is non-zero and to enhance the stability of the calculation.

[0147] formula:

[0148] ;

[0149] The advantage of the formula lies in its ability to incorporate migration ratios. and available capacity of sidechains Difference calculation, adding weight factors and adjustment factor This allows for flexible adjustment of file migration priorities, improving the accuracy and stability of the allocation process.

[0150] Detailed explanation of the formula and its derivation: Let the migration rate of the first group of archives be... The corresponding available capacity of the sidechain is Weighting factors Adjustment factor Substitute the parameter values ​​into the formula:

[0151] ;

[0152] Calculating the absolute value:

[0153] ;

[0154] Calculate the square root of the denominator:

[0155] ;

[0156] Calculate the final result:

[0157] ;

[0158] The results indicate that the migration priority of the first group of archives is 0.307. The migration order can be determined by comparing the priority of other groups. The groups with higher priority will be migrated first, generating an archive migration grouping table.

[0159] Please see Figure 6 The specific steps for obtaining the main and side chain storage path index table are as follows:

[0160] S501: Extract the main chain index path and side chain index path data of the migrated files in the file migration grouping table, call the node change records of the index path, calculate the change values ​​of all nodes in the migration file index path, determine the adjustment requirements of each migration file in the index structure, and generate a migration file index node relationship change table.

[0161] By calling the migration record of each file in the file migration grouping table, the main chain index path data of each file is read one by one. The main chain index path represents the node position and association of the file in the main chain storage. The uniqueness of each node position needs to be verified by the integrity of its association. The side chain index path records the target storage node after the file migration. Each file corresponds to a target side chain index path value. Based on the uniqueness of the migration record, the main chain and side chain path records are compared, and the change value of the path node is calculated. The change value of the path node is calculated using the absolute value of the difference between the number of corresponding nodes of the index path before and after migration. The absolute value can avoid positive and negative values ​​from interfering with the accuracy of data statistics, and at the same time reflect the actual degree of path change. In this way, an index path node change table is established for each file. The path change value of each file is counted one by one, and it is correlated with the storage capacity data of the index path to obtain the distribution of node change values. Based on the ratio of node change value to storage capacity, the adjustment requirements of each migrated file in the index structure are determined, and a migration file index node relationship change table is generated.

[0162] S502: Call the migration archive index node relationship change table, adjust the main chain and side chain index structure of the migration archive according to the node change value, and generate the adjusted migration archive index structure by rearranging and adjusting the position relationship of the index nodes.

[0163] For files with significant node changes, priority is given to adjusting the index nodes. Significant node changes indicate substantial changes in path nodes due to file migration. The adjustment process requires reconstructing the node positions and relationships of the main chain and side chains sequentially. Main chain index adjustment ensures data access continuity by rearranging the order of path nodes, while side chain index adjustment ensures data storage integrity by rebuilding the relationships in the storage path. The rearrangement of node order requires normalization calculation to standardize the original order. The normalized node order and the mapping relationship with the storage path are used to rebuild the index table. The reconstruction of relationships requires comparing the migrated path data item by item according to the original storage path data, identifying discontinuous data segments, and inserting correction points to fill the gaps in the data segments, resulting in the adjusted migrated file index structure.

[0164] S503: Invoke the adjusted migration archive index structure, synchronously write the adjustment results to the main chain and side chain storage, and calculate the balanced distribution value of index nodes in the main chain and side chain using the formula:

[0165] ;

[0166] The relationship between the index nodes of the main chain and the side chain is adjusted by calculating the balanced distribution value, and a main chain and side chain storage path index table is generated.

[0167] in, This represents the balanced distribution value of the main chain and side chain index nodes. Represents the first in the main chain The index capacity value of each node. Represents the first in the side chain The index capacity value of each node. This represents the total number of index nodes participating in the computation across the main chain and side chains. This represents the absolute difference between the index capacity values ​​of corresponding nodes in the main chain and the side chain.

[0168] formula:

[0169] ;

[0170] Detailed explanation of the formula and its calculation derivation:

[0171] The balanced distribution of index nodes in the main chain and side chains is calculated using a formula. The specific explanations and calculation methods for each parameter in the formula are as follows:

[0172] Indicates the first in the main chain The index capacity value of each node is obtained by real-time monitoring of the amount of data stored in the main chain nodes, and the unit is bytes. For example, the index capacity value of a node in the main chain is determined to be 500 bytes based on the amount of stored data.

[0173] Indicates the first in the side chain The index capacity value of each node is obtained by real-time monitoring of the amount of data stored in the sidechain nodes, and the unit is bytes. For example, the index capacity value of the corresponding node in the sidechain is determined to be 300 bytes based on the amount of stored data.

[0174] This represents the total number of index nodes participating in the computation across the main chain and side chains. It is obtained by querying the actual number of nodes participating in the computation within the system network. For example, the system currently records a total of 10 nodes participating in the computation across the main chain and side chains.

[0175] Let's plug in specific numbers for calculation, assuming the index capacity data for the main chain and side chains are as follows:

[0176] Main chain node index capacity values: 500, 600, 450, 550, 500, 620, 480, 500, 510, 495 (unit: bytes);

[0177] Sidechain node index capacity values: 300, 450, 400, 420, 350, 470, 400, 310, 390, 380 (unit: bytes).

[0178] First, calculate the absolute difference in the index capacity values ​​of each pair of nodes:

[0179] |500-300|=200, |600-450|=150, |450-400|=50, |550-420|=130, |500-350|=150, |620-470|=150, |480-400|=80, |500-310|=190, |510-390|=120, |495-380|=115;

[0180] Calculate the squared difference between the index capacity values ​​of each pair of nodes:

[0181] ;

[0182] The result of summing all squares:

[0183] ;

[0184] Substitute the results into the formula to calculate the equilibrium distribution value:

[0185] ;

[0186] Results show that the balanced distribution value of 140.35 indicates that the distribution difference of the index capacity of the main chain and side chain nodes fluctuates within a certain range. The larger the value, the higher the degree of distribution imbalance.

[0187] A blockchain-based archival storage system, used to execute the aforementioned blockchain-based archival storage method, includes:

[0188] The archive dynamic weight calculation module calculates the archive access time interval and access frequency, accumulates the time interval data, combines the archive creation time and active stage weight values, normalizes the accumulation calculation results, and generates the archive dynamic access weight value.

[0189] The storage allocation optimization module sorts the weight values ​​based on the dynamic access weight values ​​of the archives, groups the sorting results according to the capacity parameters of the main chain and side chains, matches the grouping results with the available storage capacity, records the matching results, and generates an archive distribution storage allocation table.

[0190] The main chain status monitoring module extracts the access time information of the main chain archives based on the archive distribution storage allocation table, calculates the difference between the access interval and the current time, compares it with the cumulative calculation result of the archive's initial time weight value, marks the archive's cooling status, and generates a main chain archive cooling mark value.

[0191] The sidechain migration management module filters files with cooling marks based on the main chain file cooling mark value, groups the files according to access interval and storage requirements, calculates the allocation ratio between the grouped files and the available capacity of the sidechain, adjusts the migration order according to the allocation ratio and updates the file storage status, and generates a file migration group table.

[0192] The index path adjustment module extracts the main and side chain index paths of the migrated archives based on the archive migration grouping table, calculates the change values ​​of the index path node relationships, adjusts the index node structure of the migrated archives, updates the adjusted index data, and generates the main and side chain storage path index table.

[0193] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A blockchain-based archive storage method, characterized in that, Includes the following steps: S1: Based on the archive access records and lifecycle information, extract the access time interval and access number of the archive, accumulate and sum the time interval data and calculate the weight value, accumulate the weight value with the archive creation time and active stage, perform normalization processing on the accumulation result, and generate the archive dynamic access weight value. S2: Based on the dynamic access weight value of the file, sort according to the weight value, combine the capacity allocation rules of the main chain and the side chain, sort and group according to the weight value, match the sorting and grouping results with the storage capacity, allocate the matched files to the main chain or the side chain, and establish a file distribution storage allocation table. S3: Based on the file distribution storage allocation table, extract the access time data of the files in the main chain, calculate the difference between the access interval time and the current time, compare the difference with the file initial time weight accumulation value, perform a judgment mark on the file cooling status, and generate the main chain file cooling mark value; S4: Based on the main chain file cooling mark value, extract the cooling mark files, group the files according to access interval and storage requirements, calculate the allocation ratio of the grouping results according to the available capacity of the side chain, select the migration order according to the allocation ratio, update the status of the migrated files to the side chain storage, and generate a file migration grouping table. S5: Based on the file migration grouping table, extract the main chain and side chain index path data of the migrated files, calculate the index path node relationship change value, adjust the index node structure of the migrated files, synchronously write the adjusted index structure, and establish the main and side chain storage path index table.

2. The blockchain-based archive storage method according to claim 1, characterized in that, The dynamic access weight value of the archives includes weight value, creation time, and active stage. The archive distribution storage allocation table includes sorting and grouping results, storage capacity allocation results, and allocation status of the main chain and side chains. The main chain archive cooling flag value includes access interval time, the difference between the current time and the initial time weight cumulative value, and cooling status flag. The archive migration grouping table includes access interval, storage requirements, allocation ratio, migration order, and archive status after migration. The main and side chain storage path index table includes the main chain index path of the migrated archives, the side chain index path, the index path node relationship change value, and the adjusted index structure.

3. The blockchain-based archive storage method according to claim 2, characterized in that, The specific steps for obtaining the dynamic access weight value of the archive are as follows: S101: Extract the access time interval and access count of the archive, call the access time data in the archive record, calculate and record the time interval of each access, accumulate the total time interval of each archive, calculate the ratio of the accumulated result to the access count, and generate a preliminary time weight value set. S102: Call the preliminary time weight value set, combine it with the creation time data of each file, calculate the total time weight from the file creation time to the current time, divide the weight into segments according to the time range of the active stage, calculate the total weight of each segment, and generate the total weight of the active stage. S103: The sum of the active phase weights and the initial time weight set are weighted and accumulated using the following formula: ; Calculate the dynamic access weight value of the generated archive; in, Represents the dynamic access weight value of the archive. The cumulative access time weighting of the representative file. The weighting of the creation time of the representative file is adjusted. Represents the sum of weights during the active phase. This represents the number of active time periods currently accumulated in the archive. This represents the total number of files.

4. The blockchain-based archive storage method according to claim 3, characterized in that, The specific steps for obtaining the file distribution storage allocation table are as follows: S201: Call the dynamic access weight value of the archive, sort all archives in descending order according to the weight value, determine the sorting order by comparing the weight values ​​one by one, record the index and weight value information of the sorted archive list, and generate the sorted archive list. S202: Call the sorted file list, group the files according to the capacity allocation rules of the main chain and side chain, accumulate the file weight value one by one and compare it with the capacity threshold, and put the files whose weight accumulation value does not exceed the capacity into the same group to generate the pre-grouping result of the files; S203: Match the pre-grouping results of the archives with the actual available storage capacity data, using the formula: ; Calculate the optimal storage match for each group of files and generate a file distribution storage allocation table; in, Representing the The stored matching value of the group file. Representing the Dynamic access weights for each file. Representing the The group's available storage capacity Representative at the Number of files in the group This represents the summation of the weight values ​​of the files within the group.

5. The blockchain-based archive storage method according to claim 4, characterized in that, The specific steps for obtaining the main chain archive cooling flag value are as follows: S301: Extract the file records of the main chain portion of the file distribution storage allocation table, read the access time data corresponding to the main chain files, calculate the access interval time of each file, save the access interval time results of all files, and generate a set of access interval times for the main chain files. S302: Call the main chain file access interval time set, calculate the time difference of each file based on the difference between the current time and the last access time of the file, and compare the time difference with the initial time weight accumulation value of the corresponding file to generate the file time difference comparison result; S303: Based on the comparison value of each file in the file time difference comparison results, determine whether the time difference is greater than the cooling threshold, using the formula: ; Calculate and generate the main chain archive cooling mark value; in, Represents the cooling rating value. Representing the The time difference between the files Representing the The time difference between the files This represents the sum of the time differences of all archives. This represents the average time difference across all archives. This represents the cooling threshold.

6. The blockchain-based archive storage method according to claim 5, characterized in that, The specific steps for obtaining the file migration grouping table are as follows: S401: Extract the files marked as being in a cooling state from the main chain file cooling flag values, read the access interval and storage requirement data of the files, establish grouping rules according to the access interval value and storage requirement size, perform preliminary grouping of the files that meet the grouping rules, and generate a preliminary file migration candidate list. S402: Call the preliminary file migration candidate list, extract the total storage requirement of each file group based on the dynamic monitoring data of the available capacity of the sidechain, calculate the ratio of the storage requirement of each group to the sidechain capacity, record the ratio of each file group and generate the corresponding migration ratio, and obtain the file migration ratio allocation table. S403: Based on the percentage data in the archive migration ratio allocation table, extract the migration ratio and sidechain capacity matching parameters for archive groups, using the formula: ; Calculate the migration priority values ​​of multiple file groups, update the migration results to the sidechain storage status according to priority, and generate a file migration group table; in, Representing the The migration priority value of a group of files indicates the urgency and order of group migrations. The migration rate of the representative file group reflects the proportion of migration demand during the cooling-off period. This represents the available storage capacity corresponding to the sidechain, providing a quantification of the feasibility of migration matching. It is a weighting factor for file grouping, used to adjust the flexibility and dynamic responsiveness of migration priorities. It is an adjustment factor used to ensure that the denominator is non-zero and to enhance the stability of the calculation.

7. The blockchain-based archive storage method according to claim 6, characterized in that, The specific steps for obtaining the main and side chain storage path index table are as follows: S501: Extract the main chain index path and side chain index path data of the migrated files in the file migration grouping table, call the node change record of the index path, calculate the change value of all nodes in the migration file index path, determine the adjustment requirements of each migration file in the index structure, and generate a migration file index node relationship change table. S502: Call the migration archive index node relationship change table, adjust the main chain and side chain index structure of the migration archive according to the node change value, and generate the adjusted migration archive index structure by rearranging and adjusting the position relationship of the index nodes. S503: Invoke the adjusted migration archive index structure, synchronously write the adjustment results to the main chain and side chain storage, and calculate the balanced distribution value of the index nodes in the main chain and side chain using the formula: ; The relationship between the index nodes of the main chain and the side chain is adjusted by calculating the balanced distribution value, and a main chain and side chain storage path index table is generated. in, This represents the balanced distribution value of the main chain and side chain index nodes. Represents the first in the main chain The index capacity value of each node. Represents the first in the side chain The index capacity value of each node. This represents the total number of index nodes participating in the computation across the main chain and side chains. This represents the absolute difference between the index capacity values ​​of corresponding nodes in the main chain and the side chain.

8. A blockchain-based archive storage system, characterized in that, The blockchain-based archive storage method according to any one of claims 1-7, wherein the system comprises: The archive dynamic weight calculation module calculates the archive access time interval and access frequency based on the archive access time interval and accumulates the time interval data. It also adds the archive creation time and active stage weight values ​​together and normalizes the accumulated calculation results to generate the archive dynamic access weight value. The storage allocation optimization module sorts the weight values ​​based on the dynamic access weight values ​​of the files, groups the sorting results according to the capacity parameters of the main chain and side chains, matches the grouping results with the available storage capacity, records the matching results, and generates a file distribution storage allocation table. Based on the file distribution and storage allocation table, the main chain status monitoring module extracts the access time information of the main chain files, calculates the difference between the access interval and the current time, compares it with the cumulative calculation result of the file's initial time weight value, marks the file's cooling status, and generates a main chain file cooling mark value. The sidechain migration management module filters files with cooling marks based on the main chain file cooling mark value, groups the files according to access interval and storage requirements, calculates the allocation ratio between the grouped files and the available capacity of the sidechain, adjusts the migration order according to the allocation ratio and updates the file storage status, and generates a file migration group table. The index path adjustment module extracts the main and side chain index paths of the migrated files based on the file migration grouping table, calculates the index path node relationship change value, adjusts the index node structure of the migrated files, updates the adjusted index data, and generates the main and side chain storage path index table.

Citation Information

Patent Citations

  • Cluster resource management method and device, electronic equipment and storage medium

    CN112825023A

  • Archive management system based on block chain

    CN115794739A