Method and system for balancing loss of solid-state storage

By dividing logical intervals in solid-state storage devices and building a hot and cold intensity matrix, and optimizing storage resource allocation, the problems of overuse of local areas and uneven wear across channels are solved, and efficient loss balance and long life of the equipment are achieved.

CN120353404AActive Publication Date: 2025-07-22JIANGSU HUACUN ELECTRONICS TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510814864.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-07-22
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

The loss equalization strategy of existing solid-state storage devices cannot effectively solve the problems of excessive use of local areas and uneven wear across channels, resulting in shortening of equipment reliability and service life.

Method used

By dividing the logical intervals, calculating the thermal entropy value, building a hot and cold intensity matrix and mapping it into a memory block allocation sequence, combining the gradient pointer mechanism and channel state mask, cross-channel memory block allocation and migration operations are performed, and storage resource allocation is optimized.

Benefits of technology

Reduce data migration frequency and storage fragmentation, extend the service life of the equipment, improve the stability and reliability of storage media, and optimize the storage response efficiency in high concurrent scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120353404A_ABST
    Figure CN120353404A_ABST
Patent Text Reader

Abstract

The invention discloses a solid-state storage loss balancing method and system, and relates to the technical field of computer storage, and the method comprises the steps: dividing a solid-state storage device into a plurality of logic intervals according to the time sequence characteristics of data access, and calculating a corresponding thermal entropy value based on the data access behavior of each logic interval; constructing a cold and hot intensity matrix, and mapping the cold and hot intensity matrix into a corresponding storage block allocation sequence based on a binary search tree; constructing an idle storage block resource pool, covering a preset erasure interval by applying a gradient pointer mechanism, and executing cross-channel storage block allocation in combination with a channel state mask and a probabilistic selection algorithm; the storage blocks in all the channels are arranged in a descending order according to the thermal entropy values, and cross-channel migration operation is executed according to the sorting result. Storage resource allocation is optimized, and efficient layout of the storage blocks is achieved, so that the data migration frequency and storage fragmentation are reduced, the write amplification effect is reduced, and the service life of solid-state storage equipment is effectively prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer storage, and more specifically, to a wear leveling method and system for solid-state storage. Background Art

[0002] Solid-state storage is a data storage solution based on semiconductor technology. Among them, solid-state drives (SSDs) are gradually replacing traditional mechanical hard drives and becoming the mainstream storage devices due to their high-speed data reading and writing capabilities, low power consumption, and anti-vibration properties. Currently, most solid-state storage devices use NAND flash as the main storage medium. However, due to the physical characteristics of NAND flash, the number of erasable and programmable times of each storage unit is limited. As storage technology evolves towards higher-density architectures (such as QLC, PLC), the durability of a single storage unit further decreases, making solid-state storage devices more prone to wear failure during use. Therefore, designing an efficient wear leveling algorithm to extend the device's service life while ensuring performance has become one of the key challenges in current solid-state storage technology.

[0003] Currently, the wear leveling strategy in solid-state storage devices usually relies on the counter method, that is, by real-time counting the number of erase / write cycles of each storage block or channel, and preferentially selecting the storage units with fewer erase / write cycles for data writing. However, this type of counter-driven allocation strategy has certain limitations: in the case of frequent local area access or intensive writing, it is easy to cause overuse of some storage block or channel resources, thereby exacerbating local wear; at the same time, there is a lack of global awareness and regulation of the dynamic changes in cross-channel loads, resulting in significant differences in the wear rates between different channels, causing some channels to reach the erase limit prematurely, ultimately affecting the overall reliability of the device, shortening the usage cycle, and reducing the performance stability of the storage system.

[0004] Regarding the problems in the related art, no effective solution has been proposed yet. Summary of the Invention

[0005] Regarding the problems in the related art, the present invention proposes a wear leveling method and system for solid-state storage to overcome the above-mentioned technical problems existing in the existing related technologies.

[0006] To this end, the specific technical solutions adopted by the present invention are as follows: According to one aspect of the present invention, there is provided a wear leveling method for solid-state storage, including: S1. According to the timing characteristics of data access, divide the solid-state storage device into several logical intervals, and calculate the corresponding thermal entropy values based on the data access behaviors of each logical interval; S2. Construct a cold and heat intensity matrix based on the thermal entropy values of each logical interval, and map the cold and heat intensity matrix to the corresponding storage block allocation sequence based on a binary search tree; S3. Based on the storage block allocation sequence, construct an idle storage block resource pool, use the gradient pointer mechanism to cover the preset erasure interval, and combine the channel status mask and the probabilistic selection algorithm to perform cross-channel storage block allocation; S4. According to the storage block allocation result, sort the storage blocks in each channel in descending order according to the thermal entropy value, and perform cross-channel migration operations according to the sorting result.

[0007] Optionally, before constructing a cold and heat intensity matrix based on the thermal entropy values of each logical interval and mapping the cold and heat intensity matrix to the corresponding storage block allocation sequence based on a binary search tree, it includes: S21. Normalize the thermal entropy values of each logical interval to generate a standardized heat score; S22. Based on the numbering order of the logical intervals, fill the standardized heat scores into the corresponding positions of the matrix according to the preset priority rules to construct a cold and heat intensity matrix; S23. According to the hierarchical clustering algorithm, combine the heat scores and spatial topological relationships of the logical intervals to perform clustering analysis on the cold and heat intensity matrix, and divide the logical intervals into several cold and heat intervals based on the analysis results; S24. Based on the division results of the cold and heat intervals, construct a binary search tree with the heat scores of the logical intervals as key values, and generate a mapping table from logical blocks to storage blocks by in-order traversing the binary search tree to obtain the storage block allocation sequence.

