Data processing methods, devices, solid-state drives, and storage media

By decompressing the data to be migrated in the SSD and then compressing it again using an algorithm with a lower compression ratio, the problem of insufficient SSD storage space is solved, and more efficient storage space utilization is achieved.

CN115220644BActive Publication Date: 2026-03-10TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-20
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

In the data compression process of existing solid-state storage (SSD), the compression ratio and compression rate are mutually exclusive, resulting in insignificant storage space savings. How to further save storage space in SSDs has become an urgent problem to be solved.

Method used

After decompressing the data to be migrated in the SSD, a second compression algorithm with a lower compression ratio is used to compress it again to obtain the target compressed data, which is then stored in the SSD.

Benefits of technology

Without altering the data to be migrated, it reduces storage space usage, improves storage space utilization, has high applicability, and does not affect the real-time performance of host data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115220644B_ABST
    Figure CN115220644B_ABST
Patent Text Reader

Abstract

This application discloses a data processing method, apparatus, solid-state drive, and storage medium, applicable to fields such as data storage and data retrieval in computer technology. The method includes: determining data to be migrated from compressed data stored on an SSD; determining a first compression algorithm corresponding to the data to be migrated; decompressing the data to be migrated based on the first compression algorithm to obtain first decompressed data; compressing the first decompressed data based on a second compression algorithm to obtain target compressed data; and storing the target compressed data on the SSD; wherein the compression ratio of the second compression algorithm is lower than that of the first compression algorithm. Using this application embodiment can save SSD storage space and improve applicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data processing method, apparatus, solid-state drive, and storage medium. Background Technology

[0002] In recent years, computing storage has begun to emerge, and the storage capacity of various storage devices has been increasing. For solid-state storage (SSD), SSD has certain additional hardware computing capabilities, such as through application-specific integrated circuits (ASICs) and field-programmable gate arrays (FPGAs), to achieve certain hardware computing capabilities. Among these, compression and decompression have become one of the important computing capabilities of SSD.

[0003] For example, SSDs can compress data during the writing process to create compressed data, which can then be stored to some extent, allowing more data to be stored in a limited storage space. However, current compression algorithms have a certain degree of mutual exclusivity in terms of compression ratio and compression speed. When SSDs have certain requirements for the timeliness of the data being written, if a high compression ratio is used when compressing the written data, the reduction in data size between the compressed and uncompressed data is limited, resulting in a negligible effect on saving storage space on the SSD.

[0004] Therefore, how to further save SSD storage space has become an urgent problem to be solved. Summary of the Invention

[0005] This application provides a data processing method, apparatus, solid-state drive, and storage medium, which can save SSD storage space and has high applicability.

[0006] On one hand, embodiments of this application provide a data processing method, the method comprising:

[0007] Identify the data to be migrated from the compressed data stored in the solid-state drive (SSD);

[0008] A first compression algorithm corresponding to the data to be migrated is determined, and the data to be migrated is decompressed based on the first compression algorithm to obtain the first decompressed data;

[0009] The first decompressed data is compressed based on the second compression algorithm to obtain the target compressed data, and the target compressed data is stored in the SSD.

[0010] The compression ratio of the second compression algorithm is less than that of the first compression algorithm.

[0011] On the other hand, embodiments of this application provide a data processing apparatus, which includes:

[0012] The data determination module is used to determine the data to be migrated in the compressed data stored in the solid-state drive (SSD).

[0013] The data compression module is used to determine the first compression algorithm corresponding to the data to be migrated, and decompress the data to be migrated based on the first compression algorithm to obtain the first decompressed data.

[0014] The data decompression module is used to compress the first decompressed data based on the second compression algorithm to obtain target compressed data, and store the target compressed data in the SSD.

[0015] The compression ratio of the second compression algorithm is less than that of the first compression algorithm.

[0016] On the other hand, embodiments of this application provide a solid-state drive, including a processor and a memory, which are interconnected;

[0017] The aforementioned memory is used to store computer programs;

[0018] The processor described above is configured to execute the data processing method provided in the embodiments of this application when the computer program described above is invoked.

[0019] On the other hand, embodiments of this application provide a computer-readable storage medium storing a computer program that is executed by a processor to implement the data processing method provided in embodiments of this application.

[0020] On the other hand, embodiments of this application provide a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a solid-state memory reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the data processing method provided in the embodiments of this application described above.

[0021] In this embodiment, the data to be migrated in the solid-state drive can be decompressed to obtain first decompressed data, and the first decompressed data can be compressed based on a compression algorithm with a lower compression ratio to obtain target compressed data. This makes the data size of the target compressed data smaller than the data size of the data to be migrated, thereby saving storage space of the solid-state drive without changing the data to be migrated, and has high applicability. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of a scenario of the data processing method provided in an embodiment of this application;

