A storage control method, device, equipment and computer storage medium

By changing the physical block modes of SLC and XLC modes in NAND-Flash storage devices and balancing the number of erases, the problem of low storage device life in the existing technology is solved, and performance and life are improved.

CN111104045BActive Publication Date: 2024-10-01SANECHIPS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201811250778.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-10-25
Publication Date
2024-10-01
Estimated Expiration
2038-10-25

AI Technical Summary

Technical Problem

The existing technology cannot effectively balance the erasure times of each physical block in the NAND-Flash storage device, resulting in a low service life of the storage device.

Method used

By determining the areas of SLC mode and XLC mode in the storage device, and changing its mode when the physical block is erased, the mode adopted by the physical block of the SLC area is configured as XLC mode, and the XLC area has the smallest number of erasures. The mode adopted by the block is configured as SLC mode, thereby balancing the number of erases between the two.

Benefits of technology

It effectively reduces the trigger frequency of static wear leveling and improves the performance and service life of storage devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111104045B_ABST
    Figure CN111104045B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a storage control method, apparatus, device and computer storage medium, the method comprising: in a storage area of ​​a storage device, determining an SLC area using an SLC mode and an XLC area using an XLC mode; when garbage collection occurs in the SLC area or resources in the SLC area are insufficient, it is necessary to jointly judge based on the age of the data in the SLC, the number of times of collection and other attributes, select a reasonable physical block in the SLC area for data migration, and simultaneously select a physical block with corresponding conditions in the SLC or XLC area as a data migration target physical block, and migrate valid data in the SLC area to the target physical block; when any physical block in the SLC area is erased, configure the mode adopted by the erased physical block to the XLC mode, and configure the mode adopted by the empty physical block with the smallest number of erases in the XLC area to the SLC mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to but are not limited to NAND-Flash storage control technology, and in particular to a storage control method, device, equipment and computer storage medium, which can be used to implement the design of a NAND-Flash flash memory conversion layer. Background Art

[0002] With the booming development of new services and applications such as cloud computing, the Internet of Things, big data, and high-performance computing, the demand for data access has reached an unprecedented level, which has brought huge challenges to data storage. NAND-Flash storage has many obvious advantages over hard disk storage, such as fast reading speed, strong concurrency, low power consumption, small size, and good impact resistance. It has been widely used in the field of mobile consumer devices and even enterprise-level storage systems. For example, portable storage Secure Digital Memory Card (SD card), mobile phone internal storage eMMC (Embedded MultiMedia Card) card and UFS (Universal Flash Storage) card are all products based on NAND-Flash storage technology.

[0003] NAND-Flash storage is a non-volatile storage medium. Its basic storage unit is "Cell". M cells form a physical page, N physical pages form a physical block, K physical blocks form a plane, and multiple planes form a device. Here, M, N, and K can all represent positive integers. NAND-Flash also has its unique read, write, and erase operation requirements: 1) Write and read operations are based on physical pages; 2) Overwriting is not allowed. A physical page needs to be erased before it can be written again, so updating the data on the same user logical address requires remote updating (writing on different physical pages); 3) Erasing is based on physical blocks. All data on a physical block will be erased at one time; 4) Each physical block has an erase life and cannot be erased indefinitely. It is necessary to make the erase times of each block as even as possible to obtain a higher device life.

[0004] Due to these unique operating requirements, NAND-Flash requires additional storage control technology to make it more suitable for practical applications. However, in the related art, the storage control technology for NAND-Flash storage devices cannot effectively balance the number of erase times of each physical block, resulting in a low service life of NAND-Flash storage devices. Summary of the invention

[0005] Embodiments of the present invention provide a storage control method, apparatus, device and computer storage medium, which can effectively balance the erasure times of a single-level cell (SLC) area and a non-single-level cell (XLC) area.

[0006] To achieve the above object, the technical solution of the embodiment of the present invention is implemented as follows:

[0007] An embodiment of the present invention provides a storage control method, the method comprising:

[0008] In the storage area of ​​the storage device, an SLC area adopting a single-layer storage SLC mode and an XLC area adopting a non-single-layer storage XLC mode are determined;

[0009] When any physical block in the SLC area is erased, the mode adopted by the erased physical block is configured as the XLC mode, and the mode adopted by the empty physical block with the smallest erase times in the XLC area is configured as the SLC mode.

[0010] The embodiment of the present invention further provides a storage control device, which includes a determination unit and a processing unit; wherein:

[0011] A determination unit, used to determine, in the storage area of ​​the storage device, an SLC area using a single-layer storage SLC mode and an XLC area using a non-single-layer storage XLC mode;

[0012] The processing unit is used to configure the mode adopted by the erased physical block to the XLC mode when any physical block in the SLC area is erased, and configure the mode adopted by the empty physical block with the smallest number of erase times in the XLC area to the SLC mode.

[0013] The embodiment of the present invention further provides a storage control device, the device comprising: a processor and a memory for storing a computer program that can be run on the processor; wherein:

[0014] When the processor is used to run the computer program, it executes the steps of any one of the above storage control methods.

[0015] An embodiment of the present invention further provides a computer storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the above storage control methods are implemented.

[0016] In a storage control method, apparatus, device and computer storage medium provided by an embodiment of the present invention, in the storage area of ​​the storage device, an SLC area using the SLC mode and an XLC area using the XLC mode are determined; when any physical block in the SLC area is erased, the mode used by the erased physical block is configured as the XLC mode, and the mode used by the empty physical block with the smallest number of erase times in the XLC area is configured as the SLC mode. In this way, when the above-described technical solution is adopted, by changing the mode used by the erased physical block in the SLC area and the mode used by the empty physical block with the smallest number of erase times in the XLC area, the number of erase times of the SLC area and the XLC area can be effectively balanced, the triggering frequency of static wear leveling can be reduced, and the performance and service life of the storage device can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of a flow chart of a storage control method according to an embodiment of the present invention;

[0018] Figure 2A A schematic diagram of an implementation method of a physical block entity using an MLC mode according to an embodiment of the present invention;

[0019] Figure 2B A schematic diagram of a data field of a physical page according to an embodiment of the present invention;

[0020] Figure 3 A schematic diagram of an implementation method of the SLC and MLC hybrid mode according to an embodiment of the present invention;

[0021] Figure 4 A schematic diagram of a flow chart of initialization and writing instructions of the FTL layer according to an embodiment of the present invention;

[0022] Figure 5 A schematic diagram of a process for resource recycling in an SLC area according to an embodiment of the present invention;

[0023] Fig. 6A A schematic diagram of physical block resource management node information of an SLC area according to an embodiment of the present invention;

[0024] Figure 6B A schematic diagram of a general physical block resource management information node according to an embodiment of the present invention;

[0025] Figure 6C is a schematic diagram of a mapping table entry according to an embodiment of the present invention;

[0026] Fig.6D A schematic diagram of indexes and block information of each physical block in an SLC area according to an embodiment of the present invention;

[0027] Figure 7A schematic diagram of a garbage collection process in an embodiment of the present invention;

[0028] Figure 8 A schematic diagram of a data migration process in an embodiment of the present invention;

[0029] Fig. 9 A schematic diagram of another data migration process in an embodiment of the present invention;

[0030] Fig.10 is a structural schematic diagram of a storage control device according to an embodiment of the present invention;

[0031] Fig.11 It is a structural schematic diagram of a storage control device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0033] In the related art, for the unique read, write and erase operation requirements of NAND-Flash storage devices, targeted algorithms can be used to make NAND-Flash storage devices more suitable for practical applications; in practical applications, the Flash Translation Layer (FTL) is a functional module that implements the above-mentioned targeted algorithms, and the algorithms implemented in the Flash Translation Layer may include:

[0034] 1) Mapping algorithm - the mapping between the logical address of user data and the physical address actually stored in the storage device.

[0035] 2) Garbage collection algorithm - reclaim old data on the storage device that has been updated but not erased.

[0036] 3) Wear leveling algorithm - makes the number of erase times of each physical block on the storage device as balanced as possible.

[0037] 4) Bad block management algorithm - identifies and eliminates damaged physical blocks on storage devices to ensure the reliability of user storage data.

[0038] With the development of storage technology, in the related technologies, for NAND-Flash storage devices, the number of storage bits of each Cell increases from 1 bit to 2, 3 or 4 bits. According to the number of bits stored in each Cell, the storage mode of the NAND-Flash storage device can be divided into SLC mode, multi-level storage (Multi Level Cell, MLC) mode, triple-level storage architecture (Triple-Level Cell, TLC) mode and quad-level storage architecture (Quad-Level Cell, QLC) mode. A physical block using the MLC mode can be reconfigured to the SLC mode or the MLC mode. In some related technologies, the storage mode of the NAND-Flash storage device is mainly the SLC mode; because the MLC mode has a capacity twice that of the SLC mode with the same area, in some related technologies, the MLC mode is used as the storage mode of the NAND-Flash storage device; in other related technologies, the TLC mode or the QLC mode is used as the storage mode of the NAND-Flash storage device.

[0039] As the number of storage bits per cell increases, the read and write performance of NAND-Flash storage devices will decrease to varying degrees. The single-page write rate of the SLC mode is the highest, the single-page write rate of the MLC mode is about half of that of the SLC mode, and the TLC mode or QLC mode is the worst; the single-page read rate of the SLC mode is the highest, the single-page read rate of the MLC mode is slightly lower than that of the SLC mode, and the TLC mode or QLC mode is the worst; in general, in terms of write rate, these four modes vary greatly, and although there are differences in read rate, they are not very large.

[0040] For NAND-Flash storage devices, the general product performance can be characterized by indicators such as continuous read and write performance, random read and write performance, and product life. The test granularity of random write is generally 4kB, and the test granularity of continuous write ranges from a dozen kB to 256kB (or more). Random read and write performance mainly examines the read and write rate of a single page, while continuous read and write performance not only examines the read and write rate of a single page, but also involves overall capacity indicators.

[0041] For storage devices using the MLC mode, TLC mode or QLC mode, considering that the SLC mode and the XLC mode (where X can be M, T or Q) have different read and write performances, in the related art, for the FTL layer design using the SLC and XLC mixed mode, different storage modes are used for different user write instructions, which can be specifically explained by the following points:

[0042] 1) For random write operations, using physical blocks in SLC mode for storage can significantly improve the performance of random writes.

[0043] 2) For continuous write operations, some directly use the XLC mode for storage, so that when writing large quantities of data continuously, the capacity requirements can be met without the need for additional data migration; others use the dynamic SLC cache method, writing the data first in the physical block using the SLC mode, and then writing it to the physical block using the XLC mode through background data migration after completion.