[0008] Optionally, according to the hierarchical clustering algorithm, combining the heat scores and spatial topological relationships of the logical intervals to perform clustering analysis on the cold and heat intensity matrix, and dividing the logical intervals into several cold and heat intervals includes: S231. Based on the constructed cold and heat intensity matrix, extract the heat scores and spatial topological relationships of each logical interval to construct a multi-dimensional feature matrix; S232. According to the multi-dimensional feature matrix, calculate and fuse the heat similarity and spatial proximity between each logical interval to construct an amplification formula; S233. Combine the hierarchical clustering algorithm and the amplification formula to cluster the logical intervals into clusters to generate a hierarchical tree structure; S234. Based on the generated tree structure, combine the heat distribution and spatial association to set the partitioning criteria, and divide the logical intervals into several cold and heat intervals, where the cold and heat intervals include hot areas, cold areas, and transition areas.

[0009] Optionally, the expression of the amplification formula is: ; Wherein, T ( i , j ) represents a logical interval i and j 's enhanced distance; i represents an index value; j represents an index value; D ( S i , S j ) represents a sequence of heat scores S i and S j 's similarity; S i represents a sequence of heat scores for the logical interval i ; S j represents a sequence of heat scores for the logical interval j ; γ represents a spatial coupling coefficient; D ( i , j ) represents the spatial proximity distance between the logical intervals i and j ; D max represents the maximum spatial proximity distance; λ ( t ) represents a dynamic decay factor; η represents a gradient penalty coefficient; represents a heat gradient.

[0010] Optionally, combining a hierarchical clustering algorithm with an amplification formula, clustering logical intervals into clusters to generate a hierarchical tree structure including: S2331. Taking each logical interval as an initial class, constructing a global covariance matrix based on the heat similarity and spatial proximity of all logical intervals; S2332. Initializing the covariance matrix of each initial class to half the scale of the corresponding global covariance matrix, and calculating the similarity between any two classes using the amplification formula to generate a similarity matrix; S2333. Selecting the two classes with the highest similarity from the similarity matrix for merging, calculating the covariance matrix of the new class after merging, and calculating the similarity between the new class and each class using the amplification formula to update the similarity matrix; S2334. Continuously iteratively updating the similarity matrix and detecting whether the preset termination condition is satisfied. If so, generating a hierarchical tree structure; otherwise, returning to step S2332 to continue iterating until the preset termination condition is satisfied.

[0011] Optionally, based on the generated tree structure, combining the heat distribution and spatial correlation, set the partitioning criteria, and divide the logical intervals into several hot and cold intervals, including: S2341. Traverse each hierarchical node in the tree structure, calculate the joint entropy value of each hierarchical node based on heat similarity and spatial proximity, and filter out the candidate cutting layers according to the preset entropy threshold value to construct a set of candidate cutting layers; S2342. Based on each candidate cutting layer, combining the heat distribution and spatial correlation, evaluate the score of each candidate cutting layer through weighted scoring, and select the candidate cutting layer with the highest score as the partitioning criteria for logical interval division; S2343. Classify each logical interval according to the selected demarcation criteria to obtain several hot and cold intervals, where the hot and cold intervals include hot areas, cold areas and transition areas.

[0012] Optionally, based on the division result of the hot and cold intervals, use the heat score of the logical interval as the key value to construct a binary search tree, and generate a mapping table from logical blocks to storage blocks by performing an inorder traversal of the binary search tree, and obtain the storage block allocation sequence, including: S241. Based on the division result of the hot and cold intervals, use the heat score of each logical block as the key value to sort the logical blocks to generate an ordered sequence arranged in ascending order of heat score; S242. Select the middle element from the ordered sequence as the root node of the binary search tree, and use the middle element to divide the ordered sequence into two parts, and recursively construct the left subtree and the right subtree based on the division result; S243. Repeat step S242 until all logical blocks are inserted to construct a binary search tree; S244. Perform an inorder traversal on the constructed binary search tree to generate a logical block sequence arranged in descending order of heat score, and establish a mapping relationship table from logical blocks to storage blocks according to the traversal order to obtain the storage block allocation sequence.

[0013] Optionally, according to the storage block allocation result, sort the storage blocks in each channel in descending order of thermal entropy value, and perform cross-channel migration operations according to the sorting result, including: S41. According to the storage block allocation result, use an adaptive algorithm to dynamically adjust the weight parameters in the calculation of thermal entropy value, and sort the storage blocks in each channel based on the updated thermal entropy value in descending order to generate a migration priority queue for each channel; S42. Calculate the wear difference between channels, combine the preset migration trigger threshold and the migration priority queue, filter out the storage blocks to be migrated, and establish a set of storage blocks to be migrated; S43. Perform hash hashing on the storage blocks in the set of storage blocks to be migrated, and evenly distribute the processed storage blocks to the target wear channels; S44. Calculate the wear leveling degree of each channel and the thermal retention rate of the storage block after migration, evaluate the calculation results, and adjust the migration amount based on the evaluation results.

[0014] Optionally, performing a hash processing on the storage blocks in the set to be migrated, and evenly distributing the processed storage blocks to the target wear channels includes: S431. Calculate the compensation factor of each storage block according to the thermal entropy value of each storage block and the load balancing state of each channel in the migration operation; S432. Combine the thermal entropy value of the storage block and the corresponding compensation factor, and use a weighted formula to calculate the migration priority of each storage block; S433. Sort all the storage blocks in the set to be migrated in descending order according to the migration priority, and process the sorted storage blocks using a hash algorithm to generate hash mapping values to determine the target wear channels corresponding to each storage block; S434. According to a preset polling mechanism, sequentially allocate the processed storage blocks to the corresponding target wear channels to ensure the even distribution of the storage blocks among different channels; S435. Repeat step S434 until all the storage blocks to be migrated are allocated.

