Method and system for performance improvement of solid state drive

CN121364827BActive Publication Date: 2026-08-28联想长风科技(北京)有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511570268.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-30
Publication Date
2026-08-28
Estimated Expiration
2045-10-30

AI Technical Summary

Technical Problem

[0005]本申请提供了用于固态硬盘的性能提升方法及系统,用于针对解决现有技术存在固态硬盘因垃圾回收,导致固态硬盘写入放大和性能下降的技术问题

Benefits of technology

通过当固态硬盘的可用空间低于第一阈值时,触发垃圾回收机制,通过所述垃圾回收机制遍历多个源闪存块进行筛选,确定目标源闪存块;持续监控固态硬盘的可用空间,当可用空间低于调用条件阈值时,调取垃圾回收辅助方案,通过所述垃圾回收辅助方案对所述目标源闪存块中的有效页面进行预迁移,获得迁移结果,所述迁移结果包含目标源闪存块中的有效页面比例;当所述目标源闪存块中的有效页面比例低于第二阈值,停止所述垃圾回收辅助方案的执行,达到了降低垃圾回收导致的写入放大,同时减少垃圾回收独占资源带宽时间,提高固态硬盘性能的技术效果。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121364827B_ABST
    Figure CN121364827B_ABST
Patent Text Reader

Abstract

The application provides a performance improvement method and system for a solid state disk, and relates to the technical field of solid state disks.The method comprises the following steps: when the available space of the solid state disk is lower than a first threshold value, triggering a garbage collection mechanism, screening a plurality of source flash memory blocks through the garbage collection mechanism, and determining a target source flash memory block; continuously monitoring the available space of the solid state disk, and when the available space is lower than a calling condition threshold value, calling a garbage collection auxiliary scheme, pre-migrating the valid pages in the target source flash memory block, obtaining a migration result, and when the proportion of the valid pages in the target source flash memory block is lower than a second threshold value, stopping the execution of the garbage collection auxiliary scheme, solving the technical problem that the existing technology causes the write amplification and performance decline of the solid state disk due to garbage collection, and achieving the technical effects of reducing the write amplification caused by garbage collection, reducing the exclusive resource bandwidth time of garbage collection, and improving the performance of the solid state disk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of solid-state drive (SSD) technology, and more specifically to methods and systems for improving the performance of SSDs. Background Technology

[0002] With the advent of the big data era, data storage has become increasingly important. Solid-state drives (SSDs) based on NAND flash memory have been widely adopted due to their high performance and low power consumption. Garbage collection, as a space management mechanism for SSDs, while ensuring the normal operation of the entire SSD, also has a significant impact on read and write performance. On the one hand, the extra read and write operations caused by garbage collection can lead to actual write volumes exceeding expected write volumes, a phenomenon known as write amplification. Write amplification not only reduces the lifespan and durability of flash memory chips but also increases bandwidth consumption, resulting in a sharp performance drop. On the other hand, prolonged resource occupation during garbage collection can cause a sudden increase in response latency for some command requests, leading to a sharp performance decrease.

[0003] Existing garbage collection technologies only consider block utilization or wear leveling when selecting source flash blocks. This leads to a conflict in the trigger frequencies of garbage collection and wear leveling mechanisms, exacerbating write amplification and degrading SSD performance. Furthermore, existing garbage collection schemes migrate all valid data pages as a whole once triggered, resulting in a sharp performance drop.

[0004] In summary, existing technologies suffer from the technical problem of write amplification and performance degradation in solid-state drives (SSDs) due to garbage collection. Summary of the Invention

[0005] This application provides a method and system for improving the performance of solid-state drives (SSDs), which addresses the technical problem of write amplification and performance degradation in SSDs due to garbage collection in existing technologies.

[0006] In view of the above problems, this application provides a method and system for improving the performance of solid-state drives.

[0007] The first aspect of this application provides a method for improving the performance of a solid-state drive (SSD). The method includes: triggering a garbage collection mechanism when the available space of the SSD is below a first threshold; filtering multiple source flash memory blocks through the garbage collection mechanism to determine a target source flash memory block; continuously monitoring the available space of the SSD; when the available space is below a triggering condition threshold, invoking a garbage collection assistance scheme; pre-migrating valid pages in the target source flash memory block using the garbage collection assistance scheme to obtain a migration result, the migration result including the proportion of valid pages in the target source flash memory block; and stopping the execution of the garbage collection assistance scheme when the proportion of valid pages in the target source flash memory block is below a second threshold.

[0008] A second aspect of this application provides a performance enhancement system for solid-state drives (SSDs), the system comprising: a target source flash block determination module, configured to trigger a garbage collection mechanism when the available space of the SSD is lower than a first threshold, and to determine a target source flash block by traversing multiple source flash blocks through the garbage collection mechanism; a pre-migration module, configured to continuously monitor the available space of the SSD, and when the available space is lower than a call condition threshold, to invoke a garbage collection assistance scheme, and to pre-migrate valid pages in the target source flash block through the garbage collection assistance scheme to obtain a migration result, the migration result including the proportion of valid pages in the target source flash block; and a scheme stop execution module, configured to stop the execution of the garbage collection assistance scheme when the proportion of valid pages in the target source flash block is lower than a second threshold.