[0024] Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application;

[0025] Figure 3 This is a schematic diagram of a process for writing data to a solid-state drive according to an embodiment of this application;

[0026] Figure 4 This is a schematic diagram of a scenario using the tag compression algorithm provided in the application embodiment;

[0027] Figure 5 This is a schematic diagram of a scenario for storing target compressed data provided in an embodiment of this application;

[0028] Figure 6 This is a flowchart illustrating an application scenario of the data processing method provided in this application embodiment;

[0029] Figure 7 This is a schematic diagram of the structure of the data processing apparatus provided in the embodiments of this application;

[0030] Figure 8 This is a schematic diagram of the solid-state driver provided in an embodiment of this application. Detailed Implementation

[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0032] See Figure 1 , Figure 1 This is a schematic diagram of a scenario of the data processing method provided in an embodiment of this application. For example... Figure 1As shown, after receiving host data, the solid-state drive compresses and stores the host data. Based on this, after determining the data to be migrated in the stored compressed data, the solid-state drive can determine the first compression algorithm corresponding to the data to be migrated, and then decompress the data to be migrated based on the first compression algorithm to obtain the first decompressed data.

[0033] Furthermore, the solid-state drive recompresses the first decompressed data using a second compression algorithm with a compression ratio lower than that of the first compression algorithm to obtain the target compressed data, and then stores the target compressed data.

[0034] In this embodiment of the application, the solid-state drive is also called a solid-state hard disk, which is a hard disk made of solid-state electronic storage chip array.

[0035] See Figure 2 , Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of this application, as shown below. Figure 2 As shown, the data processing method provided in this application embodiment can be applied to solid-state drives, and may specifically include the following steps:

[0036] Step S21: Determine the data to be migrated from the compressed data stored in the solid-state drive (SSD).

[0037] In some feasible implementations, after receiving a data write command, the solid-state drive receives the data to be written by the host device. When writing data, the solid-state drive compresses the data using a certain compression algorithm and stores the compressed data in the form of data blocks.

[0038] The data initially written to the solid-state drive can be system data of the host device, data obtained by the host device from data blocks or blockchain, or data obtained based on big data, network, cloud computing, etc. The specific data can be determined based on the actual application scenario requirements and is not limited here.

[0039] In order to improve data writing efficiency and reduce writing latency, so as to achieve high data throughput and data real-time performance, solid-state drives often use compression algorithms with a faster compression rate when compressing the data to be written.

[0040] The specific compression algorithm used by the solid-state drive when compressing the data to be written can be determined based on the actual application scenario requirements, and is not limited here.

[0041] As an example, when writing host data to a solid-state drive, the internal computing unit of the solid-state drive uses the LZ4 algorithm to compress the host data and then stores the compressed data in the solid-state drive.

[0042] Solid-state drives use non-volatile flash memory (NAND) to store data, which can retain the data even after power is off.

[0043] As an example, see Figure 3 , Figure 3 This is a schematic diagram illustrating a process of writing data to a solid-state drive according to an embodiment of this application. For example... Figure 3 As shown, after receiving data from the host, the solid-state drive (SSD) compresses the host data using its internal computing unit, employing a first compression algorithm, and then stores the compressed data. The SSD specifically stores the compressed data in the NAND Flash memory.

[0044] In some feasible implementations, the data to be migrated in the compressed data stored in the solid-state drive is the compressed data that needs to be stored from the current data block to other data blocks. The specific data can be determined based on the actual application scenario requirements and is not limited here.

[0045] Optionally, the data to be migrated includes at least one of the following:

[0046] Compressed data during garbage collection (GC) on a solid-state drive;

[0047] Compressed data corresponding to wear leveling (WL) processing of solid-state drives;

[0048] The solid-state drive stores compressed data in an unstable state in at least one data block.

[0049] Garbage collection is the process by which a solid-state drive (SSD) organizes compressed data stored internally to create blank data blocks. The SSD stores the remaining valid compressed data from at least one data block into a new data block and erases the compressed data from the original data block to obtain a blank data block. If the SSD needs to store compressed data, and its currently available storage space is insufficient, the SSD will use garbage collection to move a portion of the compressed data to obtain a blank data block, and then store the compressed data in that blank block. The compressed data moved during this process is the data to be migrated from the compressed data stored by the SSD.

