Data storage device and non-volatile memory control method
By adjusting the frequency of wear-leveling moves according to the write amplification rate in non-volatile memory, the problems of invalid cold data moves and deterioration of write amplification caused by wear-leveling moves are solved, and the service life of the memory is extended.
Patent Information
- Application Number
- CN202410014546.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-07-04
- Filing Date
- 2024-01-04
- Publication Date
- 2024-08-27
AI Technical Summary
When non-volatile memory performs wear-leveling migration, it may lead to invalid migration of cold data, shorten product life, and worsen write amplification.
The controller adjusts the execution frequency of wear-leveling migration according to the first value and the second value related to the write amplification rate to ensure that the erase count of the idle block is lower than the erase count of the data block to avoid unnecessary data Relocation to extend memory life.
This effectively avoids invalid movement of cold data, prevents the write amplification rate from deteriorating, and extends the service life of non-volatile memory.
Smart Images

Figure CN118553293A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a control technology for a data storage device. Background Art
[0002] There are many forms of non-volatile memory, such as flash memory, magnetoresistive RAM, ferroelectric RAM, resistive RAM, spin transfer torque RAM (STT-RAM), etc., which are used for long-term data storage and can be used as storage media to implement a data storage device.
[0003] Non-volatile memory has its own special storage characteristics and requires a corresponding storage architecture. The technical field must develop corresponding control technology corresponding to the storage architecture of non-volatile memory. Summary of the invention
[0004] The present invention aims at the special storage characteristics of non-volatile memory and proposes a non-volatile memory life extension technology.
[0005] A data storage device according to an embodiment of the present invention includes a non-volatile memory and a controller. The controller is coupled to the non-volatile memory and controls the non-volatile memory controller according to a request of a host. The controller adjusts the execution frequency of a wear leveling migration according to a first value and a second value related to the write amplification factor. Through the wear leveling migration, the controller causes an idle first block in the non-volatile memory to store data of a second block with an erase count lower than that of the first block, and then erases and releases the second block.
[0006] In one embodiment, the frequency of executing the wear leveling shift may have multiple levels for different ratios of the first value to the second value. As the ratio of the first value to the second value increases to a higher ratio, the wear leveling shift is reduced to a level with a lower execution frequency.
[0007] In one embodiment, the first value is C / TotalPE', the numerator C is a wear leveling erase increment of the non-volatile memory, indicating the erase burden of the non-volatile memory due to the wear leveling migration, and the denominator TotalPE' is a total number of erases generated by the non-volatile memory when the wear leveling migration is performed. The second value is 1-X / Xt; the numerator X is a write amplification factor generated when the wear leveling migration is not performed, and the denominator Xt is a write amplification factor upper limit, which can be set by the manufacturer or user of the data storage device.
[0008] In one implementation, the closer the first value is to the second value, the lower the execution frequency of the wear leveling migration is.
[0009] An implementation method is to propose a non-volatile memory control method based on the above concept.
[0010] The following is a detailed description of the present invention with reference to the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 A data storage device 100 is illustrated according to one embodiment of the present invention;
[0012] Figure 2 is a flow chart illustrating how the controller 104 switches the frequency level of the loss level migration according to one embodiment of the present invention; and
[0013] Figure 3 is a flow chart illustrating how the controller 104 performs the wear level migration according to the level setting according to one embodiment of the present invention.
[0014]
Explanation of symbols
[0015] 100: Data storage device
[0016] 102: Flash memory
[0017] 104: Controller
[0018] 106:Host
[0019] 108: Idle block pool
[0020] 110: Data block pool
[0021] Blk1, Blk2: first and second blocks
[0022] S202...S214, and S302...S306: Steps DETAILED DESCRIPTION
[0023] The following description lists various embodiments of the present invention. The following description introduces the basic concept of the present invention and is not intended to limit the content of the present invention. The actual scope of the invention should be defined in accordance with the scope of the patent application.
[0024] Non-volatile memory can be Flash Memory, Magnetoresistive RAM, Ferroelectric RAM, Resistive RAM (RRAM), Spin Transfer Torque RAM (STT-RAM), etc., which provide storage media for long-term data preservation. The following discussion specifically takes Flash Memory as an example, but the technology described can also be used on other types of non-volatile memory.
[0025] Nowadays, data storage devices often use flash memory as storage media to realize products such as memory cards, USB flash devices, solid-state drives (SSDs), etc. One application is to use multi-chip packaging to package flash memory and its controller together, which is called an embedded flash memory module (such as eMMC).
[0026] Data storage devices using flash memory as storage media can be applied to a variety of electronic devices, including smart phones, wearable devices, tablet computers, virtual reality devices, etc. The processor of the electronic device can be regarded as a host, operating the data storage device configured in the electronic device to access the flash memory therein.
[0027] Data storage devices using flash memory as storage media can also be used to build data centers. For example, servers can operate solid-state drive (SSD) arrays to form data centers. The server can be regarded as a host and operate the connected solid-state drive to access the flash memory therein.
[0028] Flash memory has its own special storage characteristics. The host sends read and write requests to the flash memory using logical addresses (e.g., logical block addresses LBA or global host page numbers GHP, etc.). Logical addresses need to be mapped to physical addresses to correspond to the flash memory physical space. The mapping method will depend on the flash memory architecture.
[0029] The physical space of flash memory is divided into multiple blocks for use. Each block includes multiple pages. Each page includes multiple sectors. In particular, data is updated on idle space, not copied on old data. After the update, the old data will be considered invalid. Blocks filled with invalid data will be released for reuse after garbage collection, with blocks as the erasure unit. However, erasure will shorten the life of flash memory. Once the erase count of blocks above a certain proportion exceeds the upper limit, the flash memory must be prohibited from writing. Wear leveling technology has been developed accordingly.
[0030] Wear leveling can be divided into dynamic and static. Dynamic wear leveling is to select spare blocks with low erase counts to store data, avoiding overuse of blocks that have been erased many times. Static wear leveling, also known as wear leveling migration, is to regard the data stored in data blocks with low erase counts (cold blocks) as cold data with low update probability, and move the cold data to spare blocks with higher erase counts (hot blocks) for storage and then erase the cold blocks. In this way, the cold blocks occupied by cold data can be released for use, while the frequently used hot blocks are frozen by cold data. However, wear leveling migration involves block erasure. If the data being moved is not actually cold data, not only will the purpose of freezing the frequently used blocks fail to be achieved, but the product life will also be shortened due to the waste of the erase quota of the flash memory.
[0031] In the data writing operation requested by the host, in addition to the number of data block erases generated for writing the data itself, there may also be additional data block erases generated due to the accompanying garbage collection, error preservation, wear leveling migration, etc. The present invention proposes a memory life extension technology, which adjusts the execution frequency of wear leveling migration according to a first value and a second value related to the write amplification ratio. In one embodiment, the first value is an additional erase ratio, which shows the proportion of the number of data block erases additionally performed in order to perform wear leveling migration when the non-volatile memory performs wear leveling migration in the total number of data block erases. Determining the execution frequency of wear leveling migration based on the additional erase ratio will avoid or reduce the chance of invalid migration of cold data, prevent the deterioration of write amplification ratio and extend the service life of the product. In other embodiments, the first value and the second value may also have other variations, for example, taking into account weighting or other variation parameters.
[0032] Figure 1According to one embodiment of the present invention, a data storage device 100 is illustrated, which includes a flash memory 102 and a controller 104. The controller 104 is coupled to the flash memory 102 and is used to control the flash memory 102 according to the requirements of a host 106. The storage space of the flash memory 102 is erased in blocks. The idle blocks to be configured for use belong to an idle block pool 108. The blocks storing data belong to a data block pool 110. The controller 104 provides a wear leveling migration function, which uses a first block Blk1 in the idle block pool 108 to store data of a second block Blk2 (the erase count is lower than the first block Blk1) in the data block pool 110, and then erases and releases the second block Blk2. In this way, the space of the second block Blk2, which is rarely used, can be released for use, and the frequently used first block Blk1 has a chance to be frozen (because it may store cold data and reduce the chance of being erased), avoiding rapid loss. However, the content of the second block Blk2 is not necessarily cold data. After being stored in the first block Blk1, it may be erased and released again due to frequent updates. The present invention particularly observes such a phenomenon from the additional erase ratio. The controller 104 adjusts the execution frequency of the wear leveling migration according to the additional erase ratio. Once it is found that the additional erase ratio deteriorates, the execution frequency of the wear leveling migration is reduced. Conversely, the controller 104 can also increase the execution frequency of the wear leveling migration as the additional erase ratio approaches an ideal value. The controller 104 adjusts the execution frequency of the wear leveling migration according to the additional erase ratio.
[0033] In one embodiment, the execution frequency of the wear leveling migration has multiple levels, corresponding to different levels of the extra erase ratio. As the extra erase ratio increases to a certain level, the controller will use a frequency level with a lower execution frequency; and as the extra erase ratio decreases to a certain level, the controller will use a frequency level with a higher execution frequency.
[0034] In one embodiment, the controller 104 makes an idle block with an erase count greater than a threshold value as a candidate block of the first block Blk1. The controller 104 performs a modulo operation (%) on the erase count of the candidate block. Regarding the wear balance migration, different execution frequencies correspond to different modulo remainder combinations, and only candidate blocks that meet the modulo remainder combination are allowed to perform the wear balance migration. The lower the execution frequency, the smaller the modulo remainder combination corresponding to.
[0035] In one embodiment, there are N levels of execution frequency, where N is an integer. The controller 104 performs modulo operation on the erase count of the candidate block by the divisor N. Corresponding to the frequency level with the highest execution frequency (the Nth level), the controller 104 ignores the modulo result and directly performs wear balancing migration on the candidate block; that is, all idle blocks exceeding the critical value will trigger wear balancing migration. Idle blocks with higher erase counts have a chance to be frozen by cold data originally located in data blocks with lower erase counts, and the blocks with lower erase counts will be released. Corresponding to the frequency level with the second highest execution frequency (the N-1th level), the sampling remainder combination includes all N-1 remainders that are not 0 after the modulo operation, that is, only candidate blocks whose erase counts are exactly N multiples (the remainder after the modulo operation is 0) will not trigger wear balancing migration. By analogy, in a frequency level with a lower execution frequency, the sampled remainder combination includes fewer remainders, and the wear leveling migration execution frequency is lower.
[0036] One implementation method is to design a test program, given a series of write data (the amount of scheduled write data is Host_Write_Data), and implement it without wear leveling, and record the total number of block erases TotalPE that occurred in the entire flash memory 102 during the test, and then test a write amplification factor X. The formula for the write amplification factor X is as follows:
[0037] X=TotalPE*block_size / Host_Write_Data
[0038] Among them, block_size is the size of each block.
[0039] When the controller 104 is actually operating, a wear leveling enabled function is performed, and during the process, the total number of block erases TotalPE' that have occurred in the entire flash memory 102 is recorded, and then a write amplification factor X' is obtained. The formula for the write amplification factor X' is as follows:
[0040] X'=TotalPE'*block_size / Host_Write_Data
[0041] The write amplification factor X' must not exceed the write amplification factor upper limit Xt set by the product manufacturer or user. The present invention specifically calculates a wear leveling erase increment C (=TotalPE'-TotalPE) to show the additional erase burden incurred by the flash memory 102 due to the wear leveling migration. Based on the following derivation,
[0042]
[0043] It can be seen that
[0044]
[0045] In one embodiment, C / TotalPE' can be used as the first value (i.e., the additional erase ratio), and can be calculated by the calculation method of 1-X / X'. Then, after further substituting Xt into X', a second value as the upper limit of the ratio can be obtained. The relationship between the first value and the second value will show the development trend (deterioration or improvement) of the additional erase ratio C / TotalPE'. When the first value is closer to the second value, the write amplification rate of the product is closer to the upper limit set by the product manufacturer or user. The controller 104 adjusts the execution frequency of the wear leveling migration based on the difference between the first value and the second value.
[0046] In one implementation, the closer the first value is to the second value, the worse the excess erase ratio is. The controller 104 switches to perform the wear leveling migration at a lower execution frequency.
[0047] In one embodiment, the execution frequency of the wear leveling migration has multiple levels corresponding to different closeness between the first value and the second value.
[0048] In one implementation, the controller 104 performs a modulo operation of the erase count of the candidate block (the idle block whose erase count exceeds the threshold) with a divisor of 4 to adjust the execution frequency of the wear leveling migration in four levels:
[0049] Level 4 (highest level, hereinafter labeled WL_Level_0x0):
[0050] When the first value is less than 80% of the second value, all idle blocks with erase counts exceeding the threshold will trigger wear leveling migration;
[0051] Level 3 (second highest level, hereinafter labeled WL_Level_0x1):
[0052] The first value is used when it is between 80% and 90% of the second value; after the erase count is modulo 4, as long as there is a remainder (>=1), the candidate block can participate in the wear leveling migration;
[0053] Level 2 (hereinafter labeled WL_Level_0x2):
[0054] When the first value exceeds 90% of the second value but is less than or equal to 95% of the second value, the candidate block is adopted; after the erase count is modulo 4, as long as the remainder is greater than or equal to 2 (3 or 2), the candidate block can participate in the wear leveling migration;
[0055] Level 1 (hereinafter labeled WL_Level_0x3):
[0056] It is adopted when the first value exceeds 95% of the second value; after the erase count is modulo 4, as long as the remainder is greater than or equal to 3 (only 3), the candidate block can participate in the wear leveling migration.
[0057] This embodiment clearly shows that, in a lower frequency level, the sampled residue combination includes fewer residues, and the wear leveling migration is performed less frequently.
[0058] In another embodiment, the controller 104 records the erase count difference (hereinafter referred to as PE_difference) between each block and the lowest erase count block. In this embodiment, the idle blocks whose erase count difference PE_difference exceeds the critical value are selected as candidate blocks, and the erase count difference PE_difference of the candidate blocks is modulo-calculated, and whether to perform the wear leveling migration is determined according to the modulo-calculated result. For example, the design of the execution frequency of the wear leveling migration is as follows:
[0059] Level 4 (highest level, hereinafter labeled WL_Level_0x0):
[0060] When the first value is less than 80% of the second value, all idle blocks whose erase count difference PE_difference exceeds the threshold value will trigger a wear leveling migration;
[0061] Level 3 (second highest level, hereinafter labeled WL_Level_0x1):
[0062] The first value is used when it is between 80% and 90% of the second value; after the erase count difference PE_difference is modulo 4, as long as there is a remainder (>=1), the candidate block can participate in the wear leveling migration;
[0063] Level 2 (hereinafter labeled WL_Level_0x2):
[0064] When the first value exceeds 90% of the second value but is less than or equal to 95% of the second value, the candidate block is adopted; after the erase count difference PE_difference is modulo 4, as long as the remainder is greater than or equal to 2 (3 or 2), the candidate block can participate in the wear leveling migration;
[0065] Level 1 (hereinafter labeled WL_Level_0x3):
[0066] When the first value exceeds 95% of the second value, it is adopted; after the erase count difference PE_difference is modulo 4, as long as the remainder is greater than or equal to 3 (only 3), the candidate block can participate in the wear leveling migration.
[0067] In other implementations, other values developed based on the erase count, not limited to the erase count difference, can also be used for modulo operation. The aforementioned modulo object can be an evaluation value developed based on the erase count.
[0068] Figure 2 FIG. 4 is a flow chart illustrating how the controller 104 switches the frequency level of the wear leveling migration according to one embodiment of the present invention.
[0069] In step S202, the controller 104 determines whether the first value is greater than or equal to 80% of the second value. If not, it means that the write amplification factor is still within an acceptable range; according to step S204, the controller 104 sets the execution frequency of the wear leveling migration to the highest level WL_Level_0x0. On the contrary, the controller 104 determines in step S206 whether the first value exceeds 90% of the second value. If not, according to step S208, the controller 104 sets the execution frequency of the wear leveling migration to the second highest level WL_Level_0x1. Compared with the full level WL_Level_0x0, the second highest level WL_Level_0x1 executes the wear leveling migration at a lower frequency.
[0070] If the first value exceeds the second value by 90% in step S206, the controller 104 determines in step S210 whether the first value exceeds 95% of the second value. If not, the controller 104 sets the execution frequency of the wear leveling migration to level WL_Level_0x2 according to step S212. Compared with the second highest level WL_Level_0x1, the level WL_Level_0x2 executes the wear leveling migration at a lower frequency.
[0071] If the first value exceeds 95% of the second value in step S210 , the controller 104 sets the execution frequency of the wear leveling migration to level WL_Level_0x3 according to step S214 . Compared with level WL_Level_0x2 , level WL_Level_0x3 executes the wear leveling migration at a lower frequency.
[0072] The first value may also be other variations developed based on C / TotalPE'. The second value may also be other variations developed based on 1-X / Xt.
[0073] Figure 3 is a flow chart illustrating how the controller 104 performs the wear level migration according to the level setting according to one embodiment of the present invention.
[0074] In step S302 , the controller 102 monitors whether there is a candidate block for the first block Blk1 , for example, monitoring the idle blocks newly released to the idle block pool 108 to determine whether the erase count thereof is greater than a critical value.
[0075] If there is a candidate block, according to step S304, the controller determines whether the remainder after the erase count of the candidate block is modulo 4 meets the current level setting. If not, the wear leveling migration of the candidate block is not allowed, and the process ends. On the contrary, according to step S306, the controller 104 uses the candidate block as the destination of the wear leveling migration (the first block Blk1), and moves the data stored in the data block (the second block Blk2) with a lower erase count in the data block pool 110 to the candidate block (the first block Blk1), and releases the space of the second block Blk2.
[0076] In one embodiment, the controller 104 monitors the minimum erase count in all blocks and the difference between the erase counts of other blocks and the minimum erase count, and then estimates the total erase count TotalPE' of the entire flash memory 102 in a statistical manner, and then subtracts it from the total erase count TotalPE obtained by the test to obtain the wear-leveling erase increment C.
[0077] The above frequency level evaluation criteria may be slightly modified according to user requirements. Any technology that adjusts the execution frequency of wear-leveling migration based on the additional erase ratio is related to the content of the present invention.
[0078] The above concept can be further used to implement a non-volatile memory control method, including adjusting the execution frequency of a wear leveling migration according to an additional erase ratio. The additional erase ratio shows the proportion of the number of data block erases additionally executed for the wear leveling migration in the total number of data block erases when the non-volatile memory performs the wear leveling migration. Through the wear leveling migration, an idle first block in the non-volatile memory stores data of a second block whose erase count is lower than that of the first block, and then erases and releases the second block.
[0079] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. Anyone familiar with this technology can make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be based on the scope defined by the attached patent application.
Claims
1. A data storage device, include: a non-volatile memory; as well as a controller coupled to the non-volatile memory and controlling the non-volatile memory according to a request of a host, in: The controller adjusts the execution frequency of a loss balancing migration according to a first value and a second value; and Through the wear leveling migration, the controller enables an idle first block in the non-volatile memory to store data of a second block whose erase count is lower than that of the first block, and then erases and releases the second block.
2. The data storage device according to claim 1, Features: The execution frequency of the wear leveling migration has multiple levels, corresponding to different ratios of the first value to the second value; and As the ratio of the first value to the second value increases to a higher ratio, the wear leveling shift is downgraded to a level with a lower execution frequency.
3. The data storage device as claimed in claim 2, Features: The controller makes the idle blocks with erase counts greater than a threshold value as candidate blocks for the first block; The controller modulos an evaluation value developed by the erase count of the candidate block; Regarding the wear level migration, execution frequencies of different levels correspond to different modulo remainder combinations, and candidate blocks that meet the modulo remainder combination are allowed to perform the wear level migration; and The lower the execution frequency, the smaller the modulo remainder combinations corresponding to the remainders.
4. The data storage device as claimed in claim 3, Features: There are N levels of execution frequency, where N is an integer; The controller performs modulo operation of a divisor N on the evaluation value developed from the erase count of the candidate block; For the highest execution frequency of the corresponding Nth level, the controller ignores the modulo result and directly performs wear-balancing migration on the candidate blocks; The sampled residue combination corresponding to the second highest execution frequency of the (N-1)th level includes all (N-1) residues; and The lower the execution frequency of the lower level, the fewer remainders the sampled remainder combination includes.
5. The data storage device according to claim 1, Features: The first value is C / TotalPE', wherein the numerator C is a wear leveling erase increment of the non-volatile memory, indicating the erase burden of the non-volatile memory due to the wear leveling migration, and the denominator TotalPE' is a total erase quantity generated by the non-volatile memory when performing the wear leveling migration; The second value is 1-X / Xt, where the numerator X is a write amplification factor generated when the wear leveling migration is not performed, and the denominator Xt is an upper limit of the write amplification factor.
6. The data storage device as claimed in claim 5, Features: The closer the first value is to the second value, the lower the execution frequency of the wear leveling migration is.
7. The data storage device as claimed in claim 6, Features: The execution frequency of the wear level migration has multiple levels, corresponding to the first value accounting for the second value to different degrees.
8. The data storage device as claimed in claim 7, Features: The controller makes the idle blocks with erase counts greater than a threshold value as candidate blocks for the first block; The controller modulos an evaluation value developed by the erase count of the candidate block; Regarding the wear level migration, execution frequencies of different levels correspond to different modulo remainder combinations, and candidate blocks that meet the modulo remainder combination are allowed to perform the wear level migration; and The lower the execution frequency, the smaller the modulo remainder combinations corresponding to the remainders.
9. The data storage device as claimed in claim 8, Features: There are N levels of execution frequency, where N is an integer; The controller performs modulo operation of a divisor N on the evaluation value developed from the erase count of the candidate block; For the highest execution frequency of the corresponding Nth level, the controller ignores the modulo result and directly performs wear-balancing migration on the candidate blocks; The sampled residue combination corresponding to the second highest execution frequency of the (N-1)th level includes all (N-1) residues; and The lower the execution frequency of the lower level, the fewer remainders the sampled remainder combination includes.
10. The data storage device as claimed in claim 8, Features: The evaluation value is the erase count of the candidate block itself, or the erase count difference between the candidate block and the block with the lowest erase count.
11. A non-volatile memory control method, include: According to a first value and a second value, adjusting the execution frequency of a loss leveling migration, Wherein, through the wear leveling migration, an idle first block in the non-volatile memory stores data of a second block whose erase count is lower than that of the first block, and then erases and releases the second block.
12. The non-volatile memory control method according to claim 11, Features: The execution frequency of the wear leveling migration has multiple levels, corresponding to different ratios of the first value to the second value; and As the ratio of the first value to the second value increases to a higher ratio, the wear leveling shift is downgraded to a level with a lower execution frequency.
13. The non-volatile memory control method according to claim 12, It is characterized in that Also includes: Make the idle blocks with erase counts greater than a threshold value as candidate blocks for the first block; modulo a judgment value developed by the erase count of the candidate block; Regarding the wear balance migration, different execution frequencies of different levels are made to correspond to different modular remainder combinations, and candidate blocks that meet the modular remainder combinations are allowed to perform the wear balance migration; and The lower the execution frequency, the smaller the modulo remainder combination corresponding to.
14. The non-volatile memory control method according to claim 13, It is characterized in that Also includes: Let the execution frequency have N levels, N is an integer; Taking the evaluation value developed from the erase count of the candidate block modulo the divisor N; The highest execution frequency of the corresponding Nth level is ignored, and the candidate block is directly moved for loss balancing; Corresponding to the second highest execution frequency of the (N-1)th level, the sampled remainder combination includes all (N-1) remainders; and The lower the execution frequency of the corresponding lower level, the fewer remainders the sample remainder combination includes.
15. The non-volatile memory control method according to claim 11, Features: The first value is C / TotalPE', the numerator C is a wear leveling erase increment of the non-volatile memory, indicating the erase burden of the non-volatile memory due to the wear leveling migration, and the denominator TotalPE' is a total erase quantity generated when performing the wear leveling migration; and The second value is 1-X / Xt, where the numerator X is a write amplification factor generated when the wear leveling migration is not performed, and the denominator Xt is an upper limit of the write amplification factor.
16. The non-volatile memory control method according to claim 15, Features: The closer the first value is to the second value, the lower the execution frequency of the wear leveling migration is.
17. The non-volatile memory control method according to claim 16, Features: The execution frequency of the wear level migration has multiple levels, corresponding to the first value accounting for the second value to different degrees.
18. The non-volatile memory control method according to claim 17, It is characterized in that Also includes: Make the idle blocks with erase counts greater than a threshold value as candidate blocks for the first block; modulo a judgment value developed by the erase count of the candidate block; Regarding the wear balance migration, different execution frequencies of different levels are made to correspond to different modular remainder combinations, and candidate blocks that meet the modular remainder combinations are allowed to perform the wear balance migration; and The lower the execution frequency, the smaller the modulo remainder combination corresponding to.
19. The non-volatile memory control method according to claim 18, It is characterized in that Also includes: Let the execution frequency have N levels, N is an integer; Taking the evaluation value developed from the erase count of the candidate block modulo the divisor N; The highest execution frequency of the corresponding Nth level is ignored, and the candidate block is directly moved for loss balancing; Corresponding to the second highest execution frequency of the (N-1)th level, the sampled remainder combination includes all (N-1) remainders; and The lower the execution frequency of the corresponding lower level, the fewer remainders the sample remainder combination includes.
20. The non-volatile memory control method according to claim 18, It is characterized in that Also includes: The evaluation value is the erase count of the candidate block itself, or the erase count difference between the candidate block and the block with the lowest erase count.