[0009] One or more technical solutions provided in this application have at least the following beneficial effects: When the available space of the solid-state drive (SSD) falls below a first threshold, a garbage collection mechanism is triggered. This mechanism iterates through multiple source flash memory blocks to identify a target source flash memory block. The available space of the SSD is continuously monitored. When the available space falls below a threshold, a garbage collection assistance scheme is invoked. This scheme pre-migrates valid pages in the target source flash memory block, obtaining a migration result that includes the proportion of valid pages in the target source flash memory block. When the proportion of valid pages in the target source flash memory block falls below a second threshold, the execution of the garbage collection assistance scheme is stopped. This achieves the technical effect of reducing write amplification caused by garbage collection, minimizing the time garbage collection monopolizes resource bandwidth, and improving SSD performance. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0011] Figure 1 This is a flowchart illustrating the method for improving the performance of solid-state drives according to this application.

[0012] Figure 2 This is a schematic diagram of the technical route for the method used in this application to improve the performance of solid-state drives.

[0013] Figure 3 This is a schematic diagram of the system for improving the performance of solid-state drives used in this application.

[0014] Explanation of reference numerals in the attached diagram: Target source flash memory block determination module 11, pre-migration module 12, scheme stop execution module 13. Detailed Implementation

[0015] This application provides a method and system for improving the performance of solid-state drives (SSDs), which solves the technical problem of write amplification and performance degradation in SSDs due to garbage collection in the prior art. It achieves the technical effect of reducing write amplification caused by garbage collection, while reducing the time that garbage collection occupies exclusive resource bandwidth, thereby improving the performance of SSDs.

[0016] The technical solutions of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. It should be understood that the present invention is not limited to the exemplary embodiments described herein. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention. It should also be noted that, for ease of description, only the parts related to the present invention are shown in the accompanying drawings, not all of them.

[0017] Example 1, as Figure 1 , Figure 2 As shown, this application provides a method for improving the performance of a solid-state drive (SSD), wherein the method specifically includes the following steps: When the available space of the solid-state drive is lower than the first threshold, the garbage collection mechanism is triggered. The garbage collection mechanism traverses multiple source flash memory blocks to filter and determine the target source flash memory block.

[0018] Furthermore, when the available space of the solid-state drive (SSD) falls below a first threshold, a garbage collection mechanism is triggered. This mechanism iterates through multiple source flash memory blocks to filter and determine the target source flash memory block. The method includes: importing historical space usage records of the SSD; extracting available space ratio samples at multiple time points within the historical period based on the historical space usage records; calculating and setting a first threshold based on the available space ratio samples; triggering the garbage collection mechanism when the available space of the SSD falls below the first threshold; retrieving the number of valid pages in the multiple source flash memory blocks through the garbage collection mechanism; performing multi-level analysis on the multiple source flash memory blocks based on the number of valid pages; and retrieving the multiple source flash memory blocks based on the multi-level analysis results to determine the target source flash memory block.

[0019] Specifically, based on the SSD's management unit, historical space usage records are obtained. These records represent the percentage of available space at various points in time during the SSD's past usage. Samples of available space percentages from multiple points in time within a historical period are extracted from these records. These available space percentages represent the percentage of remaining available space on the SSD relative to its total capacity at a specific point in time within a given period. For example, if the available space on the SSD is 30% of its total capacity at a certain point in the past week, then the available space percentage at that point is 0.3. By extracting samples of available space percentages from multiple points in time within a historical period, the space usage characteristics of the SSD under different usage conditions can be reflected.

[0020] By using statistical calculation methods, such as averaging, multiple samples of available space ratios are analyzed to obtain a comprehensive reference value. This comprehensive reference value is then set as the first threshold, which is the critical point at which the garbage collection mechanism is triggered. This first threshold is not fixed but dynamically adjusted based on the historical usage of the SSD. This ensures that the garbage collection mechanism neither triggers the write end prematurely nor results in excessively low available space due to delayed triggering, thus balancing performance and lifespan.

[0021] The available space of the SSD is compared with a first threshold. When the available space is less than the first threshold, garbage collection is automatically triggered. Garbage collection is a mechanism in the SSD used to reclaim invalid data blocks and free up space. This is done by migrating valid data from one block to another and then erasing the original block. After garbage collection is initiated, it traverses multiple source flash blocks in the SSD, reads the metadata of each block, and obtains the number of valid pages in each block. A source flash block is a flash block containing both valid and invalid data, processed by the garbage collection mechanism. The number of valid pages refers to the number of valid data pages contained in the source flash block. By obtaining the number of valid pages in each block, blocks can be initially filtered: blocks with fewer valid pages require less data migration and have higher recycling efficiency.

[0022] Multi-level analysis is performed on multiple source flash memory blocks based on valid page data, including but not limited to indicators such as the number of valid pages and wear level. For example, a candidate block queue is filtered based on the valid page data of the blocks. The block with the lowest wear level is selected from the candidate block queue as the multi-level analysis result. Based on the multi-level analysis result, multiple source flash memory blocks are searched to obtain the target flash memory block. After multi-level analysis, the flash memory block that needs to be garbage collected is determined.