[0050] Each data block in a solid-state drive (SSD) has a limited lifespan (Program / Erase Count, P / E value), and the number of times each data block can be erased is finite. A lower P / E value results in a longer lifespan and allows for more data erasures. The lifespan of an SSD depends on the minimum lifespan of all data blocks. Frequent erasure of a particular data block will continuously reduce the SSD's lifespan. Therefore, SSDs prioritize erasing data blocks with low P / E values, or prioritize storing compressed data from data blocks with low P / E values ​​and low access rates into data blocks with high P / E values. In this process, the compressed data that needs to be stored from low-P / E value data blocks to high-P / E value data blocks is the data to be migrated from the compressed data stored in the SSD.

[0051] In this process, the compressed data stored in the SSD based on NAND flash memory is unstable and requires data retention to migrate to a new storage space. The compressed data in at least one data block of the SSD that is unstable and needs to be migrated to a new storage space constitutes the data to be migrated from the compressed data stored on the SSD.

[0052] In some feasible implementations, the solid-state drive (SSD) can identify data to be migrated from the stored compressed data when it is idle. For example, if compressed data that is eligible for garbage collection is identified when the SSD is idle, this data is designated as data to be migrated. Similarly, if compressed data that is eligible for wear leveling is identified when the SSD is idle, this data is designated as data to be migrated. Or, if compressed data with unstable storage states is identified in each data block when the SSD is idle, this data is designated as data to be migrated.

[0053] In some feasible implementations, the data to be migrated from the compressed data stored in the solid-state drive can be determined based on a preset period. For example, garbage collection is performed based on a preset period, and the compressed data corresponding to the garbage collection process is identified as the data to be migrated. Alternatively, wear leveling is performed based on a preset period, and the compressed data corresponding to the wear leveling process is identified as the data to be migrated. Another example is identifying compressed data with unstable storage states within the data blocks storing compressed data based on a preset period, and identifying this data as the data to be migrated.

[0054] Step S22: Determine the first compression algorithm corresponding to the data to be migrated, and decompress the data to be migrated based on the first compression algorithm to obtain the first decompressed data.

[0055] In some feasible implementations, the solid-state drive (SSD) uses a fast compression algorithm when compressing the written data, and the compression ratio and compression rate are positively correlated. The compression ratio represents the ratio of the compressed data size to the original compressed size. For example, compressing 100MB of data to 90MB results in a compression ratio of 90 / 100*100% = 90%. Generally, a lower compression ratio is better, but a lower ratio leads to longer compression time and slower compression speed. Therefore, the compressed data obtained by the SSD still occupies a considerable amount of storage space. To improve the utilization of the SSD's storage space, after identifying the data to be migrated, it can be decompressed and further processed.

[0056] For ease of description, the compression algorithm corresponding to the compressed data stored in the solid-state drive will be referred to as the first compression algorithm.

[0057] Specifically, if the solid-state drive uses a preset compression algorithm to compress the written data, then after determining the data to be migrated, if the data to be migrated has not been migrated before, that is, the data to be migrated has been stored in the same data block since it was written to the solid-state drive, then the first compression algorithm corresponding to the data to be migrated can be directly determined to be the preset compression algorithm.

[0058] If the solid-state drive uniformly uses the LZ4 algorithm to compress the written data, then after determining the data to be migrated in the compressed data stored in the solid-state drive, if the data to be migrated has not changed the stored data blocks, then the first compression algorithm corresponding to the data to be migrated can be directly determined to be the LZ4 algorithm.

[0059] Optionally, when compressing the written data to obtain compressed data, the solid-state drive will mark the first compression algorithm used through a compression algorithm identifier. Specifically, the solid-state drive can use different compression algorithms for different types of data; that is, the first compression algorithm for different compressed data can be the same or different, depending on the actual application scenario requirements, and is not limited here.

[0060] For ease of description, the compression algorithm identifier corresponding to the first compression algorithm will be referred to as the first compression algorithm identifier. For example, after a solid-state drive compresses the written data to obtain compressed data, it can add the first compression algorithm identifier corresponding to the first compression algorithm to the meta area corresponding to the compressed data. The data in the meta area is used to describe the data; that is, in this embodiment, the data in the meta area can serve as the compression algorithm identifier corresponding to the compression algorithm. Based on this, after determining the data to be migrated, the first compression algorithm corresponding to the data to be migrated can be determined based on the first compression algorithm identifier in its corresponding meta area.

[0061] The first compression algorithm identifier corresponding to the first compression algorithm can be represented by one or more combinations of specific characters, numbers and symbols. The specific representation method can be determined based on the actual application scenario requirements and is not limited here.