[0015] According to another aspect of the present invention, there is also provided a wear leveling system for solid-state storage, including: A thermal entropy value calculation module, configured to divide the solid-state storage device into several logical intervals according to the timing characteristics of data access, and calculate the corresponding thermal entropy values based on the data access behaviors of each logical interval; An allocation sequence mapping module, configured to construct a cold and hot intensity matrix according to the thermal entropy values of each logical interval, and map the cold and hot intensity matrix to the corresponding storage block allocation sequence based on a binary search tree; A cross-channel allocation module, configured to construct a free storage block resource pool based on the storage block allocation sequence, use a gradient pointer mechanism to cover a preset erasure interval, and perform cross-channel storage block allocation in combination with a channel status mask and a probabilistic selection algorithm; A migration operation module, configured to sort the storage blocks in each channel in descending order according to the thermal entropy values according to the storage block allocation results, and perform cross-channel migration operations according to the sorting results.

[0016] The beneficial effects of the present invention are: 1. The present invention optimizes the storage resource allocation by analyzing the timing characteristics to divide logical intervals; at the same time, adopting a cold and hot intensity matrix mapping mechanism based on a binary search tree to achieve an efficient layout of storage blocks, thereby reducing the data migration frequency and storage fragmentation, reducing the write amplification effect, and effectively extending the service life of the solid-state storage device.

[0017] 2. The present invention dynamically manages the erasure interval by introducing a gradient pointer mechanism, combines a channel state perception algorithm to preferentially use low-wear storage blocks, and reduces the write-erase pressure on a single channel; through a probabilistic selection strategy and channel masking technology, it adaptively adjusts the cross-channel resource allocation weight, balances the wear degree of each channel, prevents premature aging in local areas, and thus improves the stability and reliability of the storage medium.

[0018] 3. The present invention realizes the intelligent reallocation of cross-channel storage blocks through a migration strategy based on the descending order of thermal entropy, combined with a dynamic priority queue and a hash mapping algorithm; through a continuous monitoring and feedback mechanism, it optimizes global wear leveling, reduces the impact of migration operations on system performance, ensures the storage response efficiency in high-concurrency scenarios, and provides continuous wear leveling support for solid-state storage devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0020] Figure 1 is a flowchart of a wear leveling method for solid-state storage according to an embodiment of the present invention; Figure 2 is a schematic block diagram of a wear leveling system for solid-state storage according to an embodiment of the present invention; Figure 3 is a schematic diagram of the generation of a tree structure of a wear leveling method for solid-state storage according to an embodiment of the present invention.

[0021] In the figure: 1. Thermal entropy value calculation module; 2. Allocation sequence mapping module; 3. Cross-channel allocation module; 4. Migration operation module. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0022] To further illustrate the embodiments, the present invention provides drawings, which are part of the disclosure of the present invention. They are mainly used to illustrate the embodiments and can be combined with the relevant descriptions in the specification to explain the operation principle of the embodiments. With reference to these contents, those of ordinary skill in the art should be able to understand other possible implementation manners and the advantages of the present invention.

[0023] According to an embodiment of the present invention, a wear leveling method and system for solid-state storage are provided.

[0024] Now, the present invention will be further described in combination with the drawings and specific implementation manners, as Figure 1As shown, the wear leveling method for solid-state storage according to an embodiment of the present invention includes: S1. Divide the solid-state storage device into several logical intervals according to the timing characteristics of data access, and calculate the corresponding thermodynamic entropy values based on the data access behaviors of each logical interval.

[0025] It should be added that based on the timing access characteristics of the solid-state storage device (such as data write / read frequency, timestamp distribution, etc.), the storage space is divided into multiple logical intervals (such as divided by time window or address segment), and for the data access patterns of each logical interval (such as access times, update frequency), the thermodynamic entropy calculation formula (such as ΔS = Q / T or Boltzmann entropy formula S = k·ln·W) is applied to quantify its degree of disorder to characterize the hot and cold characteristics. Among them, the low-entropy value interval represents the hot data area with high-frequency ordered access, the high-entropy value interval corresponds to the cold data area with low-frequency disordered access, and the medium-entropy value interval serves as the transition area for the dynamic migration of hot and cold data. This step converts the timing access characteristics into measurable thermodynamic indicators through entropy value calculation, providing a basis for the subsequent hierarchical management of hot and cold data.

[0026] S2. Based on the thermodynamic entropy values of each logical interval, construct a hot and cold intensity matrix, and map the hot and cold intensity matrix to the corresponding storage block allocation sequence based on a binary search tree.

[0027] Preferably, constructing a hot and cold intensity matrix based on the thermodynamic entropy values of each logical interval and mapping the hot and cold intensity matrix to the corresponding storage block allocation sequence based on a binary search tree further includes: S21. Normalize the thermodynamic entropy values of each logical interval to generate a standardized heat score.

[0028] S22. Based on the numbering order of the logical intervals, fill the standardized heat scores into the corresponding positions of the matrix according to a preset priority rule to construct a hot and cold intensity matrix.