[0023] Through multi-level analysis, target source flash blocks can be selected more accurately, improving garbage collection efficiency, reducing write amplification, extending the lifespan of solid-state drives (SSDs), and improving the overall performance of SSDs.

[0024] Furthermore, based on the number of valid pages, multi-level analysis is performed on the multiple source flash blocks, and the multiple source flash blocks are retrieved according to the multi-level analysis results to determine the target source flash block. The method includes: sorting the multiple source flash blocks in ascending order according to the number of valid pages to construct a candidate block queue; performing preliminary screening based on the candidate block queue to extract the top N source flash blocks, where N is a positive integer greater than 0; traversing the top N source flash blocks to perform wear analysis to obtain N wear levels; sorting the N wear levels in ascending order; and analyzing the multiple source flash blocks in conjunction with the wear sequence to obtain the target source flash block.

[0025] Specifically, multiple source flash memory blocks are sorted in ascending order of the number of valid pages, with the block having the fewest valid pages placed at the top, forming a candidate block queue. Constructing this queue prioritizes the reclamation of source flash memory blocks with less data, reducing data migration and write amplification. Pre-selection of the candidate block queue extracts the top N source flash memory blocks. These N blocks have fewer valid pages and are therefore prioritized for garbage collection. The value of N is dynamically adjusted based on the SSD's configuration parameters, and N is a positive integer greater than 0. This pre-selection further narrows down the range of source flash memory blocks requiring wear analysis, reducing unnecessary calculations and analysis, and improving the overall efficiency of the process.

[0026] The first N source flash memory blocks are traversed, and wear analysis is performed on them to obtain N wear levels. Wear analysis refers to evaluating the wear level of the first N source flash memory blocks. The wear level is measured by the number of erase / write cycles of the source flash memory block; the higher the wear level, the closer the source flash memory block is to its lifespan limit. The wear levels of the N blocks are sorted in ascending order to form a wear sequence. Through wear analysis, the wear degree of each source flash memory block is evaluated, and blocks with lower wear levels are prioritized for garbage collection, thereby extending the lifespan of the solid-state drive. Combining the number of effective pages and wear levels of multiple source flash memory blocks, the priority of each source flash memory block is comprehensively analyzed to obtain the target source flash memory block. The target source flash memory block contains fewer effective pages and has a lower wear level, avoiding excessive erasing of already highly worn blocks.

[0027] Through a multi-level screening strategy, the selection of source flash memory blocks takes into account both utilization and wear level, avoiding the drastic performance drop caused by the garbage collection mechanism and wear leveling mechanism not being aware of each other, and alleviating write amplification, thereby improving the overall performance of the solid-state drive.

[0028] Furthermore, wear analysis is performed on the first N source flash memory blocks to obtain N wear levels. These N wear levels are then sorted in ascending order. The target source flash memory block is obtained by analyzing the wear sequence in conjunction with the multiple source flash memory blocks. The method includes: sorting the N wear levels in ascending order, initializing the wear level of the first position to obtain a temporary variable; performing index matching on the multiple source flash memory blocks based on the first position's wear level to obtain an index variable; iterating and comparing the first N source flash memory blocks with the temporary variable; if any of the first N source flash memory blocks has a wear level less than the temporary variable, updating the temporary variable to generate a first temporary variable; updating the index variable based on the first temporary variable to obtain a first index variable; and determining the target source flash memory block based on the i-th index variable after all the first N source flash memory blocks have been traversed, where i is a positive integer greater than 0 and less than N.

[0029] Specifically, the wear levels of the first N source flash memory blocks are sorted in ascending order to form a wear sequence. The first wear level in the wear sequence is selected for initialization, resulting in a temporary variable. This temporary variable stores the minimum wear level as its initial value. Based on the first wear level, multiple source flash memory blocks are indexed and matched. The temporary variable, representing the index of the source flash memory block corresponding to the current minimum wear level, is then obtained. This index variable identifies the position of the source flash memory block index corresponding to the current minimum wear level.

[0030] The first N source flash memory blocks are traversed, and the wear level of each block is compared and iteratively analyzed with the current temporary variable. During the traversal, if a block among the first N flash memory blocks has a wear level less than the current temporary variable, the temporary variable is immediately updated, and the wear level less than the current temporary variable is taken as the first temporary variable. The index variable is then updated based on the first temporary variable to obtain the first index variable. Updating the index variable means updating its value to the index of the source flash memory block corresponding to the newly found minimum wear level. The first index variable is the updated index variable. By updating the index variable, the position of the source flash memory block corresponding to the current minimum wear level is always recorded. After all N source flash memory blocks have been traversed, the optimal target source flash memory block is determined based on the final i-th index variable, where i is a positive integer greater than 0 and less than N.

[0031] By traversing, comparing, and updating, the selected target source flash memory blocks are ensured to have minimal wear, enabling the SSD to balance performance and durability when performing garbage collection, reducing write amplification and extending the lifespan of the SSD.

[0032] The available space of the solid-state drive is continuously monitored. When the available space is lower than the threshold condition, a garbage collection assistance scheme is invoked. The garbage collection assistance scheme is used to pre-migrate the valid pages in the target source flash block to obtain the migration result. The migration result includes the proportion of valid pages in the target source flash block.

