Solid state disk service life prolonging method based on wear leveling algorithm
By collecting and evaluating the physical block wear status and logical block access thermal data of solid-state drives in real time, dynamic wear leveling strategy matching and data migration are performed, solving the problem of slow response of wear leveling strategies in existing technologies and improving the lifespan extension and reliability of solid-state drives.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN PANSHI TECH CO LTD
- Filing Date
- 2026-03-25
- Publication Date
- 2026-04-21
AI Technical Summary
In existing technologies, solid-state drive (SSD) lifespan extension methods based on wear leveling algorithms cannot detect sudden changes in write load in real time, resulting in a delayed response of the wear leveling strategy. This makes it impossible to promptly alleviate the concentrated wear on specific physical blocks caused by sudden writes, thus reducing the lifespan extension effect.
By collecting physical block wear status data and logical block access thermal data of solid-state drives, a global health assessment is performed to generate wear leveling strategy trigger judgments. Physical block aging cluster analysis and logical data hot and cold partition mapping are also performed to dynamically match wear leveling strategies, execute data migration and address remapping, and achieve wear leveling.
It enables real-time sensing of write load changes, timely adjustment of balancing strategies, mitigation of concentrated wear, and improvement of the timeliness and accuracy of lifespan extension effects, while ensuring the availability and reliability of the hard drive.
Smart Images