[0029] It should be added that the specific embodiments of constructing a hot and cold intensity matrix by filling the standardized heat scores into the corresponding positions of the matrix according to a preset priority rule based on the numbering order of the logical intervals are as follows: First, divide the logical address space into three-level intervals (hot zone, transition zone, cold zone). Sort the normalized heat scores (normalized to 0 - 1) according to spatial proximity (e.g., Haversine distance < 10km) and access frequency (e.g., Top 20%). Adopt the priority filling rule, where high-heat data preferentially occupies the central area of the matrix, and low-heat data is distributed at the edge. At the same time, introduce a regional compensation factor (α = 0.8 - 1.2) to adjust the weights of sparse / dense regions. Finally, generate a cold-hot intensity matrix, where the rows represent the logical interval numbers, the columns correspond to the physical block write counts, and the matrix values are the weighted cold-hot intensity values (e.g., fill 0.9 for the hot zone and 0.2 for the cold zone). This matrix can intuitively reflect the cold-hot distribution of the storage space, thereby improving the global wear leveling and resource addressing efficiency.

[0030] S23. According to the hierarchical clustering algorithm, combine the heat scores and spatial topological relationships of the logical intervals, perform clustering analysis on the cold-hot intensity matrix, and divide the logical intervals into several cold-hot intervals based on the analysis results.

[0031] Preferably, according to the hierarchical clustering algorithm, combine the heat scores and spatial topological relationships of the logical intervals, perform clustering analysis on the cold-hot intensity matrix, and divide the logical intervals into several cold-hot intervals including: S231. Based on the constructed cold-hot intensity matrix, extract the heat scores and spatial topological relationships of each logical interval to construct a multi-dimensional feature matrix.

[0032] It should be added that the specific embodiments of extracting the heat scores and spatial topological relationships of each logical interval based on the constructed cold-hot intensity matrix to construct a multi-dimensional feature matrix are as follows: First, extract the normalized heat scores (normalized to 0 - 1, e.g., 0.9 for the hot zone and 0.2 for the cold zone) and spatial topological relationships (using the adjacency matrix or spatial autocorrelation index) of the logical intervals from the cold-hot intensity matrix, and combine the direction encoding (e.g., four-way binary vector of north / south / east / west) and distance weight (proximity calculated by the Haversine formula). Subsequently, combine the heat score, topological adjacency (e.g., mark adjacent logical intervals as 1), spatial direction vector, and compensation factor (α = 0.8 - 1.2) into a four-dimensional feature vector, and use principal component analysis to reduce the dimension to a two-dimensional principal component space to form a multi-dimensional feature matrix (rows correspond to logical intervals, and columns are the principal component scores). This matrix can quantify the heat distribution and spatial correlation of the storage area, and combine with the clustering algorithm (such as K-means++) to achieve dynamic division of cold-hot intervals, thereby improving the global wear leveling and data migration efficiency of the storage system.

[0033] S232. According to the multi-dimensional feature matrix, calculate and fuse the heat similarity and spatial proximity between each logical interval to construct an amplification formula.

[0034] Preferably, the expression of the amplification formula is: ; In the formula, T ( i , j ) represents the enhancement distance between the logical intervals i and j ; i represents the index value; j represents the index value; D ( S i , S j ) represents the similarity between the heat score sequences S i and S j ; S i represents the heat score sequence of the logical interval i ; S j represents the heat score sequence of the logical interval j ; γ represents the spatial coupling coefficient; D ( i , j ) represents the spatial proximity distance between the logical intervals i and j ; D max represents the maximum spatial proximity distance; λ ( t ) represents the dynamic attenuation factor; η represents the gradient penalty coefficient; represents the heat gradient.

[0035] S233. Combine the hierarchical clustering algorithm with the amplification formula to cluster the logical intervals into clusters and generate a hierarchical tree structure.

[0036] Preferably, combining the hierarchical clustering algorithm with the amplification formula to cluster the logical intervals into clusters and generate a hierarchical tree structure includes: S2331. Take each logical interval as an initial class, and construct a global covariance matrix based on the heat similarity and spatial proximity of all logical intervals; S2332. Initialize the covariance matrix of each initial class to half the scale of the corresponding global covariance matrix, and calculate the similarity between any two classes using the amplification formula to generate a similarity matrix; S2333. Select the two classes with the highest similarity from the similarity matrix for merging, calculate the covariance matrix of the new merged class, and calculate the similarity between the new class and each class using the amplification formula to update the similarity matrix; S2334. Continuously iteratively update the similarity matrix and detect whether the preset termination condition is satisfied. If so, generate a hierarchical tree structure; otherwise, return to step S2332 to continue the iteration until the preset termination condition is satisfied.

[0037] It should be supplemented that, as Figure 3 shown, by constructing a global covariance matrix (integrating the heat similarity and spatial proximity of the logical intervals), and adopting an incremental covariance merging strategy (the initial covariance matrix is 50% of the global scale, and the increment formula introduces a heat weight α = 0.6 and a spatial decay factor β = 1.2), iteratively merge the two categories with the highest similarity (such as similarity > 0.85) to generate a tree structure, thereby improving the global wear leveling of the storage system, reducing the write amplification factor, and at the same time, through the dynamic update of the covariance matrix, effectively reducing the computational complexity (reducing a certain amount of memory occupancy compared to traditional hierarchical clustering), and then being applicable to the hierarchical management of hot and cold data in high-dimensional storage spaces.

[0038] S234. Based on the generated tree structure, combine the heat distribution and spatial association, set the partitioning criteria, and divide the logical intervals into several hot and cold intervals, where the hot and cold intervals include hot zones, cold zones, and transition zones.

[0039] Preferably, based on the generated tree structure, combine the heat distribution and spatial association, set the partitioning criteria, and divide the logical intervals into several hot and cold intervals, including: S2341. Traverse each hierarchical node in the tree structure, calculate the joint entropy value of each hierarchical node based on the heat similarity and spatial proximity, and filter out the candidate cutting layers according to the preset entropy threshold value to construct a candidate cutting layer set; S2342. Based on each candidate cutting layer, combine the heat distribution and spatial association, evaluate the score of each candidate cutting layer through weighted scoring, and select the candidate cutting layer with the highest score as the partitioning criteria for the logical interval division; S2343. According to the selected demarcation criteria, classify each logical interval to obtain several hot and cold intervals, where the hot and cold intervals include hot zones, cold zones, and transition zones.