[0033] Specifically, the SSD controller continuously checks and records changes in available space, which refers to unused storage space on the SSD. This available space is compared in real-time with a trigger threshold, which is the critical value for initiating a garbage collection assist scheme. This threshold can be dynamically adjusted based on the SSD's capacity, historical usage characteristics, and usage scenarios to prevent a sharp performance drop when space is about to run out. For example, the trigger threshold can be set to 11%. When the available space is determined to be below the trigger threshold, the garbage collection assist scheme is invoked. This scheme optimizes the garbage collection process by pre-migrating valid pages. The garbage collection assist scheme pre-migrates valid pages in the target source flash memory block. Pre-migrating means moving valid pages from the target source flash memory block to other free blocks before the garbage collection officially begins. Only one valid page is migrated at a time, and the available space status of the SSD is re-checked after each migration. By transferring some valid data through pre-migrating, the amount of data moved during the subsequent full garbage collection process is reduced, thereby reducing write amplification and smoothing SSD performance fluctuations. The migration result is obtained through pre-migration. The migration result refers to the proportion of remaining valid pages in the target source flash memory block after the pre-migration operation is completed. The valid page ratio is the proportion of the number of remaining valid pages in the target source flash memory block to the total number of pages. Monitoring continues as long as the available space is greater than or equal to the call condition threshold.

[0034] By pre-migrating valid pages to idle time to assist traditional garbage collection, the performance of solid-state drives (SSDs) is improved by minimizing the time garbage collection monopolizes bandwidth. Furthermore, pre-migrating valid pages reduces the amount of data processed during garbage collection, increasing its efficiency. This pre-migrating before garbage collection reduces performance drops caused by garbage collection, thus improving the overall performance of the SSD.

[0035] When the proportion of valid pages in the target source flash memory block is lower than the second threshold, the execution of the garbage collection assistance scheme is stopped.

[0036] Specifically, the proportion of valid pages in the target source flash memory block is compared to a second threshold. The second threshold is the lower limit used to determine the remaining valid page proportion in the target source flash memory block. When the valid page proportion in the target source flash memory block is less than the second threshold, it indicates that there is insufficient valid data in the target source flash memory block to continue the auxiliary migration operation. At this time, the execution of the garbage collection assistance scheme is stopped, including stopping subsequent page reading, migration, and invalidation marking operations. This judgment ensures that the garbage collection assistance scheme is only executed when there is sufficient valid data, avoiding unnecessary data writing, thereby reducing write amplification and improving the performance stability of the solid-state drive.

[0037] Furthermore, when the available space is lower than the call condition threshold, a garbage collection assistance scheme is invoked to pre-migrate valid pages in the target source flash block and obtain migration results. The method includes: continuously monitoring the available space ratio of the solid-state drive (SSD); triggering the garbage collection assistance scheme when the available space ratio is lower than the call condition threshold; monitoring the load status of the SSD; determining whether the SSD is idle based on the load status and obtaining a determination result; when the determination result is idle, pre-migrating valid pages in the target source flash block based on the garbage collection assistance scheme and detecting the remaining valid page ratio of the target source flash block in parallel, wherein only one valid page is migrated in each pre-migration; setting a stop condition threshold and determining whether the remaining valid page ratio is greater than the stop condition threshold; if the remaining valid page ratio is greater than the stop condition threshold, executing a continuous migration instruction to pre-migrate valid pages in the target source flash block based on the remaining valid page ratio and generating the migration result; if the remaining valid page ratio is less than or equal to the stop condition threshold, stopping the pre-migration of valid pages in the target source flash block and generating the migration result.

[0038] Furthermore, the stop condition threshold is set to a value much lower than the call condition threshold that triggers the garbage collection assist scheme.

[0039] Specifically, the operating status of the solid-state drive (SSD) is continuously monitored. When the available space ratio falls below a preset threshold, a garbage collection assistance scheme is immediately triggered. During the garbage collection assistance scheme, the SSD's load status is simultaneously monitored, including the number of read / write commands issued by the host, bus bandwidth utilization, and I / O response time. Based on the load status, an idle state determination is performed on the SSD to determine whether it is currently idle. For example, if the number of host read / write commands is below a first load threshold and the bus bandwidth utilization is below a second load threshold, the SSD is determined to be idle.

[0040] When the determination result is "idle," it indicates that the current load is low, avoiding interference with normal read and write operations. Initiating the auxiliary migration operation at this time has minimal impact on SSD performance. When the idle state is met, a pre-migration is performed on the valid pages of the target source flash memory block based on a garbage collection assistance scheme. This involves reading the metadata of the target source flash memory block according to the garbage collection assistance scheme, determining the location of valid pages, and migrating the valid pages to pre-allocated free blocks. Only one valid page is migrated at a time during each pre-migration, ensuring fine-grained precision and accuracy. Pre-migration reduces the amount of data processed during garbage collection, improving garbage collection efficiency and reducing write amplification.