[0044] 3) When the remaining storage space in the SLC mode is insufficient, or there is too much invalid data in the area in the SLC mode, garbage collection for the area in the SLC mode is started, and the data in the area in the SLC mode is moved to the area in the XLC mode;

[0045] 4) When there is too much garbage in the area using the XLC mode, garbage collection is also enabled, and valid data is still stored in the physical block using the XLC mode.

[0046] 5) During continuous writing or garbage collection, according to the dynamic wear leveling strategy, an empty physical block in XLC mode with the minimum number of erase times is selected as the storage block.

[0047] In addition, since the FTL layer design of the above-mentioned SLC and XLC mixed mode fixedly divides the NAND-Flash blocks into hot blocks (i.e., storage areas using the SLC mode) and cold blocks (storage areas using the XLC mode), the wear degree of the physical blocks using the SLC mode will be significantly higher than that of the physical blocks using the XLC mode, which inevitably requires frequent static wear leveling operations. In the related art, the static wear leveling solution can allocate block resources to two resource pools, the cold pool and the hot pool, based on a dual / multi-pool algorithm. Specifically, when certain conditions are met, the following operations are performed:

[0048] 1) Data exchange: When the difference between the maximum (or average) erase count of the hot pool and the minimum (or average) erase count of the cold pool exceeds a certain threshold, the data on the physical block with the minimum erase count in the cold pool is exchanged with the data on the physical block with the maximum erase count in the hot pool, and the hot block with cold data (the data stored in the physical block with the minimum erase count in the cold pool at the beginning) is placed in the hot pool, and the cold block with hot data (the data on the physical block with the maximum erase count in the hot pool at the beginning) is placed in the hot pool.

[0049] 2) Cold pool reconstruction: When the maximum number of erase times of each physical block in the cold pool exceeds a certain threshold of the minimum number of erase times of each physical block in the cold pool (which can be the same as the cold-hot swap threshold), the physical block with the maximum number of erase times in the cold pool is moved to the hot pool.

[0050] 3) Hot pool reconstruction: When the minimum erase count of each physical block in the hot pool is lower than a certain threshold (which can be twice the cold-hot swap threshold), the physical block with the minimum erase count in the hot pool is moved to the cold pool.

[0051] It can be seen that based on the above static wear leveling scheme, not only can the wear of each physical block be leveled, but most of the hot data can also be put into the hot pool and the cold data into the cold pool, so as to achieve a certain degree of hot and cold separation.

[0052] However, the above static wear leveling scheme will lead to too many garbage collection operations for the XLC mode, and the cost of garbage collection for the XLC mode is much higher than that for the SLC mode; because the invalid data generally stored comes from the frequently updated data, which is called hot data; and the data that is not frequently updated is called cold data. Generally speaking, the continuously written data is mostly cold data, and the hot data mostly exists in the randomly written data. The hot and cold properties of the randomly written data can be judged by the writing time: the data written to the Flash storage device is not updated for a period of time, then it is judged as cold data, otherwise it is judged as hot data. However, because the storage capacity of the SLC mode is limited, when the garbage collection for the SLC mode is triggered, the valid data recovered to the area using the XLC mode may not have reached the judgment time for hot and cold data; that is, this part of the data moved to the area using the XLC mode is very likely to be hot data, which causes the hot data to generate too much garbage in the storage area using the XLC mode; in response to the above problems, in other related technologies, a dynamic wear leveling scheme can be used to implement storage control, as described below:

[0053] 1) When garbage collection is performed on data in an area using the SLC mode, the data is first collected into a buffer area that is also in the SLC mode, which is called the warm data area.

[0054] 2) If the data in the warm data area is updated, it is directly updated to the hot data SLC area off-site.

[0055] 3) Valid data during garbage collection (because it has not been updated during the time period in the warm data area) is determined to be cold data and is recycled to the area using the XLC mode.

[0056] 4) When the area using the XLC mode is recovered, the dynamic wear leveling strategy is still followed to select the empty physical block with the smallest number of erase times as the storage block.

[0057] In the above dynamic wear leveling scheme, since the time for determining the hot and cold attributes of data is increased, the determination is more accurate, which can reduce the garbage collection for the XLC mode. However, the above dynamic wear leveling scheme also brings some other negative effects, that is, under the same space using the SLC mode, the number of garbage collections for the SLC mode is increased. And such processing does not reduce the probability of overall wear leveling of the storage device, and high wear leveling is still required to maintain the life balance of each physical block.

[0058] That is to say, in the above dynamic wear leveling scheme, the physical block with the smallest number of erases is always taken as the target write block; however, after the block is divided by SLC module and XLC module, since only empty physical blocks can be selected in the area using SLC mode during random writing, simply dividing the area using SLC mode and XLC mode into cold pool and hot pool will not be able to select the physical block with the smallest number of erases in the entire storage device, but only the physical block with the smallest number of erases in the area using SLC mode. Here, wear leveling can be achieved by reconstructing the cold and hot pools in static wear leveling. However, the disadvantage of this method is that reconstruction can only be performed when the maximum and minimum number of erases in the cold pool or hot pool meet certain conditions, resulting in uneven uniformity of dynamic wear leveling. When the durability of physical blocks is inconsistent, it may lead to a shortened lifespan.

[0059] Based on the above-described contents, the following embodiments are proposed.

[0060] First embodiment

[0061] The first embodiment of the present invention proposes a storage control method, which can be applied to a storage device, where the storage device can be a NAND-Flash storage device or other storage devices.

[0062] Figure 1 FIG. 1 is a flow chart of a storage control method according to an embodiment of the present invention. Figure 1 As shown, the process may include:

[0063] Step 101: In a storage area of ​​a storage device, determine an SLC area that adopts a single-layer storage SLC mode and an XLC area that adopts a non-single-layer storage XLC mode.

[0064] Here, all physical blocks of the storage device can be divided into an SLC area and an XLC area, and the SLC area and the XLC area are blocks using two different storage modes. The physical blocks in the SLC area are stored in the SLC mode. For example, when the XLC mode is the MLC mode, the capacity of each physical page in the SLC area is the same as the capacity of each physical page in the MLC area, but the total number of pages of each physical block in the SLC area is half (N / 2) of the total number of pages of each physical block in the MLC area. In a specific example, the SLC area may include Ks physical blocks, and the MLC area may include Km physical blocks, so that the overall user data area of ​​the storage device includes Ks+Km physical blocks.

