LDPC decoding-iteration-aware garbage collection method and device, and solid state disk
By monitoring the number of LDPC decoding iterations of flash memory blocks and dynamically adjusting the garbage collection strategy, the reliability and performance issues of flash memory blocks are solved, the service life of flash memory blocks is extended and the utilization of storage space is improved.
Patent Information
- Application Number
- PCT/CN2024/115148
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-26
- Filing Date
- 2024-08-28
- Publication Date
- 2025-10-02
AI Technical Summary
In the prior art, the garbage collection operation of flash memory blocks is not optimized enough, resulting in reliability and performance issues. In addition, improper garbage collection operations will reduce the service life of the flash memory blocks and increase the raw bit error rate.
By monitoring the number of LDPC decoding iterations for each page in the flash memory block, dynamically allocating used blocks and reserved blocks, recording and sorting the number of decoding iterations in real time, and optimizing garbage collection operations, reliability and performance issues caused by high bit error rates are reduced.
The service life and storage space utilization of the flash memory block are improved, the original bit error rate is reduced, and the overall performance of the flash memory block is improved.
Smart Images

Figure CN2024115148_02102025_PF_FP_ABST
Abstract
Description
LDPC decoding times-aware garbage collection method, garbage collection device, and solid-state hard disk Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a garbage collection method, a garbage collection device and a solid-state hard disk based on the perception of LDPC decoding times. Background Art
[0002] When flash memory runs low on space, garbage collection is initiated to reclaim the flash blocks with the most invalid data pages. The data in the valid pages of the reclaimed blocks is then migrated to new blocks, which are then marked as erased for space recycling. Improper garbage collection can cause reliability and performance issues for flash memory blocks.
[0003] Low-Density Parity-Check (LDPC) codes are widely used in flash memory to ensure data reliability because they use soft decoding for error correction, resulting in strong error correction capabilities. However, initiating soft decoding requires multiple read operations, which reduces read performance. Furthermore, when the flash memory runs out of free space, garbage collection (GC) must be initiated to reclaim already written flash blocks to accommodate new data. Initiating GC too early for some blocks reduces their useful life, while initiating GC too late for others results in a higher raw bit error rate, triggering LDPC soft decoding and causing read latency.
[0004] Therefore, how to optimize the garbage collection operation has become a focus of those skilled in the art.
[0005] Summary of the Invention
[0006] The purpose of the present invention is to propose a garbage collection method, a garbage collection device and a solid-state hard disk based on the perception of the number of LDPC decoding times, which can monitor the changes in the number of decoding iterations of each page in the flash memory block in real time to perform efficient garbage collection operations and improve the overall service life of the flash memory block.
[0007] To achieve the above object, the present invention provides a garbage collection method based on LDPC decoding times perception, comprising:
[0008] Selecting a certain number of flash memory blocks from the flash memory chip;
[0009] Divide the selected flash memory block into two parts, one part as a used block and the other part as a reserved block;
[0010] After all selected flash memory blocks have been worn a certain number of times, random data is written into the used blocks until all the used blocks are filled with data. After a period of time, a read verification is performed. The read verification includes: reading all pages in each used block for LDPC decoding, and recording whether the number of decoding iterations for the current page exceeds a preset iteration threshold;
[0011] During the read verification process, counting the number of pages in each used block that exceeds the preset iteration threshold; and sorting the used blocks from most to least according to the number;
[0012] When new data is written, it is determined whether the flash memory chip has any remaining flash memory blocks. If not, garbage collection is performed on the used blocks according to the sorting, and valid data in the used blocks that need to be recycled are migrated to the reserved blocks.
[0013] In an optional solution, the method for recording whether the number of decoding iterations of the current page exceeds the preset iteration threshold includes: if the number of decoding iterations of the current page exceeds the preset iteration threshold, marking it with bit 1; if the number of decoding iterations of the current page does not exceed the preset iteration threshold, marking it with bit 0.
[0014] In an optional solution, the method for sorting the used blocks includes: counting the number of bits 1 in each of the used blocks, and sorting the used blocks from high to low according to the number of bits 1.
[0015] In an optional solution, the method of performing garbage collection operations on the used blocks according to the order includes: performing garbage collection on the used blocks in order of the number of bits 1 recorded in the used blocks from high to low.
[0016] In an optional solution, the method for performing a garbage collection operation includes: performing an erase operation on the used block for recycling.
[0017] In an optional solution, the number of used blocks is at least three times the number of reserved blocks.
[0018] In an optional solution, the number of the selected flash memory blocks is at least 1000.
[0019] In an optional solution, the LDPC decoding is performed by executing an LDPC hard decoding operation.
[0020] The present invention also provides a garbage collection device based on the perception of the number of LDPC decoding times, comprising:
[0021] A selection module is used to select a certain number of flash memory blocks from the flash memory chip and divide the selected flash memory blocks into two parts, one part as used blocks and the other part as reserved blocks;
[0022] A read verification module is configured to write random data into the used blocks after all selected flash memory blocks have been worn a certain number of times, so that all the used blocks are filled with data, and then perform a read verification after a period of time. The read verification includes: reading all pages in each used block for LDPC decoding, and recording whether the number of decoding iterations for the current page exceeds a preset iteration threshold;
[0023] a sorting module, configured to count the number of pages exceeding the preset iteration threshold in each of the used blocks during the read verification process; and sort the used blocks from most to least according to the number;
[0024] The recycling module is used to determine whether there are any remaining flash memory blocks in the flash memory chip when new data is written. If not, garbage collection operations are performed on the used blocks according to the sorting, and valid data in the used blocks that need to be recycled are migrated to the reserved blocks.
[0025] The present invention also provides a solid state hard disk that performs garbage collection using the above-mentioned garbage collection method.
[0026] Beneficial effects of the present invention:
[0027] Different pages in a flash memory block have large differences in raw bit error rates. During the decoding process, flash memory pages have different numbers of decoding iterations. Traditional methods do not consider the impact of the number of decoding iterations on garbage collection when performing garbage collection operations, causing reliability and performance issues.
[0028] The present invention dynamically performs garbage collection operations according to changes in the number of LDPC decoding iterations, can effectively perform garbage collection, improve storage space utilization, and simultaneously reduce reliability and performance problems caused by a high original bit error rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The above and other objects, features and advantages of the present invention will become more apparent through a more detailed description of exemplary embodiments of the present invention with reference to the accompanying drawings, in which like reference numerals generally represent like components.
[0030] FIG1 is a flow chart of a garbage collection method based on LDPC decoding times perception according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The advantages and features of the present invention will become more apparent from the following description and drawings. However, it should be noted that the technical solutions of the present invention can be implemented in a variety of different forms and are not limited to the specific embodiments described herein. The drawings are highly simplified and not to exact scale, and are intended solely to facilitate and clearly illustrate the embodiments of the present invention.
[0032] It should be understood that when an element or layer is referred to as being "on," "adjacent to," "connected to," or "coupled to" another element or layer, it can be directly on, adjacent to, connected to, or coupled to the other element or layer, or there can be intervening elements or layers. Conversely, when an element is referred to as being "directly on," "directly adjacent to," "directly connected to," or "directly coupled to" another element or layer, there are no intervening elements or layers. It should be understood that although the terms first, second, third, etc. may be used to describe various elements, components, regions, layers, and / or parts, these elements, components, regions, layers, and / or parts should not be limited by these terms. These terms are merely used to distinguish one element, component, region, layer, or part from another element, component, region, layer, or part. Thus, a first element, component, region, layer, or part discussed below may be represented as a second element, component, region, layer, or part without departing from the teachings of the present invention.
[0033] Spatially relative terms such as "under," "beneath," "below," "under," "above," "above," etc., may be used herein for convenience of description to describe the relationship of one element or feature shown in the figures to other elements or features. It should be understood that the spatially relative terms are intended to include different orientations of the device in use and operation in addition to the orientations shown in the figures. For example, if the device in the drawings is flipped, then the elements or features described as "under" or "beneath" or "beneath" the other elements will be oriented as "over" the other elements or features. Thus, the exemplary terms "under" and "under" may include both the upper and lower orientations. The device may be oriented otherwise (rotated 90 degrees or in other orientations) and the spatial descriptors used herein are interpreted accordingly.
[0034] The purpose of the terms used herein is only to describe specific embodiments and is not intended to limit the present invention. When used herein, the singular forms "a", "an", and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "comprising" and / or "comprising", when used in this specification, determine the presence of the features, integers, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, parts and / or groups. When used herein, the term "and / or" includes any and all combinations of the relevant listed items.
[0035] Example 1
[0036] 1 , this embodiment provides a garbage collection method based on LDPC decoding times perception, which is applied in a flash memory system. The method includes:
[0037] Selecting a certain number of flash memory blocks from the flash memory chip;
[0038] Divide the selected flash memory block into two parts, one part as a used block and the other part as a reserved block;
[0039] After all selected flash memory blocks have been worn a certain number of times, random data is written into the used blocks until all the used blocks are filled with data. After a period of time, a read verification is performed. The read verification includes: reading all pages in each used block for LDPC decoding, and recording whether the number of decoding iterations for the current page exceeds a preset iteration threshold;
[0040] During the read verification process, counting the number of pages in each used block that exceeds the preset iteration threshold; and sorting the used blocks from most to least according to the number;
[0041] When new data is written, it is determined whether the flash memory chip has any remaining flash memory blocks. If not, garbage collection is performed on the used blocks according to the sorting, and valid data in the used blocks that need to be recycled are migrated to the reserved blocks.
[0042] Specifically, the method comprises the following steps:
[0043] Step 1: Select 2000 flash memory blocks from the flash memory chip, of which 90% are used blocks and 10% are reserved blocks.
[0044] Step 2: After all selected flash memory blocks have been worn a certain number of times, random data is written into the used blocks so that all used blocks are filled with data, and then read and verify them after a period of time (the read verification includes steps 3 and 4).
[0045] Step 3: Read out all pages in each of the used blocks to perform LDPC hard decoding operations, and count the number of decoding iterations for each page.
[0046] Step 4: Set a specific LDPC decoding iteration threshold (e.g., 20) and record pages whose iteration count exceeds the LDPC decoding iteration threshold. If the decoding iteration count of the current page exceeds the preset iteration threshold, bit 1 is used to mark it. If the decoding iteration count of the current page does not exceed the preset iteration threshold, bit 0 is used to mark it.
[0047] Step 5: Count the number of bits 1 in each used block and sort the used blocks from highest to lowest according to the number of bits 1. The number of bits 1 indicates how many pages of the block cannot be corrected using LDPC hard decoding.
[0048] Step 6: When new data is written, check whether the flash memory chip has any remaining flash memory blocks to write the new data.
[0049] Step 7: If there are no remaining blocks to write new data to, garbage collect the used blocks in descending order of the number of 1 bits recorded in the used blocks with written data. When space is insufficient, garbage collection is initiated to ensure sufficient space for new data to be written. Garbage collection, descending order of the number of 1 bits recorded in the used blocks with written data, indicates that blocks are recycled based on the reliability of the data.
[0050] Step 8: During garbage collection, the number of blocks to be garbage collected is set based on the data write requirements. Valid data pages in the used blocks are moved to reserved blocks, and the used blocks are erased for recycling. During garbage collection, valid data from other pages in the block is moved to new blocks to reduce the original bit error rate.
[0051] In this method, steps 3 to 7 are real-time changing processes. This embodiment monitors the changes in the number of decoding iterations of each page in the flash memory block in real time, performs efficient dynamic garbage collection operations, and improves the overall service life of the flash memory blocks. At the same time, it avoids read performance issues caused by the need to start LDPC soft decoding operations due to the high original bit error rate of some blocks.
[0052] Example 2
[0053] This embodiment provides a garbage collection device based on LDPC decoding times perception, including:
[0054] A selection module is used to select a certain number of flash memory blocks from the flash memory chip and divide the selected flash memory blocks into two parts, one part as used blocks and the other part as reserved blocks;
[0055] A read verification module is configured to write random data into the used blocks after all selected flash memory blocks have been worn a certain number of times, so that all the used blocks are filled with data, and then perform a read verification after a period of time. The read verification includes: reading all pages in each used block for LDPC decoding, and recording whether the number of decoding iterations for the current page exceeds a preset iteration threshold;
[0056] a sorting module, configured to count the number of pages exceeding the preset iteration threshold in each of the used blocks during the read verification process; and sort the used blocks from most to least according to the number;
[0057] The recycling module is used to determine whether there are any remaining flash memory blocks in the flash memory chip when new data is written. If not, garbage collection operations are performed on the used blocks according to the sorting, and valid data in the used blocks that need to be recycled are migrated to the reserved blocks.
[0058] Example 3
[0059] This embodiment provides a solid-state hard disk that performs garbage collection using the garbage collection method described in Example 1.
[0060] The above description is only a description of the preferred embodiments of the present invention and does not limit the scope of the present invention. Any changes and modifications made by ordinary technicians in the field of the present invention based on the above disclosure shall fall within the scope of protection of the claims.
Claims
1. A garbage collection method based on LDPC decoding times perception, characterized in that: include: Selecting a certain number of flash memory blocks from the flash memory chip; Divide the selected flash memory block into two parts, one part as a used block and the other part as a reserved block; After all selected flash memory blocks have been worn a certain number of times, random data is written into the used blocks until all the used blocks are filled with data. After a period of time, a read verification is performed. The read verification includes: reading all pages in each used block for LDPC decoding, and recording whether the number of decoding iterations for the current page exceeds a preset iteration threshold; During the read verification process, counting the number of pages in each used block that exceeds the preset iteration threshold; and sorting the used blocks from most to least according to the number; When new data is written, it is determined whether the flash memory chip has any remaining flash memory blocks. If not, garbage collection is performed on the used blocks according to the sorting, and valid data in the used blocks that need to be recycled are migrated to the reserved blocks.
2. The LDPC decoding times-aware garbage collection method according to claim 1, wherein: The method for recording whether the number of decoding iterations of the current page exceeds the preset iteration threshold includes: if the number of decoding iterations of the current page exceeds the preset iteration threshold, marking it with bit 1; if the number of decoding iterations of the current page does not exceed the preset iteration threshold, marking it with bit 0.
3. The LDPC decoding times-aware garbage collection method according to claim 2, wherein: The method for sorting the used blocks comprises: The number of bits 1 in each of the used blocks is counted, and the used blocks are sorted from high to low according to the number of bits 1.
4. The LDPC decoding times-aware garbage collection method according to claim 3, wherein: The method of performing garbage collection operations on the used blocks according to the order comprises: The used blocks are garbage collected in order of the number of bits 1 recorded in the used blocks from high to low.
5. The LDPC decoding times-aware garbage collection method according to claim 1, wherein: The method for performing a garbage collection operation includes: performing an erase operation on the used block for recycling.
6. The LDPC decoding times-aware garbage collection method according to claim 1, wherein: The number of used blocks is at least three times the number of reserved blocks.
7. The LDPC decoding times-aware garbage collection method according to claim 1, wherein: The number of the selected flash memory blocks is at least 1000.
8. The LDPC decoding times-aware garbage collection method according to claim 1, wherein: The LDPC decoding is to perform an LDPC hard decoding operation.
9. A garbage collection device based on LDPC decoding times perception, characterized in that: include: A selection module is used to select a certain number of flash memory blocks from the flash memory chip and divide the selected flash memory blocks into two parts, one part as used blocks and the other part as reserved blocks; A read verification module is configured to write random data into the used blocks after all selected flash memory blocks have been worn a certain number of times, so that all the used blocks are filled with data, and then perform a read verification after a period of time. The read verification includes: reading all pages in each used block for LDPC decoding, and recording whether the number of decoding iterations for the current page exceeds a preset iteration threshold; a sorting module, configured to count the number of pages exceeding the preset iteration threshold in each of the used blocks during the read verification process; and sort the used blocks from most to least according to the number; The recycling module is used to determine whether there are any remaining flash memory blocks in the flash memory chip when new data is written. If not, garbage collection operations are performed on the used blocks according to the sorting, and valid data in the used blocks that need to be recycled are migrated to the reserved blocks.
10. A solid state hard disk, characterized in that: Garbage recycling is carried out using the garbage recycling method described in any one of claims 1 to 8.
Citation Information
Patent Citations
An approximate data storage method in a flash memory
CN109947589A
Data reading method, storage controller and storage device
CN111913829A
LDPC decoding log-likelihood ratio information prediction method, electronic device and storage medium
CN116707544A
LDPC (Low Density Parity Check) decoding frequency sensing garbage collection method, garbage collection device and solid state disk
CN118245390A