[0041] After each single-page migration operation is completed, a stop condition judgment process is immediately executed, and the proportion of remaining valid pages is simultaneously checked. The proportion of remaining valid pages refers to the ratio of the number of remaining valid pages in the target source flash block to the total number of pages. The proportion of remaining valid pages is compared with a stop condition threshold to assess the change in the proportion of valid data remaining in the target source flash block. The stop condition threshold is preset and is a value much lower than the call condition threshold that triggers the garbage collection assistance scheme. It is used to limit the intensity of the migration process and avoid unnecessary write consumption caused by excessive pre-migration. For example, it is set to 1%. If the proportion of remaining valid pages is greater than the stop condition threshold, the pre-migration operation continues. Based on the proportion of remaining valid pages, single valid page pre-migration is performed on the valid pages in the target source flash block to generate intermediate migration results. If the proportion of remaining valid pages is less than or equal to the stop condition threshold, the pre-migration operation on the valid pages in the target source flash block is stopped, and the final migration result is generated. The migration result includes the proportion of valid pages in the target source flash block.

[0042] Compared to traditional centralized garbage collection operations, by migrating some data in batches when the solid-state drive is idle, the amount of data migrated during garbage collection is greatly reduced, thereby effectively reducing write amplification, alleviating performance drops, and improving the performance and lifespan of the solid-state drive.

[0043] Furthermore, the process of implementing the idle state includes: setting a first load threshold and a second load threshold based on the load state; retrieving the number of host read / write commands of the solid-state drive within a unit time, determining whether the number of host read / write commands is lower than the first load threshold, and generating a preliminary idle state when the number of host read / write commands is lower than the first load threshold; continuously monitoring the bus bandwidth utilization rate of the solid-state drive, determining whether the bus bandwidth utilization rate is lower than the second load threshold, and updating the preliminary idle state when the bus bandwidth utilization rate is lower than the second load threshold to determine that the solid-state drive is in an idle state.

[0044] Specifically, to ensure that the garbage collection assistance scheme only executes when the SSD load is low, avoiding interference with normal read / write performance, an idle state determination mechanism is introduced. First, two thresholds are set based on the SSD load status: a first load threshold and a second load threshold. The first load threshold measures the pressure of read / write commands initiated by the host, while the second load threshold reflects the bus transmission pressure at the data channel layer. These thresholds can be dynamically adjusted based on the SSD controller's performance metrics, host I / O behavior characteristics, and historical load distribution to ensure the rationality and adaptability of the determination criteria. Then, the number of read / write commands sent from the host to the SSD per unit time is retrieved in real time, i.e., the number of I / O instructions sent by the host within a usage cycle is counted. This number of host read / write commands is compared with the first load threshold. When the comparison determines that the number of host read / write commands is less than the first load threshold, it is determined that the current host access requests are relatively sparse, and the SSD is in a light-load operation phase, at which point a preliminary idle state is generated.

[0045] Continuously monitor the bus bandwidth utilization of the SSD, which reflects the actual usage intensity of the data channel between the SSD controller and the host. Compare the bus bandwidth utilization to a second load threshold. If the comparison shows that the bus bandwidth utilization is lower than the second load threshold, it indicates that the SSD is also in a low-utilization state at the data transfer level. At this point, update the initial idle state and finally determine that the SSD is in an idle state. Then, perform a pre-migration operation on valid pages in the target source flash memory block based on a garbage collection-assisted scheme. Furthermore, after each migration operation, the SSD status needs to be checked again to ensure that page migration only occurs when the SSD is idle. This avoids prolonged periods of garbage collection monopolizing resource bandwidth, reduces performance drops, and improves both garbage collection efficiency and SSD performance stability.

[0046] Furthermore, based on the garbage collection assistance scheme, the effective pages in the target source flash memory block are pre-migrated, and the proportion of remaining effective pages in the target source flash memory block is detected in parallel. The method includes: when the determination result is an idle state, constructing a page mapping table for the target source flash memory block; migrating and locating the page mapping table based on the garbage collection assistance scheme to determine the physical address to be migrated; reading data based on the physical address to be migrated to obtain a first effective page; constructing an idle source flash memory block and migrating the first effective page to the idle source flash memory block; matching the target source flash memory block based on the physical address to be migrated to determine the original physical address and marking the original physical address as invalid; and performing effective detection on the target source flash memory block based on the invalidation mark to determine the proportion of remaining effective pages.

[0047] Specifically, in solid-state drives (SSDs), a flash translation layer exists between logical addressing and physical storage. When the SSD is determined to be idle, a page mapping table for the target source flash block is constructed. This table records the correspondence between the logical block address and the physical page address of the target source flash block, serving as the data structure for the flash translation layer to achieve logical addressing and physical location. A garbage collection-assisted scheme is used to migrate and locate the page mapping table. By traversing the page mapping table, valid page records are identified, and the migration target is determined using a single-page pre-migration strategy within the garbage collection-assisted scheme. The physical page address corresponding to the logical page of the migration target is parsed to determine the physical address to be migrated in this round of migration, achieving precise location of valid data in the target source flash block. A data read operation is performed based on the physical address to be migrated, extracting the first valid page from the target source flash block, i.e., the data page to be migrated. To ensure efficient migration and data integrity, an idle source flash block is constructed on the SSD controller as the receiving target. This idle source flash block is in an unwritten state and can be directly used for data writing operations. Based on the garbage collection-assisted scheme, the read valid pages are migrated to the free source flash memory block, completing a page-level data migration.