[0065] Figure 2A FIG. 1 is a schematic diagram of an implementation method of a physical block entity using an MLC mode according to an embodiment of the present invention. Figure 2A As shown, in the MLC area of ​​the storage device, each physical block entity includes N physical pages (physical pages are referred to as pages for short), each page includes m bytes, where m and N are both positive integers; in the SLC area of ​​the storage device, each physical block entity includes N / 2 physical pages, each page includes m bytes; refer to Figure 2A Each page can store valid data (see Figure 2A D1, D2, D4, D5, D8, Dn, Dn+1, Dn+3), and can also store invalid data (see Figure 2A Invalid page in .

[0066] In an example, taking the valid data in each physical page as 16 kB, each physical page can accommodate four 4 kB user data. Figure 2B FIG. 1 is a schematic diagram of a data field of a physical page according to an embodiment of the present invention. Figure 2B As shown, the data of a physical page may include 4 kB of user data, a logical address, a timestamp, and corresponding coded redundant data (see Figure 2B Coding redundancy in ), etc.

[0067] Here, the XLC mode may be an MLC mode, a TLC mode, or a QLC mode.

[0068] Furthermore, the area using the XLC mode can be divided into a hot pool and a cold pool; Figure 3 FIG. 1 is a schematic diagram of an implementation method of the SLC and MLC hybrid mode according to an embodiment of the present invention. Figure 3 As shown, the SLC area is referred to as the SLC area, the MLC area is referred to as the MLC area, and the SLC area includes four physical blocks with the number of erase times from low to high ( Figure 3 The MLC area includes a cold pool and a hot pool, wherein the cold pool includes four physical blocks with a low to high erase count ( Figure 3 The hot pool includes three physical blocks with the number of erases from low to high ( Figure 3 8, 9 and 10 are indicated by boxes therein respectively).

[0069] Reference Figure 3 In one example, for a random write operation, the data to be written can be written into the physical block with the lowest erase count in the SLC area, and for a continuous write operation, the data to be written can be written into the physical block with the lowest erase count in the cold pool of the MLC area; that is, in an embodiment of the present invention, the target area for writing can be distinguished according to the type of write request (random write or continuous write); the advantage of this is that there is no need to perform background migration operations for continuous write data, and the disadvantage is that the continuous write performance is relatively low.

[0070] It should be noted that Figure 3 The continuous write operation is merely an exemplary operation mode. The operation mode of the continuous write operation in the embodiment of the present invention is not limited to Figure 3 The operation mode shown; specifically, the operation mode of the continuous write operation can be a first operation mode or a second operation mode, wherein the first operation mode is used to indicate that the data to be written is directly written into the XLC area, and the second operation mode is used to indicate that the data to be written is first written into the SLC area, and then the data first written into the SLC area is migrated to the XLC area.

[0071] Step 102: when any physical block in the SLC area is erased, the mode adopted by the erased physical block is configured as the XLC mode; and the mode adopted by the empty physical block with the smallest erase times in the XLC area is configured as the SLC mode.

[0072] That is to say, when any physical block in the SLC area is erased, the mode used by the erased physical block can be changed to the XLC mode, and the erased physical block can be added to the XLC area; at the same time, the mode used by the empty physical block with the smallest number of erase times in the XLC area can be changed to the SLC mode, and the empty physical block with the smallest number of erase times in the XLC area can be added to the SLC area.

[0073] In another implementation, when the XLC area includes a cold pool and a hot pool, when any physical block in the SLC area is erased, the mode used by the erased physical block can be configured as the XLC mode, and the erased physical block can be added to the cold pool of the XLC area; the mode used by the empty physical block with the smallest number of erase times in the XLC area can be configured as the SLC mode, and the empty physical block with the smallest number of erase times in the cold pool of the XLC area can be added to the SLC area.

[0074] In the embodiment of the present invention, the physical blocks in the SLC area may be erased due to various reasons, for example, they may be erased due to garbage collection or data migration. The embodiment of the present invention does not limit the reasons for erasing the physical blocks.

[0075] It can be seen that in the embodiment of the present invention, based on the operation of this step, the amount of physical block resources in the SLC area can be guaranteed to be certain, so that the empty physical block resources used in the SLC area can always be the ones with the smallest number of erase times among all physical block resources of the storage device.

[0076] In the implementation of the present invention, based on the storage control method described above, load sharing can be used to reduce the number of static wear leveling required; specifically, the number of erasures (durability) that a physical block can withstand is different when using the SLC mode and the MLC mode. The number of erasures that a physical block can withstand in the SLC mode is about 10 times that in the MLC mode. If the statistics are separated, it will inevitably bring additional storage costs, or hinder the life balance of physical blocks using the SLC mode and physical blocks using the MLC mode; however, under the resource exchange strategy proposed by the present invention, statistically, each physical block has experienced the process of erasing in the SLC mode and erasing in the MLC mode. Therefore, in a statistical sense, it is not necessary to distinguish between erasing in the SLC mode and erasing in the MLC mode, and each physical block can only use one erasure count mark to characterize the life of the physical block.

[0077] In summary, by changing the mode used by the erased physical blocks in the SLC area and the mode used by the empty physical blocks with the smallest erase times in the XLC area, the erase times of the SLC area and the XLC area can be effectively balanced, reducing the triggering frequency of static wear leveling, thereby improving the performance and service life of the storage device.

[0078] Second embodiment

[0079] In order to better reflect the purpose of the present invention, further examples are given based on the first embodiment of the present invention. In the second embodiment of the present invention, the XLC mode is the MLC mode.

[0080] Figure 4 FIG. 1 is a flow chart of initialization and writing instructions of the FTL layer according to an embodiment of the present invention. Figure 4 As shown, the process may include:

[0081] Step 401: Perform system initialization operation on the storage device.

[0082] Step 402: Determine whether the storage device is powered on for the first time, if yes, execute step 403, if no, execute step 405.

[0083] Step 403: Divide the entire space (the entire storage area) of the storage device into an SLC area (abbreviated as SLC area) and an MLC area, divide the MLC area into a cold pool and a hot pool, and then execute step 404.

[0084] Step 404: Initialize all physical block information and node information.

[0085] That is to say, if the storage device is powered on for the first time, it is necessary to initialize the resource management of the entire device of the storage device, that is, to perform initialization allocation of the SLC area and the MLC area in sequence. In specific implementation, for the operation of dividing the SLC area, the physical blocks can be allocated in sequence according to the sequence number of the physical blocks, and a fixed number of physical blocks with small sequence numbers are allocated to the SLC area, and then the remaining physical blocks are allocated to the MLC area; in one implementation, the physical blocks in the MLC area can be allocated to the cold pool and the hot pool according to a certain rule according to the requirements of the static wear leveling algorithm.

[0086] Step 405: Restore the system information from the Flash at the last power failure.

[0087] Here, Flash represents a corresponding storage device, and the system information represents a division method of an SLC area and an MLC area in the storage device and a division method of a hot pool and a cold pool in the MLC area.

[0088] It can be seen that if the storage device is not powered on for the first time, the previous initialization state should have been recorded in a fixed area of ​​the storage device. Software can be used to read corresponding system information from the fixed area to obtain all system information before power failure.

[0089] Step 406: Receive a user write instruction.

[0090] Here, after the initialization is completed, the user side instruction can be accepted; the embodiment of the present invention only involves the optimization of the write operation process, so Figure 4 Only operations related to write instructions are listed; for example, after receiving a write instruction, it is determined whether to perform a random write operation or a continuous write operation based on the instruction type and the amount of write data carried in the instruction.

[0091] Step 407: Determine whether the write instruction is a random write instruction, if yes, execute step 409, if no, execute step 408.

[0092] Step 408: Determine whether the write instruction is a continuous write instruction. At this time, determine whether the amount of data to be written corresponding to the continuous write instruction exceeds one physical page (referred to as page for short). If yes, execute step 410; if not, execute step 409.

[0093] Step 409: Perform a random write operation to write the data to be written into the available physical block with the smallest erase count in the SLC area.

[0094] Step 410: Perform a continuous write operation to write the data to be written into the available physical block with the smallest erase count in the MLC area.

[0095] It should be noted that steps 407 to 410 are merely exemplary of a method of performing a write operation according to the type of a write instruction, and the embodiment of the present invention is not limited to the method of performing a write operation according to the type of a write instruction. Figure 4 The implementation shown.

[0096] During normal use of the storage device, when certain conditions are met, a resource recovery operation may be performed on the data in the storage area. Here, the resource recovery operation may be a garbage recovery operation or a data migration operation.

[0097] Exemplarily, when a first trigger condition is met, a garbage collection operation may be performed on garbage data in the SLC area, wherein the garbage data is used to represent data that has been updated and not erased, and the first trigger condition includes at least one of the following:

[0098] The number of empty physical blocks in the SLC area is less than a first set threshold;

[0099] The amount of junk data in the SLC area exceeds a second set threshold.

[0100] When a second trigger condition is met, a data migration operation may be performed on the data in the SLC area, wherein the second trigger condition includes at least one of the following:

[0101] The number of empty physical blocks in the SLC area is less than a first set threshold, and the amount of junk data in the SLC area does not exceed a second set threshold;

[0102] The data existence time of the physical block with the longest data existence time in the SLC area exceeds the set time length.

[0103] Here, the first set threshold and the second set threshold can be preset according to actual needs. The empty physical block in the SLC area represents a physical block that does not store data; the data existence time of the physical block in the SLC area can be recorded as the age of the physical block.

[0104] It can be seen that the existence time (age) of data is closely related to the data timestamp; and the data age that the SLC area is concerned about is only related to the data age of the data in the SLC area, so the record of the current time should also be only related to the data change of the SLC; therefore, different current time recording methods should be used for different data writing operations; the record of the current time should distinguish between the SLC time (i.e., the timestamp of the SLC area) T_slc and the MLC time (i.e., the timestamp of the MLC area) T_xlc, that is, the SLC time T_slc and the MLC time T_xlc need to be recorded independently, as described below:

[0105] 1) When an operation of writing a physical page of the SLC area occurs, the value of the current time T_slc of the SLC area is increased by 1.

[0106] 2) When an operation of writing a physical page of the XLC area occurs, the value of the current time T_xlc of the XLC area is increased by 1.

[0107] 3) When data is written to the SLC area, a timestamp is recorded using T_slc.

[0108] 4) When data is written to the XLC area, T_xlc is used to record the timestamp.

[0109] 5) When judging the data age of the SLC area, only T_slc is used as the current time for judgment.

[0110] Figure 5 FIG. 1 is a flow chart of resource recovery in the SLC area according to an embodiment of the present invention. Figure 5 As shown, when the operation mode of the continuous write operation is the first operation mode, the process may include:

[0111] Step 501: When the remaining resources of the SLC area are insufficient (less than a set threshold), execute step 502.

[0112] In normal use, when the remaining resources of the SLC area are insufficient, the resources of the SLC area need to be recycled and reused. Here, the insufficient remaining resources can be manifested as the number of empty physical blocks being less than a first set threshold, for example, the first set threshold is 1.

[0113] Step 502: Determine whether the amount of junk data in the SLC area is greater than a second set threshold, if yes, execute step 505, if no, execute step 503.

[0114] In practical applications, garbage data may be represented as invalid pages. The resource recovery program may be used to first determine the garbage data in the SLC area to determine whether the amount of garbage data exceeds the amount of garbage Th_garbage (ie, the second set threshold) that the SLC area can allow.

[0115] Exemplarily, the second set threshold Th_garbage can be defined by the number of redundant blocks in the SLC area. If the number of redundant blocks in the SLC area is K1, then Th_garbage = K1*4*N / 2, where N / 2 is the number of pages in each physical block of the SLC area, and 4 is the number of user data per page (taking 16kB page as an example, 16 / 4).

[0116] Step 503: Search for the oldest physical block in the SLC area.

[0117] Here, the oldest physical block in the SLC area indicates the physical block where data has existed the longest. If the amount of garbage does not exceed the threshold, it indicates that it is difficult to effectively reclaim the SLC space even if garbage collection is performed, and the data in the SLC area should be migrated to the MLC area. At this time, the oldest physical block in the SLC area can be selected for data migration.

[0118] Step 504: Perform data migration operation.

[0119] Step 505: Search the physical block with the largest amount of garbage data in the SLC area.

[0120] If the amount of garbage data exceeds the second set threshold, the SLC space may be reclaimed through a garbage collection process, and a physical block with the largest amount of garbage data in the SLC area may be selected for garbage collection operations.

[0121] Step 506: Perform garbage collection operation.

[0122] Fig. 6A FIG. 1 is a schematic diagram of physical block resource management node information of an SLC area according to an embodiment of the present invention. Fig. 6A As shown, the physical block resource management node information of the SLC area may include a 16-bit block number, a 48-bit block timestamp, and a data bitmap, wherein the data bitmap is used to indicate data validity, and the size of the data bitmap is N*Ks*M / 4096 bits.