[0062] See Figure 4 , Figure 4 This is a schematic diagram of a scenario using the tag compression algorithm provided in the application embodiment. For example... Figure 4 As shown, for the identified data to be migrated, since the data to be migrated is essentially compressed data, if the first compression algorithm corresponding to it is the LZ4 algorithm, then the first compression algorithm corresponding to the data to be migrated can be marked by the character "LZ4" in the meta area corresponding to the data to be migrated. That is, the first compression algorithm corresponding to the first compression algorithm is identified as "LZ4".

[0063] Specifically, when decompressing the data to be migrated based on the first compression algorithm, the decompression algorithm corresponding to the first compression algorithm can be used to decompress the data to be migrated, resulting in decompressed data. For ease of description, the decompressed data obtained after decompressing the data to be migrated based on the first compression algorithm will be referred to as the first decompressed data.

[0064] Step S23: Compress the first decompressed data based on the second compression algorithm to obtain the target compressed data, and store the target compressed data in the solid-state drive.

[0065] In some feasible implementations, after decompressing the data to be migrated to obtain the corresponding first decompressed data, since solid-state drives often use a compression algorithm with a faster compression rate when compressing the data to be written in order to improve data writing efficiency, after obtaining the first decompressed data corresponding to the data to be migrated, a compression algorithm with a lower compression rate can be used to compress the first decompressed data, and then the compressed data obtained after compressing the first decompressed data with a compression algorithm with a lower compression rate is stored in the solid-state drive.

[0066] For ease of description, the compression algorithm with a lower compression ratio used when compressing the first decompressed data will be referred to as the second compression algorithm. That is, the compression ratio of the second decompression algorithm is less than that of the first compression algorithm.

[0067] For ease of description, the compressed data obtained by compressing the first decompressed data using the second compression algorithm will be referred to as the target compressed data.

[0068] See Figure 5 , Figure 5 This is a schematic diagram of a scenario for storing target compressed data provided in an embodiment of this application. For example... Figure 5 As shown, the solid-state drive (SSD) identifies the data to be migrated from the NAND flash memory used to store compressed data, and then decompresses the data using a first compression algorithm. Further, the SSD uses a second compression algorithm to recompress the decompressed data, storing the compressed data (i.e., the target compressed data in this embodiment). The second compression algorithm has a lower compression ratio, favoring high compression ratios, thus further saving storage space after storing the target compressed data in a new data block in the NAND flash memory. The compression and decompression operations are performed in the background of the SSD and do not directly affect the real-time performance of the host's read / write operations on the data stored in the SSD.

[0069] In some feasible implementations, after decompressing the data to be migrated based on the first compression algorithm to obtain the first decompressed data, a second compression algorithm for compressing the first decompressed data can be determined first.

[0070] Specifically, based on the identifier of the first compression algorithm corresponding to the data to be migrated, the first compression algorithm corresponding to the data to be migrated can be determined. Then, it can be determined whether the first compression algorithm is the one with the lowest compression ratio. If the first compression algorithm is not the one with the lowest compression ratio, then any compression algorithm with a compression ratio lower than that of the first compression algorithm is determined as the second compression algorithm. For example, if the first compression algorithm corresponding to the data to be migrated is determined to be the LZ4 algorithm based on the identifier of the first compression algorithm corresponding to the data to be migrated, then since the compression ratio of the gzip algorithm is lower than that of the LZ4 algorithm, the gzip algorithm can be determined as the second compression algorithm.

[0071] Optionally, the solid-state drive stores a first compression algorithm list and a second compression algorithm list, wherein the compression ratio of any compression algorithm in the first compression algorithm list is greater than the compression ratio of any compression algorithm in the second compression algorithm list, and the second compression algorithm list includes the compression algorithm with the lowest current compression ratio. After determining the first compression algorithm corresponding to the data to be migrated, it can be determined whether the first compression algorithm belongs to the first compression algorithm list. If the first compression algorithm belongs to the first compression algorithm list, then any compression algorithm in the second compression algorithm list with a compression ratio lower than that of the first compression algorithm can be determined as the second compression algorithm.

[0072] Optionally, the second compression algorithm can be a preset compression algorithm with the lowest compression ratio. That is, no matter what the first compression algorithm of the determined data to be migrated is, the compression ratio of the second compression algorithm can always be no greater than the compression ratio of the first algorithm.

[0073] The compression ratio of each compression algorithm is calculated based on computer equipment and cloud computing, and the list of compression algorithms is determined based on the calculation results.

[0074] Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to obtain computing power, storage space, and information services as needed. This application's embodiments can quickly determine the compression ratio of various compression algorithms based on the computing power of cloud computing.