[0048] After migration is complete, the original storage location within the target source flash memory block is indexed and matched based on the physical address to be migrated to determine the original physical address of the migrated data. To avoid data redundancy and subsequent read errors, the original physical address is marked as invalid, and its status is marked as invalid in the metadata management table. After completing a single page migration and invalidation marking operation, the target source flash memory block is validated, and the proportion of remaining valid pages is calculated. The proportion of remaining valid pages is the ratio of the number of valid pages still retained in the target source flash memory block to the total number of pages. By determining the proportion of remaining valid pages, the pre-migration execution effect can be dynamically obtained.

[0049] By pre-migrating valid pages during idle periods, write amplification is significantly reduced, garbage collection latency is smoothed, and the overall performance and lifespan of the solid-state drive are improved.

[0050] Furthermore, the method for parallel detection of the remaining effective page ratio of the target source flash block includes: querying the target source flash block after each pre-migration operation of a single effective page to obtain the metadata of the target flash block; performing an effective evaluation based on the metadata of the target flash block to obtain the number of effective pages; retrieving the total number of effective pages in the target source flash block, using the number of effective pages as the numerator and the total number of pages as the denominator to perform a fractional calculation to obtain the remaining effective page ratio.

[0051] Specifically, the remaining effective page ratio of the target source flash block is detected simultaneously. Furthermore, after each pre-migration operation of a single effective page, the target source flash block can be queried in real-time to obtain its metadata. This metadata is structured information used by the SSD controller to manage the flash block status, including the validity marker, write / erase count, and logical-to-physical mapping for each page. Based on the target flash block's metadata, an effective evaluation is performed to count the number of still-retained effective pages in the target source flash block. This number reflects the true proportion of usable data in the target source flash block. The total number of effective pages within the target source flash block is retrieved to construct a denominator. Using the number of effective pages as the numerator and the total number of pages as the denominator, a fractional calculation is performed to obtain the remaining effective page ratio. The remaining effective page ratio obtained through this calculation provides a dynamic basis for stopping the operation, ensuring that the pre-migration operation reduces write amplification without excessively migrating invalid data or interfering with host I / O performance. This achieves a significant reduction in write amplification, smoothing of garbage collection latency, and improved overall SSD performance and lifespan.

[0052] Example 2, based on the same inventive concept as the method for improving the performance of solid-state drives in the foregoing examples, such as... Figure 3 As shown, this application provides a performance enhancement system for solid-state drives (SSDs), wherein the performance enhancement system for SSDs includes: The target source flash block determination module 11 is used to trigger a garbage collection mechanism when the available space of the solid-state drive is lower than a first threshold, and to traverse multiple source flash blocks through the garbage collection mechanism to filter and determine the target source flash block; the pre-migration module 12 is used to continuously monitor the available space of the solid-state drive, and when the available space is lower than the calling condition threshold, to call a garbage collection assistance scheme, and to pre-migrate the valid pages in the target source flash block through the garbage collection assistance scheme to obtain a migration result, the migration result including the proportion of valid pages in the target source flash block; the scheme stop execution module 13 is used to stop the execution of the garbage collection assistance scheme when the proportion of valid pages in the target source flash block is lower than a second threshold.

[0053] Furthermore, the target source flash block determination module 11 is also used to: introduce the historical space usage records of the solid-state drive, extract the available space ratio samples at multiple time points within the historical period based on the historical space usage records, calculate based on the available space ratio samples, and set a first threshold; when the available space of the solid-state drive is lower than the first threshold, trigger a garbage collection mechanism; traverse the multiple source flash blocks through the garbage collection mechanism to retrieve the effective page count of the multiple source flash blocks; perform multi-level analysis on the multiple source flash blocks based on the effective page count, and search the multiple source flash blocks based on the multi-level analysis results to determine the target source flash block.

[0054] Furthermore, the target source flash memory block determination module 11 is also configured to: sort the plurality of source flash memory blocks in ascending order according to the number of effective pages to construct a candidate block queue; perform preliminary screening based on the candidate block queue to extract the first N source flash memory blocks, where N is a positive integer greater than 0; traverse the first N source flash memory blocks to perform wear analysis to obtain N wear levels, sort the N wear levels in ascending order, and analyze the plurality of source flash memory blocks in conjunction with the wear sequence to obtain the target source flash memory block.

[0055] Furthermore, the target source flash memory block determination module 11 is also used for: sorting the N wear levels in ascending order, selecting the first wear level for initialization, and obtaining a temporary variable; performing index matching on the multiple source flash memory blocks based on the first wear level, and obtaining an index variable; traversing the first N source flash memory blocks and performing iterative analysis by comparing them with the temporary variable; if there is a wear level less than the temporary variable among the first N source flash memory blocks, then updating the temporary variable and generating a first temporary variable; updating the index variable according to the first temporary variable, and obtaining a first index variable; after all the first N source flash memory blocks have been traversed, determining the target source flash memory block according to the i-th index variable, where i is a positive integer greater than 0 and less than N.