[0123] Figure 6B FIG. 1 is a schematic diagram of a resource management information node of a general physical block (including a physical block in an SLC area and a physical block in an MLC area) according to an embodiment of the present invention. Figure 6BAs shown, the general physical block (resource management node information may include 4 bits of block status, 12 bits of invalid page quantity information, and 16 bits of erase count information.

[0124] Figure 6C Schematic diagram of a mapping table entry according to an embodiment of the present invention, such as Figure 6C As shown, the mapping table is set for the data in the storage device, and the mapping table entry has a total of 32 bits, wherein the mapping table entry may include a 1-bit status mark, a 2-bit recycling mark (used to mark the number of garbage collection times) and a 29-bit physical address.

[0125] Fig.6D FIG. 1 is a schematic diagram of the index and block information of each physical block in the SLC area of ​​an embodiment of the present invention. Fig.6D As shown, each physical block (physical block 0, physical block 1, physical block 2, physical block 3, physical block 4...physical block Ks-1) has corresponding block information (block information 0, block information 1, block information 2, block information 3, block information 4...block information Ks-1), and the index corresponding to each physical block can be represented by a node (see Fig.6D SLC node 0, SLC node 1, SLC node 2, SLC node 3, SLC node 4…SLC node Ks-1).

[0126] Combination FIG. 6A to FIG. 6B In an embodiment of the present invention, a method for selecting a physical block with the largest number of junk data may be: first, according to the block sequence number in the physical block resource management node information of the SLC area, find the common physical block node of the physical block of each SLC area corresponding to the SLC area; then sort the number of invalid pages in all the physical block node information, find the physical block with the largest number of invalid pages, and determine the physical block with the largest number of invalid pages as the physical block with the largest number of junk data.

[0127] Combination Fig. 6A In an embodiment of the present invention, a method for selecting the oldest physical block may be: calculating the difference between the block timestamp in each SLC resource management node in the SLC area and the current timestamp, sorting the time differences, and the physical block with the largest time difference is the oldest physical block.

[0128] Optionally, an operation mode of a continuous write operation may be determined, and a garbage collection operation may be performed on garbage data in the SLC area according to the operation mode of the continuous write operation.

[0129] When the operation mode of the continuous write operation is the first operation mode and the first trigger condition is Figure 5When the trigger condition shown in FIG. 1 is met (ie, the number of empty physical blocks in the SLC area is less than the first set threshold, and the amount of garbage data in the SLC area exceeds the second set threshold), an exemplary garbage collection process may be as follows: Figure 7 shown.

[0130] Figure 7 FIG. 1 is a schematic diagram of a garbage collection process in an embodiment of the present invention. Figure 7 As shown, the process may include:

[0131] Step 701: Start.

[0132] Step 702: Read the information table of the corresponding physical block to obtain the valid page bitmap.

[0133] Here, according to Fig. 6A The invalid page quantity information shown is used to determine the physical block to be garbage collected, that is, the physical block with the largest amount of garbage data is selected.

[0134] In specific implementation, if the data validity bitmap of the corresponding physical block is stored in the SLC area node information, the validity of the corresponding data can be determined through the bitmap; if the bitmap is not stored, the data validity can be determined by reading the data and determining whether the data reverse index matches the mapping table.

[0135] Step 703: Read valid physical page data according to the bitmap, and store the data in the controller.

[0136] In specific implementation, the data validity bitmap can use a bit to mark whether the corresponding user data is valid, and can use "0" to indicate invalid data, and "1" to indicate valid data; in the embodiment of the present invention, each physical page corresponds to 4 bits, and the bitmap represents each user data in sequence according to the page order; when the user data is first written, the bit corresponding to the bitmap is marked as "1", which is valid data; when the data is updated remotely, the bit is rewritten to "0", which is invalid data. During retrieval, if there is "1" in the 4 bits corresponding to a physical page, it is necessary to read the physical page from the storage device, take out the valid data with the corresponding bit as "1", and store it in the cache of the controller; if the 4 bits corresponding to a physical page are all "0", it is not necessary to read the page from the storage device.

[0137] Here, the valid data includes: user data, logical address and timestamp (604); the coded redundant data will be automatically deleted by the hardware logic after the error correction is completed; the controller's cache should contain at least 1 SLC page space and 2 MLC page spaces, corresponding to the physical block with the smallest SLC erase count and the physical block with the largest MLC hot pool erase count, respectively.

[0138] Step 704: Obtain the age of the data.

[0139] Here, the age of the data is used to indicate the existence time of the data. In practical applications, the timestamp information in the read data can be obtained, and the mapping table can be queried according to the read logical address to obtain the recycling mark and physical address; in principle, the physical address of the mapping table should completely correspond to the address of the read data.

[0140] Step 705: Determine whether the age of the data exceeds the set time length Th_age, if yes, execute step 706, if no, execute step 708.

[0141] Here, the age (age) of the data can be represented by the difference between the data timestamp and the current time.

[0142] Regarding the implementation method of setting the initial value of the duration Th_age, in one example, the initial value of Th_age is determined by the total physical space of the SLC area, which is proportional to the number of write times from the SLC area being completely empty to being completely full, that is, the initial value of Th_age is proportional to the total number of physical pages in the SLC area. The initial value of Th_age can be recorded as Th_age0; the more the total number of physical pages of the SLC, the larger the initial value of Th_age.

[0143] Step 706 : Determine that the data attribute is cold attribute, write into the physical block with the largest number of erase times in the hot pool of the MLC area, and execute step 707 .

[0144] Here, when the age of the data exceeds the set time length Th_age, the data corresponding to the timestamp is determined to be cold data (that is, the attribute of the data is determined to be a cold attribute).

[0145] In the specific implementation, the cold data can be temporarily stored in the cache space corresponding to the MLC. When the 2-page cache space corresponding to the MLC is full or stores the last data of the garbage collection operation, the data in the MLC cache is written to the available physical block with the largest number of erase times in the hot pool of the MLC area using a dual-page write instruction (Dual-Page-Program). The new physical address is updated in the mapping table, and the garbage collection count mark is set to "0".

[0146] Step 707: After all data in the corresponding physical block is recovered, the physical block is erased and step 711 is executed.

[0147] Step 708: Determine whether the number of data recycling times reaches 3, if yes, execute step 706, if no, execute step 709.

[0148] That is, if the age of the data does not exceed the set time length Th_age, and the number of garbage collection times of the data in the mapping table is marked as 3, the data is also determined to be cold data.

[0149] Step 709 : Determine that the data does not meet the standard for writing into the MLC area, write the data into the physical block with the smallest erase count in the SLC area, and then execute step 710 .

[0150] If the age of the data does not exceed the set time length Th_age, and the number of garbage collection times of the data in the mapping table is not marked as 3, the data is determined to be hot data.

[0151] In specific implementation, hot data can be temporarily stored in the cache space corresponding to the SLC. When the 1-page cache space corresponding to the SLC is full or stores the last data of the garbage collection operation, the data in the SLC cache is written to the available block with the least erase times in the SLC area, and the new physical address is updated in the mapping table.

[0152] Step 710: Increase the garbage collection count mark of the data in the mapping table by 1, and then execute step 707.

[0153] That is, increase the value of the garbage collection count of the data by 1.

[0154] Step 711: Delete the corresponding physical block from the SLC resource, add it to the MLC area, and determine its erase count to decide whether to put it into the cold pool or the hot pool of the MLC area.

[0155] In practical applications, the number of erase times of the physical block can be compared with the maximum number of erase times of each physical block in the cold pool and the minimum number of erase times of each physical block in the hot pool of the MLC area; if the number of erase times of the physical block is greater than the maximum number of erase times of each physical block in the cold pool, the physical block is placed in the hot pool; if the number of erase times of the physical block is less than the maximum number of erase times of each physical block in the cold pool and less than the minimum number of erase times of each physical block in the hot pool, the physical block is placed in the cold pool; if none of the above conditions are met, the physical block is placed in the hot pool.

[0156] Step 712: Add the empty physical block with the smallest erase count in the MLC area to the SLC area.

[0157] Step 713: Update the block resource node information of the SLC area.

[0158] Optionally, an operation mode of a continuous write operation is determined, and according to the operation mode of the continuous write operation and the second trigger condition, a data migration operation is performed on the garbage data in the SLC area.

[0159] When the operation mode of the continuous write operation is the first operation mode and the second trigger condition is Figure 5 When the trigger condition shown in FIG. 1 is met (i.e., the number of empty physical blocks in the SLC area is less than the first set threshold, and the amount of junk data in the SLC area does not exceed the second set threshold), an exemplary data migration process may be as follows: Figure 3 and Figure 8 shown.

[0160] Figure 8 FIG. 1 is a schematic diagram of a data migration process in an embodiment of the present invention. Figure 8 As shown, the process may include:

[0161] Step 801: Start.

[0162] Step 802: After determining the physical block to be migrated, read the information table of the corresponding physical block to obtain the valid page bitmap.

[0163] In specific implementation, if the data validity bitmap of the corresponding physical block is stored in the SLC area node information, the validity of the corresponding data can be determined through the bitmap; if the bitmap is not stored, the data validity can be determined by reading the data and determining whether the data reverse index matches the mapping table.

[0164] Step 803 to step 804: The implementation method is basically the same as step 703 to step 704, and the main differences include: the controller's cache should contain at least 6 MLC page spaces, where the 6 MLC page spaces are divided into 3 2-page cache spaces, corresponding to the physical block with the largest number of hot pool erases in the MLC area, the physical block with the smallest number of hot pool erases in the MLC area, and the physical block with the smallest number of cold pool erases in the MLC area.

[0165] Step 805: Determine whether the age of the data exceeds the set time length Th_age, if yes, execute step 808, if no, execute step 806.

[0166] Here, the age (existence time) of the data can be expressed by the difference between the data timestamp and the current time. In specific implementation, the timestamp information in the read data can be obtained, and the mapping table can be queried based on the read logical address to obtain the recycling mark and physical address; in principle, the physical address of the mapping table should completely correspond to the address of the read data.

[0167] Step 806: Determine whether the number of garbage collection times of the data is equal to 3, if yes, execute step 808, if no, execute step 807.

[0168] Step 807: Determine whether the number of garbage collection times of the data is equal to 0, if yes, execute step 809, if not, execute step 810.

[0169] Step 808 : Determine that the data attribute is cold attribute, write into the physical block with the largest number of erase times in the hot pool of the MLC area, and execute step 811 .

[0170] Here, when the age of the data exceeds the set time length Th_age, the data is determined to be cold data (that is, the attribute of the data is determined to be a cold attribute); when the age of the data does not exceed the set time length Th_age and the number of garbage collections of the data is equal to 3, the data corresponding to the timestamp is also determined to be cold data (that is, the attribute of the data is determined to be a cold attribute)

[0171] In specific implementation, the cold data can be temporarily stored in the cache space corresponding to the available block with the largest number of erase times in the hot pool of the MLC area. When the corresponding 2-page cache space is full or stores the last data of the garbage collection operation, the data in the corresponding cache is written using a double-page write instruction to the available physical block with the largest number of erase times in the hot pool of the MLC area. The new physical address is updated in the mapping table, and the garbage collection count mark is set to 0.

[0172] Step 809 : Determine that the data attribute is a hot attribute, write the data into the physical block with the smallest erase count in the cold pool of the MLC area, and execute step 811 .

[0173] Here, when the age of the data exceeds the set time length Th_age and the number of garbage collection times of the data is equal to 0, the data is determined to be hot data (that is, the attribute of the data is determined to be a hot attribute).

[0174] In specific implementation, the hot data can be temporarily stored in the cache space corresponding to the physical block with the smallest number of cold pool erase times in the MLC area. When the corresponding 2-page cache space is full or stores the last data of the garbage collection operation, the data in the corresponding cache is written to the physical block with the smallest number of cold pool erase times in the MLC area using a double-page write instruction, the new physical address is updated in the mapping table, and the garbage collection count mark is set to 0.

[0175] Step 810 : Determine that the data attribute is an unknown attribute, write the data into the physical block with the minimum erase count in the hot pool of the MLC area, and execute step 811 .

[0176] Here, when the age of the data exceeds the set time length Th_age, and the number of garbage collection times of the data is not equal to 0 and 3, the data is determined to be unknown attribute data.

[0177] In the specific implementation, the unknown attribute data can be temporarily stored in the cache space corresponding to the physical block with the smallest erase count in the hot pool of the MLC area. When the corresponding 2-page cache space is full or stores the last data of the garbage collection operation, the data in the corresponding cache is written to the available physical block with the smallest erase count in the hot pool of the MLC area using a double-page write instruction, the new physical address is updated in the mapping table, and the garbage collection count mark is set to 0.

[0178] Step 811: After all data in the corresponding physical block is migrated, the physical block is erased and step 812 is executed.

[0179] Step 812 to step 814 are implemented in the same way as step 711 to step 713, and will not be repeated here.

[0180] In the related art, the timestamp corresponding to each physical page indicates the time when the data in the physical page is written into a storage device such as a Flash memory. When the data is written into the storage device by a user write instruction, the timestamp indicates the actual age of the data; when the data is rewritten to another page of the storage device due to garbage collection, the corresponding timestamp indicates the time when the data is updated (which no longer has the meaning of actual age). Therefore, it is not accurate to judge the hotness and coldness of data based only on the timestamp. If both the writing age and the recycling age of each data are recorded, storage space will be wasted.

[0181] In this embodiment of the present invention, during garbage collection or data migration, the age of each data can be determined based on the timestamp of the data and the number of garbage collections, so that the hotness or coldness of the data in the SLC area can be determined more accurately.

[0182] In addition, by adopting the scheme recorded in the embodiment of the present invention, the determined cold data can be placed in the hot block to directly reduce the heat of the hot block, achieving the effect of "natural cooling", thereby reducing the need to use static wear leveling to achieve "artificial cooling"; placing data with a higher probability of cold data in the block with the smallest number of erase times in the hot pool can achieve the effect of "natural cooling" in terms of probability; placing completely uncertain data in the block with the smallest number of erase times in the cold pool is to follow the traditional dynamic wear leveling strategy for processing; therefore, through the technical scheme of the present invention, the efficiency of garbage collection can be effectively improved in the SLC and XLC mixed mode, and the purposefulness of the garbage collection strategy can be enhanced.

[0183] In summary, the embodiment of the present invention can design a new storage control method based on the mapping strategy of the SLC and XLC mixed modes, taking into account the reliability of judging the hot and cold properties of data, the garbage collection strategy, and the static wear leveling strategy, which can provide a more efficient, more reliable and more convenient FTL layer functional module for storage devices.

[0184] Third embodiment

[0185] Based on the contents recorded in the above embodiments, further examples are given to illustrate.

[0186] In the third embodiment of the present invention, when the operation mode of the continuous write operation is the first operation mode, and the first trigger condition is that the amount of garbage data in the SLC area exceeds the second set threshold value Th_garbage, the garbage collection process for the data in the SLC area is the same as Figure 7 The process shown is the same and will not be repeated here.

[0187] When the operation mode of the continuous write operation is the first operation mode, and the second trigger condition is that the data existence time of the physical block with the longest data existence time in the SLC area exceeds the set time, an exemplary data migration process can be as follows: Fig. 9 shown.

[0188] Fig. 9 FIG. 1 is a schematic diagram of another data migration process in an embodiment of the present invention. Fig. 9 As shown, the process may include:

[0189] Step 901 to step 908: The implementation method is basically the same as step 701 to step 708, and the main differences include: in addition to the above-mentioned 6 MLC page spaces, the controller's cache also includes 1 SLC page cache space, corresponding to the physical block with the smallest erase count in the SLC area.

[0190] Step 909 : Determine that the data attribute is a thermal attribute, write to the physical block with the smallest erase count in the SLC area, and execute step 911 .

[0191] Here, when the age of the data exceeds the set time length Th_age and the number of garbage collection times of the data is equal to 0, the data is determined to be hot data (that is, the attribute of the data is determined to be a hot attribute).

[0192] In specific implementation, the hot data can be temporarily stored in the cache space corresponding to the physical block with the smallest erase count in the SLC area. When the corresponding 1-page cache space is full or stores the last data of the garbage collection operation, the data in the corresponding cache is written to the physical block with the smallest erase count in the SLC area using a single-page write instruction, the new physical address is updated in the mapping table, and the garbage collection count mark is increased by 1.

[0193] Step 910 : Determine that the data attribute is an unknown attribute, write the data into the physical block with the minimum erase count in the hot pool of the MLC area, and execute step 911 .

[0194] Here, when the age of the data exceeds the set time length Th_age, and the number of garbage collection times of the data is not equal to 0 and 3, the data is determined to be unknown attribute data.

[0195] In the specific implementation, the unknown attribute data can be temporarily stored in the cache space corresponding to the physical block with the smallest erase count in the cold pool of the MLC area. When the corresponding 2-page cache space is full or stores the last data of the garbage collection operation, the data in the corresponding cache is written to the available physical block with the smallest erase count in the cold pool of the MLC area using a double-page write instruction, the new physical address is updated in the mapping table, and the garbage collection count mark is set to 0.

[0196] Fourth embodiment

[0197] Based on the contents recorded in the above embodiments, further examples are given to illustrate.

[0198] The application scenarios of the fourth embodiment of the present invention include: the operation mode of the continuous write operation is the second operation mode, that is, the data to be written is first written into the SLC area, and then the data first written into the SLC area is migrated to the XLC area through background operation.

[0199] Here, each continuous write operation is used to trigger data migration from the SLC area to the XLC area; that is, after each writing to the SLC area through a continuous write operation, the data written to the SLC area each time is migrated to the XLC area through a data migration operation.

[0200] When the operation mode of the continuous write operation is the second operation mode, and each continuous write operation is used to trigger data migration from the SLC area to the XLC area, the timestamp and the set duration of the SLC area need to be adjusted accordingly.

[0201] In practical applications, the timestamp of the SLC area can be updated once each time a continuous write operation is performed on the SLC area, that is, for a complete continuous write operation, the timestamp of the SLC area is updated once; that is, for a complete continuous write operation on the SLC area, no matter how many physical pages of data are written, the timestamp of the SLC area is only updated once, so the timestamps recorded on all physical pages written by the same continuous write operation are the same. As for the method of updating the timestamp of the SLC area, in one example, the timestamp T_slc of the SLC area can be increased by 1.

[0202] In addition, each time a continuous write operation is performed on the SLC area, the current set time length may be increased by a fixed interval value, where the fixed interval value is greater than 0, for example, the fixed interval value is 1.

[0203] During each continuous write operation, when the difference between the timestamp of the data migrated from the SLC area to the XLC area and the timestamp T_slc of the SLC area is greater than the current set duration Th_age1, compare the current set duration with the initial value of the set duration; when the current set duration is greater than the initial value of the set duration, subtract the fixed interval value from the current set duration; when the current set duration is equal to the initial value of the set duration, keep the current set duration unchanged.

[0204] During each continuous write operation, when the difference between the timestamp of the data migrated from the SLC area to the XLC area and the timestamp T_slc of the SLC area is not greater than the current set duration Th_age1, and the number of garbage collection times of the data migrated from the SLC area to the XLC area is not 0, compare the current set duration with the initial value of the set duration; when the current set duration is greater than the initial value of the set duration, subtract the fixed interval value from the current set duration; when the current set duration is equal to the initial value of the set duration, keep the current set duration unchanged.

[0205] According to the above-mentioned contents, in the fourth embodiment of the present invention, the garbage collection operation of data is performed in addition to the second embodiment. Figure 7 In addition to the recorded process, it is also necessary to check the timestamp of the data to be recycled. The following is an example:

[0206] When the difference between the timestamp of the data to be recovered and the timestamp T_slc of the current SLC area exceeds the current set duration Th_age1, the data to be recovered is written into the XLC area; the current set duration Th_age1 is compared with the initial value Th_age0 of the set duration. If Th_age1>Th_age0, the value of Th_age1 is reduced by 1 to obtain a new Th_age1.

[0207] When the difference between the timestamp of the data to be recovered and the timestamp T_slc of the current SLC area is not greater than the current set duration Th_age1, but the number of garbage collections of the data to be recovered is 3, the data to be recovered is written to the XLC area; compare the current set duration Th_age1 with the initial value Th_age0 of the set duration. If Th_age1>Th_age0, subtract 1 from the value of Th_age1 to obtain a new Th_age1.

[0208] According to the above-mentioned contents, in the fourth embodiment of the present invention, the data migration operation process may be performed after each continuous write operation is completed. An exemplary data migration operation process may include:

[0209] Each time a continuous write operation is performed on the SLC area, the starting physical address of the continuous write operation of the SLC area is determined; after each continuous write operation of the SLC area is completed, the write data of the continuous write operation of this SLC area is migrated to the XLC area in sequence according to the starting physical address of the continuous write operation of this SLC area.

[0210] For the above exemplary data migration operation process, optionally, the starting physical address of the continuous write operation of the SLC area can be recorded; optionally, the continuous write data migration can be triggered after each continuous write operation is completed.

[0211] For the implementation method of migrating the write data of the continuous write operation of this SLC area to the XLC area in sequence, the write data of the continuous write operation of this SLC area can be migrated to the physical block with the largest number of erase times in the XLC area; optionally, the data in the SLC area after being migrated is determined to be invalid data (i.e., garbage data).

[0212] Fifth embodiment

[0213] Based on the contents recorded in the above embodiments, further examples are given to illustrate.

[0214] The application scenarios of the fifth embodiment of the present invention include: the operation mode of the continuous write operation is the second operation mode, that is, the data to be written is first written into the SLC area, and then the data first written into the SLC area is migrated to the XLC area through background operation.

[0215] Here, not every continuous write operation is used to trigger data migration from the SLC area to the XLC area; in actual applications, data migration from the SLC area to the XLC area can be triggered after the Kth continuous write operation, but the embodiment of the present invention does not limit the value of K.

[0216] For the above application scenario, in terms of data structure, a record of the number of consecutively written data pages can be added to the aforementioned SLC area node data structure, so the SLC node structure includes:

[0217] 1) Block number - 2B;