[0075] Optionally, if the solid-state drive compresses the written data using a pre-defined first compression algorithm, then after decompressing the data to be migrated using the pre-defined first compression algorithm to obtain the first decompressed data, the first decompressed data can be compressed using a pre-defined second compression algorithm to obtain the target compressed data. The compression ratio of the pre-defined first compression algorithm is greater than the compression ratio of the pre-defined second compression algorithm.

[0076] If the data to be migrated is not decompressed using a preset first compression algorithm to obtain the first decompressed data, it indicates that the data to be migrated has previously undergone data migration, meaning it was re-decompressed and recompressed after being written to the solid-state drive. In this case, it can be determined whether the compression ratio of the first compression algorithm used to decompress the data to be migrated is greater than the compression ratio of a preset second compression algorithm. If it is greater, the preset second compression algorithm is determined as the second compression algorithm used to compress the first decompressed data. Otherwise, any compression algorithm with a compression ratio less than the first compression algorithm can be determined as the second compression algorithm used to compress the first decompressed data.

[0077] Optionally, since compression algorithms compress data by re-encoding it, the encoding efficiency may differ when using a uniform encoding method to encode data of different data types. Therefore, for compression algorithms, the compression ratios for different data types of the same size may vary. Thus, for the first decompressed data corresponding to the data to be migrated, to further reduce the storage space occupied by the target compressed data after compressing the first decompressed data, the second compression algorithm can be determined based on the data type of the first decompressed data.

[0078] Specifically, when determining the second compression algorithm based on the data type of the first decompressed data, the compression ratio of each compression algorithm corresponding to that data type can be determined. Then, a compression algorithm with a compression ratio lower than that of the first compression algorithm corresponding to the same data type can be identified, and any one of these compression algorithms is selected as the second compression algorithm. After compressing the first decompressed data using the second compression algorithm determined in this way to obtain the target compressed data, the size of the target compressed data can be smaller than the data to be migrated corresponding to the first decompressed data, thereby saving storage space on the solid-state drive.

[0079] In some feasible implementations, after determining the second compression algorithm, the first decompressed data can be compressed based on the second compression algorithm, and the resulting target compressed data can be stored in a solid-state drive. Specifically, the target compressed data can be stored in a new empty block in the solid-state drive.

[0080] The following is combined with Figure 6 The data processing method provided in the embodiments of this application will be further described. See [link to relevant documentation]. Figure 6 , Figure 6 This is a flowchart illustrating an application scenario of the data processing method provided in this application embodiment. Figure 6In this process, after receiving host data, the SSD's internal computing unit compresses the host data using the LZ4 algorithm, writes the compressed data into the NAND Flash, and marks the LZ4 algorithm in the corresponding meta tag of the compressed data. The LZ4 algorithm is the first compression algorithm in this embodiment.

[0081] Furthermore, when the SSD identifies valid data during garbage collection—that is, when valid data is read from the NAND Flash for reclaimed storage—the corresponding compression algorithm can be determined to be the LZ4 algorithm based on the meta region of the valid data, and the valid data can be decompressed based on the LZ4 algorithm. Simultaneously, if the LZ4 algorithm is determined to have a high compression ratio, the decompressed data is recompressed using the gzip algorithm, which has a lower compression ratio, and then the compressed data is written to the NAND Flash.

[0082] In this embodiment, the LZ4 algorithm is the first compression algorithm, the gzip algorithm is the second compression algorithm, the valid data read by the SSD during garbage collection is the data to be migrated in this embodiment, the data obtained after decompressing the valid data based on the LZ4 algorithm is the first decompressed data in this embodiment, and the compressed data obtained based on the gzip algorithm is the target compressed data in this embodiment.

[0083] In some feasible implementations, when storing the target compressed data obtained by compressing the first decompressed data based on the second compression algorithm into a solid-state drive, the compression algorithm identifier of the second compression algorithm can be determined. For ease of description, the compression algorithm identifier of the second compression algorithm will be referred to as the second compression algorithm identifier below.

[0084] Furthermore, the target compressed data is marked based on the second compression algorithm identifier, and then the marked target compressed data is stored in the solid-state drive.

[0085] The second compression algorithm identifier can also be based on one or more combinations of characters, letters, and numbers.

[0086] The marking methods for the second compression algorithm identifiers corresponding to different target compressed data can be the same or different, and can be determined based on the actual application scenario requirements, without any restrictions here.

[0087] Specifically, by adding a second compression algorithm identifier to the meta region corresponding to the target compressed data, the second garden algorithm corresponding to the target compressed data can be marked.

