Data storage method in transparent compression storage device
By dividing multiple super blocks in the solid-state drive and selecting an appropriate storage mode according to the data compression ratio, the problem of poor read performance of existing transparent compression SSDs in scenarios with more reads and less writes is solved, achieving higher read performance and more Long NAND lifespan.
Patent Information
- Application Number
- CN202410853405.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-09-24
AI Technical Summary
Existing transparent compression SSDs cannot effectively improve read performance in scenarios where there are many reads and few writes, because all user data still uses the default TLC or QLC mode when writing to NAND, making it difficult to improve the read time.
By dividing multiple super blocks in the solid-state drive, each super block corresponds to a storage mode, and setting up a data compression module and a compression ratio judgment module on the data writing and recovery path, and dynamically selecting appropriate storage based on the compression ratio of the data. mode, such as SLC, MLC or TLC, for data storage.
By dynamically selecting a high-performance storage mode for storage based on the data compression ratio, the read performance of SSD is improved and the service life of NAND is extended.
Smart Images

Figure CN118689403A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of storage devices, and in particular to a data storage method in a transparent compression storage device. Background Art
[0002] With the advancement of storage technology, solid-state drives (SSDs) have gradually become the main medium for data storage in individuals, enterprises and data centers. Compared with traditional mechanical disks (hard-disk drives, HDDs), they have greatly alleviated the pressure on the storage end and released the performance potential of the overall system.
[0003] The main storage medium of SSD is NAND. The development of NAND has mainly gone through several stages: SLC, MLC, TLC and QLC. From SLC to QLC, the storage density of NAND has been continuously improved, but correspondingly, the performance (read / write latency) has also been continuously reduced. The current large-capacity SSD mainly uses TLC or QLC.
[0004] In recent years, SSDs with transparent compression have emerged. That is, after data enters the SSD, the SSD will compress the data before writing it to NAND, thereby reducing the amount of data written to NAND. The use of transparent compression increases the effective storage space of the SSD, improves the performance of the SSD, and extends the service life of the NAND. However, in actual usage scenarios, all user data of the current SSD with transparent compression is still written to NAND through the default TLC mode or QLC mode. Therefore, in common scenarios with more reads and fewer writes, no matter what the data compression ratio (that is, the amount of data before compression / the amount of data after compression) is, it still has to go through the data reading time of TLC or QLC, and it is difficult to obtain higher read performance. Summary of the invention
[0005] In order to overcome the deficiencies of the prior art, the present invention provides a data storage method in a transparent compression storage device.
[0006] To achieve the above purpose, a data storage method in a transparent compression storage device is designed, comprising the following steps: S1, divide the storage area in the solid state drive SSD into several super blocks, each super block corresponds to a storage mode; S2, a data compression module is set on the path where data is written to the host and / or the path where data is recovered inside the SSD, and a compression ratio determination module is set on the path where data is written to the host and / or the path where data is recovered inside the SSD, and is set on the path after the data compression module; S3, in the data writing stage or the data recovery stage, the data compression module compresses the data, and the compression ratio determination module determines the compression ratio of the compressed data; S4, writing the data into a target super block of a corresponding storage module according to the compression ratio of the compressed data.
[0007] In the step S1, when the super block in each storage mode is full of data, the SSD allocates a new super block for the storage mode.
[0008] In the step S1, any storage mode is set as the default storage mode.
[0009] In the compression ratio judgment module, when making compression ratio judgment, the judgment can be made according to the unit size of the logical address and physical address mapping, or according to the preset fixed size, or according to the size of the write request.
[0010] In step S4, when the data compression ratio is greater than or equal to 3:1, the SSD writes the data to the super block corresponding to the SLC storage mode; when the data compression ratio is less than 3:1 and greater than or equal to 2:1, the SSD writes the data to the super block corresponding to the MLC storage mode; when the data compression ratio is less than 2:1, the SSD writes the data to the super block corresponding to the TLC storage mode.
[0011] In the step 2, when the data compression module and the compression ratio judgment module are both on the path for writing data on the host side, in the data writing phase, the data written by the host side passes through the data compression module and the compression ratio judgment module respectively, and then is written into the super block under the corresponding storage mode according to the compression ratio judgment result.
[0012] In the step 2, when the data compression module is on the path for writing data on the host side and the compression ratio judgment module is on the path for recovering data inside the SSD, the data written by the host side is compressed by the data compression module and written into the super block under the default storage mode; when the data is recovered, the compression ratio judgment module judges the corresponding storage mode according to the compression ratio of the valid data read from the source super block, and writes the valid data into the target super block under the corresponding storage mode according to the judgment result.
[0013] In the step 2, when the compression module and the compression ratio judgment module are both on the path of data recovery inside the SSD, the data written by the host side is directly written into the super block in the default storage mode without being compressed; when recovering data, if the source super block is a super block written by the host side, the valid data read from the source super block first passes through the data compression module, and then the compression ratio judgment module determines the corresponding storage mode according to the compression ratio of the valid data, and writes the valid data into the target super block in the corresponding storage mode; if the source super block is a super block written in the data recovery stage, the compression ratio judgment module determines the corresponding storage mode according to its compression ratio for the valid data read from the source super block, and writes the valid data into the target super block in the corresponding storage mode.
[0014] In the step 2, when the data compression module is on the path where the host writes data, and the compression ratio judgment module exists on both the host data writing path and the SSD internal data recovery path, the data written by the host passes through the data compression module and the compression ratio judgment module, and is then written into the super block in the corresponding storage mode according to the compression ratio judgment result; when the SSD recovers data, the compressed valid data read from the source super block still passes through the compression ratio judgment module, and is then written into the super block in the corresponding storage mode according to the compression ratio judgment result.
[0015] In the step 2, when the data compression module and the compression ratio judgment module both exist on the host-side data writing path and the SSD internal data recovery path, the data written by the host side passes through the data compression module and the compression ratio judgment module, and is then written into the super block in the corresponding storage mode according to the compression ratio judgment result; when the SSD recovers data, the compressed valid data read from the source super block passes through the compression module and the compression ratio judgment module again, and is written into the super block in the corresponding storage mode according to the compression ratio judgment result.
[0016] Compared with the prior art, the present invention dynamically uses different NAND storage modes to store data according to the compression ratio of the written data, so that when the data has a high compression ratio, the data is stored in a storage mode with higher performance, thereby improving the read performance of the SSD. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a schematic diagram of the present invention using different storage modes for data according to the data compression ratio.
[0018] Figure 2 It is a schematic diagram of the first embodiment of the present invention.
[0019] Figure 3 It is a schematic diagram of the second embodiment of the present invention.
[0020] Figure 4 It is a schematic diagram of the third embodiment of the present invention.
[0021] Figure 5 It is a schematic diagram of Embodiment 4 of the present invention.
[0022] Figure 6 It is a schematic diagram of Embodiment 5 of the present invention.
[0023] Figure 7 It is a schematic diagram of the compression ratio judgment module of the present invention when performing compression ratio judgment according to the unit size of the logical address and the physical address mapping.
[0024] Figure 8 It is a schematic diagram of the compression ratio judgment module of the present invention when performing compression ratio judgment according to a preset fixed size.
[0025] Fig. 9 It is a schematic diagram of the compression ratio judgment module of the present invention performing compression ratio judgment according to the size of the write request. DETAILED DESCRIPTION
[0026] The present invention will be further described below with reference to the accompanying drawings.
[0027] like Figure 1 As shown, the data storage method in the transparent compression storage device of the present invention comprises the following steps: S1, divide the storage area in the solid state drive SSD into several super blocks, each super block corresponds to a storage mode; S2, a data compression module is set on the path where data is written to the host and / or the path where data is recovered inside the SSD, and a compression ratio determination module is set on the path where data is written to the host and / or the path where data is recovered inside the SSD, and is set on the path after the data compression module; S3, in the data writing stage or the data recovery stage, the data compression module compresses the data, and the compression ratio determination module determines the compression ratio of the compressed data; S4, writing the data into a target super block of a corresponding storage module according to the compression ratio of the compressed data.
[0028] In step S1, any storage mode is set as the default storage mode. When the super block in each storage mode is full of data, the SSD allocates a new super block for the storage mode.
[0029] like Figure 7 As shown, the compression ratio determination module can make a determination according to the unit size of the logical address and the physical address mapping when making a compression ratio determination. Figure 7The unit size of the mapping is 4KB. After the data compression module compresses each uncompressed original 4KB data, it obtains the compression ratio corresponding to each 4KB data, and then the compression ratio judgment module writes the compressed data into the super block of the corresponding storage mode according to the corresponding compression ratio.
[0030] like Figure 8 As shown, the compression ratio determination module can make a determination according to other preset fixed sizes when making compression ratio determinations. Figure 8 The preset fixed size is 16KB. The data compression module can compress the original data of 16KB to obtain a final compression ratio; it can also compress the original data with a smaller unit granularity and then obtain an average compression ratio. For example, the compression module can split the original data of 16KB into 4 4KB, and then compress each 4KB separately to obtain an average compression ratio.
[0031] like Fig. 9 As shown, the compression ratio determination module can make a determination according to the size of the write request when making a compression ratio determination. Fig. 9 The size of a logical block address (LBA) is 4KB. A common scenario is that the compression module compresses the original data according to the size of the host write request to obtain a final compression ratio, and then the compression ratio judgment module determines the storage mode corresponding to the data in the write request based on the final compression ratio.
[0032] In specific use, when the data compression ratio is greater than or equal to 3:1, the SSD writes the data to the super block corresponding to the SLC storage mode; when the data compression ratio is less than 3:1 and greater than or equal to 2:1, the SSD writes the data to the super block corresponding to the MLC storage mode; when the data compression ratio is less than 2:1, the SSD writes the data to the super block corresponding to the TLC storage mode. Embodiment 1
[0033] like Figure 2 As shown, in this embodiment, the data compression module and the compression ratio judgment module are both on the path of writing data on the host side. In the data writing stage, the data written by the host side passes through the data compression module and the compression ratio judgment module respectively, and then is written into the super block in the corresponding storage mode according to the compression ratio judgment result.
[0034] The working method of this embodiment corresponds to the scenario that the compression module and the compression ratio judgment module are both operated according to the unit size (such as 4KB) of the logical address and physical address mapping. When data is recovered, the valid data in the selected source super block can be moved to the target super block with the same storage mode. If the source super block is in SLC storage mode, the target super block is also SLC storage. Embodiment 2
[0035] like Figure 3 As shown, in this embodiment, the data compression module is on the path of writing data on the host side, and the compression ratio determination module is on the path of data recovery inside the SSD.
[0036] The data written by the host end is compressed by the data compression module and written into the super block in the default storage mode. In this embodiment, the default storage mode is the TLC mode, and all data written by the host end are directly stored using the TLC mode of NAND.
[0037] When data is recovered, the compression ratio judgment module judges the corresponding storage mode according to the compression ratio of the valid data read from the source super block, and writes the valid data into the target super block in the corresponding storage mode according to the judgment result. At this time, the data will be written into different storage modes such as TLC, MLC or SLC according to the compression ratio.
[0038] The working method of this embodiment is conducive to reducing the design complexity of the host-side data writing path, thereby helping to reduce the delay of the host-side data writing. Embodiment 3
[0039] like Figure 4 As shown, in this embodiment, the compression module and the compression ratio determination module are both on the path of data recovery inside the SSD.
[0040] Data written by the host is written directly to the super block in the default storage mode without compression.
[0041] During data recovery, if the source super block is a super block written by the host side, that is, the data in the source super block has not been compressed, the valid data read from the source super block first passes through the data compression module, and then the compression ratio judgment module judges the corresponding storage mode based on the compression ratio of the valid data, and writes the valid data into the target super block under the corresponding storage mode.
[0042] If the source super block is a super block written in the data recovery phase, that is, the data in the source super block has been compressed, then the valid data read from the source super block is judged by the compression ratio judgment module according to its compression ratio to determine the corresponding storage mode, and the valid data is written into the target super block under the corresponding storage mode.
[0043] The working mode of this embodiment can further reduce the design complexity of the host-side data writing path by removing the compression module from the host-side data writing path, thereby facilitating reducing the delay of the host-side data writing. Embodiment 4
[0044] like Figure 5As shown, the data compression module is on the path where the host writes data, and the compression ratio judgment module exists on both the path where the host writes data and the path where the SSD internal data is recovered.
[0045] The data written by the host side passes through the data compression module and the compression ratio judgment module, and then is written into the super block in the corresponding storage mode according to the compression ratio judgment result.
[0046] When the SSD performs data recovery, the compressed valid data read from the source super block still passes through the compression ratio judgment module and is then written into the super block in the corresponding storage mode according to the compression ratio judgment result.
[0047] The working method of this embodiment is to add an additional compression ratio judgment module on the data recovery path, so that a data size different from that used by the compression ratio judgment module on the host-side write data path can be used on this path. For example, the compression ratio judgment module on the host-side write data path uses an original data size of 4KB, while the compression ratio judgment module on the data recovery path uses an original data size of 16KB. Embodiment 5
[0048] like Figure 6 As shown, the data compression module and the compression ratio determination module both exist on the host-side data writing path and the SSD internal data recovery path.
[0049] The data written by the host side passes through the data compression module and the compression ratio judgment module, and then is written into the super block in the corresponding storage mode according to the compression ratio judgment result.
[0050] When the SSD performs data recovery, the compressed valid data read from the source super block passes through the compression module and the compression ratio judgment module again, and is written into the super block in the corresponding storage mode according to the compression ratio judgment result.
[0051] The working method of this embodiment is to add an additional compression module and a compression ratio judgment module on the data recovery path. A compression unit size and a compression ratio judgment unit size different from those used on the host-side write data path can be used on this path. For example, the compression module on the host-side write data path uses a unit size of 4KB, and the compression ratio judgment module also uses an original data size of 4KB, while the compression module on the data recovery path uses a unit size of 16KB, and the compression ratio judgment module also uses an original data size of 16KB.
[0052] By using a larger compression unit in the data compression module, a higher compression ratio and better compression effect can be obtained. In addition, since the compression module on the data recovery path is relatively insensitive to delay, a more complex and better compression algorithm can be used to improve the compression effect.
[0053] In the present invention, the data compression module can be arbitrarily set according to the compression effect of the data to be compressed, and the compression ratio judgment module can be arbitrarily set on the path where the data has been compressed. If the compression effect of the data compression module, that is, the size comparison before and after the data compression is very good, the compression throughput is large and the compression delay is very short, and the compression efficiency is very high, then the compression module and the compression ratio judgment module can be located only on the path where the host end writes data. If the realization of high compression efficiency cannot be achieved, only lightweight compression can be performed on the host end write data path. At this time, the compression algorithm is relatively simple, and it is easy to achieve other goals except the compression effect, and the compression ratio judgment based on this (no compression ratio judgment is also possible, which is equivalent to the data being compressed, but also uniformly stored in the default storage mode), or no compression at all (at the same time, there is no need for compression ratio judgment). On the data recovery path, a compression module with good compression effect and large throughput is introduced. Because this path is not sensitive to delay and only focuses on throughput, the compression module is relatively easy to implement. On this basis, the compression ratio judgment can be further performed. At this time, the compression effect on this path is better than the compression effect on the host end write data path.
[0054] The present invention dynamically uses different NAND storage modes to store data according to the compression ratio of the written data, so that when the data has a high compression ratio, the data is stored in a storage mode with higher performance, thereby improving the read performance of the SSD.
Claims
1. A data storage method in a transparent compression storage device, characterized in that: The steps include: S1, divide the storage area in the solid state drive SSD into several super blocks, each super block corresponds to a storage mode; S2, a data compression module is set on the path where data is written to the host and / or the path where data is recovered inside the SSD, and a compression ratio determination module is set on the path where data is written to the host and / or the path where data is recovered inside the SSD, and is set on the path after the data compression module; S3, in the data writing stage or the data recovery stage, the data compression module compresses the data, and the compression ratio determination module determines the compression ratio of the compressed data; S4, writing the data into a target super block of a corresponding storage module according to the compression ratio of the compressed data.
2. The data storage method in a transparent compression storage device according to claim 1, characterized in that: In the step S1, when the super block in each storage mode is full of data, the SSD allocates a new super block for the storage mode.
3. The data storage method in a transparent compression storage device according to claim 1, characterized in that: In the step S1, any storage mode is set as the default storage mode.
4. The data storage method in a transparent compression storage device according to claim 1, characterized in that: In the compression ratio judgment module, when making compression ratio judgment, the judgment can be made according to the unit size of the logical address and physical address mapping, or according to the preset fixed size, or according to the size of the write request.
5. The data storage method in a transparent compression storage device according to claim 1, characterized in that: In step S4, when the data compression ratio is greater than or equal to 3:1, the SSD writes the data to the super block corresponding to the SLC storage mode; when the data compression ratio is less than 3:1 and greater than or equal to 2:1, the SSD writes the data to the super block corresponding to the MLC storage mode; when the data compression ratio is less than 2:1, the SSD writes the data to the super block corresponding to the TLC storage mode.
6. The data storage method in a transparent compression storage device according to claim 1, characterized in that: In the step 2, when the data compression module and the compression ratio judgment module are both on the path for writing data on the host side, in the data writing phase, the data written by the host side passes through the data compression module and the compression ratio judgment module respectively, and then is written into the super block under the corresponding storage mode according to the compression ratio judgment result.
7. The data storage method in a transparent compression storage device according to claim 1, characterized in that: In the step 2, when the data compression module is on the path for writing data on the host side and the compression ratio judgment module is on the path for recovering data inside the SSD, the data written by the host side is compressed by the data compression module and written into the super block under the default storage mode; when the data is recovered, the compression ratio judgment module judges the corresponding storage mode according to the compression ratio of the valid data read from the source super block, and writes the valid data into the target super block under the corresponding storage mode according to the judgment result.
8. The data storage method in a transparent compression storage device according to claim 1, characterized in that: In the step 2, when the compression module and the compression ratio judgment module are both on the path of data recovery inside the SSD, the data written by the host side is directly written into the super block in the default storage mode without being compressed; when the data is recovered, if the source super block is a super block written by the host side, the valid data read from the source super block first passes through the data compression module, and then the compression ratio judgment module judges the corresponding storage mode according to the compression ratio of the valid data, and writes the valid data into the target super block in the corresponding storage mode; If the source super block is a super block written in the data recovery phase, the compression ratio judgment module determines the corresponding storage mode based on the compression ratio of the valid data read from the source super block, and writes the valid data into the target super block under the corresponding storage mode.
9. The data storage method in a transparent compression storage device according to claim 1, characterized in that: In the step 2, when the data compression module is on the path where the host writes data, and the compression ratio judgment module is present on both the path where the host writes data and the path where the SSD internal data is recovered, the data written by the host passes through the data compression module and the compression ratio judgment module, and then is written into the super block in the corresponding storage mode according to the compression ratio judgment result; When the SSD performs data recovery, the compressed valid data read from the source super block still passes through the compression ratio judgment module and is then written into the super block in the corresponding storage mode according to the compression ratio judgment result.
10. The data storage method in a transparent compression storage device according to claim 1, characterized in that: In the step 2, when the data compression module and the compression ratio judgment module both exist on the host-side data writing path and the SSD internal data recovery path, the data written by the host side passes through the data compression module and the compression ratio judgment module, and is then written into the super block in the corresponding storage mode according to the compression ratio judgment result; when the SSD recovers data, the compressed valid data read from the source super block passes through the compression module and the compression ratio judgment module again, and is written into the super block in the corresponding storage mode according to the compression ratio judgment result.
