SSD data storage method, SSD, terminal device and storage medium
By using SCM media cache in SSD and moving data sequentially to QLC particles, the problems of large throughput delay and short erase life of QLC particles are solved, extending the life of SSD and improving performance, achieving efficient data storage.
Patent Information
- Application Number
- CN202111612595.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-27
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-12-27
AI Technical Summary
QLC particles in SSDs cannot meet the performance requirements and are not used in high-performance SSDs due to large throughput delay and short erase life.
By using SCM media as a cache, the data to be stored is written into the SCM cache and moved to the QLC in sequence for storage, reducing the number of erases of the QLC, reducing write amplification, and improving the overall throughput efficiency of the SSD.
It extends the life of SSD, improves the storage performance of QLC, meets the requirements of high-performance SSDs, and reduces overall costs.
Smart Images

Figure CN114489484B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of memory technology, and in particular to a data storage method for an SSD, an SSD, a terminal device, and a computer storage medium. Background Art
[0002] At present, there are four types of flash memory particles in the industry, namely, SLC (Single-Level Cell, i.e. 1 bit / cell, with a simple structure but high execution efficiency, characterized by fast speed and long life - about 100,000 erase and write cycles, but expensive (about 3 times the price of MLC)), MLC (Multi-Level Cell, i.e. 2 bit / cell, with four charge values of 00, 01, 10, and 11, so it takes more access time than SLC, characterized by average speed and average life (about 3000-10000 erase and write cycles), and relatively expensive), TLC (Trinary-Level Cell, i.e. 3 bit / cell, each cell can store 1 / 2 more data than MLC, with a total of eight charge values, and some Flash manufacturers call it 8LC, characterized by slow speed and relatively short life (about 500 erase and write cycles), and average price), and QLC (Quad-Level Cell, that is, 4 bits / cell, supports 16 charging values, has the slowest speed and shortest life (about 150 erase and write cycles) but is the cheapest. It is currently in the research and development stage.
[0003] In addition, the particles of common high-performance SSDs (Solid State Disk or Solid State Drive) on the market mostly use TLC particles or relatively more expensive MLC particles (SLC particles are usually only used in enterprise-level SSDs (such as the classic Intel X25-E series) or some high-end USB flash drives due to their high cost). The lowest-cost QLC particles are not used in SSDs because they cannot meet performance requirements due to their large throughput delay and short erase and write life. Summary of the invention
[0004] The main purpose of the present invention is to provide a data storage method for SSD, SSD, terminal equipment and computer storage medium, aiming to use SCM (Storage Class Memory, a storage medium technology) medium to improve the defects of large throughput delay and short erase life of QLC particles, so as to realize the use of QLC particles as SSD particles and improve the overall performance of SSD using QLC particles. Among them, SCM is a very popular new medium form in the industry, and has the characteristics of persistence (Storage Class) and fast byte-level access (Memory). Currently, SCM is also called PM (Persistent Memory) medium or NVM (Non-Volatile Memory) medium. SCM is between DRAM (Dynamic Random Access Memory) and NAND Flash (a type of Flash memory), and its data reading and writing speed is higher than NAND, but slightly lower than DRAM.
[0005] To achieve the above object, the present invention provides a data storage method for an SSD, the data storage method for the SSD being applied to an SSD using QLC as storage particles, the data storage method for the SSD comprising:
[0006] Acquire data to be stored, and write the data to be stored into an SCM cache in the SSD;
[0007] The data to be stored is moved from the SCM cache to the QLC in sequence for storage.
[0008] Further, the QLC includes a plurality of ZONE areas, and the step of sequentially moving the data to be stored from the SCM cache to the QLC for storage includes:
[0009] Determining target data to be stored to be moved from the SCM cache;
[0010] According to the order in which the QLC is managed based on the multiple ZONE areas, the target data to be stored is moved to a target ZONE area among the multiple ZONE areas for storage.
[0011] Furthermore, the data storage method of the SSD also includes:
[0012] Detecting whether there is a vacant first ZONE area among the plurality of ZONE areas, wherein no data is written in the first ZONE area;
[0013] If the existence of the first ZONE area is detected, the first ZONE area is determined as the target ZONE area.
[0014] Further, after the step of detecting whether there are any vacant ZONE areas among the plurality of ZONE areas, the method further includes:
[0015] If it is detected that the first ZONE area does not exist, determining a second ZONE area with the smallest amount of stored data from the multiple ZONE areas;
[0016] The data stored in the second ZONE area is moved to a preset redundant area and then determined as the target ZONE area.
[0017] Furthermore, the data storage method of the SSD also includes:
[0018] Detecting a data cache state of the SCM cache, wherein the data cache state includes: a cache space is full and a cache space is not full;
[0019] When it is detected that the data cache state is that the cache space is full, the step of sequentially moving the data to be stored from the SCM cache to the QLC for storage is performed.
[0020] Furthermore, the data storage method of the SSD also includes:
[0021] Respond to a data read instruction and read the target data pointed to by the instruction from the SCM cache and / or the QLC.
[0022] Further, the step of reading the target data pointed to by the instruction from the SCM cache and / or the QLC includes:
[0023] Detecting whether the target data exists in the SCM cache;
[0024] If it is detected that all the target data exist in the SCM cache, reading the target data from the SCM cache;
[0025] If it is detected that the target data does not exist in the SCM cache, reading the target data from the QLC;
[0026] If it is detected that a portion of the entire target data exists in the SCM cache, the target data is read from the SCM cache and the QLC.
[0027] In addition, to achieve the above object, the present invention further provides an SSD, characterized in that the SSD uses QLC as storage particles, the SSD uses SCM media as cache, and the SSD includes:
[0028] A data cache module, used to obtain data to be stored and write the data to be stored into the SCM cache in the SSD;
[0029] The data migration storage module is used to sequentially migrate the data to be stored from the SCM cache to the QLC for storage.
[0030] Each functional module of the SSD of the present invention implements the steps of the data storage method of the SSD as described above during operation.
[0031] In addition, to achieve the above-mentioned purpose, the present invention also provides a terminal device, which includes: an SSD using QLC as storage particles and SCM media as cache, a processor, and an SSD data storage program stored on the storage device and executable on the processor, wherein the SSD data storage program, when executed by the processor, implements the steps of the SSD data storage method as described above.
[0032] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the data storage method of the SSD as described above are implemented.
[0033] The present invention proposes an SSD data storage method, an SSD, a terminal device, and a computer storage medium. The SSD data storage method is applied to an SSD using QLC as a storage particle. The SSD data storage method includes: obtaining data to be stored, and writing the data to be stored into an SCM cache in the SSD; and sequentially moving the data to be stored from the SCM cache to the QLC for storage.
[0034] In the process of using QLC as the storage particle of the SSD for data storage, the present invention first writes the acquired data to be stored into the SCM cache of the SSD using the SCM medium as the cache, and then sequentially moves the data to be stored from the SCM cache to the back-end QLC for storage.
[0035] Compared with the traditional SSD that uses TCL particles, MLC particles or even SLC particles, the SSD proposed in the present invention uses QLC as storage particles, and uses SCM media instead of traditional memory to form a conversion layer between the external terminal connected to the SSD and the internal QLC, which can reduce the overall cost of the SSD to a certain extent. In addition, in the process of data storage in the SSD, the data to be stored is first written into the SCM cache, and then moved to the QLC in sequence for storage. In this way, the data is aggregated through the SCM cache and then moved to the QLC for storage, which can not only greatly reduce the number of erase times of the underlying QLC and extend the life of the SSD, but also effectively reduce the write amplification of the QLC, thereby increasing the overall throughput efficiency of the SSD and meeting the high performance requirements of the SSD. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a schematic diagram of the structure of the hardware operation of the terminal device involved in the embodiment of the present invention;
[0037] Figure 2 It is a flow chart of an embodiment of a data storage method of an SSD of the present invention;
[0038] Figure 3 This is a schematic diagram of an application scenario of an SSD of the present invention;
[0039] Figure 4 It is a schematic diagram of the structural relationship of functional modules of an SSD of the present invention.
[0040] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings in conjunction with the embodiments. DETAILED DESCRIPTION
[0041] 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.
[0042] like Figure 1 As shown, Figure 1 It is a structural diagram of the hardware operating environment of the terminal device involved in the embodiment of the present invention.
[0043] It should be noted that Figure 1 The terminal device of the embodiment of the present invention may be a terminal device that includes an SSD using QLC particles as storage particles and SCM media as cache, and executes the data storage method of the SSD provided by the present invention for the SSD. The terminal device may specifically be a mobile terminal, a data storage control terminal, a PC, or a portable computer.
[0044] like Figure 1As shown, the terminal device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005 (specifically, it may be the above-mentioned storage device), and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a non-volatile memory (such as a Flash memory), a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0045] Those skilled in the art will understand that Figure 1 The terminal device structure shown in the figure does not constitute a limitation on the terminal device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0046] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a data storage program of the SSD. Among them, the operating system is a program for managing and controlling the hardware and software resources of the sample terminal device, and supports the operation of the data storage program of the SSD and other software or programs.
[0047] exist Figure 1 In the terminal device shown, the user interface 1003 is mainly used for data communication with each terminal; the network interface 1004 is mainly used for connecting to the backend server and communicating data with the backend server; and the processor 1001 can be used to call the data storage program of the SSD stored in the memory 1005 and perform the following operations:
[0048] Acquire data to be stored, and write the data to be stored into an SCM cache in the SSD;
[0049] The data to be stored is moved from the SCM cache to the QLC in sequence for storage.
[0050] Furthermore, the QLC includes a plurality of ZONE areas, and the processor 1001 may call a data storage program of the SSD stored in the memory 1005, and further perform the following operations:
[0051] Determining target data to be stored to be moved from the SCM cache;
[0052] According to the order in which the QLC is managed based on the multiple ZONE areas, the target data to be stored is moved to a target ZONE area among the multiple ZONE areas for storage.
[0053] Further, the processor 1001 may call the data storage program of the SSD stored in the memory 1005, and further perform the following operations:
[0054] Detecting whether there is a vacant first ZONE area among the plurality of ZONE areas, wherein no data is written in the first ZONE area;
[0055] If the existence of the first ZONE area is detected, the first ZONE area is determined as the target ZONE area.
[0056] Further, the processor 1001 may call the data storage program of the SSD stored in the memory 1005, and after executing the step of detecting whether there are vacant ZONE areas in the plurality of ZONE areas, further perform the following operations:
[0057] If it is detected that the first ZONE area does not exist, determining a second ZONE area with the smallest amount of stored data from the multiple ZONE areas;
[0058] The data stored in the second ZONE area is moved to a preset redundant area and then determined as the target ZONE area.
[0059] Further, the processor 1001 may call the data storage program of the SSD stored in the memory 1005, and further perform the following operations:
[0060] Detecting a data cache state of the SCM cache, wherein the data cache state includes: a cache space is full and a cache space is not full;
[0061] When it is detected that the data cache state is that the cache space is full, the step of sequentially moving the data to be stored from the SCM cache to the QLC for storage is performed.
[0062] Further, the processor 1001 may call the data storage program of the SSD stored in the memory 1005, and further perform the following operations:
[0063] Respond to a data read instruction and read the target data pointed to by the instruction from the SCM cache and / or the QLC.
[0064] Further, the processor 1001 may call the data storage program of the SSD stored in the memory 1005, and further perform the following operations:
[0065] Detecting whether the target data exists in the SCM cache;
[0066] If it is detected that all the target data exist in the SCM cache, reading the target data from the SCM cache;
[0067] If it is detected that the target data does not exist in the SCM cache, reading the target data from the QLC;
[0068] If it is detected that a portion of the entire target data exists in the SCM cache, the target data is read from the SCM cache and the QLC.
[0069] Based on the above structure, various embodiments of the data storage method of the SSD of the present invention are proposed.
[0070] It should be noted that at present, there are four types of flash memory particles in the industry, namely, SLC (Single-Level Cell, i.e. 1 bit / cell, with a simple structure but high execution efficiency, characterized by fast speed and long life - about 100,000 erase and write cycles, but expensive (about 3 times the price of MLC)), MLC (Multi-Level Cell, i.e. 2 bit / cell, with four charge values of 00, 01, 10, and 11, so it takes more access time than SLC, characterized by average speed and average life (about 3000-10,000 erase and write cycles), and relatively expensive), TLC (Trinary-Level Cell, i.e. 3 bit / cell, each cell can store 1 / 2 more data than MLC, with a total of eight charge values, and some Flash manufacturers call it 8LC, characterized by slow speed and relatively short life (about 500 erase and write cycles), and average price), and QLC (Quad-Level Cell, that is, 4 bits / cell, supports 16 charging values, has the slowest speed and shortest life (about 150 erase and write cycles) but is the cheapest. It is currently in the research and development stage.
[0071] In addition, the particles of common high-performance SSDs (Solid State Disk or Solid State Drive) on the market mostly use TLC particles or relatively more expensive MLC particles (SLC particles are usually only used in enterprise-level SSDs (such as the classic Intel X25-E series) or some high-end USB flash drives due to their high cost). The lowest-cost QLC particles are not used in SSDs because they cannot meet performance requirements due to their large throughput delay and short erase and write life.
[0072] In view of the above phenomenon, the present application provides a data storage method for an SSD. In the process of storing data in an SSD using QLC as storage particles, the acquired data to be stored is first written into an SCM cache of the SSD using SCM media as cache, and then the data to be stored is sequentially moved from the SCM cache to the QLC at the back end for storage.
[0073] Compared with the traditional SSD that uses TCL particles, MLC particles or even SLC particles, the SSD proposed in the present invention uses QLC as storage particles, and uses SCM media instead of traditional memory to form a conversion layer between the external terminal connected to the SSD and the internal QLC, which can reduce the overall cost of the SSD to a certain extent. In addition, in the process of data storage in the SSD, the data to be stored is first written into the SCM cache, and then moved to the QLC in sequence for storage. In this way, the data is aggregated through the SCM cache and then moved to the QLC for storage, which can not only greatly reduce the number of erase times of the underlying QLC and extend the life of the SSD, but also effectively reduce the write amplification of the QLC, thereby increasing the overall throughput efficiency of the SSD and meeting the high performance requirements of the SSD.
[0074] For details, please refer to Figure 2 , Figure 2 FIG. 1 is a flow chart of a first embodiment of a method for storing data in an SSD according to the present invention.
[0075] The embodiment of the present invention provides an embodiment of a data storage method for an SSD, and the data storage method for an SSD in the embodiment of the present invention is applied to the above-mentioned terminal device to perform data storage on an SSD that uses QLC particles as storage particles and uses SCM media as a cache. It should be noted that although a logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from that here.
[0076] In this embodiment, the data storage method of the SSD of the present invention includes:
[0077] Step S100, obtaining data to be stored, and writing the data to be stored into the SCM cache in the SSD;
[0078] When the terminal device responds to a data storage instruction and stores the data to be stored pointed to by the instruction in the SSD using QLC particles as storage particles and SCM media as cache, it first obtains the data to be stored and writes the data to be stored to the SCM cache in the SSD for temporary storage.
[0079] It should be noted that, in this embodiment, the SCM cache replaces the traditional memory in the entire SSD to form a conversion layer between the terminal device and the QLC inside the SSD. Since the SCM cache itself has the characteristics of non-volatility, the temporary storage of data through the SCM cache will greatly reduce the overall complexity of the SSD. In addition, the SSD also directly stores various table entry data in the SCM cache, which can simplify the overall table entry management of the SSD and perform power-off reconstruction.
[0080] Specifically, for example, see Figure 3 As shown in the application scenario, in this embodiment, after the terminal device receives an instruction to store certain data initiated by the user (or automatically initiated by an application installed on the terminal device), the terminal device connects to the firmware FW in the SSD (ZONE Based SSD FW in the figure) through an interface, and based on the control of the firmware FW, writes the data to be stored pointed to by the instruction to the SCM cache (SCM in the figure) for temporary storage.
[0081] Step S200, moving the data to be stored from the SCM cache to the QLC in sequence for storage.
[0082] After the terminal device writes the data to be stored into the SCM cache of the SSD for temporary storage, it further moves the data to be stored from the SCM cache to the QLC for storage in a predetermined order.
[0083] It should be noted that, in this embodiment, the QLC in the SSD is managed by the firmware FW using ZONE. Figure 3 In the application scenario shown, the firmware FW in the SSD divides the QLC (QLC NANDFLASH in the figure) into multiple ZONE areas for management based on the ZNS algorithm. In this way, since the multiple ZONE areas in the QLC are managed in sequence, there will be no large-capacity addressing problem in the SCM cache like traditional DRAM (a type of memory), making the SSD as a whole very suitable for large-capacity and high-performance storage scenarios.
[0084] In addition, in this embodiment, since the capacity of SCM can be expanded without limit based on actual needs, compared with traditional memory (such as DDR, i.e. double rate synchronous dynamic random access memory) with limited capacity (currently the maximum capacity of DDR is 64G) which cannot provide the cache capacity required by large-capacity SSD, the present invention is based on SCM instead of traditional memory and can meet the cache capacity required by any large-capacity SSD, and can be applicable to large data storage devices.
[0085] Furthermore, in a feasible embodiment, the above step S200 may include:
[0086] Step S201, determining target data to be stored to be moved from the SCM cache;
[0087] Step S202: according to the order in which the QLC manages the multiple ZONE areas, the target data to be stored is moved to a target ZONE area among the multiple ZONE areas for storage.
[0088] In this embodiment, when the terminal device moves the data to be stored from the SCM cache of the SSD to the QLC for storage, the SSD firmware FW first determines the target data to be stored that currently needs to be moved to the QLC for storage from all the data to be stored in the SCM cache. Then, according to the order in which the firmware FW manages the multiple ZONE areas in the QLC, the target data to be stored is moved to the target ZONE area determined from the multiple ZONE areas for storage.
[0089] It should be noted that, in this embodiment, when the terminal device moves the target data to be stored to the target ZONE area for storage through the SSD firmware FW, the target data to be stored is specifically written sequentially into the multiple ZONE areas. That is, the firmware FW determines the target ZONE area from the multiple ZONE areas in sequence according to the order in which the QLC is divided into multiple ZONE areas for management based on the ZNS algorithm, and then writes the target data to be stored into the target ZONE area. After the target ZONE area is full, the next ZONE area in the multiple ZONE areas is determined in sequence as the new target ZONE area to continue writing data for storage.
[0090] Furthermore, in a feasible embodiment, the data storage method of the SSD of the present invention may also include:
[0091] Step A, detecting whether there is a vacant first ZONE area among the plurality of ZONE areas, wherein no data is written in the first ZONE area;
[0092] Step B: If the existence of the first ZONE area is detected, the first ZONE area is determined as the target ZONE area.
[0093] In this embodiment, when the terminal device moves the target data to be stored to the QLC for storage through the SSD firmware FW, the firmware FW determines the target ZONE area from the multiple ZONE areas in order according to the order in which the QLC is divided into multiple ZONE areas for management based on the ZNS algorithm, that is, the firmware FW detects whether there is a vacant first ZONE area in the multiple ZONE areas that has no other data written, and then, if the firmware FW detects that there is one or more of the first ZONE areas in the multiple ZONE areas, then the first ZONE area arranged first in order is directly determined as the target ZONE area to be written to the target data to be stored.
[0094] Specifically, for example, assuming that the SSD firmware FW divides the QLC into 10 ZONE areas based on the ZNS algorithm, and the first 5 of the 10 ZONE areas have been written with other data. Then, when the terminal device moves the target data to be stored to the QLC for storage through the SSD firmware FW, it first detects whether there are any vacant first ZONE areas without data written in the total 10 ZONE areas of the QLC, thereby detecting that the last 5 ZONE areas of the 10 ZONE areas are all first ZONE areas, and thus, the first ZONE area arranged in order among the 5 first ZONE areas is directly selected as the target ZONE area to be written with the target data to be stored.
[0095] Further, in a feasible embodiment, after detecting whether there is a vacant first ZONE area among the plurality of ZONE areas in the above step A, the data storage method of the SSD of the present invention may further include:
[0096] Step C, if it is detected that the first ZONE area does not exist, determining a second ZONE area with the smallest amount of stored data from the multiple ZONE areas;
[0097] Step D: Move the data stored in the second ZONE area to a preset redundant area and then determine it as the target ZONE area.
[0098] In this embodiment, if the terminal device detects through the SSD firmware FW that the above-mentioned first ZONE area does not exist in the multiple ZONE areas, then the terminal device detects the amount of data stored in each of the multiple ZONE areas through the firmware FW, and further determines a second ZONE area with the least amount of stored data from the multiple ZONE areas. After that, the data already stored in the second ZONE area is first moved to the preset redundant area pre-divided by the QLC to make the second ZONE area become free, and then the free second ZONE area is determined as the target ZONE area where the target data to be stored is to be written.
[0099] Specifically, for example, assuming that the firmware FW of the SSD divides the QLC into 10 ZONE areas based on the ZNS algorithm, and other data has been written into the 10 ZONE areas. Then, when the terminal device moves the target data to be stored to the QLC for storage through the firmware FW of the SSD, it first detects whether there is a vacant first ZONE area without data written into the 10 ZONE areas of the QLC, thereby detecting that there is no first ZONE area among the 10 ZONE areas, and then further detects the amount of data currently stored in each of the 10 ZONE areas in turn, and compares them in turn to determine that the first ZONE area with the smallest amount of data stored in the 10 ZONE areas is the second ZONE area, and then first moves the data stored in the second ZONE area to the preset redundant area pre-divided by the QLC to make the second ZONE area vacant, and then directly determines the only vacant second ZONE area as the target ZONE area to be written with the target data to be stored.
[0100] It should be noted that, in the present embodiment, the preset redundant area is a part of the physical storage area separately allocated in advance from the QLC when the firmware FW of the SSD divides the ZONE area for the QLC based on the ZNS algorithm.
[0101] Furthermore, in a feasible embodiment, the data storage method of the SSD of the present invention may also include:
[0102] Step E, detecting a data cache state of the SCM cache, wherein the data cache state includes: cache space is full and cache space is not full;
[0103] Step F, when it is detected that the data cache state is that the cache space is full, executing the step of sequentially moving the data to be stored from the SCM cache to the QLC for storage.
[0104] In this embodiment, before the terminal device moves the data to be stored in the SCM cache to the QLC for storage through the SSD firmware FW, the terminal device continuously detects the data cache status of the SCM cache, so that only when it is detected that the data cache status of the SCM cache is that the cache space is full, the above-mentioned process of moving the data to be stored in the SCM cache to the QLC for storage through the SSD firmware FW is executed.
[0105] Only when it is detected that the data cache status of the SCM cache is that the cache space is not full, the terminal device does not move the data through the SSD firmware FW, but when responding to a new data storage instruction and needing to store new data to be stored, the terminal device continues to write the new data to be stored into the SCM cache until the data cache status of the SCM cache changes to that the cache space is full, and then executes the above process of moving the data to be stored in the SCM cache to the QLC for storage through the SSD firmware FW.
[0106] It should be noted that, in the present embodiment, when the terminal device moves the data to be stored in the SCM cache to the QLC for storage through the SSD firmware FW, it can determine the target data to be stored that is currently to be moved to the QLC for storage among all the data to be stored in chronological order according to the time when each data to be stored in the SCM cache is written.
[0107] Specifically, for example, the terminal device can determine the first data to be stored written among all the data to be stored as the target data to be moved to the QLC for storage at present according to the time when all the data to be stored in the SCM cache are written.
[0108] In this embodiment, during the process of storing data in an SSD using QLC as storage particles, the terminal device first writes the acquired data to be stored into the SCM cache of the SSD using SCM media as cache, and then sequentially moves the data to be stored from the SCM cache to the back-end QLC for storage.
[0109] Compared with the traditional SSD that uses TCL particles, MLC particles or even SLC particles, the SSD proposed in the present invention uses QLC as storage particles, and uses SCM media instead of traditional memory to form a conversion layer between the external terminal connected to the SSD and the internal QLC, which can reduce the overall cost of the SSD to a certain extent. In addition, in the process of data storage in the SSD, the data to be stored is first written into the SCM cache, and then moved to the QLC in sequence for storage. In this way, the data is aggregated through the SCM cache and then moved to the QLC for storage, which can not only greatly reduce the number of erase times of the underlying QLC and extend the life of the SSD, but also effectively reduce the write amplification of the QLC, thereby increasing the overall throughput efficiency of the SSD and meeting the high performance requirements of the SSD.
[0110] Further, based on the first embodiment of the data storage method of the SSD of the present invention, a second embodiment of the data storage method of the SSD of the present invention is proposed. The main difference between this embodiment and the first embodiment is that in this embodiment, the data storage method of the SSD of the present invention may also include:
[0111] Step S300, responding to a data read instruction, and reading the target data pointed to by the instruction from the SCM cache and / or the QLC.
[0112] In this embodiment, after the terminal device responds to the above-mentioned data storage instruction and writes the data to be stored pointed to by the instruction into the SCM cache of the SSD through the SSD firmware FW for temporary storage, or further moves the data to be stored in the SCM cache to the QLC of the SSD for storage, if the terminal device receives a data reading instruction initiated based on a user operation (or automatically initiated based on an application installed by the terminal device) at this time, the terminal device immediately responds to the instruction to directly read the target data pointed to by the instruction from the SCM cache through the firmware FW, or directly read the target data from the QLC, or read the target data from the SCM cache and the QLC at the same time.
[0113] Furthermore, in a feasible embodiment, the above step S300 may further include:
[0114] Step S301, detecting whether the target data exists in the SCM cache;
[0115] In this embodiment, when the terminal device reads the target data from the SSD through the SSD firmware FW, it first detects whether the target data exists in the SCM cache of the SSD.
[0116] Specifically, for example, if the terminal device receives a read instruction for the data to be stored after writing the data to be stored to the SCM cache through the SSD firmware FW and before further moving the data to be stored to the QLC for storage, then at this time, the data to be stored is the target data to be stored currently pointed to by the instruction, so that the terminal device can detect through the firmware FW that the target data exists in the SCM cache, or, if the terminal device receives a read instruction for the data to be stored after moving the data to be stored from the SCM cache to the QLC for storage through the SSD firmware FW, then at this time, the terminal device can detect through the firmware FW that the target data does not exist in the SCM cache.
[0117] Step S302: if it is detected that all the target data exist in the SCM cache, the target data is read from the SCM cache;
[0118] In this embodiment, if the terminal device detects that all target data pointed to by the instruction exists in the SCM cache of the SSD when responding to the above-mentioned data reading instruction, the terminal device directly reads all the target data from the SCM cache through the firmware FW of the SSD.
[0119] Specifically, for example, after the terminal device writes the data to be stored into the SCM cache through the SSD firmware FW, and has not further moved the data to be stored to the QLC for storage, when the terminal device receives a read instruction for the data to be stored, the terminal device detects through the firmware FW that all the target data pointed to exists in the SCM cache. In this way, the terminal device directly reads all the target data from the SCM cache through the firmware FW.
[0120] Step S303: if it is detected that the target data does not exist in the SCM cache, read the target data from the QLC;
[0121] In this embodiment, if the terminal device detects that the target data pointed to by the instruction does not exist at all in the SCM cache of the SSD when responding to the above-mentioned data reading instruction, the terminal device directly reads all the target data from the QLC of the SSD through the firmware FW of the SSD.
[0122] Specifically, for example, after the terminal device moves the data to be stored from the SCM cache to the QLC for storage through the SSD firmware FW, when the terminal device receives a read instruction for the data to be stored, the terminal device detects through the firmware FW that all the target data does not exist in the SCM cache. In this way, the terminal device directly reads all the target data from the QLC of the SSD through the firmware FW.
[0123] Step S304: If it is detected that a portion of the entire target data exists in the SCM cache, the target data is read from the SCM cache and the QLC.
[0124] In this embodiment, if the terminal device detects that a portion of the target data pointed to by the instruction exists in the SCM cache of the SSD when responding to the above-mentioned data read instruction, then the terminal device reads all the target data from the SCM cache and the QLC of the SSD at the same time through the firmware FW of the SSD.
[0125] Specifically, for example, when the terminal device receives a read instruction for the data to be stored during the process of moving the data to be stored from the SCM cache to the QLC for storage through the SSD firmware FW, the terminal device may also respond to the instruction at this time. Since not all the data to be stored are moved to the QLC, a part of the target data pointed to by the instruction may exist in both the SCM cache and the QLC of the SSD. In this way, the terminal device detects through the firmware FW that a part of the target data exists in the SCM cache. Then, the terminal device reads data from the SCM cache and the QLC at the same time through the firmware FW, so as to read a part of the target data from the SCM cache and another part of the target data from the QLC.
[0126] In this embodiment, after the terminal device responds to the above-mentioned data storage instruction and writes the data to be stored pointed to by the instruction into the SCM cache of the SSD through the SSD firmware FW for temporary storage, or further moves the data to be stored in the SCM cache to the QLC of the SSD for storage, if the terminal device receives a data reading instruction initiated based on a user operation (or automatically initiated based on an application installed by the terminal device) at this time, the terminal device immediately responds to the instruction to directly read the target data pointed to by the instruction from the SCM cache through the firmware FW, or directly read the target data from the QLC, or read the target data from the SCM cache and the QLC at the same time.
[0127] In addition, please refer to Figure 4 The embodiment of the present invention further provides an SSD, wherein the SSD of the present invention uses QLC as storage particles and uses SCM media as cache. The SSD of the present invention includes:
[0128] A data cache module 10 is used to obtain data to be stored and write the data to be stored into the SCM cache in the SSD;
[0129] The data migration storage module 20 is used to sequentially migrate the data to be stored from the SCM cache to the QLC for storage.
[0130] Preferably, the QLC includes multiple ZONE areas, and the data migration storage module 20 includes:
[0131] A determination unit, configured to determine target data to be stored to be moved from the SCM cache;
[0132] The moving unit is used to move the target data to be stored to a target ZONE area among the multiple ZONE areas for storage according to the order in which the QLC is managed based on the multiple ZONE areas.
[0133] Preferably, the SSD of the present invention further comprises:
[0134] The ZONE area determination module is used to detect whether there is a vacant first ZONE area among the multiple ZONE areas, wherein no data is written in the first ZONE area; and if the existence of the first ZONE area is detected, the first ZONE area is determined as the target ZONE area.
[0135] Preferably, the ZONE area determination module of the SSD of the present invention is also used to determine a second ZONE area with the smallest amount of stored data from multiple ZONE areas if it is detected that the first ZONE area does not exist; and to move the data stored in the second ZONE area to a preset redundant area and then determine it as the target ZONE area.
[0136] Preferably, the SSD of the present invention further comprises:
[0137] A detection module, used to detect the data cache state of the SCM cache, wherein the data cache state includes: the cache space is full and the cache space is not full;
[0138] The data migration storage module 20 of the SSD of the present invention is also used to execute the step of sequentially migrating the data to be stored from the SCM cache to the QLC for storage when it is detected that the data cache state is that the cache space is full.
[0139] Preferably, the SSD of the present invention further comprises:
[0140] A data reading module is used to respond to a data reading instruction and read the target data pointed to by the instruction from the SCM cache and / or the QLC.
[0141] Preferably, the data reading module includes:
[0142] A detection unit, configured to detect whether the target data exists in the SCM cache;
[0143] A first reading unit, configured to read the target data from the SCM cache if it is detected that all the target data exists in the SCM cache;
[0144] A second reading unit, configured to read the target data from the QLC if it is detected that the target data does not exist in the SCM cache;
[0145] The third reading unit is configured to read the target data from the SCM cache and the QLC if it is detected that a portion of the target data exists in the SCM cache.
[0146] The steps implemented by the functional modules of the SSD of the present invention when the controller is running can refer to the embodiments of the data storage method of the SSD of the present invention, which will not be described in detail here.
[0147] In addition, an embodiment of the present invention also proposes a terminal device, which includes: an SSD that uses QLC particles as storage particles and uses SCM media as cache, a processor, and a data storage program of the SSD that is stored on the storage device and can be run on the processor. When the data storage program of the SSD is executed by the processor, the steps of the data storage method of the SSD as described above are implemented.
[0148] The steps implemented when the data storage program of the SSD running on the processor is executed may refer to the various embodiments of the data storage method of the SSD of the present invention, and will not be described in detail here.
[0149] In addition, an embodiment of the present invention further proposes a computer storage medium, which is applied to a computer. The computer storage medium can be a non-volatile computer-readable computer storage medium, and a data storage program of an SSD is stored on the computer storage medium. When the data storage program of the SSD is executed by a processor, the steps of the data storage method of the SSD as described above are implemented.
[0150] The steps implemented when the data storage program running on the processor is executed may refer to the various embodiments of the data storage method of the SSD of the present invention, and will not be described in detail here.
[0151] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0152] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a computer storage medium (such as Flash memory, ROM / RAM, disk, CD), including a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.), and the controller for controlling the storage medium to perform data read and write operations executes the methods described in each embodiment of the present invention.
[0154] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A data storage method for an SSD, It is characterized in that The data storage method of the SSD is applied to an SSD using QLC as storage particles, and the data storage method of the SSD includes: Acquire data to be stored, and write the data to be stored into an SCM cache in the SSD; Sequentially move the data to be stored from the SCM cache to the QLC for storage, wherein the QLC includes a plurality of ZONE areas; The step of sequentially moving the data to be stored from the SCM cache to the QLC for storage includes: The SSD-based firmware FW determines the target data to be stored that currently needs to be moved to the QLC for storage from all the data to be stored in the SCM cache; By means of the firmware FW, the QLC is divided into a plurality of the ZONE areas for management in the order based on the ZNS algorithm, a target ZONE area is determined from the plurality of the ZONE areas in sequence, and the target data to be stored is written into the target ZONE area; After determining that the target ZONE area is full, sequentially determining the next ZONE area among the multiple ZONE areas as a new target ZONE area, and returning to execute the step of writing the target data to be stored into the target ZONE area; The SSD data storage method further includes: After the firmware FW detects that there is no free first ZONE area among the multiple ZONE areas, the firmware FW determines a second ZONE area with the smallest amount of stored data from the multiple ZONE areas, and moves the data stored in the second ZONE area to a preset redundant area pre-divided by the QLC; After determining that the second ZONE area becomes free, the second ZONE area is determined as the target ZONE area to be written with the target data to be stored according to the free state, wherein no data is written in the first ZONE area.
2. The method for storing data in an SSD according to claim 1, It is characterized in that The step of sequentially moving the data to be stored from the SCM cache to the QLC for storage includes: Determining target data to be stored to be moved from the SCM cache; According to the order in which the QLC is managed based on the multiple ZONE areas, the target data to be stored is moved to a target ZONE area among the multiple ZONE areas for storage.
3. The method for storing data in an SSD according to claim 2, It is characterized in that The SSD data storage method further includes: Detect whether there is a vacant first ZONE area among the multiple ZONE areas; If the existence of the first ZONE area is detected, the first ZONE area is determined as the target ZONE area.
4. The method for storing data in an SSD according to claim 3, It is characterized in that After the step of detecting whether there are any vacant ZONE areas in the plurality of ZONE areas, the method further includes: If it is detected that the first ZONE area does not exist, determining a second ZONE area with the smallest amount of stored data from the multiple ZONE areas; The data stored in the second ZONE area is moved to a preset redundant area and then determined as the target ZONE area.
5. The method for storing data in an SSD according to claim 1, It is characterized in that The SSD data storage method further includes: Detecting a data cache state of the SCM cache, wherein the data cache state includes: a cache space is full and a cache space is not full; When it is detected that the data cache state is that the cache space is full, the step of sequentially moving the data to be stored from the SCM cache to the QLC for storage is performed.
6. The method for storing data in an SSD according to claim 1, It is characterized in that The SSD data storage method further includes: Respond to a data read instruction and read the target data pointed to by the instruction from the SCM cache and / or the QLC.
7. The method for storing data in an SSD as claimed in claim 6, It is characterized in that The step of reading the target data pointed to by the instruction from the SCM cache and / or the QLC includes: Detecting whether the target data exists in the SCM cache; If it is detected that all the target data exist in the SCM cache, reading the target data from the SCM cache; If it is detected that the target data does not exist in the SCM cache, reading the target data from the QLC; If it is detected that a portion of the entire target data exists in the SCM cache, the target data is read from the SCM cache and the QLC.
8. An SSD, It is characterized in that The SSD uses QLC as storage particles, the SSD uses SCM media as cache, and the SSD includes: A data cache module, used to obtain data to be stored and write the data to be stored into the SCM cache in the SSD; A data migration storage module, used to sequentially migrate the data to be stored from the SCM cache to the QLC for storage, wherein the QLC includes a plurality of ZONE areas; The data migration storage module is also used to determine the target data to be stored that currently needs to be moved to the QLC for storage from all the data to be stored in the SCM cache based on the SSD firmware FW; through the firmware FW, in accordance with the order in which the QLC is divided into multiple ZONE areas for management based on the ZNS algorithm, sequentially determine the target ZONE area from the multiple ZONE areas, and write the target data to be stored into the target ZONE area; after determining that the target ZONE area is full, sequentially determine the next ZONE area in the multiple ZONE areas as the new target ZONE area, and return to execute the step of writing the target data to be stored into the target ZONE area; The data migration storage module is also used to determine the second ZONE area with the smallest amount of storage data from the multiple ZONE areas after the firmware FW detects that there is no free first ZONE area among the multiple ZONE areas, and migrate the data already stored in the second ZONE area to the preset redundant area pre-divided by the QLC; after determining that the second ZONE area becomes free, determine the second ZONE area as the target ZONE area to be written with the target data to be stored based on the free state, wherein no data is written in the first ZONE area.
9. A terminal device, It is characterized in that The terminal device includes: an SSD using QLC particles as storage particles and SCM media as cache, a processor, and a data storage program of the SSD stored on the storage device and capable of running on the processor. When the data storage program of the SSD is executed by the processor, the steps of the data storage method of the SSD as described in any one of claims 1 to 7 are implemented.
10. A computer storage medium, It is characterized in that The computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data storage method of the SSD according to any one of claims 1 to 7 are implemented.