[0088] In some feasible implementations, the system can also respond to a data read command and return decompressed data corresponding to the data read command. The aforementioned data read command can be a command issued by the device corresponding to the solid-state drive for reading data, or a data read command issued by a relevant process within the device corresponding to the solid-state drive when it needs to access relevant data. The specific triggering method of the aforementioned data read command can be determined based on the actual application scenario requirements and is not limited here.

[0089] Specifically, in response to a data read command, the compressed data corresponding to the data read command is determined from the compressed data stored in the solid-state drive. For ease of description, the compressed data corresponding to the data read command will be referred to as the data to be read below.

[0090] The compressed data corresponding to the above data read instruction can be compressed data obtained based on the first compression algorithm stored in the solid-state drive, or compressed data obtained based on the second compression algorithm stored in the solid-state drive. The specific data can be determined based on the actual application scenario requirements, and there are no restrictions here.

[0091] Furthermore, the compression algorithm corresponding to the data to be read is determined, and then the data to be read is decompressed based on the compression algorithm to obtain the decompressed data corresponding to the data to be read. For ease of description, the decompressed data corresponding to the data to be read will be referred to as the second decompression data below.

[0092] In determining the compression algorithm corresponding to the data to be read, the compression algorithm identifier corresponding to the data to be read can also be determined, and then the compression algorithm corresponding to the data to be read can be determined based on the compression algorithm identifier corresponding to the data to be read.

[0093] Specifically, when decompressing the data to be read based on the compression algorithm corresponding to the data to be read, the data to be read can be decompressed based on the decompression algorithm corresponding to the compression algorithm.

[0094] Furthermore, after decompressing the data to be read to obtain second decompressed data, the second decompressed data can be returned. For example, the second decompressed data can be returned to the device corresponding to the solid-state drive.

[0095] It should be noted that the first and second compression algorithms in the embodiments of this application include, but are not limited to, LZ77, LZR, LZSS, DEFLATE, LZMA, LZ4 and gzip algorithms. In practical applications, the compression ratio of the second compression algorithm can be less than that of the first compression algorithm, and no restrictions are imposed here.

[0096] In this embodiment of the application, the data to be migrated in the solid-state drive can be decompressed to obtain first decompressed data, and the first decompressed data can be compressed based on a compression algorithm with a lower compression ratio to obtain target compressed data, so that the data size of the target compressed data is smaller than the data size of the data to be migrated, thereby saving storage space of the solid-state drive without changing the data to be migrated.

[0097] Meanwhile, this application can process the data to be migrated during the garbage collection and wear leveling processes of solid-state drives without directly affecting the real-time performance of host devices reading and writing data to solid-state drives, making it highly applicable.

[0098] See Figure 7 , Figure 7 This is a schematic diagram of the structure of the data processing apparatus provided in an embodiment of this application. The data processing apparatus 1 provided in an embodiment of this application includes:

[0099] Data determination module 11 is used to determine the data to be migrated in the compressed data stored in the solid-state drive SSD;

[0100] Data compression module 12 is used to determine the first compression algorithm corresponding to the data to be migrated, and decompress the data to be migrated based on the first compression algorithm to obtain the first decompressed data;

[0101] The data decompression module 13 is used to compress the first decompressed data based on the second compression algorithm to obtain target compressed data, and store the target compressed data in the SSD.

[0102] The compression ratio of the second compression algorithm is less than that of the first compression algorithm.

[0103] In some feasible implementations, the data to be migrated includes at least one of the following:

[0104] The compressed data corresponding to the garbage collection process of the above SSD;

[0105] The compressed data corresponding to the wear leveling process of the above SSD;

[0106] At least one data block of the aforementioned SSD stores compressed data in an unstable state.

[0107] In some feasible implementations, the data compression module 12 described above is used for:

[0108] Determine the identifier of the first compression algorithm corresponding to the above-mentioned data to be migrated;

[0109] Based on the above compression algorithm identifier, the first compression algorithm corresponding to the above data to be migrated is determined.

[0110] In some feasible implementations, the data decompression module 13 described above is further used for:

[0111] Determine the data type of the first decompressed data mentioned above;

[0112] The second compression algorithm is determined based on the above data types.

[0113] In some feasible implementations, the data decompression module 13 described above is further used for:

[0114] The identifier of the second compression algorithm is determined by the second compression algorithm described above;

[0115] The target compressed data is marked based on the second compression algorithm identifier, and the marked target compressed data is stored in the SSD.

[0116] In some feasible implementations, the data decompression module 13 described above is further used for:

[0117] In response to a data read command, the data to be read corresponding to the data read command is determined from the compressed data stored in the SSD.

[0118] Determine the compression algorithm corresponding to the data to be read, decompress the data to be read based on the compression algorithm, obtain the second decompressed data corresponding to the data to be read, and return the second decompressed data.

[0119] In some feasible implementations, the data determination module 11 described above is further used for:

[0120] The data to be migrated in the compressed data stored on the SSD is determined based on a preset period.

[0121] The aforementioned data processing device can be a computer program (including program code) running on a solid-state drive. For example, the data processing device is application software that can be used to execute the above-mentioned... Figure 2 The implementation methods provided for each step are detailed in the above-mentioned implementation methods and will not be repeated here.

[0122] In some feasible implementations, the data processing apparatus provided in this application embodiment can be implemented in a combination of hardware and software. As an example, the data processing apparatus provided in this application embodiment can be a processor in the form of a hardware decoding processor, which is programmed to execute the data processing method provided in this application embodiment. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.

[0123] In some feasible implementations, the data processing apparatus provided in this application embodiment can be implemented in software, which can be software in the form of programs and plug-ins, and includes a series of modules, including a data determination module 11, a data compression module, and a data decompression module 13. The data determination module 11, the data compression module, and the data decompression module 13 are used to implement the data processing method provided in this application embodiment.

[0124] In this embodiment, the data to be migrated in the SSD can be decompressed to obtain first decompressed data, and the first decompressed data can be compressed based on a compression algorithm with a lower compression ratio to obtain target compressed data. This makes the data size of the target compressed data smaller than the data size of the data to be migrated, thereby saving SSD storage space without changing the data to be migrated, and has high applicability.

[0125] See Figure 8 , Figure 8 This is a schematic diagram of the solid-state drive provided in an embodiment of this application. For example... Figure 8As shown, the solid-state drive 1000 in this embodiment may include: a processor 1001, a network interface 1004, and a memory 1005. Furthermore, the solid-state drive 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to implement communication between these components. The user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as at least one disk storage device. Optionally, the memory 1005 may also be at least one storage device located remotely from the aforementioned processor 1001. Figure 8 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a network communication module, a user interface module, and a device control application.

[0126] exist Figure 8 In the solid-state drive 1000 shown, the network interface 1004 provides network communication functionality; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0127] Identify the data to be migrated from the compressed data stored in the solid-state drive (SSD);

[0128] A first compression algorithm corresponding to the data to be migrated is determined, and the data to be migrated is decompressed based on the first compression algorithm to obtain the first decompressed data;

[0129] The first decompressed data is compressed based on the second compression algorithm to obtain the target compressed data, and the target compressed data is stored in the SSD.

[0130] The compression ratio of the second compression algorithm is less than that of the first compression algorithm.

[0131] In some feasible implementations, the data to be migrated includes at least one of the following:

[0132] The compressed data corresponding to the garbage collection process of the above SSD;

[0133] The compressed data corresponding to the wear leveling process of the above SSD;

[0134] At least one data block of the aforementioned SSD stores compressed data in an unstable state.

[0135] In some feasible implementations, the processor 1001 described above is used for:

[0136] Determine the identifier of the first compression algorithm corresponding to the above-mentioned data to be migrated;

[0137] Based on the above compression algorithm identifier, the first compression algorithm corresponding to the above data to be migrated is determined.

[0138] In some feasible implementations, the processor 1001 is further configured to:

[0139] Determine the data type of the first decompressed data mentioned above;

[0140] The second compression algorithm is determined based on the above data types.

[0141] In some feasible implementations, the processor 1001 described above is used for:

[0142] The identifier of the second compression algorithm is determined by the second compression algorithm described above;

[0143] The target compressed data is marked based on the second compression algorithm identifier, and the marked target compressed data is stored in the SSD.

[0144] In some feasible implementations, the processor 1001 is further configured to:

[0145] In response to a data read command, the data to be read corresponding to the data read command is determined from the compressed data stored in the SSD.

[0146] Determine the compression algorithm corresponding to the data to be read, decompress the data to be read based on the compression algorithm, obtain the second decompressed data corresponding to the data to be read, and return the second decompressed data.

[0147] In some feasible implementations, the processor 1001 described above is used for:

[0148] The data to be migrated in the compressed data stored on the SSD is determined based on a preset period.

[0149] It should be understood that in some feasible implementations, the processor 1001 described above may be a central processing unit (CPU), which may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. The memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of the memory may also include non-volatile random access memory. For example, the memory may also consist of non-volatile memory chips (NAND).