Figure CN121900710A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data storage technology, specifically to a method for extending the lifespan of solid-state drives based on wear leveling algorithms. Background Technology
[0002] With the rapid development of computer technology and the arrival of the digital age, the frequent use of digital and network technologies in daily life, scientific research, and corporate operations has led to an explosive growth in data. The generation of data often requires storage or recording, which compels the rapid development of storage technology to meet the demands for data storage. Solid-state drives (SSDs), also known as solid-state drives, are hard drives made using arrays of solid-state electronic storage chips. Due to their high performance, low power consumption, and strong shock resistance, SSDs have gradually become an important component of modern computer systems and data storage devices.
[0003] Currently, SSD lifespan extension methods based on wear leveling algorithms typically rely on static and periodic assessments of physical block wear states to trigger leveling operations. These methods cannot detect and adapt to sudden changes in write load and dynamic migrations of data access locality in real time. When load characteristics change drastically within the assessment interval, the wear leveling strategy will be slow to respond and will not be able to alleviate the concentrated wear caused by sudden writes on specific physical blocks in a timely manner, thereby reducing the lifespan extension effect.
[0004] Therefore, a method for extending the lifespan of solid-state drives based on wear leveling algorithms is proposed to solve the above problems. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this invention provides a method for extending the lifespan of solid-state drives based on a wear leveling algorithm. This method solves the problem mentioned in the background section that the concentrated wear caused by sudden writes to specific physical blocks cannot be mitigated in a timely manner, thereby reducing the lifespan extension effect.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for extending the lifespan of a solid-state drive based on a wear leveling algorithm, the method comprising the following steps: S1. Collect physical block wear status data and logical block access thermal data of the solid-state drive; S2. Based on the physical block wear status data and logical block access thermal data, perform global health assessment of the solid-state drive to generate global health feature data of the solid-state drive. S3. Based on the global health feature data of the solid-state drive, perform wear leveling strategy trigger judgment processing, generate wear leveling strategy trigger identification data, and when the identification is that wear leveling is not required, the process ends. S4. When it is identified that equalization is required, perform physical block aging cluster analysis based on the physical block wear state data to generate physical block wear cluster feature data. S5. Based on the access thermal data of the logical block, perform logical data hot and cold partition mapping processing to generate logical data access thermal partition data; S6. Based on the physical block wear clustering feature data and the logical data access thermal partition data, perform dynamic matching processing of wear leveling strategy to generate target dynamic wear leveling algorithm type feature data; S7. Based on the target dynamic wear leveling algorithm type feature data, the physical block wear clustering feature data and the logical data access thermal partition data, perform physical block and logical data collaborative migration planning processing to generate a physical block data migration planning table. S8. Based on the physical block data migration plan table, perform lossless data migration and address remapping processing in the background of the solid-state drive controller to generate updated physical block address mapping table data.
[0007] Preferably, the step S1 of collecting physical block wear status data and logical block access thermal data of the solid-state drive includes the following steps: S11. Through the health status monitoring unit embedded in the solid-state drive controller, read the programmable erase count, actual erase count, read error rate and data retention time parameters of each physical block at a predetermined period, and perform normalization and time series marking to generate physical block wear status data. S12. Through the logical address access tracking unit of the solid-state drive controller, the read and write operation frequency, data update frequency and continuous access pattern characteristics of each logical block address within a unit of time are statistically analyzed in real time to generate logical block access heat data.
[0008] Preferably, the global health assessment of the solid-state drive in step S2 includes the following steps: S21. Obtain the actual number of erasures of all physical blocks in the physical block wear status data, calculate its variance and maximum value, and generate the physical block wear dispersion index. S22. Obtain the access heat data of the logic block, identify the set of physical blocks mapped by the logic block that has been in a high access frequency for a long time, and generate hot spot physical block set data. S23. Combining the physical block wear dispersion index with the hot spot physical block set data, a weighted scoring model is used to calculate the overall health score of the current solid-state drive, and it is classified into healthy, sub-healthy and risky states according to a preset threshold to generate global health feature data of the solid-state drive.
[0009] Preferably, the wear leveling strategy triggering judgment process in S3 includes the following steps: S31. Obtain the global health status feature data of the solid-state drive; S32. When the global health feature data of the solid-state drive is in a healthy state, the wear leveling strategy trigger flag data is output as no leveling is required. S33. When the global health characteristic data of the solid-state drive is in a sub-healthy or risky state, it is further determined whether the physical block wear dispersion index exceeds the dynamic threshold. If it does, the wear leveling strategy trigger flag data is output as wear leveling is required.
[0010] Preferably, the physical block aging clustering analysis in step S4 includes the following steps: S41. When the wear leveling strategy triggers the identification data as requiring leveling, obtain the wear status time sequence data of all physical blocks. S42. A density-based clustering algorithm is used to group all physical blocks, and physical blocks with wear rates higher than the average and the ratio of actual erase counts to maximum programmable erase counts greater than a preset threshold are classified as high-aging-risk physical block clusters. S43. Classify physical blocks with a gradual wear rate and an actual number of wipes below a preset threshold as low-aging-risk physical block clusters; S44. Integrate the classification information of the high-aging-risk physical block clusters and the low-aging-risk physical block clusters to generate physical block wear clustering feature data.
[0011] Preferably, the logical data hot and cold partition mapping process in S5 includes the following steps: S51. Obtain the access heat data of the logic block and analyze the temporal locality and spatial locality of the access to the logic block address; S52. Based on the access frequency threshold, the logical address space is divided into a continuous high-frequency access region, an intermittent medium-frequency access region, and a long-term low-frequency access region. S53. Mark the continuous high-frequency access area as a high-hot access logical data partition, and mark the long-term low-frequency access area as a low-hot access logical data partition. S54. Integrate the partitioning information of the high-hot access logical data partition and the low-hot access logical data partition to generate logical data access hot partition data.
[0012] Preferably, the dynamic matching process for wear leveling strategy in S6 includes the following steps: S61. Establish a pre-stored dynamic wear leveling strategy matching rule set. This rule set is constructed based on the cold and hot data exchange equalization logic. It associates multiple sets of standardized physical block wear clustering features with logical data access thermal partition matching mode feature data. These multiple sets of matching mode feature data constitute standard matching mode feature data. S62. Combine the currently obtained physical block wear clustering feature data with the logical data access thermal partitioning data to form a real-time matching feature vector; S63. Calculate the similarity between the real-time matching feature vector and the standard matching pattern feature data, and select the algorithm type with the highest similarity using an optimized search algorithm; S64. Encapsulate the selected algorithm type and its initialization parameters to generate target dynamic wear equalization algorithm type feature data.
[0013] Preferably, the physical block and logical data collaborative migration planning process in S7 includes the following steps: S71. Parse the target dynamic wear leveling algorithm type feature data to obtain its specified leveling logic; S72. Based on the cold and hot data exchange logic, a migration plan is carried out, specifically: the high-hot access partition data stored in the high-aging-risk physical block cluster is migrated to the low-aging-risk physical block cluster, and at the same time, the low-hot access partition data stored in some low-aging-risk physical block clusters is migrated back to the high-aging-risk physical block clusters that have been vacated due to the aforementioned migration. S73. Based on the migration plan, specify the source physical block address, target physical block address, data length and migration priority for each group of data migration, and generate a physical block data migration plan table.
[0014] Preferably, the lossless data migration and address remapping process in step S8 includes the following steps: S81. During background idle periods, the solid-state drive controller initiates the data migration process according to the physical block data migration plan table. S82. Perform data reading, verification and writing operations on a page-by-page basis, and update the logical-to-physical address mapping relationship in the flash translation layer after each data unit migration is completed; S83. After all planned migration tasks have been completed, integrate the updated mapping items and generate updated physical block address mapping table data.
[0015] Preferably, after generating the updated physical block address mapping table data, the method further includes S9: performing write amplification factor optimization verification processing based on the updated physical block address mapping table data and the wear status of the migrated physical blocks, and generating this wear leveling performance evaluation report, specifically including the following steps: S91. During a monitoring cycle after the data migration is completed, collect the total amount of writes to the solid-state drive, the actual number of physical erases, and the resources and time consumed in the data migration process. S92. Based on the total amount written and the number of physical erases, calculate the write amplification factor after this equalization operation, and compare it with the historical write amplification factor in the same time period before the equalization operation to obtain the improvement degree of write amplification factor. S93. Monitor and evaluate the changes in access pressure of high-aging-risk physical block clusters in the physical block wear clustering feature data after migration, and analyze the wear rate changes based on historical and current wear rate data. S94. Based on the improvement of the write amplification factor, the change in the wear rate, and the migration process overhead determined based on the resources and time consumed, generate a wear leveling performance evaluation report containing quantitative indicators. S95. Summarize and analyze the current wear leveling performance evaluation report and historical wear leveling records, and update the parameters of the solid-state drive life prediction model.
[0016] Compared with existing technologies, this invention provides a method for extending the lifespan of solid-state drives based on wear leveling algorithms, which has the following beneficial effects: 1. In this invention, when performing wear leveling on a solid-state drive to extend its lifespan, by collecting logical block access thermal data in real time and dynamically updating the logical data hot and cold partitions, it is possible to sense and adapt to sudden changes in write load and dynamic migration of data access locality. Thus, when load characteristics change, the leveling strategy can be adjusted in a timely manner to alleviate the concentrated wear caused by sudden writes on specific physical blocks, thereby improving the timeliness and effectiveness of the lifespan extension effect.
[0017] 2. In this invention, when making wear leveling decisions for solid-state drives (SSDs), the system comprehensively considers the global health of the SSD, physical block wear clustering features, and logical data access to multi-dimensional state data of thermal partitions. It also performs dynamic similarity matching with multiple pre-stored matching modes. This allows the system to adaptively select the optimal leveling strategy based on real-time, multi-dimensional internal state depth of the hard drive, reducing strategy selection bias and improving the accuracy and efficiency of wear leveling.
[0018] 3. In this invention, when performing wear leveling data migration, the migration is planned to be performed during the idle period in the background of the controller. The improvement of write amplification factor, wear rate change and migration process overhead are comprehensively analyzed after the migration is completed. This allows for the consideration and optimization of the additional write overhead and input / output performance interference brought about by the migration operation itself, thereby extending the overall lifespan while ensuring the overall availability and reliability of the solid-state drive. Attached Figure Description
[0019] Figure 1 This is a flowchart of the solid-state drive lifespan extension method based on wear leveling algorithm of the present invention; Figure 2 This is a schematic diagram of the logical data access thermal partitioning in this invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] For specific implementation examples, please refer to: Figures 1-2 A method for extending the lifespan of solid-state drives based on wear leveling algorithms, comprising the following steps: S1. Collect physical block wear status data and logical block access thermal data of the solid-state drive; S2. Based on physical block wear status data and logical block access thermal data, perform global health assessment of the solid-state drive to generate global health feature data of the solid-state drive. S3. Based on the global health characteristic data of the solid-state drive, perform wear leveling strategy trigger judgment and generate wear leveling strategy trigger identification data. When the identification is that wear leveling is not required, the process ends. S4. When it is identified as needing to be balanced, perform physical block aging cluster analysis based on physical block wear state data to generate physical block wear cluster feature data. S5. Based on the logical block access thermal data, perform logical data cold and hot partition mapping processing to generate logical data access thermal partition data; S6. Based on the physical block wear clustering feature data and logical data, access the thermal partition data to perform dynamic matching processing of wear leveling strategies, and generate target dynamic wear leveling algorithm type feature data. S7. Based on the target dynamic wear leveling algorithm type feature data, physical block wear clustering feature data and logical data access thermal partition data, perform physical block and logical data collaborative migration planning processing to generate a physical block data migration planning table. S8. Based on the physical block data migration plan, perform lossless data migration and address remapping in the background of the solid-state drive controller to generate updated physical block address mapping table data.
[0022] The steps involved in collecting physical block wear status data and logical block access thermal data of the solid-state drive in S1 are as follows: S11. Through the health status monitoring unit embedded in the solid-state drive controller, read the programmable erase count, actual erase count, read error rate and data retention time parameters of each physical block at a predetermined period, and perform normalization and time series marking to generate physical block wear status data. S12. Through the logical address access tracking unit of the solid-state drive controller, the read and write operation frequency, data update frequency and continuous access pattern characteristics of each logical block address within a unit of time are statistically analyzed in real time to generate logical block access heat data.
[0023] The S2 process for global health assessment of solid-state drives includes the following steps: S21. Obtain the actual number of erasures of all physical blocks in the physical block wear status data, calculate its variance and maximum value, and generate the physical block wear dispersion index. S22. Obtain logical block access heat data, identify the set of physical blocks mapped by logical blocks that have been accessed at high frequency for a long time, and generate hot spot physical block set data. S23. Combining the physical block wear dispersion index with the hot spot physical block set data, a weighted scoring model is used to calculate the overall health score of the current solid-state drive, and it is classified into healthy, sub-healthy, and risky states according to preset thresholds to generate global health feature data of the solid-state drive, including the following steps: S231. Set a first weighting coefficient for the physical block wear dispersion index and a second weighting coefficient for the average wear rate of the physical blocks corresponding to the hot spot physical block set data. S232. Normalize the physical block wear dispersion index and the average wear rate respectively to obtain the corresponding normalized dispersion value and normalized wear rate value. S233. The overall health score is calculated by adding the product of the first weighting coefficient and the normalized dispersion value to the product of the second weighting coefficient and the normalized wear rate value. The calculation formula is as follows: ; in, This indicates the overall health score. This represents the first weighting coefficient set for the physical block wear dispersion index. This represents the normalized physical block wear dispersion value. This represents the second weighting coefficient used to set the average wear rate of hotspot physical blocks. This represents the normalized average wear rate of the hotspot physical block. S234. Based on the preset score threshold range, calculate the overall health score. It is mapped to healthy, sub-healthy, and risky states.
[0024] The wear leveling strategy triggering process in S3 includes the following steps: S31. Obtain global health status data of the solid-state drive; S32. When the global health status data of the solid-state drive is healthy, the wear leveling strategy trigger flag data is output as no leveling is required. S33. When the global health characteristic data of the solid-state drive is in a sub-healthy or risky state, further determine whether the physical block wear dispersion index exceeds the dynamic threshold. If it does, output the wear leveling strategy trigger flag data indicating that leveling is required. The dynamic threshold... It is not a fixed value; it is dynamically adjusted based on the historical health status and real-time load of the solid-state drive. The calculation method is as follows: ; in, This represents the average value of the physical block wear dispersion index over recent historical periods. Its standard deviation, This is the tolerance factor set according to the preset reliability level of the solid-state drive. This is the load fluctuation correction calculated based on the thermal data accessed in the current logic block.
[0025] The physical block aging clustering analysis in S4 includes the following steps: S41. When the wear leveling strategy triggers the flag data indicating that leveling is required, obtain the wear status time-series data of all physical blocks. S42. A density-based clustering algorithm is used to group all physical blocks, and physical blocks with wear rates higher than the average and the ratio of actual erase counts to maximum programmable erase counts greater than a preset threshold are classified as high-aging-risk physical block clusters. The process of grouping all physical blocks using a density-based clustering algorithm includes the following steps: S421. Taking each physical block as an object, based on the collected physical block wear state data, extract its actual number of erasures as one of the features, and calculate its wear rate. The calculation formula is: ; in, This represents the actual number of times the physical block was erased at the end of the current statistical period. This represents the actual number of times the physical block was erased at the end of the previous statistical period. The time interval between two statistical periods; S422, based on actual number of erasures and the calculated wear rate The two-dimensional feature vectors that constitute this physical block ; S423, Set neighborhood radius parameter With the minimum number of points parameter MinPts, and the neighborhood radius parameter The recommended values are determined based on the statistical distribution of the Euclidean distances between the eigenvectors of all physical blocks, and the pairwise Euclidean distances between all physical blocks are calculated. , It can be set to the distance sample percentiles, among which The value range is [5, 10]; this setting enables the algorithm to capture local dense patterns of physical blocks in the wear feature space; the suggested value for the minimum number of points parameter MinPts is related to the total number of physical blocks on the solid-state drive. The relevant empirical calculation formula is as follows: ; in, The function is the natural logarithm. This setting makes the identified physical block clusters statistically significant and can filter out noise points composed of individual abnormal wear blocks. For any two physical blocks, the feature vectors and When its Euclidean distance is less than or equal to Then it is called exist of Within the neighborhood, the distance is calculated using the following formula: ; in, Represents Euclidean distance. , Representing physical blocks and physical blocks Two-dimensional feature vectors, , Representing physical blocks and physical blocks The actual number of times to erase, , Representing physical blocks and physical blocks The wear rate, Represents the neighborhood radius parameter; When a physical block - If the number of physical blocks contained in the neighborhood is not less than MinPts, then the physical block is marked as a core point; based on the density reachability and density accessibility relationship of the core point, all density-connected physical block objects are divided into the same cluster; S424. Mark physical blocks containing fewer than the minimum number of physical blocks (MinPts) and not contained in any high-density region as noise points and classify them into the nearest cluster. S425. Based on the mean of the feature vectors of all physical blocks in each cluster, calculate the average actual number of erasures and the average wear rate of the cluster. The specific criteria for classifying physical blocks with wear rates higher than average and actual erase counts close to the maximum programmable erase count as high-risk physical block clusters include the following steps: S426. Calculate the arithmetic mean of the wear rates of all physical blocks and the arithmetic mean of the actual number of erases. ; S427, Set the wear rate threshold coefficient and the ratio of the number of erases to the threshold For a physical block, when its wear rate and actual number of erases If the following inequalities are satisfied, the block is initially marked as a high-risk candidate block: ; in, Represents physical blocks The wear rate, This represents the wear rate threshold coefficient. This represents the arithmetic mean of the wear rates of all physical blocks. Represents physical blocks The actual number of times to erase, The maximum programmable number of erases for a physical block. This indicates the percentage of the threshold number of erase attempts; S428. Perform the density-based clustering described above on all initially labeled high-risk candidate blocks to ultimately form a high-aging-risk physical block cluster; S43. Classify physical blocks with a gradual wear rate and an actual number of wipes below a preset threshold as low-aging-risk physical block clusters; S44. Integrate the classification information of physical block clusters with high aging risk and those with low aging risk to generate physical block wear clustering feature data.
[0026] The logical data hot / cold partition mapping process in S5 includes the following steps: S51. Obtain logical block access heat data and analyze the temporal and spatial locality of logical block address access, including the following steps: S511, Temporal Locality Analysis: Within a preset time window Within, trace the address of the same logical block. The distribution of time intervals of repeated visits, and the calculation of their average visit time interval. variance of the access interval The calculation formula is: ; ; in, In the time window Internal Total number of visits For the summation index, For the first The timestamp of the first visit. For the first Timestamp of the second visit The time interval between two consecutive visits; S512, Locality of Access Analysis: Within a preset logical address space range Internally, it identifies consecutively accessed logical block address sequences and counts the frequency of such sequences. The calculation formula is: ; in, In the logical address space range The frequency of consecutive access sequences within the sequence. The number of address sequences required to satisfy the "contiguous and proximity access conditions" In the logical address space range The total number of input / output operations that occur within the specified time. S513, Based on average access time interval Variance of access interval and the frequency of consecutive access sequences The locality strength of each logical block address is comprehensively determined and used as one of the bases for dividing the access area; S52. Based on the access frequency threshold, the logical address space is divided into a continuous high-frequency access region, an intermittent medium-frequency access region, and a long-term low-frequency access region, including the following steps: S521, Statistics within a Time Window Within, the address of each logical block Total number of visits ; S522, Set high frequency threshold and low frequency threshold ; S523. Determine partitioning based on total access count: when... Then the When it is included in the continuous high-frequency access zone, Then it will be classified into the long-term low-frequency access zone, when If so, it is classified as an intermittent medium-frequency access region; S53. Mark areas with continuous high-frequency access as high-hot access logical data partitions and areas with long-term low-frequency access as low-hot access logical data partitions. S54. Integrate the partitioning information of high-hot access logical data partitions and low-hot access logical data partitions to generate logical data access hot partition data.
[0027] The dynamic matching process for wear leveling strategy in S6 includes the following steps: S61. Establish a pre-stored dynamic wear leveling strategy matching rule set. This rule set is constructed based on the cold and hot data exchange equalization logic. It associates multiple sets of standardized physical block wear clustering features with logical data access thermal partition matching mode feature data. These multiple sets of matching mode feature data constitute standard matching mode feature data. S62. Combine the currently obtained physical block wear clustering feature data with the logical data access thermal partition data to form a real-time matching feature vector; S63. Calculate the similarity between the real-time matching feature vector and the standard matching pattern feature data, and select the algorithm type with the highest similarity using an optimized search algorithm, including the following steps: S631, Real-time matching feature vectors The first in the feature data of matching the standard pattern Group pattern feature vector Each of them is vectorized and aligned; S632. Calculate the real-time matching feature vector using the cosine similarity algorithm. With each set of standard pattern feature vectors The cosine of the angle between them is used as the similarity score. The calculation formula is as follows: ; in, The dimension of the feature vector. and They are vectors and In the Components in the dimension; S633, calculate the cosine value As a similarity score, the standard matching pattern with the highest score is determined to be the most similar matching pattern; S64. Encapsulate the selected algorithm type and its initialization parameters to generate target dynamic wear equalization algorithm type feature data.
[0028] The steps involved in the collaborative migration planning of physical blocks and logical data in S7 are as follows: S71. Analyze the target dynamic wear equalization algorithm type feature data and obtain its specified equalization logic; S72. Based on the cold and hot data exchange logic, a migration plan is carried out, specifically: the high-hot access partition data stored in the high-aging-risk physical block cluster is migrated to the low-aging-risk physical block cluster, and at the same time, the low-hot access partition data stored in some low-aging-risk physical block clusters is migrated back to the high-aging-risk physical block clusters that have been vacated due to the aforementioned migration. S73. Based on the migration plan, specify the source physical block address, target physical block address, data length, and migration priority for each group of data migration, and generate a physical block data migration plan table, including the following steps: S731. For each set of data to be migrated, calculate its priority score. This score is determined by the risk level coefficient of the source physical block. Popularity level coefficient of logical data The calculation formula is as follows, jointly determined: ; in, This is the preset balance coefficient; S732, based on the calculated priority score Sort all data groups to be migrated in descending order, with higher scores having higher priority, and prioritize them in the physical block data migration planning table.
[0029] The lossless data migration and address remapping process in S8 includes the following steps: During background idle periods, the S81 solid-state drive controller initiates the data migration process based on the physical block data migration plan. S82. Perform data reading, verification and writing operations on a page-by-page basis, and update the logical-to-physical address mapping relationship in the flash translation layer after each data unit migration is completed; S83. After all planned migration tasks have been completed, integrate the updated mapping items and generate updated physical block address mapping table data.
[0030] After generating the updated physical block address mapping table data, the method also includes S9: performing write amplification factor optimization and verification based on the updated physical block address mapping table data and the wear status of the migrated physical blocks, and generating this wear leveling performance evaluation report, which specifically includes the following steps: S91. During a monitoring cycle after the data migration is completed, collect the total amount of writes to the solid-state drive, the actual number of physical erases, and the resources and time consumed in the data migration process. S92. Based on the total write volume and the number of physical erases, calculate the write amplification factor after this leveling operation, and compare it with the historical write amplification factor within the same time period before the leveling operation to obtain the improvement in write amplification factor, including the following steps: S921, Total Write Amount Based on Data Acquisition And the actual number of physical erases Calculate the write amplification factor after this equalization operation. The calculation formula is: ; in, This represents the total amount of data written by the host to the solid-state drive during the monitoring period. The actual number of physical erases that occurred on the solid-state drive flash memory media within the same monitoring period; S922. Retrieve from the historical balancing record database the records from monitoring periods of equal length prior to this balancing operation. Historical write magnification factor ; S923, Calculation The arithmetic mean of the historical write magnification factors is used as the baseline value for the historical write magnification factors. The calculation formula is: ; in, This indicates the historical amplification factor baseline value. This indicates the number of historical write amplification factor records retrieved. For the summation index, Indicates the first Record the amplification factor in the historical data; S924. Calculate the write magnification factor after this equalization operation. Compared with historical benchmarks The difference is calculated by dividing the difference by the historical baseline value to obtain the improvement in the write amplification factor. The percentage value is calculated using the following formula: ; in, This indicates the degree of improvement in write amplification brought about by this equalization operation; S93. Monitor and evaluate the changes in access pressure of high-aging-risk physical block clusters in physical block wear clustering feature data after migration, and analyze the changes in wear rate based on historical and current data of their wear rate. S94. Based on the improvement of the overall write amplification factor, the change in wear rate, and the migration process overhead determined based on the resources and time consumed, generate a wear leveling effectiveness assessment report containing quantitative indicators. S95. Summarize and analyze this wear leveling performance evaluation report with historical leveling records, and update the parameters of the solid-state drive lifespan prediction model, including the following steps: S951. Obtain the quantitative indicators and historical leveling records from this wear leveling performance evaluation report, and extract the input feature parameters of the solid-state drive life prediction model. The input feature parameters include the average wear rate of physical blocks, the evolution trend of wear dispersion index, the mean and improvement of historical write amplification factor, the access frequency of high-heat access data area, and the average cycle of historical leveling operations. S952. The feature vector formed by the extracted input feature parameters, along with the corresponding observed values of the solid-state drive's lifespan status, is input into the lifespan prediction model constructed based on the recursive least squares method. The model weight parameters are iteratively updated, and the parameter update calculation satisfies the following formula: ; in, Indicates the first The updated model weight parameter vector Indicates the first The updated model weight parameter vector To be based on the feature vector The gain matrix calculated from historical data, This represents the current lifetime state observation. Indicates the transpose operation; S953, Utilizing the updated model weight parameters Calculate the updated predicted remaining lifespan of the solid-state drive using the current input feature parameters.
[0031] The operation steps of this solid-state drive lifespan extension method based on wear leveling algorithm are as follows: Step 1: Data Acquisition and Solid State Drive Health Assessment First, the monitoring unit embedded in the SSD controller periodically collects parameters such as the programmable erase count, actual erase count, read error rate, and data retention time for each physical block, generating physical block wear status data. Simultaneously, the logical address access tracking unit statistically analyzes the read / write frequency and access patterns of each logical block address in real time, generating logical block access thermal data. Based on these two types of data, the dispersion of physical block wear is calculated. Combined with the set of hot physical blocks mapped from frequently accessed logical blocks, a weighted scoring model is used to assess the overall health of the SSD, generating global health characteristic data and classifying it into healthy, sub-healthy, and risky states.
[0032] Step 2: Balanced Trigger Judgment and In-depth Data Feature Analysis: When the health assessment result is in a sub-healthy or risky state, and the wear dispersion of physical blocks exceeds the dynamic threshold, the wear leveling strategy is triggered. After entering the leveling process, on the one hand, in-depth analysis of the physical block wear status data is performed. Using a density-based clustering algorithm, based on the actual number of erases and wear rate of each physical block, all physical blocks are divided into high-aging-risk physical block clusters and low-aging-risk physical block clusters, and integrated to generate physical block wear clustering feature data. On the other hand, access time and spatial locality analysis is performed on the logical block access thermal data. Based on the access frequency threshold, the logical address space is divided into high-hot-access logical data partitions and low-hot-access logical data partitions, and integrated to generate logical data access thermal partition data.
[0033] Step 3: Dynamic Strategy Matching and Collaborative Migration Planning The physical block wear clustering feature data generated in the above steps is combined with the logical data access thermal partitioning data to form a real-time feature vector. This vector is then compared with pre-stored standard matching pattern feature data to calculate similarity, dynamically matching and selecting the optimal balancing strategy type, generating feature data for the target dynamic wear balancing algorithm type. Next, this feature data is parsed, and a specific migration plan is executed according to the hot and cold data exchange logic: high-heat access partition data stored in high-aging-risk physical block clusters is migrated out to low-aging-risk physical block clusters; simultaneously, some low-heat access partition data stored in low-aging-risk physical block clusters is migrated back to the vacated physical block space, and finally, a detailed physical block data migration plan table is generated, specifying the source address, target address, and priority for each migration.
[0034] Step 4: Background migration execution and load balancing performance verification: When the SSD controller detects a background idle period, it initiates a data migration process page by page based on the physical block data migration plan, updating the logical-to-physical address mapping in real time during the migration. After all migration tasks are completed, the updated physical block address mapping table is generated. In a subsequent monitoring cycle, the actual total write volume, physical erase counts, and migration process overhead are collected. The write amplification improvement after this wear leveling operation is calculated, and the wear rate change after migrating high-risk physical block clusters is assessed. These quantitative indicators are combined to generate a wear leveling performance evaluation report containing specific improvement data.
[0035] Step 5: Historical Learning and Life Prediction Model Iteration: Finally, the generated performance evaluation report is summarized and compared with the records previously stored in the historical balancing database. Based on the analysis results, the weight parameters of key features related to wear rate and write amplification factor improvement in the SSD lifespan prediction model are dynamically adjusted to complete the iterative update of model parameters. This makes the lifespan prediction and balancing strategy triggering and matching more accurate, forming a self-learning and optimization closed-loop system.
[0036] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0037] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for extending the lifespan of solid-state drives based on wear leveling algorithms, characterized in that: The method includes the following steps: S1. Collect physical block wear status data and logical block access thermal data of the solid-state drive; S2. Based on the physical block wear status data and logical block access thermal data, perform global health assessment of the solid-state drive to generate global health feature data of the solid-state drive. S3. Based on the global health feature data of the solid-state drive, perform wear leveling strategy trigger judgment processing, generate wear leveling strategy trigger identification data, and when the identification is that wear leveling is not required, the process ends. S4. When it is identified that equalization is required, perform physical block aging cluster analysis based on the physical block wear state data to generate physical block wear cluster feature data. S5. Based on the access thermal data of the logical block, perform logical data hot and cold partition mapping processing to generate logical data access thermal partition data; S6. Based on the physical block wear clustering feature data and the logical data access thermal partition data, perform dynamic matching processing of wear leveling strategy to generate target dynamic wear leveling algorithm type feature data; S7. Based on the target dynamic wear leveling algorithm type feature data, the physical block wear clustering feature data and the logical data access thermal partition data, perform physical block and logical data collaborative migration planning processing to generate a physical block data migration planning table. S8. Based on the physical block data migration plan table, perform lossless data migration and address remapping processing in the background of the solid-state drive controller to generate updated physical block address mapping table data.
2. The method for extending the lifespan of a solid-state drive based on a wear leveling algorithm according to claim 1, characterized in that: The steps in S1 to collect physical block wear status data and logical block access thermal data of the solid-state drive include the following: S11. Through the health status monitoring unit embedded in the solid-state drive controller, read the programmable erase count, actual erase count, read error rate and data retention time parameters of each physical block at a predetermined period, and perform normalization and time series marking to generate physical block wear status data. S12. Through the logical address access tracking unit of the solid-state drive controller, the read and write operation frequency, data update frequency and continuous access pattern characteristics of each logical block address within a unit of time are statistically analyzed in real time to generate logical block access heat data.
3. The method for extending the lifespan of a solid-state drive based on a wear leveling algorithm according to claim 2, characterized in that: The S2 step of performing a global health assessment of the solid-state drive includes the following steps: S21. Obtain the actual number of erasures of all physical blocks in the physical block wear status data, calculate its variance and maximum value, and generate the physical block wear dispersion index. S22. Obtain the access heat data of the logic block, identify the set of physical blocks mapped by the logic block that has been in a high access frequency for a long time, and generate hot spot physical block set data. S23. Combining the physical block wear dispersion index with the hot spot physical block set data, a weighted scoring model is used to calculate the overall health score of the current solid-state drive, and it is classified into healthy, sub-healthy and risky states according to a preset threshold to generate global health feature data of the solid-state drive.
4. The method for extending the lifespan of a solid-state drive based on a wear leveling algorithm according to claim 3, characterized in that: The wear leveling strategy triggering judgment process in S3 includes the following steps: S31. Obtain the global health status feature data of the solid-state drive; S32. When the global health feature data of the solid-state drive is in a healthy state, the wear leveling strategy trigger flag data is output as no leveling is required. S33. When the global health characteristic data of the solid-state drive is in a sub-healthy or risky state, it is further determined whether the physical block wear dispersion index exceeds the dynamic threshold. If it does, the wear leveling strategy trigger flag data is output as wear leveling is required.
5. The method for extending the lifespan of a solid-state drive based on a wear leveling algorithm according to claim 4, characterized in that: The physical block aging clustering analysis in step S4 includes the following steps: S41. When the wear leveling strategy triggers the identification data as requiring leveling, obtain the wear status time-series data of all physical blocks. S42. A density-based clustering algorithm is used to group all physical blocks, and physical blocks with wear rates higher than the average and the ratio of actual erase counts to maximum programmable erase counts greater than a preset threshold are classified as high-aging-risk physical block clusters. S43. Classify physical blocks with a gradual wear rate and an actual number of wipes below a preset threshold as low-aging-risk physical block clusters; S44. Integrate the classification information of the high-aging-risk physical block clusters and the low-aging-risk physical block clusters to generate physical block wear clustering feature data.
6. The method for extending the lifespan of a solid-state drive based on a wear leveling algorithm according to claim 3, characterized in that: The logical data hot / cold partition mapping process in S5 includes the following steps: S51. Obtain the access heat data of the logic block and analyze the temporal locality and spatial locality of the access to the logic block address; S52. Based on the access frequency threshold, the logical address space is divided into a continuous high-frequency access region, an intermittent medium-frequency access region, and a long-term low-frequency access region. S53. Mark the continuous high-frequency access area as a high-hot access logical data partition, and mark the long-term low-frequency access area as a low-hot access logical data partition. S54. Integrate the partitioning information of the high-hot access logical data partition and the low-hot access logical data partition to generate logical data access hot partition data.
7. The method for extending the lifespan of a solid-state drive based on a wear leveling algorithm according to claim 5, characterized in that: The dynamic matching process for wear leveling strategy in S6 includes the following steps: S61. Establish a pre-stored dynamic wear leveling strategy matching rule set. This rule set is constructed based on the cold and hot data exchange equalization logic. It associates multiple sets of standardized physical block wear clustering features with logical data access thermal partition matching mode feature data. These multiple sets of matching mode feature data constitute standard matching mode feature data. S62. Combine the currently obtained physical block wear clustering feature data with the logical data access thermal partitioning data to form a real-time matching feature vector; S63. Calculate the similarity between the real-time matching feature vector and the standard matching pattern feature data, and select the algorithm type with the highest similarity using an optimized search algorithm; S64. Encapsulate the selected algorithm type and its initialization parameters to generate target dynamic wear equalization algorithm type feature data.
8. The method for extending the lifespan of a solid-state drive based on a wear leveling algorithm according to claim 7, characterized in that: The S7 process for co-migrating physical blocks and logical data includes the following steps: S71. Parse the target dynamic wear leveling algorithm type feature data to obtain its specified leveling logic; S72. Based on the cold and hot data exchange logic, a migration plan is carried out, specifically: the high-hot access partition data stored in the high-aging-risk physical block cluster is migrated to the low-aging-risk physical block cluster, and at the same time, the low-hot access partition data stored in some low-aging-risk physical block clusters is migrated back to the high-aging-risk physical block clusters that have been vacated due to the aforementioned migration. S73. Based on the migration plan, specify the source physical block address, target physical block address, data length and migration priority for each group of data migration, and generate a physical block data migration plan table.
9. The method for extending the lifespan of a solid-state drive based on a wear leveling algorithm according to claim 8, characterized in that: The lossless data migration and address remapping process in S8 includes the following steps: S81. During background idle periods, the solid-state drive controller initiates the data migration process according to the physical block data migration plan table. S82. Perform data reading, verification and writing operations on a page-by-page basis, and update the logical-to-physical address mapping relationship in the flash translation layer after each data unit migration is completed; S83. After all planned migration tasks have been completed, integrate the updated mapping items and generate updated physical block address mapping table data.
10. The method for extending the lifespan of a solid-state drive based on a wear leveling algorithm according to claim 9, characterized in that: The method, after generating the updated physical block address mapping table data, further includes S9: performing write amplification factor optimization and verification processing based on the updated physical block address mapping table data and the wear status of the migrated physical blocks, and generating this wear leveling performance evaluation report, specifically including the following steps: S91. During a monitoring cycle after the data migration is completed, collect the total amount of writes to the solid-state drive, the actual number of physical erases, and the resources and time consumed in the data migration process. S92. Based on the total amount written and the number of physical erases, calculate the write amplification factor after this equalization operation, and compare it with the historical write amplification factor in the same time period before the equalization operation to obtain the improvement degree of write amplification factor. S93. Monitor and evaluate the changes in access pressure of high-aging-risk physical block clusters in the physical block wear clustering feature data after migration, and analyze the wear rate changes based on historical and current wear rate data. S94. Based on the improvement of the write amplification factor, the change in the wear rate, and the migration process overhead determined based on the resources and time consumed, generate a wear leveling performance evaluation report containing quantitative indicators. S95. Summarize and analyze the current wear leveling performance evaluation report and historical wear leveling records, and update the parameters of the solid-state drive life prediction model.
Citation Information
Patent Citations
SSD wear leveling method and device based on dynamic data migration and medium
CN120596011A
Solid state disk wear leveling global optimization method and system based on multi-granularity data features
CN121209787A
SSD B + tree indexing method and system based on wear leveling
CN121455958A
Solid state disk data management and efficient storage allocation method
CN121560236A