[0040] It should be supplemented that by calculating the node joint entropy value (integrating the heat similarity and spatial proximity) to filter out the candidate cutting layers (such as an entropy threshold value of 1.2 bits), and combining weighted scoring (heat weight 60%, spatial correlation 40%) to determine the optimal demarcation criteria, finally divide the logical intervals into hot zones (entropy < 0.5, access frequency Top 20%), cold zones (entropy > 1.5, low-frequency access), and transition zones (dynamically adjusted), thereby improving the global wear leveling of the storage system, reducing the write amplification factor and misjudgment rate, and then being applicable to the real-time resource optimization in high-concurrency scenarios.

[0041] S24. According to the division result of the hot and cold intervals, using the heat score of the logical interval as the key value, construct a binary search tree, and through the in-order traversal of the binary search tree, generate a mapping table from logical blocks to storage blocks, and obtain the storage block allocation sequence.

[0042] Preferably, according to the division result of the hot and cold intervals, using the heat score of the logical interval as the key value, construct a binary search tree, and through the in-order traversal of the binary search tree, generate a mapping table from logical blocks to storage blocks, and obtaining the storage block allocation sequence includes: S241. According to the division result of the hot and cold intervals, use the heat scores of each logical block as the key values to sort the logical blocks, and generate an ordered sequence arranged in ascending order of heat scores; S242. Select the middle element from the ordered sequence as the root node of the binary search tree, and use the middle element to divide the ordered sequence into two parts, and recursively construct the left subtree and the right subtree based on the division result; S243. Repeat step S242 until all logical blocks are inserted to construct the binary search tree; S244. Perform an in-order traversal on the constructed binary search tree, generate a logical block sequence arranged in descending order of heat scores, and establish a mapping relationship table from logical blocks to storage blocks according to the traversal order, and obtain the storage block allocation sequence.

[0043] It should be added that the specific embodiments of constructing a binary search tree according to the division result of the hot and cold intervals, using the heat score of the logical interval as the key value, and through the in-order traversal of the binary search tree to generate a mapping table from logical blocks to storage blocks and obtain the storage block allocation sequence are as follows: Arrange the logical blocks in ascending order of heat scores, take the middle element as the root node (such as the 50th block among 100 logical blocks, with a heat of 0.65), and recursively construct an AVL tree; generate a descending sequence through in-order traversal (the top 20% of the logical blocks in the hot area are preferentially mapped to high-performance storage blocks), and establish a storage mapping table in combination with the spatial proximity compensation factor (the mapping interval between adjacent logical blocks ≤ 5 physical blocks), so as to reduce the write amplification factor of the storage system, improve the access hit rate of the hot area, and at the same time stabilize the search complexity at O(logn) through the balanced tree structure, thereby reducing the latency of the linked list structure.

[0044] S3. Based on the storage block allocation sequence, construct an idle storage block resource pool, use the gradient pointer mechanism to cover the preset erasure interval, and combine the channel status mask and the probabilistic selection algorithm to perform cross-channel storage block allocation.

[0045] It should be noted that based on the storage block allocation sequence, an idle storage block resource pool is constructed, the gradient pointer mechanism is used to cover the preset erasure interval, and combined with the channel state mask and the probabilistic selection algorithm, the specific implementation of cross-channel storage block allocation is as follows: First, the idle storage blocks are divided by channel (such as NAND flash channels 0 - 3) to construct a resource pool. The gradient pointer mechanism (initial offset Δ = 10%, step decay factor β = 0.9) is used to dynamically cover the erasure interval (such as the block in the range of 1000 - 5000 write / erase cycles). The channel state mask (such as binary encoding [0x1, 0x2, 0x4, 0x8]) is used to mark the load status of each channel (such as mask value 0x3 indicates that channels 0 and 1 are busy). Combined with the probabilistic selection algorithm (high load channel weight α = 0.3, low load channel weight α = 0.7), cross-channel allocation is performed to reduce the storage block fragmentation rate and improve the write / erase balance. At the same time, through dynamic update of the mask, the cross-channel allocation delay is stabilized within 5 μs. For example, when an allocation request arrives, the channel with a low mask value (such as channel 3 mask 0x8) is preferentially selected, and the available block within the erasure interval is located according to the gradient pointer (such as the block with 2500 write / erase cycles), and load balancing is achieved by combining probability weights.

[0046] S4. According to the storage block allocation result, the storage blocks in each channel are sorted in descending order according to the thermal entropy value, and cross-channel migration operations are performed according to the sorting result.

[0047] Preferably, according to the storage block allocation result, sorting the storage blocks in each channel in descending order according to the thermal entropy value, and performing cross-channel migration operations according to the sorting result includes: S41. According to the storage block allocation result, use the adaptive algorithm to dynamically adjust the weight parameters in the calculation of the thermal entropy value, and sort the storage blocks in each channel based on the updated thermal entropy value in descending order to generate a migration priority queue for each channel.

[0048] S42. Calculate the wear difference between channels, combine the preset migration trigger threshold and the migration priority queue, screen out the storage blocks to be migrated, and establish a set of storage blocks to be migrated.