[0218] 2) Number of invalid pages in the block - 2B;

[0219] 3) Number of consecutive write pages in a block - 2B, in 4kB units;

[0220] 4) Block timestamp – 6B;

[0221] 6) Page data bitmap - (Me / 4096) bits per page, marking the corresponding 4kB data on the physical page as valid or invalid, a total of (N*Ks*Me / 4096) bits;

[0222] In addition, in terms of data structure, you can Figure 2B On the basis of the data field shown, a continuous write mark is added. Therefore, the data field after adding the continuous write mark includes: user data, logical address, timestamp, continuous write mark, and coding redundancy; here, the continuous write mark is used to indicate whether the data of this physical page is written through a continuous write operation.

[0223] For the application scenario of the fifth embodiment of the present invention, when determining the physical block to be subjected to garbage collection operation or the physical block to be subjected to data migration operation, the implementation method of the second and third embodiments is no longer used for determination, but the physical block with the largest number of consecutively written physical pages in the SLC area is used as the physical block to be subjected to garbage collection operation or the physical block to be subjected to data migration operation; when the number of physical blocks with the largest number of consecutively written physical pages in the SLC area is greater than 1 (such as the number of consecutively written physical pages of three physical blocks is 3, and these three physical blocks are also the physical blocks with the largest number of consecutively written physical pages in the SLC area), the physical block with the longest data existence time can be selected from the physical blocks with the largest number of consecutively written physical pages in the SLC area as the physical block to be subjected to garbage collection operation or the physical block with data migration operation.