[0150] In specific implementation, the aforementioned solid-state drive 1000 can perform the above-described actions through its built-in functional modules. Figure 2 The implementation methods provided for each step are detailed in the above-mentioned implementation methods and will not be repeated here.

[0151] In this embodiment, the data to be migrated in the SSD can be decompressed to obtain first decompressed data, and the first decompressed data can be compressed based on a compression algorithm with a lower compression ratio to obtain target compressed data. This makes the data size of the target compressed data smaller than the data size of the data to be migrated, thereby saving SSD storage space without changing the data to be migrated, and has high applicability.

[0152] This application also provides a computer-readable storage medium storing a computer program that is executed by a processor to perform... Figure 2 The methods provided in each step are detailed in the implementation methods provided in the above steps, and will not be repeated here.

[0153] The aforementioned computer-readable storage medium can be an internal storage unit of any of the aforementioned data processing devices or solid-state storage devices, such as non-volatile flash memory chips of a solid-state storage device. The computer-readable storage medium can also be an external storage device of the electronic device corresponding to the solid-state drive, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device. The aforementioned computer-readable storage medium can also include magnetic disks, optical disks, read-only memory (ROM), or random access memory (RAM), etc. Furthermore, the computer-readable storage medium can include both the internal storage unit of the solid-state drive and the corresponding external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the electronic device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0154] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. The processor of a solid-state drive reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform... Figure 2 The methods provided for each step in the process.

[0155] The terms "first," "second," etc., used in the claims, description, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or electronic device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or electronic devices. References to "embodiment" herein mean that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The presentation of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments. The term "and / or" as used in this application's description and appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0156] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Those skilled in the art can implement the described functions using different methods for each specific application, but such implementations should not be considered beyond the scope of this application.

[0157] The above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application shall still fall within the scope of this application.

Claims

1. A data processing method, characterized by, The method comprises: determining to-be-migrated data in compressed data stored by a solid state drive (SSD); determining a first compression algorithm corresponding to the to-be-migrated data, decompressing the to-be-migrated data based on the first compression algorithm to obtain first decompressed data; compressing the first decompressed data based on a second compression algorithm to obtain target compressed data, and storing the target compressed data to the SSD; a compression rate of the second compression algorithm is less than a compression rate of the first compression algorithm.

2. The method of claim 1, wherein, The to-be-migrated data comprises at least one of: compressed data corresponding to garbage collection processing of the SSD; compressed data corresponding to wear leveling processing of the SSD; compressed data with unstable storage state in at least one data block of the SSD.

3. The method of claim 1, wherein, The method further comprises: determining a data type of the first decompressed data; determining a second compression algorithm based on the data type.

4. The method of claim 1, wherein, The method further comprises: determining a second compression algorithm identifier of the second compression algorithm; based on the second compression algorithm identifier, marking the target compressed data, and storing the marked target compressed data to the SSD.

5. The method of claim 1, wherein, The method further comprises: in response to a data reading instruction, determining to-be-read data corresponding to the data reading instruction from the compressed data stored by the SSD; determining a compression algorithm corresponding to the to-be-read data, decompressing the to-be-read data based on the compression algorithm corresponding to the to-be-read data to obtain second decompressed data corresponding to the to-be-read data, and returning the second decompressed data.

6. The method of claim 1, wherein, The method further comprises: based on a preset period, determining to-be-migrated data in the compressed data stored by the SSD. The apparatus comprises:

7. The method of claim 1, wherein, a data determination module configured to determine to-be-migrated data in compressed data stored by a solid state drive (SSD); a data compression module configured to determine a first compression algorithm corresponding to the to-be-migrated data, decompress the to-be-migrated data based on the first compression algorithm to obtain first decompressed data; 8. A data processing apparatus, characterized by, a data decompression module configured to compress the first decompressed data based on a second compression algorithm to obtain target compressed data, and store the target compressed data to the SSD; a compression rate of the second compression algorithm is less than a compression rate of the first compression algorithm. The apparatus comprises a processor and a memory, which are connected to each other; the memory is configured to store a computer program; the processor is configured to execute a method as claimed in any one of claims 1 to 7 when the computer program is invoked.

9. A solid state drive, characterized by, The computer readable storage medium stores a computer program, which is executed by a processor to implement the method of any one of claims 1 to 7. ​ ​ 10. A computer-readable storage medium, characterized in that, ​

Citation Information

Patent Citations

  • Data processing method, device thereof and flash-memory storage system

    CN101526923A

  • Capturing time-varying storage of data in memory device for data recovery purposes

    US20210011845A1