[0049] It should be noted that the specific implementation of calculating the wear difference between channels, combining the preset migration trigger threshold and the migration priority queue, screening out the storage blocks to be migrated, and establishing a set of storage blocks to be migrated is as follows: First, calculate the wear difference index for each channel (e.g., the number of erase / write cycles for channel A is 2500 times, and for channel B is 1800 times, the difference rate = (2500 - 1800) / 1800 = 38.9%). Combine with the migration trigger threshold (preset Δ = 30%) to screen out the over-standard channels. Subsequently, construct a migration priority queue (weighted scoring based on the wear degree of storage blocks, spatial proximity, and access popularity, with weights α = 0.6 / 0.3 / 0.1). For example, the score of storage block X in the queue = 0.6·(number of erase / write cycles / maximum number of erase / write cycles) + 0.3·(idle degree of adjacent channels) + 0.1·(recent access frequency). Select the blocks to be migrated from the queue through a probabilistic selection algorithm (high-priority weight 0.7, low-priority weight 0.3). For example, blocks with more than 4000 erase / write cycles enter the set first, thereby improving the wear balance across channels, reducing the number of trigger times for migration operations, and lowering the write amplification factor. For example, in a NAND flash memory system, when the wear difference index of channel 3 reaches 45%, trigger the migration mechanism, migrate the top 10% of the storage blocks (such as blocks with 4300 erase / write cycles) in the priority queue to a low-load channel (such as channel 1 with a wear rate of 22%), and overwrite the erasure interval through a gradient pointer mechanism (offset Δ = 15%) to ensure that the wear rate difference between channels after migration ≤ 15%.

[0050] S43. Perform hash hashing on the storage blocks in the set to be migrated, and evenly distribute the processed storage blocks to the target wear channels.

[0051] Preferably, performing hash hashing on the storage blocks in the set to be migrated and evenly distributing the processed storage blocks to the target wear channels includes: S431. Calculate the compensation factor for each storage block according to the thermal entropy value of each storage block and the load balancing state of each channel during the migration operation. S432. Combine the thermal entropy value of the storage block and the corresponding compensation factor, and use a weighted formula to calculate the migration priority of each storage block. S433. Sort all the storage blocks in the set to be migrated in descending order according to the migration priority, and process the sorted storage blocks using a hash hashing algorithm to generate hash mapping values to determine the target wear channels corresponding to each storage block. S434. According to the preset polling mechanism, sequentially distribute the processed storage blocks to the corresponding target wear channels to ensure the uniform distribution of storage blocks among different channels. S435. Repeat step S434 until all the storage blocks to be migrated are allocated.

[0052] It should be noted that the specific embodiments of performing hash hashing on the storage blocks in the set to be migrated and evenly distributing the processed storage blocks to the target wear channels are as follows: Calculate the thermal entropy value of the storage blocks (reflecting the hot and cold data distribution, such as the entropy value of the hot area is 0.3 and the entropy value of the cold area is 1.8), and generate a compensation factor (the compensation factor for the hot area α = 0.6, the compensation factor for the cold area β = 0.2) in combination with the channel load balancing state (such as the wear rate of channel A is 28% and the wear rate of channel B is 45%); calculate the migration priority through the weighted formula (priority score = entropy value × compensation factor + channel load weight × 0.4). For example, the score of a storage block with an entropy value of 1.2 in a channel with a load weight of 0.7 is 1.2×0.6 + 0.7×0.4 = 1.0; use the hash algorithm (such as BKDRHash modulo the number of channels) to map the sorted storage blocks to the target channel. For example, the hash value 0x3A5 is mapped to channel 3; allocate migration tasks through the polling mechanism (combining the channel weights, the allocation interval of high-load channels is extended by 50%), so as to improve the cross-channel wear difference rate and reduce the write amplification factor and migration operation latency. For example, in the NAND flash memory system, when the wear rate of channel 2 exceeds the threshold of 30%, the storage blocks with the top 10% migration priority (such as the hot data block with an entropy value of 0.5) are mapped to the low-load channel through hashing (such as the wear rate of channel 4 is 18%), and the polling interval is dynamically adjusted to allocate the high-load channel once every 5 operations to achieve global balance.

[0053] S44. Calculate the wear balance degree of each channel and the thermal retention rate of the storage blocks after migration, evaluate the calculation results, and adjust the migration amount based on the evaluation results.

[0054] It should be added that the specific embodiments of calculating the wear balance degree of each channel and the thermal retention rate of the storage blocks after migration, evaluating the calculation results, and adjusting the migration amount based on the evaluation results are as follows: Taking the NAND flash memory system as an example, first calculate the wear leveling degree of each channel after migration (formula: δ = Σ|erase count - global average| / number of channels × 100%, for example, the erase counts of channels A / B / C are 2800 / 3200 / 3000, and the leveling degree δ = (200 + 200 + 0) / 3 = 13.3%), combined with the thermal retention rate (extrapolating the data retention time based on the bit error rate, for example, the retention time of the storage block after migration at 85 °C ≥ 7 days, the thermal retention rate = measured retention time / predicted time × 100% = 92%). If the evaluation result does not meet the standard (such as δ > 15% or the thermal retention rate < 90%), then adjust the migration amount through dynamic migration threshold adjustment (initial threshold Δ = 30%, lower the threshold by 3% for every 5% deviation in the leveling degree) and priority queue weight correction (for every 5% decrease in the thermal retention rate, increase the cold data migration weight α by 0.2). For example, when δ = 18%, trigger a secondary migration, screen the storage blocks with an erase count difference > 250 times (such as the blocks in channel B with an erase count > 3450), and append a 20% migration amount through a probabilistic allocation algorithm (increase the migration probability of the high-wear channel to 70%), so as to improve the channel leveling degree and thermal retention rate, while reducing the number of migration operations (for example, from 120 times a day to 78 times), and reducing the overall write amplification factor.