[0056] Furthermore, the pre-migration module 12 is also used for: continuously monitoring the available space ratio of the solid-state drive (SSD); triggering the garbage collection assistance scheme when the available space ratio is lower than the call condition threshold; monitoring the load status of the SSD; determining whether the SSD is idle based on the load status; obtaining a determination result when the determination result is idle; performing pre-migration on valid pages in the target source flash memory block based on the garbage collection assistance scheme, and detecting the remaining valid page ratio of the target source flash memory block in parallel, wherein only one valid page is migrated in each pre-migration; setting a stop condition threshold; determining whether the remaining valid page ratio is greater than the stop condition threshold; if the remaining valid page ratio is greater than the stop condition threshold, executing a continuous migration instruction; performing pre-migration on valid pages in the target source flash memory block based on the remaining valid page ratio; generating the migration result; if the remaining valid page ratio is less than or equal to the stop condition threshold, stopping the pre-migration of valid pages in the target source flash memory block; and generating the migration result.

[0057] Furthermore, the pre-migration module 12 is also configured to: set the stop condition threshold to a value much lower than the call condition threshold that triggers the garbage collection assistance scheme.

[0058] Furthermore, the pre-migration module 12 is also used to: set a first load threshold and a second load threshold based on the load status; retrieve the number of host read / write commands of the solid-state drive within a unit time, determine whether the number of host read / write commands is lower than the first load threshold, and generate a preliminary idle state when the number of host read / write commands is lower than the first load threshold; continuously monitor the bus bandwidth utilization rate of the solid-state drive, determine whether the bus bandwidth utilization rate is lower than the second load threshold, and update the preliminary idle state when the bus bandwidth utilization rate is lower than the second load threshold to determine that the solid-state drive is in an idle state.

[0059] Furthermore, the pre-migration module 12 is also configured to: when the determination result is an idle state, construct a page mapping table for the target source flash memory block, perform migration and positioning of the page mapping table based on the garbage collection assistance scheme, and determine the physical address to be migrated; read data based on the physical address to be migrated to obtain a first valid page; construct an idle source flash memory block and migrate the first valid page to the idle source flash memory block; match the target source flash memory block based on the physical address to be migrated to determine the original physical address, and mark the original physical address as invalid; perform valid detection on the target source flash memory block according to the invalidation mark to determine the proportion of remaining valid pages.

[0060] Furthermore, the pre-migration module 12 is also used to: query the target source flash block after each pre-migration operation of a single valid page to obtain the metadata of the target flash block; perform effective evaluation based on the metadata of the target flash block to obtain the number of valid pages; retrieve the total number of valid pages in the target source flash block, use the number of valid pages as the numerator and the total number of pages as the denominator to perform fractional calculation to obtain the proportion of remaining valid pages.

[0061] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0062] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of this application and its equivalents, this application also intends to include such modifications and variations.

Claims

1. A method for improving the performance of solid-state drives, characterized in that, The method for improving the performance of solid-state drives includes: When the available space of the solid-state drive is lower than the first threshold, the garbage collection mechanism is triggered. The garbage collection mechanism traverses multiple source flash memory blocks for filtering to determine the target source flash memory block. The available space of the solid-state drive is continuously monitored. When the available space is lower than the threshold condition, the garbage collection assistance scheme is invoked. The garbage collection assistance scheme is used to pre-migrate the valid pages in the target source flash block to obtain the migration result. The migration result includes the proportion of valid pages in the target source flash block. When the proportion of valid pages in the target source flash memory block is lower than the second threshold, the execution of the garbage collection assistance scheme is stopped; When the available space of the solid-state drive falls below a first threshold, a garbage collection mechanism is triggered. This mechanism iterates through multiple source flash memory blocks to filter and determine the target source flash memory block. The method includes: The historical space usage records of the solid-state drive are introduced. Based on the historical space usage records, samples of the available space ratio at multiple time points within the historical period are extracted. Based on the available space ratio samples, a first threshold is set. When the available space of the solid-state drive is lower than the first threshold, the garbage collection mechanism is triggered; The garbage collection mechanism is used to traverse the multiple source flash blocks and retrieve the number of valid pages in the multiple source flash blocks. Based on the number of valid pages, a multi-level analysis is performed on the multiple source flash blocks. The multiple source flash blocks are then retrieved based on the results of the multi-level analysis to determine the target source flash block.

2. The method for improving the performance of a solid-state drive as described in claim 1, characterized in that, The method includes performing multi-level analysis on the multiple source flash blocks based on the number of valid pages, retrieving the multiple source flash blocks according to the results of the multi-level analysis, and determining the target source flash block. The multiple source flash blocks are sorted in ascending order according to the number of valid pages to construct a candidate block queue; Based on the candidate block queue, a preliminary screening is performed to extract the first N source flash memory blocks, where N is a positive integer greater than 0; The wear analysis is performed on the first N source flash memory blocks to obtain N wear levels. The N wear levels are then sorted in ascending order. The target source flash memory block is obtained by combining the wear sequence with the analysis of the multiple source flash memory blocks.