[0224] For the application scenario of the fifth embodiment of the present invention, an exemplary garbage collection operation process may include:

[0225] Traverse the physical blocks in the SLC area and find the physical block with the largest number of consecutive write pages.

[0226] The data written by the random write operation on the physical block to be subjected to the garbage collection operation is determined as: when the data is to be recycled, a garbage collection operation of the data can be performed according to the garbage collection process of the second embodiment.

[0227] When the data written by continuous write operation on the physical block to be subjected to garbage collection operation is determined as data to be collected, the data to be collected can be directly written into the XLC area as cold data.

[0228] After the data recovery of the physical block to be subjected to the garbage recovery operation is completed, the physical block to be subjected to the garbage recovery operation is erased.

[0229] In practical applications, each time a write operation of an XLC physical page occurs, the value of the timestamp T_mlc of the XLC area may be increased by 1; and T_mlc is used as the write timestamp of the physical page.

[0230] The subsequent process after erasing the physical block to be subjected to the garbage collection operation can be implemented with reference to the second embodiment, which will not be described in detail here.

[0231] For the application scenario of the fifth embodiment of the present invention, an exemplary data migration operation process may include:

[0232] Traverse the physical blocks in the SLC area and find the physical block with the largest number of consecutive write pages.

[0233] When the data written by the random write operation on the physical block to be subjected to the data migration operation is determined as the data to be migrated, the data migration operation can be performed according to the data migration process of the second embodiment.

[0234] When the data written by the continuous write operation on the physical block to be subjected to the data migration operation is determined as the data to be migrated, the data to be migrated can be directly migrated to the XLC area as cold data.

[0235] After the data migration operation of the physical block to be subjected to the data migration operation is completed, the physical block to be subjected to the data migration operation is erased.

[0236] In practical applications, each time a write operation of an XLC physical page occurs, the value of the timestamp T_mlc of the XLC area may be increased by 1; and T_mlc is used as the write timestamp of the physical page.

[0237] The subsequent process after erasing the physical block to be subjected to the data migration operation can be implemented with reference to the second embodiment, which will not be described in detail here.

[0238] Sixth embodiment

[0239] Based on the storage control method proposed in the above-mentioned embodiment of the present invention, the sixth embodiment of the present invention proposes a storage control device, which can be applied to a storage device.

[0240] Fig.10 FIG. 1 is a schematic diagram of the structure of a storage control device according to an embodiment of the present invention. Fig.10 As shown, the device may include: a determining unit 1001 and a processing unit 1002; wherein,

[0241] The determining unit 1001 is used to determine, in the storage area of ​​the storage device, an SLC area using the SLC mode and an XLC area using the XLC mode;

[0242] The processing unit 1002 is used to configure the mode adopted by the erased physical block to the XLC mode when any physical block in the SLC area is erased, and configure the mode adopted by the empty physical block with the smallest number of erase times in the XLC area to the SLC mode.

[0243] In one embodiment, the processing unit 1002 is further used to divide the XLC area into two parts, a hot pool and a cold pool; after the mode adopted by the erased physical block is configured as the XLC mode, when it is determined that the erase count of the erased physical block is less than the maximum erase count of each physical block in the cold pool and the minimum erase count of each physical block in the hot pool, the erased physical block is placed in the cold pool; when it is determined that the erase count of the erased physical block is not less than the maximum erase count of each physical block in the cold pool, or is not less than the minimum erase count of each physical block in the hot pool, the erased physical block is placed in the hot pool.

[0244] In one implementation, the processing unit 1002 is further configured to:

[0245] When it is determined that a first trigger condition is met, a garbage collection operation is performed on the garbage data in the SLC area, wherein the garbage data is used to represent data that has been updated and not erased, and the first trigger condition includes at least one of the following:

[0246] The number of empty physical blocks in the SLC area is less than a first set threshold;

[0247] The amount of junk data in the SLC area exceeds a second set threshold.

[0248] In one embodiment, the processing unit 1002 is specifically configured to determine an operation mode of a continuous write operation, and perform a garbage collection operation on garbage data in the SLC area according to the operation mode of the continuous write operation;

[0249] Among them, the operation mode of the continuous write operation is the first operation mode or the second operation mode, the first operation mode is used to indicate that the data to be written is directly written into the XLC area, and the second operation mode is used to indicate that the data to be written is first written into the SLC area, and then the data first written into the SLC area is migrated to the XLC area.

[0250] In one implementation, the processing unit 1002 is further configured to:

[0251] Divide the XLC area into two parts: hot pool and cold pool;

[0252] Determine that the operation mode of the continuous write operation is the first operation mode, determine that the physical block to be subjected to the garbage collection operation is the physical block with the largest amount of garbage data in the SLC area; record the data in the physical block to be subjected to the garbage collection operation as data to be recovered;

[0253] When the existence time of the data to be recycled is greater than the set time, or when the existence time of the data to be recycled is not greater than the set time and the number of garbage collection times of the data to be recycled is equal to the set number, the data to be recycled is written into the physical block with the largest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be recycled is changed to 0;

[0254] When the existence time of the data to be recycled is not greater than the set time length and the number of garbage collection times of the data to be recycled is less than the set number of times, the data to be recycled is written into the physical block with the smallest number of erasure times in the SLC area, and the value of the number of garbage collection times of the data to be recycled is increased by 1;

[0255] After the data recovery of the physical block to be subjected to the garbage recovery operation is completed, the physical block to be subjected to the garbage recovery operation is erased.

[0256] In one implementation, the processing unit 1002 is further configured to:

[0257] Determining that the operation mode of the continuous write operation is the second operation mode, and each continuous write operation is used to trigger data migration from the SLC area to the XLC area, each time the continuous write operation of the SLC area is performed, the timestamp of the SLC area is updated once, and the value of the current set time length is increased by a fixed interval value;

[0258] In each continuous write operation, when the difference between the timestamp of the data migrated from the SLC area to the XLC area and the timestamp of the SLC area is greater than the current set time length, or when the difference between the timestamp of the data migrated from the SLC area to the XLC area and the timestamp of the SLC area is not greater than the current set time length, and the number of garbage collections of the data migrated from the SLC area to the XLC area is not 0, compare the current set time length with the initial value of the set time length;

[0259] When the current set duration is greater than the initial value of the set duration, the fixed interval value is subtracted from the current set duration; when the current set duration is equal to the initial value of the set duration, the current set duration is kept unchanged.

[0260] In one implementation, the processing unit 1002 is further configured to:

[0261] Divide the XLC area into two parts: hot pool and cold pool;

[0262] The performing a garbage collection operation on the garbage data in the SLC area according to the operation mode of the continuous write operation includes:

[0263] When determining that the operation mode of the continuous write operation is the second operation mode and determining that not every continuous write operation is used to trigger data migration from the SLC area to the XLC area, determining that the physical block to be subjected to the garbage collection operation is the physical block having the largest number of continuous write physical pages in the SLC area; the continuous write physical page is a physical page storing at least data written by the continuous write operation;

[0264] The data written by the random write operation on the physical block to be subjected to the garbage collection operation is determined as follows: when the data is to be recovered, when the existence time of the data to be recovered is greater than the set time length, or when the existence time of the data to be recovered is not greater than the set time length and the number of garbage collection times of the data to be recovered is equal to the set number of times, the data to be recovered is written into the physical block with the largest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be recovered is changed to 0; when the existence time of the data to be recovered is not greater than the set time length and the number of garbage collection times of the data to be recovered is less than the set number of times, the data to be recovered is written into the physical block with the smallest number of erasure times in the SLC area, and the value of the number of garbage collection times of the data to be recovered is increased by 1;

[0265] Determine the data written by the continuous write operation on the physical block to be subjected to the garbage collection operation as follows: when the data is to be recycled, write the data to be recycled into the XLC area;

[0266] After the data recovery of the physical block to be subjected to the garbage recovery operation is completed, the physical block to be subjected to the garbage recovery operation is erased.

[0267] In one implementation, the processing unit 1002 is further configured to:

[0268] When the number of physical blocks with the largest number of continuously written physical pages in the SLC area is greater than 1, the physical block with the longest data existence time is selected from among the physical blocks with the largest number of continuously written physical pages in the SLC area as the physical block to be subjected to garbage collection operation.

[0269] In one implementation, the processing unit 1002 is further configured to:

[0270] When a second trigger condition is met, a data migration operation is performed on the data in the SLC area, wherein the second trigger condition includes at least one of the following:

[0271] The number of empty physical blocks in the SLC area is less than a first set threshold, and the amount of junk data in the SLC area does not exceed a second set threshold;

[0272] The data existence time of the physical block with the longest data existence time in the SLC area exceeds the set time length.

[0273] In one embodiment, the processing unit 1002 is specifically configured to determine an operation mode of a continuous write operation, and perform a data migration operation on the data in the SLC area according to the operation mode of the continuous write operation and the second trigger condition;

[0274] Among them, the operation mode of the continuous write operation is the first operation mode or the second operation mode, the first operation mode is used to indicate that the data to be written is directly written into the XLC area, and the second operation mode is used to indicate that the data to be written is first written into the SLC area, and then the data first written into the SLC area is migrated to the XLC area.

[0275] In one implementation, the processing unit 1002 is further configured to:

[0276] Divide the XLC area into two parts: hot pool and cold pool;

[0277] Determining that the operation mode of the continuous write operation is the first operation mode, the second trigger condition is: the number of empty physical blocks in the SLC area is less than a first set threshold, and the amount of junk data in the SLC area does not exceed a second set threshold;

[0278] Determine that the physical block to be subjected to the data migration operation is the physical block in which the data has existed for the longest time in the SLC area; record the data of the physical block to be subjected to the data migration operation as the data to be migrated;