[0055] As Figure 2 shown, according to another embodiment of the present invention, there is also provided a wear leveling system for solid-state storage, including: A thermal entropy value calculation module 1, configured to divide the solid-state storage device into several logical intervals according to the timing characteristics of data access, and calculate the corresponding thermal entropy value based on the data access behavior of each logical interval; An allocation sequence mapping module 2, configured to construct a cold and hot intensity matrix according to the thermal entropy values of each logical interval, and map the cold and hot intensity matrix to a corresponding storage block allocation sequence based on a binary search tree; A cross-channel allocation module 3, configured to construct an idle storage block resource pool based on the storage block allocation sequence, use a gradient pointer mechanism to cover a preset erase interval, and perform cross-channel storage block allocation in combination with a channel status mask and a probabilistic selection algorithm; A migration operation module 4, configured to sort the storage blocks in each channel in descending order according to the thermal entropy value according to the storage block allocation result, and perform a cross-channel migration operation according to the sorting result.

[0056] In summary, by means of the above technical solutions of the present invention, logical intervals are divided by analyzing timing characteristics to optimize the allocation of storage resources. At the same time, a hot-cold intensity matrix mapping mechanism based on a binary search tree is adopted to achieve an efficient layout of storage blocks, thereby reducing the data migration frequency and storage fragmentation, reducing the write amplification effect, and effectively extending the service life of the solid-state storage device. By introducing a gradient pointer mechanism to dynamically manage the erasure interval and combining a channel state perception algorithm to preferentially use low-wear storage blocks, the erasure and write pressure on a single channel is reduced. Through a probabilistic selection strategy and channel masking technology, the cross-channel resource allocation weight is adaptively adjusted to balance the wear degree of each channel and prevent premature aging in local areas, thereby improving the stability and reliability of the storage medium. Through a migration strategy based on the descending order of thermal entropy, combined with a dynamic priority queue and a hash mapping algorithm, an intelligent reallocation of cross-channel storage blocks is achieved. Through a continuous monitoring and feedback mechanism, the global wear leveling is optimized, the impact of migration operations on system performance is reduced, and the storage response efficiency in high-concurrency scenarios is ensured, providing continuous wear leveling support for the solid-state storage device.

[0057] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A wear leveling method for solid state storage, characterized in that, Including: S1. Divide the solid-state storage device into several logical intervals according to the timing characteristics of data access, and calculate the corresponding thermal entropy values based on the data access behaviors of each logical interval; S2. Construct a cold and hot intensity matrix based on the thermal entropy values of each logical interval, and map the cold and hot intensity matrix to the corresponding storage block allocation sequence based on a binary search tree; S3. Construct an idle storage block resource pool based on the storage block allocation sequence, use the gradient pointer mechanism to cover the preset erasure interval, and perform cross-channel storage block allocation in combination with the channel status mask and the probabilistic selection algorithm; S4. According to the storage block allocation result, sort the storage blocks in each channel in descending order of the thermal entropy value, and perform cross-channel migration operations according to the sorting result; Among them, S2 includes: S23. Perform clustering analysis on the cold and hot intensity matrix according to the hierarchical clustering algorithm, combining the heat score and spatial topological relationship of the logical interval, and divide the logical interval into several cold and hot intervals based on the analysis result.

2. The wear leveling method for solid-state storage according to claim 1, wherein Before constructing the cold and hot intensity matrix based on the thermal entropy values of each logical interval and mapping the cold and hot intensity matrix to the corresponding storage block allocation sequence based on a binary search tree, it includes: S21. Normalize the thermal entropy values of each logical interval to generate a standardized heat score; S22. Based on the numbering order of the logical intervals, fill the standardized heat scores into the corresponding positions of the matrix according to the preset priority rules to construct a cold and hot intensity matrix; After constructing the cold and hot intensity matrix based on the thermal entropy values of each logical interval and mapping the cold and hot intensity matrix to the corresponding storage block allocation sequence based on a binary search tree, it includes: S24. Based on the division result of the cold and hot intervals, construct a binary search tree with the heat score of the logical interval as the key value, and generate a mapping table from logical blocks to storage blocks by in-order traversing the binary search tree to obtain the storage block allocation sequence.

3. The wear leveling method for solid-state storage according to claim 2, wherein The performing clustering analysis on the cold and hot intensity matrix according to the hierarchical clustering algorithm, combining the heat score and spatial topological relationship of the logical interval, and dividing the logical interval into several cold and hot intervals includes: S231. Based on the constructed cold and hot intensity matrix, extract the heat score and spatial topological relationship of each logical interval to construct a multi-dimensional feature matrix; S232. Calculate and fuse the heat similarity and spatial proximity between each logical interval according to the multi-dimensional feature matrix to construct an amplification formula; S233. Combine the hierarchical clustering algorithm and the amplification formula to cluster the logical intervals into clusters to generate a hierarchical tree structure; S234. Based on the generated tree structure, combine the heat distribution and spatial association to set the partitioning criteria, and divide the logical interval into several cold and hot intervals, where the cold and hot intervals include hot areas, cold areas and transition areas.

4. A wear leveling method for solid state storage according to claim 3, characterized in that The expression of the amplification formula is: ; In the formula, represents the logical interval i and j the enhanced distance of i Represents an index value; j Represents an index value; D ( S i , S j ) represents a sequence of heat scores S i The similarity with S j ; S i Represents a logical interval i Of the sequence of heat scores; S j Represents a logical interval j Of the sequence of heat scores; γ Represents a spatial coupling coefficient; D ( i , j ) represents a logical interval i With j The spatial proximity distance; D max Represents the maximum spatial proximity distance; λ ( t ) represents a dynamic decay factor; η Represents a gradient penalty coefficient; Represents a heat gradient.