3. The method for improving the performance of a solid-state drive as described in claim 2, characterized in that, The method involves iterating through the first N source flash memory blocks for wear analysis to obtain N wear levels, sorting these N wear levels in ascending order, and then analyzing the wear sequence in conjunction with the multiple source flash memory blocks to obtain the target source flash memory block. Based on the N wear levels, sort them in ascending order, select the first wear level to initialize, and obtain a temporary variable; Based on the wear degree of the first bit order, the multiple source flash memory blocks are indexed and matched to obtain index variables; The first N source flash memory blocks are traversed and compared iteratively with the temporary variables; If the wear level of the first N source flash memory blocks is less than that of the temporary variable, then update the temporary variable and generate the first temporary variable; The index variable is updated based on the first temporary variable to obtain the first index variable; After all the first N source flash memory blocks have been traversed, the target source flash memory block is determined according to the i-th index variable, where i is a positive integer greater than 0 and less than N.

4. The method for improving the performance of a solid-state drive as described in claim 1, characterized in that, Continuously monitor the available space of the solid-state drive (SSD). When the available space falls below a threshold condition, invoke a garbage collection assistance scheme. Use this scheme to pre-migrate valid pages in the target source flash memory block to obtain migration results. The method includes: The system continuously monitors the available space ratio of the solid-state drive (SSD), and triggers the garbage collection assistance scheme when the available space ratio falls below the trigger condition threshold. Monitor the load status of the solid-state drive (SSD), determine whether the SSD is idle based on the load status, and obtain the determination result; When the determination result is an idle state, the valid pages in the target source flash block are pre-migrated based on the garbage collection assistance scheme, and the proportion of remaining valid pages in the target source flash block is detected in parallel. In each pre-migration, only one valid page is migrated. Set a stop condition threshold and determine whether the proportion of remaining valid pages is greater than the stop condition threshold. If the proportion of remaining valid pages is greater than the stopping condition threshold, a continuous migration instruction is executed to pre-migrate the valid pages in the target source flash memory block based on the proportion of remaining valid pages, and the migration result is generated. If the proportion of remaining valid pages is less than or equal to the stopping condition threshold, then the pre-migration of valid pages in the target source flash block is stopped, and the migration result is generated.

5. The method for improving the performance of a solid-state drive as described in claim 4, characterized in that, The stop condition threshold is set to a value much lower than the call condition threshold that triggers the garbage collection assist scheme.

6. The method for improving the performance of a solid-state drive as described in claim 4, characterized in that, The process of implementing the idle state includes: A first load threshold and a second load threshold are set based on the load status; The number of host read / write commands to the solid-state drive within a unit of time is retrieved, and it is determined whether the number of host read / write commands is lower than the first load threshold. When the number of host read / write commands is lower than the first load threshold, a preliminary idle state is generated. The bus bandwidth utilization rate of the solid-state drive is continuously monitored to determine whether the bus bandwidth utilization rate is lower than the second load threshold. When the bus bandwidth utilization rate is lower than the second load threshold, the preliminary idle state is updated to determine that the solid-state drive is in an idle state.

7. The method for improving the performance of a solid-state drive as described in claim 4, characterized in that, Based on the aforementioned garbage collection assistance scheme, the valid pages in the target source flash memory block are pre-migrated, and the proportion of remaining valid pages in the target source flash memory block is detected in parallel. The method includes: When the determination result is an idle state, a page mapping table of the target source flash memory block is constructed, and the page mapping table is migrated and located based on the garbage collection assistance scheme to determine the physical address to be migrated; Data is read based on the physical address to be migrated to obtain the first valid page; Construct a free source flash block and migrate the first valid page to the free source flash block; The target source flash memory block is matched based on the physical address to be migrated to determine the original physical address, and the original physical address is marked as invalid. The target source flash memory block is effectively detected based on the invalidation flag to determine the proportion of remaining valid pages.

8. The method for improving the performance of a solid-state drive as described in claim 4, characterized in that, The method for detecting the remaining valid page ratio of the target source flash memory block in parallel further includes: After each pre-migration operation of a single valid page, the target source flash block is queried to obtain the target flash block's metadata; The number of valid pages is obtained by effectively evaluating the metadata of the target flash memory block. The total number of valid pages in the target source flash memory block is retrieved. The number of valid pages is used as the numerator, and the total number of pages is used as the denominator to perform a fractional calculation to obtain the proportion of remaining valid pages.

9. A performance enhancement system for solid-state drives, characterized in that, The step of implementing the performance improvement method for a solid-state drive according to any one of claims 1 to 8, wherein the performance improvement system for a solid-state drive comprises: The target source flash memory block determination module is used to trigger a garbage collection mechanism when the available space of the solid-state drive is lower than a first threshold, and to traverse multiple source flash memory blocks through the garbage collection mechanism to filter and determine the target source flash memory block. The pre-migration module is used to continuously monitor the available space of the solid-state drive. When the available space is lower than the threshold condition, the garbage collection assistance scheme is invoked. The garbage collection assistance scheme is used to pre-migrate the valid pages in the target source flash block to obtain the migration result. The migration result includes the proportion of valid pages in the target source flash block. The scheme stop execution module is used to stop the execution of the garbage collection assistance scheme when the proportion of valid pages in the target source flash memory block is lower than a second threshold.

Citation Information

Patent Citations

  • Solid state disk garbage treatment method and solid state disk thereof

    CN116540948A