A method, storage device and electronic device for optimizing garbage collection efficiency
By monitoring empty blocks and the amount of valid data, and by employing multi-rate garbage collection strategies and algorithms to optimize the garbage collection process, the problem of low garbage collection efficiency in solid-state storage devices has been solved, thereby improving write speed and device performance.
Patent Information
- Application Number
- CN202510672036.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2045-05-23
AI Technical Summary
Solid-state storage devices suffer from low garbage collection efficiency during the writing process due to inconsistent erase and write units, especially when the number of empty blocks is small, leading to fluctuations in read and write speeds and a decrease in write speed.
By monitoring the number of remaining empty blocks and the amount of valid data, early garbage collection is performed at different rates, including first-rate and second-rate garbage collection, and appropriate garbage collection algorithms, such as greedy algorithms, cost-effective algorithms, or window algorithms, are selected to optimize the garbage collection process.
It effectively reduces the impact of write operations on read and write speeds, ensures that write speeds do not decrease, and improves the efficiency of garbage collection and the performance of storage devices.
Smart Images

Figure CN120179574B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of storage technology, and in particular to a method, storage device, and electronic device for optimizing waste recycling efficiency. Background Technology
[0002] The read / write process of solid-state storage devices (SSDs) using NAND flash memory as the storage medium is fundamentally different from that of traditional HDDs, especially in terms of writing. HDDs can directly overwrite data stored on the disk, while NAND storage devices cannot. The erase-then-write performance of SSDs adds an erase operation. The inconsistency between the write unit (Page) and the erase unit (Block) causes SSDs to constantly move between different blocks. Some blocks may contain both valid and invalid data at the same time. When there is too much invalid data, garbage collection (GC) is required to clean it up. This involves moving the valid data to a new block and then clearing the old block, so that the old block can continue to be used.
[0003] Generally, garbage collection (GC) is initiated when the number of empty blocks on a storage device falls below a certain threshold. The fewer the empty blocks, the faster the GC needs to run. This can cause greater fluctuations in the read / write speed of the storage device. Furthermore, typical GC processes do not release blocks prematurely when the number of empty blocks falls below a certain threshold. In situations where the host continuously sends data that overwrites existing data, and this continuous overwriting is significant, some data blocks may contain very little valid data. If GC is still initiated when there are few empty blocks, the write speed for some data will drop excessively. Summary of the Invention
[0004] To address the aforementioned technical problems, this invention provides a method, storage device, and electronic device for optimizing waste recycling efficiency.
[0005] To this end, the first aspect of the present invention provides a method for optimizing garbage collection efficiency, comprising: in response to a write data request from a host, monitoring whether a first collection trigger condition is met; in response to meeting the first trigger condition, performing early garbage collection at a first rate; monitoring whether a second trigger condition is met; and in response to meeting the second trigger condition, performing garbage collection at a second rate, wherein the second rate is greater than the first rate.
[0006] In one specific embodiment, monitoring whether the first recycling trigger condition is met includes:
[0007] Determine whether the number of remaining empty blocks meets the first preset condition;
[0008] If the number of remaining empty blocks meets the first preset condition, then obtain the amount of valid data in each written block;
[0009] Determine the total amount of valid data in the N blocks with the minimum amount of valid data, where N is a natural number;
[0010] Determine whether the total amount is less than the total capacity of an empty block;
[0011] If the total amount is less than the total capacity of an empty block, then the first recycling trigger condition is confirmed to be met.
[0012] In one specific embodiment, monitoring whether the first recycling trigger condition is met includes:
[0013] Determine whether the number of remaining empty blocks meets the first preset condition;
[0014] If the number of remaining empty blocks meets the first preset condition, then the first recycling trigger condition is confirmed to be met.
[0015] In one specific embodiment, determining whether the number of remaining empty blocks meets a first preset condition includes:
[0016] Determine whether the ratio of the number of remaining empty blocks to the total number of blocks is no longer greater than a first preset threshold; or
[0017] Determine whether the number of remaining empty blocks is no longer less than the first quantity threshold.
[0018] In one specific embodiment, monitoring whether the first recycling trigger condition is met includes:
[0019] Get the amount of valid data in each written block;
[0020] Determine the total amount of valid data in the N blocks with the minimum amount of valid data, where N is a natural number;
[0021] Determine whether the total amount is less than the total capacity of an empty block;
[0022] If the total amount is less than the total capacity of an empty block, then the first recycling trigger condition is confirmed to be met.
[0023] In one specific embodiment, performing early garbage collection at a first rate includes:
[0024] The early garbage collection is performed based on a preset amount of data for a single garbage collection program, wherein the preset amount of data for a single garbage collection program depends on the type of storage device.
[0025] In one specific embodiment, the monitoring of whether the second triggering condition is met includes: determining whether the second triggering condition is met based on the number of remaining empty blocks.
[0026] In one specific embodiment, the monitoring of whether the second triggering condition is met includes:
[0027] Determine whether the number of remaining empty blocks meets the second preset condition.
[0028] The second preset condition includes one of the following ranges:
[0029] First range: Third quantity threshold < Number of remaining empty blocks ≤ Second quantity threshold;
[0030] Second range: Fourth quantity threshold < Number of remaining empty blocks ≤ Third quantity threshold;
[0031] Third range: The number of remaining empty blocks ≤ the fourth quantity threshold.
[0032] In one specific embodiment, in response to the satisfaction of a second triggering condition, performing garbage collection at a second rate includes:
[0033] Based on the range satisfied by the number of remaining empty blocks, select the corresponding garbage collection mode;
[0034] Garbage collection is performed at a second rate according to the corresponding garbage collection mode, wherein the second rate corresponding to the first range is greater than the second rate corresponding to the second range, and the second rate corresponding to the second range is greater than the second rate corresponding to the third range.
[0035] In one specific embodiment, the garbage collection uses one of the greedy algorithm, the cost-effective algorithm, and the window algorithm.
[0036] A second aspect of the present invention provides an apparatus for optimizing waste recycling efficiency, comprising:
[0037] The first monitoring module responds to the host's write data request and monitors whether the first recycling trigger condition is met.
[0038] The first execution module, in response to the fulfillment of the first triggering condition, performs early garbage collection at a first rate;
[0039] The second monitoring module monitors whether the second triggering condition is met.
[0040] The second execution module performs garbage collection at a second rate in response to a second triggering condition being met, wherein the second rate is greater than the first rate.
[0041] A third aspect of the present invention provides a storage device including a controller and a flash memory module, the flash memory module including a program that, when executed by the controller, implements the method described in the first aspect of the present invention.
[0042] A fourth aspect of the present invention provides an electronic device including a host and a storage device as described in the third aspect of the present invention.
[0043] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0044] The method of the present invention can not only enter the early GC process to organize the data and release the blocks in advance according to the remaining number of empty blocks, but also change the amount of data programmed in one GC process according to the remaining number of empty blocks, so that the write speed after GC is started will not drop too low. Attached Figure Description
[0045] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below.
[0046] Figure 1 This is a schematic diagram of a storage device according to an embodiment of the present invention;
[0047] Figure 2 This is a flowchart of a method for optimizing waste recycling efficiency according to an embodiment of the present invention;
[0048] Figure 3 This is a flowchart of monitoring whether a first recycling trigger condition is met according to an embodiment of the present invention;
[0049] Figure 4 This is a flowchart illustrating whether a first recycling trigger condition is met, according to another embodiment of the present invention;
[0050] Figure 5 This is a flowchart of monitoring whether the first recycling trigger condition is met according to another embodiment of the present invention;
[0051] Figure 6 This is a flowchart of performing garbage collection at a second rate according to yet another embodiment of the present invention. Detailed Implementation
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0053] Figure 1This is a schematic diagram of a storage device 12 according to an embodiment of the present invention. The storage device 12 includes a flash memory module 125 and a flash memory controller 120, and the flash memory controller 120 is used to access the flash memory module 125. According to this embodiment, the flash memory controller 120 includes a processor, control logic, buffer storage, and interface logic. The processor is used to execute program code to control access to the flash memory module. Typically, the flash memory module includes multiple flash memory chips, and each flash memory chip includes multiple blocks, and the flash memory controller performs data erasure operations on the flash memory module in units of blocks. In addition, a block can record a specific number of data pages, and the flash memory controller performs data writing operations on the flash memory module in units of data pages. In one example, the flash memory module is a 3D NAND-type flash memory module.
[0054] The flash memory controller, which executes program code via a processor, can utilize its internal components to perform various control operations, such as: using control logic to control the access operations of the flash memory module (especially access operations to at least one block or at least one data page), using buffer storage for necessary buffering operations, and using interface logic to communicate with the host device 10. The buffer storage is implemented in random access memory (RAM). For example, the buffer storage can be static random access memory (SRAM), but the invention is not limited thereto.
[0055] In one embodiment, the storage device 12 may be a portable memory device (e.g., a memory card conforming to SD / MMC, CF, MS, or XD standards), and the host device 10 may be an electronic device that can be connected to the storage device, such as a mobile phone, laptop, desktop computer, dashcam, etc. In another embodiment, the storage device 12 may be a solid-state drive or an embedded storage device conforming to Universal Flash Storage (UFS) or Embedded Multi Media Card (EMMC) specifications, and may be disposed in an electronic device, such as a mobile phone, laptop, or desktop computer, in which case the host device 10 may be a processor of the electronic device.
[0056] Therefore, the first aspect of the present invention provides a method for optimizing waste recycling efficiency, such as... Figure 2 As shown, it includes:
[0057] S10. In response to the host's write data request, monitor whether the first recycling trigger condition is met.
[0058] In one example, when host 10 sends a write request to storage device, flash controller 120 of storage device 12 begins to execute the method of the present invention to monitor whether a first recycling trigger condition is met.
[0059] In one specific embodiment, the monitoring of whether the first recycling trigger condition is met, such as... Figure 3 As shown, it includes:
[0060] S100: Determine whether the number of remaining empty blocks meets the first preset condition;
[0061] For example, flash memory module 125 has a total of 1000 blocks, divided into written blocks and empty blocks. In one example, the number of remaining blocks is 450.
[0062] In this case, two judgment logics can be preset.
[0063] The first method is to judge based on the percentage, that is, to determine whether the ratio of the number of remaining empty blocks to the total number of blocks is no longer greater than a first preset threshold. For example, the first preset threshold is preset to 50%. When the percentage of remaining empty blocks is less than 50%, it is determined that the first preset condition is met. For example, in the example above, the number of remaining blocks is 450, which is less than 50% of the total number of blocks, so it is determined that the first preset condition is met.
[0064] The second method is to judge directly by quantity, that is, to determine whether the number of remaining empty blocks is no longer less than a first quantity threshold. For example, the first quantity threshold is preset to 500. When the number of remaining blocks is less than 500, it is determined that the first preset condition is met. For example, in the example above, the number of remaining blocks is 450, which is less than 500, so it is determined that the first preset condition is met.
[0065] Those skilled in the art will understand that the first method has better generalizability when programming because it uses a percentage-based criterion and does not need to consider the total number of blocks in different flash memory modules.
[0066] S102. If the number of remaining empty blocks meets the first preset condition, then obtain the amount of valid data in each written block.
[0067] The controller can obtain the number of valid pages (i.e. the number of pages with written data) in the written blocks by reading the metadata or mapping table stored in the flash module.
[0068] On the other hand, if the number of remaining empty blocks does not meet the first preset condition, the method ends and no further actions are performed.
[0069] S104. Determine the total amount of valid data in the N blocks with the minimum amount of valid data, where N is a natural number;
[0070] In one example, the amount of valid data in all written blocks is sorted in ascending order, and the top 5 written blocks are selected (i.e., N is chosen as 5). Those skilled in the art will understand that the selection of N can be made according to the actual situation, such as whether it is desired to intervene in garbage collection earlier or later.
[0071] S106. Determine whether the total amount is less than the total capacity of an empty block.
[0072] In one example, an empty block has a total capacity of 512 pages (using TLC as an example); on the other hand, the top 5 written blocks have 50, 70, 90, 90, and 100 valid pages respectively, totaling 400. In this case, the total number of pages is less than the total capacity.
[0073] S108. If the total amount is less than the total capacity of an empty block, then the first recycling trigger condition is confirmed to be met.
[0074] On the other hand, if the number of remaining empty blocks does not meet the first preset condition, the method ends and no further actions are performed.
[0075] In the above example, the judgment is first made at the block level, and then at the page level. Only when both levels meet the preset requirements is the subsequent early garbage collection strategy executed to release empty blocks in advance, so as to minimize the impact on write operations. However, in practice, this standard is sometimes too high, and it is desirable to sacrifice the speed of write operations to perform garbage collection in advance to some extent. Therefore, this invention provides another alternative implementation method.
[0076] In another alternative embodiment, the monitoring of whether a first recycling trigger condition is met, such as Figure 4 As shown, it includes:
[0077] S110. Determine whether the number of remaining empty blocks meets the first preset condition;
[0078] For example, flash memory module 125 has a total of 1000 blocks, divided into written blocks and empty blocks. In one example, the number of remaining blocks is 450.
[0079] In this case, two judgment logics can be preset.
[0080] The first method is to judge based on the percentage, that is, to determine whether the ratio of the number of remaining empty blocks to the total number of blocks is no longer greater than a first preset threshold. For example, the first preset threshold is preset to 50%. When the percentage of remaining empty blocks is less than 50%, it is determined that the first preset condition is met. For example, in the example above, the number of remaining blocks is 450, which is less than 50% of the total number of blocks, so it is determined that the first preset condition is met.
[0081] The second method is to judge directly by quantity, that is, to determine whether the number of remaining empty blocks is no longer less than a first quantity threshold. For example, the first quantity threshold is preset to 500. When the number of remaining blocks is less than 500, it is determined that the first preset condition is met. For example, in the example above, the number of remaining blocks is 450, which is less than 500, so it is determined that the first preset condition is met.
[0082] Those skilled in the art will understand that the first method has better generalizability when programming because it uses a percentage-based criterion and does not need to consider the total number of blocks in different flash memory modules.
[0083] S112. If the number of remaining empty blocks meets the first preset condition, then the first recycling trigger condition is confirmed to be met.
[0084] The controller can obtain the number of valid pages (i.e. the number of pages with written data) in the written blocks by reading the metadata or mapping table stored in the flash module.
[0085] In this embodiment, the determination of whether the first recycling trigger condition is met is made only at the block level. If the condition is met, the subsequent early garbage collection strategy is executed.
[0086] In an alternative embodiment, the monitoring of whether a first recycling trigger condition is met, such as... Figure 5 As shown, it includes:
[0087] S130, Obtain the amount of valid data in each written block;
[0088] The controller can obtain the number of valid pages (i.e. the number of pages with written data) in the written blocks by reading the metadata or mapping table stored in the flash module.
[0089] S132. Determine the total amount of valid data in the N blocks with the minimum amount of valid data, where N is a natural number;
[0090] In one example, the amount of valid data in all written blocks is sorted in ascending order, and the top 5 written blocks are selected (i.e., N is chosen as 5). Those skilled in the art will understand that the selection of N can be made according to the actual situation, such as whether it is desired to intervene in garbage collection earlier or later.
[0091] S134. Determine whether the total amount is less than the total capacity of an empty block;
[0092] In one example, an empty block has a total capacity of 512 pages (using TLC as an example); on the other hand, the top 5 written blocks have 50, 70, 90, 90, and 100 valid pages respectively, totaling 400. In this case, the total number of pages is less than the total capacity.
[0093] S136. If the total amount is less than the total capacity of an empty block, then the first recycling trigger condition is confirmed to be met.
[0094] In this embodiment, the determination of whether the first recycling trigger condition is met is based solely on the page level. If the condition is met, the subsequent early garbage collection strategy is executed.
[0095] S12. In response to the fulfillment of the first triggering condition, perform early garbage collection at a first rate.
[0096] In one specific embodiment, common garbage collection strategies include: Greedy Algorithm; Cost-Benefit Algorithm; Window Algorithm, etc. This application may select a suitable algorithm as an early garbage collection strategy, and this application does not limit the choice of algorithm.
[0097] In one specific embodiment, the early garbage collection is performed based on a preset amount of data for a single garbage collection program, wherein the preset amount of data for a single garbage collection program depends on the type of storage device.
[0098] When performing early garbage collection at the first rate, this invention performs slow data cleanup, which will have a slight impact on writing, but the writing speed is still greater than the writing speed at the second rate mentioned later.
[0099] The first rate of garbage collection is also related to the front-end's write behavior. Since the front-end may repeatedly write data, if the probability of repeated writing is high, then garbage collection will be initiated. The first rate can release enough empty blocks, thus avoiding entering the second rate of garbage collection.
[0100] In one example, the amount of data processed in a single GC process is set to the size of one word line. The size of a word line varies depending on the type of storage device.
[0101] For example, for TLC, the number of pages programmed at one time is 3; for SLC, the number of pages programmed at one time is 1; and for MLC, the number of pages programmed at one time is 2.
[0102] S14. Monitor whether the second triggering condition is met.
[0103] The controller monitors whether the preset second trigger condition is met.
[0104] In one specific embodiment, the monitoring of whether the second triggering condition is met includes:
[0105] Determine whether the number of remaining empty blocks meets the second preset condition.
[0106] The second preset condition includes one of the following ranges:
[0107] First range: Third quantity threshold < Number of remaining empty blocks ≤ Second quantity threshold;
[0108] Second range: Fourth quantity threshold < Number of remaining empty blocks ≤ Third quantity threshold;
[0109] Third range: The number of remaining empty blocks ≤ the fourth quantity threshold.
[0110] In one example, the second quantity threshold is 9, the third quantity threshold is 6, and the fourth quantity threshold is 3.
[0111] S16. In response to the satisfaction of a second triggering condition, perform garbage collection at a second rate, wherein the second rate is greater than the first rate.
[0112] When the second triggering condition is met—that is, when the number of remaining empty blocks falls within any of the first, second, or third ranges mentioned above—garbage collection can be performed at a second rate, which is higher than the first rate. Those skilled in the art will understand that the faster the garbage collection rate, the slower the write speed will be.
[0113] If early garbage collection is also being performed at this time, the first garbage collection rate can be increased to the second rate, and the same garbage collection strategy can be executed; alternatively, early garbage collection can be stopped, and a different garbage collection strategy can be executed at the second rate, such as a greedy algorithm, a cost-benefit algorithm, or a window algorithm. This application may choose a suitable algorithm as a garbage collection strategy, and this application does not limit the choice.
[0114] In one specific embodiment, garbage collection is performed at a second rate in response to the satisfaction of a second triggering condition, such as... Figure 6 As shown, it includes:
[0115] S160. Based on the range satisfied by the number of remaining empty blocks, select the corresponding garbage collection mode;
[0116] Continuing with the example above, the first range corresponds to the first garbage collection mode; the second range corresponds to the second garbage collection mode; and the third range corresponds to the third garbage collection mode.
[0117] S162. Perform garbage collection at a second rate according to the corresponding garbage collection mode, wherein the second rate corresponding to the first range is greater than the second rate corresponding to the second range, and the second rate corresponding to the second range is greater than the second rate corresponding to the third range.
[0118] Taking a TLC flash memory module as an example, the number of pages programmed at one time corresponds to 9 for the second rate in the first range; 27 for the second rate in the second range; and 96 for the second rate in the third range.
[0119] Using a fixed number of pages per program ensures that the time spent entering garbage collection is relatively even each time, preventing the risk that the write speed will drop too low due to entering garbage collection.
[0120] The method of the present invention can not only enter the early GC process to slowly reorganize the data and release the blocks in advance according to the remaining number of empty blocks, but also select different GC modes according to the remaining number of empty blocks, and change the amount of data programmed in one GC process so that the write speed will not drop too low after GC is started.
[0121] It should be noted that the above-described method for optimizing garbage collection efficiency applies not only to scenarios involving user data writing but also to scenarios involving mapping table data writing. In data storage, some dedicated blocks are typically allocated for storing mapping table data, while the remaining blocks are used to store user data. However, both mapping table data and user data require garbage collection; therefore, the optimization method proposed in this invention is equally applicable.
[0122] A second aspect of the present invention provides a storage device, such as Figure 1 As shown, it includes a controller and a flash memory module, wherein the flash memory module includes a program that, when executed by the controller, implements the method described in the first aspect of the present invention.
[0123] A third aspect of the present invention provides an electronic device, such as... Figure 1 As shown, it includes a host and the storage device described in the second aspect of the present invention.
[0124] A fourth aspect of the present invention provides an apparatus for optimizing waste recycling efficiency, comprising:
[0125] The first monitoring module responds to the host's write data request and monitors whether the first recycling trigger condition is met.
[0126] The first execution module, in response to the fulfillment of the first triggering condition, performs early garbage collection at a first rate;
[0127] The second monitoring module monitors whether the second triggering condition is met.
[0128] The second execution module performs garbage collection at a second rate in response to a second triggering condition being met, wherein the second rate is greater than the first rate.
[0129] It should be noted that although the steps in the above embodiments are described in a specific order, those skilled in the art will understand that in order to achieve the effect of this application, different steps do not necessarily have to be executed in such an order. They can be executed simultaneously (in parallel) or in other orders. These adjusted solutions are equivalent to the technical solutions described in this application and therefore will also fall within the protection scope of this application.
[0130] The above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and are not intended to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or improve the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in the present invention; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for optimizing waste recycling efficiency, characterized in that, include: In response to a write data request from the host, monitor whether the first recycling trigger condition is met; In response to the fulfillment of the first triggering condition, early garbage collection is performed at the first rate; Monitor whether the second trigger condition is met; In response to the fulfillment of a second triggering condition, garbage collection is performed at a second rate, wherein the second rate is greater than the first rate. The monitoring of whether the first recovery trigger condition is met includes: Determine whether the number of remaining empty blocks meets the first preset condition; If the number of remaining empty blocks meets the first preset condition, then obtain the amount of valid data in each written block; Determine the total amount of valid data in the N blocks with the minimum amount of valid data, where N is a natural number greater than or equal to 2; Determine whether the total amount is less than the total capacity of an empty block; If the total amount is less than the total capacity of an empty block, then the first recycling trigger condition is confirmed to be met.
2. The method according to claim 1, characterized in that, The determination of whether the number of remaining empty blocks meets the first preset condition includes: Determine whether the ratio of the number of remaining empty blocks to the total number of blocks is no longer greater than a first preset threshold; or Determine whether the number of remaining empty blocks is no longer less than the first quantity threshold.
3. The method according to claim 1, characterized in that, The aforementioned early garbage collection at a first rate includes: The early garbage collection is performed based on a preset amount of data for a single garbage collection program, wherein the preset amount of data for a single garbage collection program depends on the type of storage device.
4. The method according to claim 1, characterized in that, The monitoring of whether the second triggering condition is met includes: determining whether the second triggering condition is met based on the number of remaining empty blocks.
5. The method according to any one of claims 1-4, characterized in that, The garbage collection algorithm used is one of the greedy algorithm, cost-effective algorithm, and window algorithm.
6. A device for optimizing waste recycling efficiency, characterized in that, include: The first monitoring module responds to the host's write data request and monitors whether the first recycling trigger condition is met. The first execution module, in response to the fulfillment of the first triggering condition, performs early garbage collection at a first rate; The second monitoring module monitors whether the second triggering condition is met. The second execution module, in response to a second triggering condition being met, performs garbage collection at a second rate, wherein the second rate is greater than the first rate. The monitoring of whether the first recovery trigger condition is met includes: Determine whether the number of remaining empty blocks meets the first preset condition; If the number of remaining empty blocks meets the first preset condition, then obtain the amount of valid data in each written block; Determine the total amount of valid data in the N blocks with the minimum amount of valid data, where N is a natural number; Determine whether the total amount is less than the total capacity of an empty block; If the total amount is less than the total capacity of an empty block, then the first recycling trigger condition is confirmed to be met.
7. A storage device comprising a controller and a flash memory module, characterized in that, The flash memory module includes a program that, when executed by the controller, implements the method of any one of claims 1-4.
8. An electronic device, characterized in that, Includes a host and a storage device according to claim 7.
Citation Information
Patent Citations
Memory space garbage collection processing method and device, equipment and medium
CN112749102A