5. A wear leveling method for solid-state storage according to claim 4, characterized in that, The combining the hierarchical clustering algorithm and the amplification formula to cluster the logical intervals into clusters to generate a hierarchical tree structure includes: S2331. Take each logical interval as an initial class, and construct a global covariance matrix based on the heat similarity and spatial proximity of all logical intervals; S2332. Initialize the covariance matrix of each initial class to half the scale of the corresponding global covariance matrix, and calculate the similarity between any two classes using the amplification formula to generate a similarity matrix; S2333. Select the two classes with the highest similarity from the similarity matrix for merging, calculate the covariance matrix of the new class after merging, and calculate the similarity between the new class and each class using the amplification formula to update the similarity matrix; S2334. Continuously iterate and update the similarity matrix, and detect whether the preset termination condition is met. If so, generate a hierarchical tree structure. Otherwise, return to step S2332 to continue the iteration until the preset termination condition is met.

6. A wear leveling method for solid-state storage according to claim 5, characterized in that, Based on the generated tree structure, combine the heat distribution and spatial correlation, set the partitioning criteria, and divide the logical interval into several cold and hot intervals, including: S2341. Traverse each hierarchical node in the tree structure, calculate the joint entropy value of each hierarchical node based on heat similarity and spatial proximity, and filter out the candidate cutting layers according to the preset entropy value threshold to construct a set of candidate cutting layers; S2342. Based on each candidate cutting layer, combine the heat distribution and spatial correlation, evaluate the score of each candidate cutting layer through weighted scoring, and select the candidate cutting layer with the highest score as the partitioning criterion for logical interval division; S2343. Classify each logical interval according to the selected boundary criterion to obtain several cold and hot intervals, including hot areas, cold areas, and transition areas.

7. A wear leveling method for solid-state storage according to claim 6, characterized in that, Based on the division result of the cold and hot intervals, construct a binary search tree with the heat score of the logical interval as the key value, and generate a mapping table from logical blocks to storage blocks by performing an inorder traversal of the binary search tree to obtain a storage block allocation sequence, including: S241. Based on the division result of the cold and hot intervals, use the heat score of each logical block as the key value to sort the logical blocks and generate an ordered sequence arranged in ascending order of heat score; S242. Select the middle element from the ordered sequence as the root node of the binary search tree, and use the middle element to divide the ordered sequence into two parts. Recursively construct the left subtree and the right subtree based on the division result; S243. Repeat step S242 until all logical blocks are inserted to construct a binary search tree; S244. Perform an inorder traversal on the constructed binary search tree to generate a logical block sequence arranged in descending order of heat score, and establish a mapping relationship table from logical blocks to storage blocks according to the traversal order to obtain a storage block allocation sequence.

8. A wear leveling method for solid-state storage according to claim 1, characterized in that According to the storage block allocation result, sort the storage blocks in each channel in descending order of thermal entropy value, and perform cross-channel migration operations according to the sorting result, including: S41. According to the storage block allocation result, dynamically adjust the weight parameters in the calculation of thermal entropy value using an adaptive algorithm, and sort the storage blocks in each channel in descending order based on the updated thermal entropy value to generate a migration priority queue for each channel; S42. Calculate the wear difference between channels, combine the preset migration trigger threshold and the migration priority queue, filter out the storage blocks to be migrated, and establish a set of storage blocks to be migrated; S43. Perform hash hashing on the storage blocks in the migration set, and evenly distribute the processed storage blocks to the target wear channels; S44. Calculate the wear leveling degree of each channel and the thermal retention rate of the storage blocks after migration, evaluate the calculation results, and adjust the migration amount based on the evaluation results.

9. A wear leveling method for solid state storage according to claim 8, characterized in that, The step of performing hash hashing on the storage blocks in the migration set and evenly distributing the processed storage blocks to the target wear channels includes: S431. Calculate the compensation factor of each storage block according to the thermal entropy value of each storage block and the load balancing state of each channel in the migration operation; S432. Combine the thermal entropy value of the storage block and the corresponding compensation factor, and use the weighted formula to calculate the migration priority of each storage block; S433. Sort all the storage blocks in the migration set in descending order according to the migration priority, and process the sorted storage blocks using the hash hashing algorithm to generate hash mapping values to determine the target wear channels corresponding to each storage block; S434. According to the preset polling mechanism, sequentially allocate the processed storage blocks to the corresponding target wear channels to ensure the even distribution of the storage blocks among different channels; S435. Repeat step S434 until all the storage blocks to be migrated are allocated.

10. A wear leveling system for solid state storage, which is used to implement the wear leveling method of the solid state storage described in any one of claims 1-9, characterized in that, including: A thermal entropy value calculation module, which is used to divide the solid-state storage device into several logical intervals according to the timing characteristics of data access, and calculate the corresponding thermal entropy values based on the data access behaviors of each logical interval; An allocation sequence mapping module, which is used to construct a cold and hot intensity matrix based on the thermal entropy values of each logical interval, and map the cold and hot intensity matrix to the corresponding storage block allocation sequence based on the binary search tree; A cross-channel allocation module, which is used to construct an idle storage block resource pool based on the storage block allocation sequence, use the gradient pointer mechanism to cover the preset erasure interval, and perform cross-channel storage block allocation in combination with the channel state mask and the probabilistic selection algorithm; A migration operation module, which is used to sort the storage blocks in each channel in descending order according to the thermal entropy value according to the storage block allocation result, and perform cross-channel migration operations according to the sorting result.

Citation Information

Patent Citations

  • Combined distortion estimation and error correction coding for memory devices

    CN101512661A

  • Memory management method, memory control circuit unit and memory storage device

    CN105988950A

  • Fuel cell air compressor heat dissipation method, device and equipment

    CN119878497A