[0279] When the existence time of the data to be migrated is greater than the set time, or when the existence time of the data to be migrated is not greater than the set time and the number of garbage collection times of the data to be migrated is equal to the set number, the data to be migrated is written into the physical block with the largest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0;

[0280] When the existence time of the data to be migrated is not greater than the set time length and the number of garbage collection times of the data to be migrated is equal to 0, the data to be migrated is written into the physical block with the smallest number of erasure times in the cold pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0;

[0281] When the existence time of the data to be migrated is not greater than the set time length and the number of garbage collection times of the data to be migrated is not equal to 0 and the set number of times, the data to be migrated is written into the physical block with the smallest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0;

[0282] After the data migration operation of the physical block to be subjected to the data migration operation is completed, the physical block to be subjected to the data migration operation is erased.

[0283] In one implementation, the processing unit 1002 is further configured to:

[0284] Divide the XLC area into two parts: hot pool and cold pool;

[0285] The performing a data migration operation on the data in the SLC area according to the operation mode of the continuous write operation and the second trigger condition includes:

[0286] Determining that the operation mode of the continuous write operation is the first operation mode, the second trigger condition is: the data existence time of the physical block with the longest data existence time in the SLC area exceeds a set time length;

[0287] Determine that the physical block to be subjected to the data migration operation is the physical block in which the data has existed for the longest time in the SLC area; record the data of the physical block to be subjected to the data migration operation as the data to be migrated;

[0288] When the existence time of the data to be migrated is greater than the set time, or when the existence time of the data to be migrated is not greater than the set time and the number of garbage collection times of the data to be migrated is equal to the set number, the data to be migrated is written into the physical block with the largest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0;

[0289] When the existence time of the data to be migrated is not greater than the set time length and the number of garbage collection times of the data to be migrated is equal to 0, the data to be migrated is written into the physical block with the smallest number of erasure times in the SLC area, and the value of the number of garbage collection times of the data to be migrated is increased by 1;

[0290] When the existence time of the data to be migrated is not greater than the set time length and the number of garbage collection times of the data to be migrated is not equal to 0 and the set number of times, the data to be migrated is written into the physical block with the smallest number of erasure times in the cold pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0;

[0291] After the data migration operation of the physical block to be subjected to the data migration operation is completed, the physical block to be subjected to the data migration operation is erased.

[0292] In one implementation, the processing unit 1002 is further configured to:

[0293] Determining that the operation mode of the continuous write operation is the second operation mode, and each continuous write operation is used to trigger data migration from the SLC area to the XLC area, each time the continuous write operation of the SLC area is performed, the timestamp of the SLC area is updated once, and the value of the current set time length is increased by a fixed interval value;

[0294] In each continuous write operation, when the difference between the timestamp of the data migrated from the SLC area to the XLC area and the timestamp of the SLC area is greater than the current set time length, or when the difference between the timestamp of the data migrated from the SLC area to the XLC area and the timestamp of the SLC area is not greater than the current set time length, and the number of garbage collections of the data migrated from the SLC area to the XLC area is not 0, compare the current set time length with the initial value of the set time length;

[0295] When the current set duration is greater than the initial value of the set duration, the fixed interval value is subtracted from the current set duration; when the current set duration is equal to the initial value of the set duration, the current set duration is kept unchanged.

[0296] In one implementation, the processing unit 1002 is specifically configured to:

[0297] Each time a continuous write operation is performed on the SLC area, the starting physical address of the continuous write operation of the SLC area is determined; after each continuous write operation of the SLC area is completed, the write data of the continuous write operation of this SLC area is migrated to the XLC area in sequence according to the starting physical address of the continuous write operation of this SLC area.

[0298] In one implementation, the processing unit 1002 is further configured to:

[0299] Divide the XLC area into two parts: hot pool and cold pool;

[0300] The performing a data migration operation on the data in the SLC area according to the operation mode of the continuous write operation and the second trigger condition includes:

[0301] When determining that the operation mode of the continuous write operation is the second operation mode and determining that not every continuous write operation is used to trigger data migration from the SLC area to the XLC area, determining that the physical block to be subjected to the data migration operation is the physical block having the largest number of continuous write physical pages in the SLC area; the continuous write physical page is a physical page storing at least data written by the continuous write operation;

[0302] The data written by the random write operation on the physical block to be subjected to the data migration operation is determined as follows: when the data is to be migrated, when the existence time of the data to be migrated is greater than the set time length, or when the existence time of the data to be migrated is not greater than the set time length and the number of garbage collection times of the data to be migrated is equal to the set number of times, the data to be migrated is written to the physical block with the largest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0; when the existence time of the data to be migrated is not greater than the set time length, and the number of garbage collection times of the data to be migrated is equal to 0, the data to be migrated is written to the physical block with the smallest number of erasure times in the cold pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0; when the existence time of the data to be migrated is not greater than the set time length, and the number of garbage collection times of the data to be migrated is not equal to 0 and the set number of times, the data to be migrated is written to the physical block with the smallest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0;

[0303] Determine the data written by the continuous write operation on the physical block to be subjected to the data migration operation as: when the data is to be migrated, migrate the data to be migrated to the XLC area;

[0304] After the data migration operation of the physical block to be subjected to the data migration operation is completed, the physical block to be subjected to the data migration operation is erased.

[0305] In one implementation, the processing unit 1002 is further configured to:

[0306] When the number of physical blocks with the largest number of consecutively written physical pages in the SLC area is greater than 1, the physical block with the longest data existence time is selected from among the physical blocks with the largest number of consecutively written physical pages in the SLC area as the physical block to be subjected to data migration operation.

[0307] In one implementation, the initial value of the set time length is proportional to the total number of physical pages in the SLC area.

[0308] In one embodiment, the XLC mode is an MLC mode, a TLC mode or a QLC mode.

[0309] In practical applications, the above-mentioned determination unit 1001 and processing unit 1002 can be implemented by a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA) located in a storage control device.

[0310] In addition, each functional module in this embodiment can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or software functional modules.

[0311] If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or the part that contributes to the prior art or the whole or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the method described in this embodiment. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.

[0312] Specifically, the computer program instructions corresponding to a storage control method in this embodiment can be stored on a storage medium such as a CD, a hard disk, or a USB flash drive. When the computer program instructions corresponding to a storage control method in the storage medium are read or executed by an electronic device, the steps of any one of the storage control methods in the aforementioned embodiments are implemented.

[0313] Based on the same technical concept as the above embodiments, see Fig.11 , which shows a storage control device 11 provided by an embodiment of the present invention, the device may include:

[0314] Memory 111, processor 112 and bus 113; wherein,

[0315] The bus 113 is used to connect the memory 111, the processor 112 and the mutual communication between these devices;

[0316] The memory 111 is used to store computer programs and data;

[0317] The processor 112 is used to execute the computer program stored in the memory to implement the steps of any one of the storage control methods in the foregoing embodiments.

[0318] In practical applications, the memory 111 may be a volatile memory, such as RAM; or a non-volatile memory, such as ROM, flash memory, hard disk drive (HDD) or solid-state drive (SSD); or a combination of the above types of memory, and provide instructions and data to the processor 112.

[0319] The processor 112 may be at least one of an application specific integrated circuit (ASIC), a DSP, a digital signal processing device (DSPD), a programmable logic device (PLD), an FPGA, a CPU, a controller, a microcontroller, and a microprocessor. It is understandable that for different devices, the electronic device used to implement the functions of the processor may also be other, and the embodiment of the present invention does not specifically limit this.

[0320] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.

[0321] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0322] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0323] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0324] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention.

Claims

1. A storage control method, characterized in that: The method comprises: In the storage area of ​​the storage device, an SLC area adopting a single-layer storage SLC mode and an XLC area adopting a non-single-layer storage XLC mode are determined; When any physical block in the SLC area is erased, the mode adopted by the erased physical block is configured as the XLC mode, and the mode adopted by the empty physical block with the smallest erase times in the XLC area is configured as the SLC mode.

2. The method according to claim 1, characterized in that The method further comprises: dividing the XLC region into two parts, a hot pool and a cold pool; After the mode adopted by the erased physical block is configured as the XLC mode, when it is determined that the erase count of the erased physical block is less than the maximum erase count of each physical block in the cold pool and the minimum erase count of each physical block in the hot pool, the erased physical block is placed in the cold pool; when it is determined that the erase count of the erased physical block is not less than the maximum erase count of each physical block in the cold pool, or is not less than the minimum erase count of each physical block in the hot pool, the erased physical block is placed in the hot pool.

3. The method according to claim 1, characterized in that: The method further comprises: When a first trigger condition is met, a garbage collection operation is performed on garbage data in the SLC area, wherein the garbage data is used to represent data that has been updated and not erased, and the first trigger condition includes at least one of the following: The number of empty physical blocks in the SLC area is less than a first set threshold; The amount of junk data in the SLC area exceeds a second set threshold.

4. The method according to claim 3, characterized in that The performing a garbage collection operation on the garbage data in the SLC area includes: determining an operation mode of a continuous write operation, and performing a garbage collection operation on the garbage data in the SLC area according to the operation mode of the continuous write operation; Among them, the operation mode of the continuous write operation is the first operation mode or the second operation mode, the first operation mode is used to indicate that the data to be written is directly written into the XLC area, and the second operation mode is used to indicate that the data to be written is first written into the SLC area, and then the data first written into the SLC area is migrated to the XLC area.

5. The method according to claim 4, characterized in that The method further comprises: dividing the XLC region into two parts, a hot pool and a cold pool; The performing a garbage collection operation on the garbage data in the SLC area according to the operation mode of the continuous write operation includes: Determine that the operation mode of the continuous write operation is the first operation mode, determine that the physical block to be subjected to the garbage collection operation is the physical block with the largest amount of garbage data in the SLC area; record the data in the physical block to be subjected to the garbage collection operation as data to be recovered; When the existence time of the data to be recycled is greater than the set time, or when the existence time of the data to be recycled is not greater than the set time and the number of garbage collection times of the data to be recycled is equal to the set number, the data to be recycled is written into the physical block with the largest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be recycled is changed to 0; When the existence time of the data to be recycled is not greater than the set time length and the number of garbage collection times of the data to be recycled is less than the set number of times, the data to be recycled is written into the physical block with the smallest number of erasure times in the SLC area, and the value of the number of garbage collection times of the data to be recycled is increased by 1; After the data recovery of the physical block to be subjected to the garbage recovery operation is completed, the physical block to be subjected to the garbage recovery operation is erased.

6. The method according to claim 4, characterized in that The method further comprises: Determining that the operation mode of the continuous write operation is the second operation mode, and each continuous write operation is used to trigger data migration from the SLC area to the XLC area, each time the continuous write operation of the SLC area is performed, the timestamp of the SLC area is updated once, and the value of the current set time length is increased by a fixed interval value; In each continuous write operation, when the difference between the timestamp of the data migrated from the SLC area to the XLC area and the timestamp of the SLC area is greater than the current set time length, or when the difference between the timestamp of the data migrated from the SLC area to the XLC area and the timestamp of the SLC area is not greater than the current set time length, and the number of garbage collections of the data migrated from the SLC area to the XLC area is not 0, compare the current set time length with the initial value of the set time length; When the current set duration is greater than the initial value of the set duration, the fixed interval value is subtracted from the current set duration; when the current set duration is equal to the initial value of the set duration, the current set duration is kept unchanged.

7. The method according to claim 4, characterized in that The method further comprises: dividing the XLC region into two parts, a hot pool and a cold pool; The performing a garbage collection operation on the garbage data in the SLC area according to the operation mode of the continuous write operation includes: When determining that the operation mode of the continuous write operation is the second operation mode and determining that not every continuous write operation is used to trigger data migration from the SLC area to the XLC area, determining that the physical block to be subjected to the garbage collection operation is the physical block having the largest number of continuous write physical pages in the SLC area; the continuous write physical page is a physical page storing at least data written by the continuous write operation; The data written by the random write operation on the physical block to be subjected to the garbage collection operation is determined as follows: when the data is to be recovered, when the existence time of the data to be recovered is greater than the set time length, or when the existence time of the data to be recovered is not greater than the set time length and the number of garbage collection times of the data to be recovered is equal to the set number of times, the data to be recovered is written into the physical block with the largest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be recovered is changed to 0; when the existence time of the data to be recovered is not greater than the set time length and the number of garbage collection times of the data to be recovered is less than the set number of times, the data to be recovered is written into the physical block with the smallest number of erasure times in the SLC area, and the value of the number of garbage collection times of the data to be recovered is increased by 1; Determine the data written by the continuous write operation on the physical block to be subjected to the garbage collection operation as follows: when the data is to be recycled, write the data to be recycled into the XLC area; After the data recovery of the physical block to be subjected to the garbage recovery operation is completed, the physical block to be subjected to the garbage recovery operation is erased.

8. The method according to claim 7, characterized in that The method also includes: when the number of physical blocks with the largest number of consecutively written physical pages in the SLC area is greater than 1, selecting the physical block with the longest data existence time among the physical blocks with the largest number of consecutively written physical pages in the SLC area as the physical block to be subjected to garbage collection operation.

9. The method according to claim 1, characterized in that: The method further comprises: When a second trigger condition is met, a data migration operation is performed on the data in the SLC area, wherein the second trigger condition includes at least one of the following: The number of empty physical blocks in the SLC area is less than a first set threshold, and the amount of junk data in the SLC area does not exceed a second set threshold; The data existence time of the physical block with the longest data existence time in the SLC area exceeds the set time length.

10. The method according to claim 9, characterized in that The performing a data migration operation on the data in the SLC area includes: determining an operation mode of a continuous write operation, and performing a data migration operation on the data in the SLC area according to the operation mode of the continuous write operation and the second trigger condition; Among them, the operation mode of the continuous write operation is the first operation mode or the second operation mode, the first operation mode is used to indicate that the data to be written is directly written into the XLC area, and the second operation mode is used to indicate that the data to be written is first written into the SLC area, and then the data first written into the SLC area is migrated to the XLC area.

11. The method according to claim 10, characterized in that The method further comprises: dividing the XLC region into two parts, a hot pool and a cold pool; The performing a data migration operation on the data in the SLC area according to the operation mode of the continuous write operation and the second trigger condition includes: Determining that the operation mode of the continuous write operation is the first operation mode, the second trigger condition is: the number of empty physical blocks in the SLC area is less than a first set threshold, and the amount of junk data in the SLC area does not exceed a second set threshold; Determine that the physical block to be subjected to the data migration operation is the physical block in which the data has existed for the longest time in the SLC area; record the data of the physical block to be subjected to the data migration operation as the data to be migrated; When the existence time of the data to be migrated is greater than the set time, or when the existence time of the data to be migrated is not greater than the set time and the number of garbage collection times of the data to be migrated is equal to the set number, the data to be migrated is written into the physical block with the largest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0; When the existence time of the data to be migrated is not greater than the set time length and the number of garbage collection times of the data to be migrated is equal to 0, the data to be migrated is written into the physical block with the smallest number of erasure times in the cold pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0; When the existence time of the data to be migrated is not greater than the set time length and the number of garbage collection times of the data to be migrated is not equal to 0 and the set number of times, the data to be migrated is written into the physical block with the smallest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0; After the data migration operation of the physical block to be subjected to the data migration operation is completed, the physical block to be subjected to the data migration operation is erased.

12. The method according to claim 10, characterized in that The method further comprises: dividing the XLC region into two parts, a hot pool and a cold pool; The performing a data migration operation on the data in the SLC area according to the operation mode of the continuous write operation and the second trigger condition includes: Determining that the operation mode of the continuous write operation is the first operation mode, the second trigger condition is: the data existence time of the physical block with the longest data existence time in the SLC area exceeds a set time length; Determine that the physical block to be subjected to the data migration operation is the physical block in which the data has existed for the longest time in the SLC area; record the data of the physical block to be subjected to the data migration operation as the data to be migrated; When the existence time of the data to be migrated is greater than the set time, or when the existence time of the data to be migrated is not greater than the set time and the number of garbage collection times of the data to be migrated is equal to the set number, the data to be migrated is written into the physical block with the largest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0; When the existence time of the data to be migrated is not greater than the set time length and the number of garbage collection times of the data to be migrated is equal to 0, the data to be migrated is written into the physical block with the smallest number of erasure times in the SLC area, and the value of the number of garbage collection times of the data to be migrated is increased by 1; When the existence time of the data to be migrated is not greater than the set time length and the number of garbage collection times of the data to be migrated is not equal to 0 and the set number of times, the data to be migrated is written into the physical block with the smallest number of erasure times in the cold pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0; After the data migration operation of the physical block to be subjected to the data migration operation is completed, the physical block to be subjected to the data migration operation is erased.

13. The method according to claim 10, characterized in that The method further comprises: Determining that the operation mode of the continuous write operation is the second operation mode, and each continuous write operation is used to trigger data migration from the SLC area to the XLC area, each time the continuous write operation of the SLC area is performed, the timestamp of the SLC area is updated once, and the value of the current set time length is increased by a fixed interval value; In each continuous write operation, when the difference between the timestamp of the data migrated from the SLC area to the XLC area and the timestamp of the SLC area is greater than the current set time length, or when the difference between the timestamp of the data migrated from the SLC area to the XLC area and the timestamp of the SLC area is not greater than the current set time length, and the number of garbage collections of the data migrated from the SLC area to the XLC area is not 0, compare the current set time length with the initial value of the set time length; When the current set duration is greater than the initial value of the set duration, the fixed interval value is subtracted from the current set duration; when the current set duration is equal to the initial value of the set duration, the current set duration is kept unchanged.

14. The method according to claim 13, characterized in that The performing a data migration operation on the data in the SLC area includes: Each time a continuous write operation is performed on the SLC area, the starting physical address of the continuous write operation of the SLC area is determined; after each continuous write operation of the SLC area is completed, the write data of the continuous write operation of this SLC area is migrated to the XLC area in sequence according to the starting physical address of the continuous write operation of this SLC area.

15. The method according to claim 10, characterized in that The method further comprises: dividing the XLC region into two parts, a hot pool and a cold pool; The performing a data migration operation on the data in the SLC area according to the operation mode of the continuous write operation and the second trigger condition includes: When determining that the operation mode of the continuous write operation is the second operation mode and determining that not every continuous write operation is used to trigger data migration from the SLC area to the XLC area, determining that the physical block to be subjected to the data migration operation is the physical block having the largest number of continuous write physical pages in the SLC area; the continuous write physical page is a physical page storing at least data written by the continuous write operation; The data written by the random write operation on the physical block to be subjected to the data migration operation is determined as follows: when the data is to be migrated, when the existence time of the data to be migrated is greater than the set time length, or when the existence time of the data to be migrated is not greater than the set time length and the number of garbage collection times of the data to be migrated is equal to the set number of times, the data to be migrated is written to the physical block with the largest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0; when the existence time of the data to be migrated is not greater than the set time length, and the number of garbage collection times of the data to be migrated is equal to 0, the data to be migrated is written to the physical block with the smallest number of erasure times in the cold pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0; when the existence time of the data to be migrated is not greater than the set time length, and the number of garbage collection times of the data to be migrated is not equal to 0 and the set number of times, the data to be migrated is written to the physical block with the smallest number of erasure times in the hot pool of the XLC area, and the number of garbage collection times of the data to be migrated is changed to 0; Determine the data written by the continuous write operation on the physical block to be subjected to the data migration operation as: when the data is to be migrated, migrate the data to be migrated to the XLC area; After the data migration operation of the physical block to be subjected to the data migration operation is completed, the physical block to be subjected to the data migration operation is erased.

16. The method according to claim 15, characterized in that The method also includes: when the number of physical blocks with the largest number of consecutively written physical pages in the SLC area is greater than 1, selecting the physical block with the longest data existence time among the physical blocks with the largest number of consecutively written physical pages in the SLC area as the physical block to be subjected to data migration operation.

17. The method according to any one of claims 5 to 16, characterized in that The initial value of the set time length is proportional to the total number of physical pages in the SLC area.

18. The method according to any one of claims 1 to 16, characterized in that The XLC mode is a multi-layer storage MLC mode, a three-layer storage architecture TLC mode or a four-layer storage architecture QLC mode.

19. A storage control device, characterized in that: The device comprises a determination unit and a processing unit; wherein, A determination unit, used to determine, in the storage area of ​​the storage device, an SLC area using a single-layer storage SLC mode and an XLC area using a non-single-layer storage XLC mode; The processing unit is used to configure the mode adopted by the erased physical block to the XLC mode when any physical block in the SLC area is erased, and configure the mode adopted by the empty physical block with the smallest number of erase times in the XLC area to the SLC mode.

20. A storage control device, characterized in that: The device comprises: a processor and a memory for storing a computer program that can be run on the processor; wherein, When the processor is used to run the computer program, the steps of the method according to any one of claims 1 to 18 are performed.

21. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 18 are implemented.