Data processing method of solid state disk, solid state disk, electronic device and medium

By dynamically partitioning the solid-state drive and performing garbage collection in the log area to migrate data to the data area, the impact of frequent garbage collection on read/write performance and lifespan is resolved, resulting in improved performance and lifespan.

CN115421651BActive Publication Date: 2026-07-21ALIBABA (CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2022-08-19
Publication Date
2026-07-21

Smart Images

  • Figure CN115421651B_ABST
    Figure CN115421651B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a data processing method of a solid state disk, a solid state disk, an electronic device and a medium. In the embodiments of the present application, the solid state disk has a log area for carrying data written from a host system and a data area for carrying data migrated from the log area through dynamic partitioning. Further, the migration of data from the log area to the data area is completed when a GC operation is performed on the log area, that is, the data of the log area is passively written into the data area through the internal GC operation of the disk body, which reduces the write amplification of the solid state disk to a certain extent, greatly reduces the data migration amount and saves the bus bandwidth. Further, the valid data of the storage blocks in the log area can continue to be deposited in the log area, thereby reducing the GC pressure of the data area and the write amplification of the solid state disk. Thus, the read-write performance and service life of the solid state disk are improved.
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 for a solid-state drive, a solid-state drive, an electronic device, and a medium. Background Technology

[0002] Given their superior IOPS (Input / Output Per Second) performance, high-capacity, low-cost solid-state drives (SSDs) have gradually become the mainstream local storage devices. The storage medium in an SSD typically consists of several physical blocks, and each physical block contains several pages. A block is the smallest unit for data erasure on an SSD, while a page is the smallest unit for read and write operations. In practical applications, due to the large amount of data written to SSDs, garbage collection (GC) operations are frequently triggered to free up more available storage space. However, frequent garbage collection operations can negatively impact the read / write performance and lifespan of an SSD. Summary of the Invention

[0003] This application provides a data processing method for a solid-state drive, a solid-state drive, an electronic device, and a medium to improve the read / write performance and lifespan of a solid-state drive.

[0004] This application also provides a data processing method for a solid-state drive (SSD). The storage space of the SSD's storage medium is divided into a log area, a data area, and a blank area, each including at least one storage block. The method includes: writing at least one piece of data requested by the host system to all or part of the storage blocks in at least one storage block of the log area; detecting whether each storage block in the at least one storage block of the log area is in a full state; if a first storage block in a full state is detected, triggering a garbage collection operation for the first storage block, and migrating the valid data in the first storage block that has been cleaned up by the garbage collection operation to a storage block in the log area or data area that is not in a full state; erasing the data in the migrated first storage block, and scheduling the data-erased first storage block from the log area to the blank area.

[0005] This application provides a solid-state drive, including: a controller and a storage medium interconnected with each other; the controller is used to partition the storage space of the storage medium to divide it into a log area, a data area, and a blank area, each of the log area, data area, and blank area including at least one storage block; the controller is also used to write at least one piece of data requested by the host system to all or part of the storage blocks in at least one storage block of the log area; detect whether each storage block in at least one storage block of the log area is in a full state; if a first storage block in a full state is detected, trigger a garbage collection operation for the first storage block, and migrate the valid data in the first storage block that has been sorted out by the garbage collection operation to a storage block in the log area or data area that is not in a full state, and erase the data in the migrated first storage block, and schedule the first storage block after data erasure from the log area to the blank area.

[0006] This application also provides an electronic device, including: a memory and a processor; the memory for storing a computer program; and the processor coupled to the memory for executing the computer program to perform steps in a solid-state drive data processing method.

[0007] This application also provides a computer storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the solid-state drive data processing method.

[0008] In this embodiment, the solid-state drive (SSD) uses dynamic partitioning, including a log area for carrying data written from the host system and a data area for carrying data migrated from the log area. Furthermore, during garbage collection (GC) operations in the log area, data migration from the log area to the data area is completed. That is, data in the log area is passively written to the data area through internal GC operations, which reduces write amplification of the SSD to a certain extent, significantly reduces the amount of data migration, and saves bus bandwidth. Furthermore, valid data in the storage blocks within the log area can continue to accumulate in the log area, further reducing GC pressure on the data area and decreasing write amplification of the SSD. Therefore, the read / write performance and lifespan of the SSD are improved. Attached Figure Description

[0009] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0010] Figure 1 This is a schematic diagram of the structure of a solid-state drive provided in an embodiment of this application;

[0011] Figure 2This application provides a schematic diagram of internal garbage collection in a solid-state drive.

[0012] Figure 3 A data migration diagram provided as an embodiment of this application;

[0013] Figure 4 A storage capacity comparison chart provided for an embodiment of this application;

[0014] Figure 5 A flowchart illustrating a data processing method for a solid-state drive provided in this application embodiment;

[0015] Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0016] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0018] In practical applications, due to the large amount of writing to SSDs, SSDs frequently trigger garbage collection (GC) operations to free up more available storage space. However, frequent garbage collection operations can negatively impact the read / write performance and lifespan of SSDs. Therefore, this application provides a data processing method for a solid-state drive (SSD), an SSD, an electronic device, and a medium. In this application embodiment, the SSD uses dynamic partitioning, including a log area that carries data written from the host system and a data area that carries data migrated from the log area. Furthermore, during GC operations in the log area, data migration from the log area to the data area is completed. That is, data in the log area is passively written to the data area through internal GC operations, which reduces write amplification of the SSD to a certain extent, greatly reduces the amount of data migration, and saves bus bandwidth. Furthermore, valid data in the storage blocks in the log area can continue to accumulate in the log area, thereby reducing the GC pressure on the data area and reducing write amplification of the SSD. Thus, the read / write performance and lifespan of the SSD are improved.

[0019] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0020] Figure 1 This is a schematic diagram of a solid-state drive (SSD) provided as an embodiment of this application. See also... Figure 1 The solid-state drive (SSD) includes a controller and a storage medium that are communicatively connected to each other. The controller includes, but is not limited to, MCUs (Microcontrollers), CPUs (Central Processing Units), and MPUs (Microprocessors). The storage medium includes, but is not limited to, NAND flash memory. Furthermore, the SSD may also include Dynamic Random Access Memory (DRAM). DRAM can be used to store a flash mapping table of the Flash Translation Layer (FTL), which represents the mapping relationship between logical addresses and physical addresses.

[0021] In this embodiment, the controller can partition the storage space of the storage medium into a log area, a data area, and a blank area. Each of the log area, data area, and blank area includes at least one storage zone. A storage zone can be understood as a storage unit with a larger granularity than a physical block. It can include one or more physical blocks, that is, one storage zone corresponds to a group of physical blocks.

[0022] In this embodiment, the solid-state drive (SSD) is dynamically partitioned, containing both a log area for data written from the host system and a data area for data migrated from the log area. Of course, data provided by the host system can also be directly written to the data area; there is no restriction on this. In terms of data storage duration, the log area can be understood as a short-term storage area, while the data area can be understood as a long-term storage area. Newly written data to the SSD is prioritized for writing to the log area, and existing data in the log area can be written to the data area after certain conditions are met. That is, data is stored for a relatively short time in the log area and a relatively long time in the data area. Naturally, the host system can flexibly choose whether to write the currently needed data to the log area or the data area. The storage capacity of the log area can be equivalent to or different from the storage capacity of the data area; there is no restriction on this. Additionally, the blank area is a storage area where no data is stored. It's important to note that storage blocks in the blank area can be scheduled to the log area or the data area. Similarly, storage blocks in the log area or data area that have been erased (i.e., currently empty) can also be scheduled to the blank area. In other words, any storage block can be dynamically scheduled to the blank area, log area, or data area. Furthermore, no storage block can contain data from both the log area and the data area. Each storage block has a single purpose: either storing data in the log area or storing data in the data area.

[0023] In this embodiment, the dynamic boundary between the storage capacity of the log area and the storage capacity of the data area can be flexibly scheduled, reducing wear leveling. Optionally, the controller can then schedule storage blocks in empty areas to the log area or the data area using global wear leveling. Global wear leveling allows for the rotation of storage blocks between the log area and the data area, reducing wear hotspots and improving the lifespan of solid-state applications.

[0024] In this embodiment, the solid-state drive (SSD) may further include a host interface, through which the host system can interact with the SSD for data read and write operations. That is, the host system can write data to the SSD and read data from the SSD. The host system may include, but is not limited to, any computer system in any device form, such as a laptop, desktop computer, smartphone, tablet computer, or industrial computer. The host system and the SSD may reside in the same device or in different devices; there is no limitation in this regard.

[0025] In this embodiment, the controller can write at least one piece of data requested by the host system to all or part of the storage blocks in at least one storage block of the log area. Over time, storage blocks in the log area may become full. To improve the read / write performance and lifespan of the solid-state drive, the controller can detect whether each storage block in at least one storage block of the log area is full. If a first storage block is detected to be full, a garbage collection operation is triggered for the first storage block, and the valid data in the first storage block that has been cleaned up by the garbage collection operation is migrated to a storage block in the log area or data area that is not full. The migrated first storage block is then erased, and the erased first storage block is scheduled from the log area to a blank area.

[0026] In this embodiment, the controller can detect whether any storage block in the log area is full in real time or periodically. Specifically, the current remaining storage capacity of any storage block in the log area can be compared with a flexibly set remaining storage capacity threshold. If the current remaining storage capacity is less than the remaining storage capacity threshold, the storage block can be considered to be in a partially full state; if the current remaining storage capacity is greater than or equal to the remaining storage capacity threshold, the storage block can be considered to be in a full state.

[0027] In this embodiment, when the controller detects that any storage block in the log area is full, it can trigger a garbage collection operation for that storage block to reclaim the valid data within it. This valid data can then be migrated to other unfilled storage blocks in the log area, or to unfilled storage blocks in the data area; there are no restrictions on this. Further, optionally, the valid data in the storage block can be written along with user data provided by the host system to one or more unfilled storage blocks in the data area to reduce the number of storage blocks simultaneously storing data. See also... Figure 2 At time T = t1, valid data in the full storage block 5 of the log area is written to storage block N in the data area. Of course, valid data in the full storage block 5 of the log area can also be written to storage block M in the log area that is not yet full (i.e., being written). Additionally, in Figure 2 In the given information, M, N, X, and Y are all distinct positive integers.

[0028] In this embodiment, data migration from the log area to the data area is completed during GC operations on the log area. That is, data in the log area is passively written to the data area through internal disk GC operations. This writing method can be called passive mode data writing, which reduces write amplification of the solid-state drive to a certain extent, significantly reduces the amount of data migration, and saves bus bandwidth. Furthermore, compared to active data copying, passive mode data writing, because it does not actively copy data from the log area to the data area, greatly reduces the amount of data migration and saves bus bandwidth.

[0029] In this embodiment, valid data stored in the log area can continue to accumulate in the log area, thereby reducing the GC pressure on the data area or reducing the refresh operation of the data area, and reducing the write amplification of the solid-state drive.

[0030] Alternatively, data migration can be performed by combining the read and write characteristics of data in the solid-state drive (SSD), thereby selectively controlling the location and retention period of data in different partitions of the SSD, reducing congestion and lowering write amplification.

[0031] Based on the above, the controller can also analyze the popularity type of at least one piece of data written to the log area, including write hot type, read hot type, write cold type, and read cold type. Of course, the controller can also analyze the popularity type of at least one piece of data written to the data area, without limitation.

[0032] Specifically, the controller can determine the data's popularity type based on the number of reads or writes over a period of time. For example, if the number of reads exceeds a pre-set threshold, the data is classified as a "read hotspot." If the number of reads is less than or equal to the threshold, it's classified as a "read coldspot." Similarly, if the number of writes exceeds a pre-set threshold, the data is classified as a "write hotspot." If the number of writes is less than or equal to the threshold, it's classified as a "write coldspot." The logic for classifying popularity types is tailored to specific needs.

[0033] Based on the above, when migrating valid data in the first storage block, the controller specifically performs the following steps: For valid data of write hot type in the first storage block, write the valid data of write hot type to the second storage block in the log area that is not full; For valid data of read hot type in the first storage block, if some storage blocks in the log area are not full, write the valid data of read hot type to the third storage block in the log area that is not full; if all storage blocks in the log area are full, write the valid data of read hot type to the fourth storage block in the data area that is not full; For valid data of write cold type in the first storage block, write the valid data of write cold type to the fifth storage block in the data area that is not full, and the heat level of the fifth storage block matches the heat information of the valid data of write cold type; For valid data of read cold type in the first storage block, compress the valid data of read cold type, and write the compressed valid data of read cold type to the sixth storage block in the data area that is not full.

[0034] See Figure 3 The host system sends read commands to the solid-state drive (SSD) to read data from it, and write commands to the SSD to read data from it. Over time, the SSD stores more and more data. The SSD controller can analyze the read / write activity of the stored data based on access characteristics such as read or write counts to determine the type of data activity.

[0035] In one scenario, when any storage block in the log area is reclaimed, the valid data of the write hotspot type that has been sorted out is written together with the data requested to be written by the host system into the unfilled storage block in the log area to continue to accumulate, thereby reducing the GC triggering of the storage blocks in the background data area.

[0036] It's worth noting that write-hot data has a high write frequency and is updated frequently. Therefore, write-hot data should still be written to the log area for continued iteration. Furthermore, write-hot data can be written together with currently requested data from the host system to unfilled storage blocks in the log area, eliminating the need to allocate additional blank storage blocks. This simplifies metadata management and power-loss protection, effectively reducing garbage collection (GC) triggering in the background data area. Of course, if the log area currently has no remaining storage capacity, write-hot data can still be written to the data area. Alternatively, if the log area has no remaining storage capacity, blank storage blocks can be allocated to the log area to expand its storage capacity, and then write-hot data to the log area.

[0037] In another scenario, if the log area's storage capacity has not reached the capacity threshold (i.e., the log area still has remaining storage capacity), when any storage block in the log area is reclaimed, the valid data of the read hotspot type is written to the unfilled storage blocks in the log area to continue accumulating; if the capacity threshold is reached (i.e., the log area has no remaining storage capacity), the valid data is written to several storage blocks in the data area.

[0038] It's worth noting that read-hot data is frequently accessed during SSD storage. Based on the working mechanism of NAND flash media, the error rate of surrounding data due to read disturbance increases, ultimately forcing background data refresh and increasing write amplification. Therefore, identifying read-hot data and placing it in the log area can reduce the error rate and overall write amplification. Of course, read-hot data is only temporarily placed in the log area; valid data in the log area will eventually be migrated to the data area, and invalid data will be deleted. Furthermore, the data in the log area itself has a relatively short existence time in the NAND flash media, limiting the impact of read disturbance. Therefore, when the log area has sufficient capacity, read-hot data can be retained there. For example, when the log area reclaims a full storage block, read-hot data can be written to the currently being written storage block in the log area.

[0039] In another scenario, when any storage block in the log area is reclaimed, the valid data of the cold write point type is written to the storage block in the data area used to store cold data, and placed in the data area according to the write hotness level, thereby reducing the GC triggering of the storage blocks in the background data area.

[0040] In practical applications, write activity levels are differentiated based on the number of open storage blocks supported by the SSD, and data is written to the corresponding storage blocks accordingly. This means maintaining multiple open data storage blocks to accommodate data with varying write activity levels. This refined differentiation reduces garbage collection (GC) triggering.

[0041] Specifically, the data area includes multiple storage blocks with different write popularity levels for storing cold data; the higher the write popularity level, the more popular the data. Valid data of write cold point types compiled from the log area is written to the storage block in the data area with a write popularity level that matches its popularity information.

[0042] In another scenario, when any storage block in the log area is reclaimed, the controller compresses the valid data of the sorted cold read point type, and writes the compression result into the data area.

[0043] In practical applications, when valid data of the cold-point type is migrated from the log area to the data area, the SSD controller can first correct errors before writing it to the data area. Furthermore, the controller's compression process for valid data of the cold-point type can save storage space and provide more blank areas for flexible scheduling, which is equivalent to increasing the SSD's OP (over-provisioning) area, improving write performance and lifespan.

[0044] In this embodiment, since only valid data within the storage blocks is migrated, invalid data may still remain. Therefore, the migrated storage blocks are erased to clear the data, allowing the SSD to provide usable storage space. The erased storage blocks can remain in the log area. Furthermore, to reduce wear hotspots and improve the lifespan of the SSD, the erased storage blocks can be moved from the log area to the blank area. In this way, in subsequent use, storage blocks that previously served as the log area can be used as data blocks in the future, providing the prerequisite for dynamically updating storage blocks. See also... Figure 2 After GC is completed, storage block 5 in the log area, after the data is cleared, can be scheduled to the blank area.

[0045] Optionally, the controller can also perform garbage collection operations on at least one storage block in the data area according to the set garbage collection strategy, migrate the valid data of at least one storage block in the data area after the garbage collection operation to the storage block in the blank area, erase the data of at least one storage block in the migrated data area, schedule at least one storage block in the erased data area from the data area to the blank area, and schedule the storage block in the blank area after the data migration from the blank area to the data area.

[0046] Specifically, garbage collection strategies can be flexibly set according to actual application needs. For example, garbage collection can be performed periodically on the data area, garbage collection can be performed irregularly on the data area, or garbage collection can be performed on the data area when the current remaining storage capacity of the data area is insufficient, but it is not limited to these.

[0047] See Figure 2 At time T = t2, a GC operation or a data refresh operation is performed on storage block N in the data area. The valid data in storage block N that has been cleaned up can be written into storage block Y in the blank area. Storage block Y with data written to it is scheduled from the blank area to the data area. In addition, storage block N with data erased is scheduled from the data area to the blank area.

[0048] In some alternative implementations, when the controller writes at least one piece of data requested by the host system to the log area, it specifically performs the following: for each piece of data, it appends the data, its version, and the Logical Block Addressing (LBA) to any one of the at least one storage blocks in the log area.

[0049] Specifically, over time, the log area stores multiple versions of data at the same logical block address; that is, new and old versions of the same data are stored in the log area. It is understandable that dynamically coordinating the storage capacity of the log area can improve the efficiency of data version integration. The solid-state drive (SSD) provided in this embodiment, considering factors such as write lifespan, parallelism, and latency, can provide a large log area storage capacity. Therefore, the log area of ​​the SSD provided in this embodiment can hold more versions of data at the same logical block address, thereby extending the data's residence time in the log area. This significantly reduces the amount of data migration when data is subsequently migrated from the log area to the data area, reducing write amplification and wear on the storage medium. Based on this, optionally, when migrating valid data in the first storage block, the controller specifically performs the following steps: selects the latest valid data corresponding to the version of the logical block address from multiple versions of valid data at the same logical block address in the first storage block; and migrates the latest valid data corresponding to each logical block address to a storage block in the log area or data area that is not yet fully written.

[0050] In practical applications, SCM (Storage Class Memory) SSDs are typically used as local storage devices. SCM SSDs refer to hybrid storage devices composed of SCM and solid-state drives. See also... Figure 4 While SCM SSDs can store a maximum of three versions of data, the log area of ​​the solid-state drive (SSD) provided in this embodiment can store 18 or more versions of data. The log area storage capacity of the SSD provided in this embodiment is significantly larger than that of the SCM SSD. Taking LBA=l1 as an example, during data migration, the SCM SSD can omit two obsolete versions, with v3 being the latest version. The SSD provided in this embodiment can omit 17 obsolete versions, with v18 being the latest version. This means that when migrating data from the log area, only the latest version of the data needs to be migrated, while obsolete versions, i.e., older versions, can be erased, greatly reducing the amount of data migration. Furthermore, supporting the storage of more versions of data in the log area of ​​the SSD provided in this embodiment can effectively extend the data settling time and reduce intermediate state transition processes.

[0051] The technical solution provided in this application embodiment involves a solid-state drive (SSD) dynamically partitioned, containing both a log area for data written from the host system and a data area for data migrated from the log area. Furthermore, during garbage collection (GC) operations in the log area, data migration from the log area to the data area is completed. That is, data in the log area is passively written to the data area through internal GC operations, which reduces write amplification of the SSD to a certain extent, significantly reduces the amount of data migration, and saves bus bandwidth. Moreover, valid data in the storage blocks within the log area can continue to accumulate in the log area, further reducing GC pressure on the data area and decreasing write amplification of the SSD. Thus, the read / write performance and lifespan of the SSD are improved.

[0052] Figure 5 This is a flowchart illustrating a data processing method for a solid-state drive (SSD) according to an embodiment of this application. The SSD's storage medium is divided into a log area, a data area, and a blank area, each including at least one storage block. See also... Figure 5 The method may include the following steps:

[0053] 501. Write at least one piece of data requested by the host system to all or part of the storage blocks in at least one storage block of the log area.

[0054] 502. Check whether each storage block in at least one storage block of the log area is in a full state.

[0055] 503. If a first storage block in a full state is detected, a garbage collection operation is triggered for the first storage block, and the valid data in the first storage block that has been sorted out by the garbage collection operation is migrated to the log area or a storage block in the data area that is not full.

[0056] 504. Erase the data in the first storage block after migration, and schedule the first storage block after data erasure from the log area to the blank area.

[0057] Further optionally, before migrating the valid data in the first storage block that has been sorted out by the garbage collection operation to the log area or the storage block in the data area that is not full, the above method further includes: analyzing the heat type of each of at least one piece of data that has been written to the log area, the heat type including write hot type, read hot type, write cold type and read cold type.

[0058] Optionally, migrating valid data from the first storage block, after being cleaned up by garbage collection, to a partially filled storage block in the log area or data area includes: for valid data of write-hot type in the first storage block, writing the valid data of write-hot type to a partially filled second storage block in the log area; for valid data of read-hot type in the first storage block, if some storage blocks in the log area are partially filled, writing the valid data of read-hot type to a partially filled third storage block in the log area; if all storage blocks in the log area are fully filled... If the data is in a hotspot state, then the valid data of the hotspot type is written to the fourth storage block in the data area that is not full. If the data is in a coldspot state, then the valid data of the coldspot type is written to the fifth storage block in the data area that is not full. The hotspot level of the fifth storage block matches the hotspot information of the valid data of the coldspot type. If the data is in a coldspot state, then the valid data of the coldspot type is compressed and the compressed valid data of the coldspot type is written to the sixth storage block in the data area that is not full.

[0059] Further optionally, the host system requests to write at least one piece of data to all or part of the storage blocks in at least one storage block of the log area, including: for each piece of data, appending the data and its version and logical block address (LBA) to any storage block in at least one storage block of the log area.

[0060] Further optionally, migrating the valid data in the first storage block that has been sorted out by the garbage collection operation to the storage blocks in the log area or data area that are not full includes: selecting the latest valid data corresponding to the version of the logical block address from multiple versions of valid data at the same logical block address in the first storage block; and migrating the latest valid data corresponding to each logical block address to the storage blocks in the log area or data area that are not full.

[0061] Further, optionally, the above method also includes: scheduling storage blocks in the blank area to the log area or data area in a globally wear-balanced manner.

[0062] Further optionally, the above method also includes: performing a garbage collection operation on at least one storage block in the data area according to a set garbage collection strategy; migrating the valid data of at least one storage block in the data area that has been cleaned up by the garbage collection operation to a storage block in the blank area; erasing the data of at least one storage block in the migrated data area; scheduling at least one storage block in the erased data area from the data area to the blank area; and scheduling the storage block in the blank area after the data migration from the blank area to the data area.

[0063] For detailed implementation processes of each step in the method embodiments, please refer to the relevant descriptions in the foregoing device embodiments, which will not be repeated here.

[0064] The technical solution provided in this application embodiment involves a solid-state drive (SSD) dynamically partitioned, containing both a log area for data written from the host system and a data area for data migrated from the log area. Furthermore, during garbage collection (GC) operations in the log area, data migration from the log area to the data area is completed. That is, data in the log area is passively written to the data area through internal GC operations, which reduces write amplification of the SSD to a certain extent, significantly reduces the amount of data migration, and saves bus bandwidth. Moreover, valid data in the storage blocks within the log area can continue to accumulate in the log area, further reducing GC pressure on the data area and decreasing write amplification of the SSD. Thus, the read / write performance and lifespan of the SSD are improved.

[0065] Figure 6 This is a schematic diagram of a data processing device provided in an embodiment of this application. This data processing device can be implemented in software and / or hardware, and is generally integrated into a solid-state drive (SSD) or electronic device. The storage space of the SSD is divided into a log area, a data area, and a blank area, each of which includes at least one storage block. See also... Figure 6 The device may include:

[0066] The writing module 61 is used to write at least one piece of data requested by the host system to all or part of the storage blocks in at least one storage block of the log area.

[0067] Detection module 62 is used to detect whether each storage block in at least one storage block of the log area is in a full state;

[0068] The multi-functional processing module 63 is used to trigger a garbage collection operation for the first storage block if a first storage block in a full state is detected, and to migrate the valid data in the first storage block that has been sorted out by the garbage collection operation to a storage block in the log area or data area that is not full; to erase the data in the migrated first storage block, and to schedule the first storage block after data erasure from the log area to the blank area.

[0069] Further optionally, the multi-functional processing module 63 is also used to: analyze the heat type of at least one piece of data written to the log area, including write hot type, read hot type, write cold type and read cold type.

[0070] Optionally, when the multi-functional processing module 63 migrates valid data from the first storage block, which has been sorted out by garbage collection, to a storage block in the log area or data area that is not full, it specifically performs the following: for valid data of write hot type in the first storage block, write the valid data of write hot type to a second storage block in the log area that is not full; for valid data of read hot type in the first storage block, if some storage blocks in the log area are not full, write the valid data of read hot type to a third storage block in the log area that is not full; if all storage blocks in the log area are not full... If a block is full, then valid data of the hot read type is written to the fourth storage block in the data area that is not full. For valid data of the cold write type in the first storage block, then valid data of the cold write type is written to the fifth storage block in the data area that is not full, and the heat level of the fifth storage block matches the heat information of the valid data of the cold write type. For valid data of the cold read type in the first storage block, then the valid data of the cold read type is compressed, and the compressed valid data of the cold read type is written to the sixth storage block in the data area that is not full.

[0071] Further optionally, when the write module 61 writes at least one piece of data requested by the host system to all or part of the storage blocks in at least one storage block of the log area, it is specifically used to: for each piece of data, write the data and its version and logical block address (LBA) to any storage block in at least one storage block of the log area in an append write manner.

[0072] Optionally, when the multi-functional processing module 63 migrates the valid data in the first storage block that has been sorted out by the garbage collection operation to the storage blocks in the log area or data area that are not full, it is specifically used to: select the latest valid data corresponding to the logical block address from multiple versions of valid data with the same logical block address in the first storage block; and migrate the latest valid data corresponding to each logical block address to the storage blocks in the log area or data area that are not full.

[0073] Further optional, the multi-functional processing module 63 is also used to schedule storage blocks in the blank area to the log area or data area in a globally wear-balanced manner.

[0074] Further optionally, the multi-functional processing module 63 is also configured to perform garbage collection operations on at least one storage block in the data area according to a set garbage collection strategy; migrate valid data from at least one storage block in the data area after the garbage collection operation to storage blocks in the blank area; erase data from at least one storage block in the migrated data area; schedule at least one storage block in the erased data area from the data area to the blank area; and schedule storage blocks in the blank area after the data migration from the blank area to the data area.

[0075] Figure 6 The data processing device shown can perform Figure 5 The implementation principle and technical effects of the solid-state drive data processing method in the illustrated embodiment will not be described in detail here.

[0076] The technical solution provided in this application embodiment involves a solid-state drive (SSD) dynamically partitioned, containing both a log area for data written from the host system and a data area for data migrated from the log area. Furthermore, during garbage collection (GC) operations in the log area, data migration from the log area to the data area is completed. That is, data in the log area is passively written to the data area through internal GC operations, which reduces write amplification of the SSD to a certain extent, significantly reduces the amount of data migration, and saves bus bandwidth. Moreover, valid data in the storage blocks within the log area can continue to accumulate in the log area, further reducing GC pressure on the data area and decreasing write amplification of the SSD. Thus, the read / write performance and lifespan of the SSD are improved.

[0077] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 501 to 504 can be device A; or the execution subject of steps 501 and 502 can be device A, and the execution subject of steps 503 and 504 can be device B; and so on.

[0078] Furthermore, in some of the processes described in the above embodiments and accompanying drawings, multiple operations appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 501, 502, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a chronological order, nor do they limit "first" and "second" to different types.

[0079] Figure 7This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 7 As shown, the electronic device includes: a memory 71 and a processor 72;

[0080] Memory 71 is used to store computer programs and can be configured to store various other data to support operation on the computing platform. Examples of this data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc.

[0081] The memory 71 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0082] The processor 72, coupled to the memory 71, is configured to execute a computer program in the memory 71 for: writing at least one piece of data requested to be written by the host system to all or part of a storage block in at least one storage block of the log area; detecting whether each storage block in at least one storage block of the log area is in a full state; if a first storage block in a full state is detected, triggering a garbage collection operation for the first storage block, and migrating the valid data in the first storage block that has been sorted out by the garbage collection operation to a storage block in the log area or data area that is not in a full state; erasing the data in the migrated first storage block, and scheduling the data-erased first storage block from the log area to a blank area.

[0083] Further optionally, the processor 72 is also configured to: analyze the heat type of at least one piece of data written to the log area, including write hot type, read hot type, write cold type and read cold type.

[0084] Optionally, when the processor 72 migrates valid data from the first storage block, which has been cleared by garbage collection, to a storage block in the log area or data area that is not fully written, it specifically performs the following: for valid data of write hot type in the first storage block, write the valid data of write hot type to a second storage block in the log area that is not fully written; for valid data of read hot type in the first storage block, if some storage blocks in the log area are not fully written, write the valid data of read hot type to a third storage block in the log area that is not fully written; if all storage blocks in the log area are not fully written... If the data is in a full state, then the valid data of the hot read type is written to the fourth storage block in the data area that is not full. For the valid data of the cold write type in the first storage block, then the valid data of the cold write type is written to the fifth storage block in the data area that is not full, and the heat level of the fifth storage block matches the heat information of the valid data of the cold write type. For the valid data of the cold read type in the first storage block, then the valid data of the cold read type is compressed, and the compressed valid data of the cold read type is written to the sixth storage block in the data area that is not full.

[0085] Further optionally, when the processor 72 writes at least one piece of data requested by the host system to all or part of the storage blocks in at least one storage block of the log area, it is specifically used to: for each piece of data, write the data, its version, and logical block address to any storage block in at least one storage block of the log area in an append-only manner.

[0086] Optionally, when the processor 72 migrates valid data from the first storage block that has been sorted out by garbage collection to a storage block in the log area or data area that is not full, it specifically performs the following: selects the latest valid data corresponding to the logical block address from multiple versions of valid data at the same logical block address in the first storage block; and migrates the latest valid data corresponding to each logical block address to a storage block in the log area or data area that is not full.

[0087] Further optionally, processor 72 is also used to schedule storage blocks in the empty area to the log area or data area in a globally wear-balanced manner.

[0088] Further optionally, the processor 72 is also configured to perform garbage collection operations on at least one storage block in the data area according to a set garbage collection strategy; migrate valid data from at least one storage block in the data area that has been cleaned up by the garbage collection operation to a storage block in the blank area; erase data from at least one storage block in the migrated data area; schedule at least one storage block in the erased data area from the data area to the blank area; and schedule the storage block in the blank area after the data has been moved in from the blank area to the data area.

[0089] Furthermore, such as Figure 7 As shown, the electronic device also includes other components such as a communication component 73, a display 74, a power supply component 75, and an audio component 76. Figure 7 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 7 The components shown. Additionally... Figure 7 The components within the dashed box are optional, not mandatory, and their specific requirements depend on the product form of the electronic device. The electronic device in this embodiment can be a terminal device such as a desktop computer, laptop computer, smartphone, or IoT device, or a server-side device such as a conventional server, cloud server, or server array. If the electronic device in this embodiment is a terminal device such as a desktop computer, laptop computer, or smartphone, it may include... Figure 7 The components within the dashed box; if the electronic device in this embodiment is implemented as a conventional server, cloud server, or server array, etc., it may be omitted. Figure 7 The component within the dashed box.

[0090] For a detailed description of the implementation process of each action by the processor, please refer to the relevant descriptions in the foregoing method embodiments or device embodiments, which will not be repeated here.

[0091] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be performed by an electronic device in the above method embodiments.

[0092] Accordingly, this application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, enables the processor to perform the steps that can be executed by an electronic device in the above method embodiments.

[0093] The aforementioned communication components are configured to facilitate wired or wireless communication between the device containing the communication components and other devices. The device containing the communication components can access wireless networks based on communication standards, such as WiFi, 2G, 3G, 4G / LTE, 5G, and other mobile communication networks, or combinations thereof. In one exemplary embodiment, the communication components receive broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication components also include a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra-Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0094] The aforementioned display includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.

[0095] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.

[0096] The aforementioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0097] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0098] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0099] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0100] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0101] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0102] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0103] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0104] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0105] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A data processing method for a solid-state drive, characterized in that, The storage space of the solid-state drive's storage medium is divided into a log area, a data area, and a blank area, each of which includes at least one storage block. The method includes: the log area is used to carry data written from the host system, the data area is used to carry data migrated from the log area, the blank area is a storage area where no data is stored, and the storage blocks in the blank area can be scheduled to the log area or the data area. Write at least one piece of data requested by the host system to all or part of the storage blocks in at least one storage block of the log area; Detect whether each storage block in at least one storage block of the log area is in a full write state; If a first storage block is detected to be full, a garbage collection operation is triggered for the first storage block, and the valid data in the first storage block that has been sorted out by the garbage collection operation is migrated to the log area or a storage block in the data area that is not full. The data in the migrated first storage block is erased, and the erased first storage block is scheduled from the log area to the blank area.

2. The method according to claim 1, characterized in that, Before migrating the valid data in the first storage block, which has been sorted out by garbage collection, to the log area or the storage blocks in the data area that are not full, the process further includes: Analyze the popularity type of at least one piece of data that has been written to the log area, including write hot spot type, read hot spot type, write cold spot type, and read cold spot type.

3. The method according to claim 2, characterized in that, Migrating valid data from the first storage block, which has been cleared by garbage collection, to the log area or storage blocks in the data area that are not yet full includes: For valid data of the write hotspot type in the first storage block, write the valid data of the write hotspot type into the second storage block in the log area that is not full; For valid data of the read hotspot type in the first storage block, if some storage blocks in the log area are not full, the valid data of the read hotspot type is written to the third storage block in the log area that is not full; if all storage blocks in the log area are full, the valid data of the read hotspot type is written to the fourth storage block in the data area that is not full. For valid data of the write cold point type in the first storage block, the valid data of the write cold point type is written to the fifth storage block in the data area that is not full. The heat level of the fifth storage block is matched with the heat information of the valid data of the write cold point type. For valid data of the cold read type in the first storage block, the valid data of the cold read type is compressed, and the compressed valid data of the cold read type is written into the sixth storage block of the data area that is not full.

4. The method according to claim 2, characterized in that, Writing at least one piece of data requested by the host system to all or part of the storage blocks in at least one storage block of the log area, including: For each of the at least one data items, the data item, its version, and logical block address (LBA) are appended to any one of the at least one storage blocks in the log area.

5. The method according to claim 4, characterized in that, Migrating valid data from the first storage block, which has been cleared by garbage collection, to the log area or storage blocks in the data area that are not yet full includes: Select the latest valid data corresponding to the LBA from the valid data of multiple versions of the same LBA in the first storage block; The latest valid data corresponding to each LBA is migrated to the log area or the storage block in the data area that is not full.

6. The method according to any one of claims 1 to 5, characterized in that, Also includes: The storage blocks in the blank area are scheduled to the log area or the data area using a global wear leveling method.

7. The method according to any one of claims 1 to 5, characterized in that, Also includes: According to the set garbage collection strategy, perform garbage collection operations on at least one storage block in the data area; The valid data of at least one storage block in the data area that has been sorted out by the garbage collection operation is migrated to the storage block in the blank area; At least one storage block in the migrated data area is erased, and at least one storage block in the erased data area is moved from the data area to the blank area, and storage blocks in the blank area after data migration are moved from the blank area to the data area.

8. A solid-state drive, characterized in that, include: Controllers and storage media that are interconnected; The controller is used to partition the storage space of the storage medium to divide it into a log area, a data area, and a blank area. Each of the log area, the data area, and the blank area includes at least one storage block. The log area is used to carry data written from the host system, the data area is used to carry data migrated from the log area, and the blank area is a storage area where no data is stored. The storage blocks in the blank area can be scheduled to the log area or the data area. The controller is further configured to write at least one piece of data requested by the host system into all or part of the storage blocks in at least one storage block of the log area; and to detect whether each storage block in at least one storage block of the log area is in a full state. If a first storage block in a full state is detected, a garbage collection operation is triggered for the first storage block, and the valid data in the first storage block that has been sorted out by the garbage collection operation is migrated to the log area or a storage block in the data area that is not full. The migrated first storage block is then erased, and the first storage block with erased data is scheduled from the log area to the blank area.

9. The solid-state drive according to claim 8, characterized in that, The controller is also used for: Analyze the popularity type of at least one piece of data that has been written to the log area, including write hot spot type, read hot spot type, write cold spot type, and read cold spot type.

10. The solid-state drive according to claim 9, characterized in that, When migrating valid data in the first storage block, the controller is specifically used for: For valid data of the write hotspot type in the first storage block, write the valid data of the write hotspot type into the second storage block in the log area that is not full; For valid data of the read hotspot type in the first storage block, if some storage blocks in the log area are not full, the valid data of the read hotspot type is written to the third storage block in the log area that is not full; if all storage blocks in the log area are full, the valid data of the read hotspot type is written to the fourth storage block in the data area that is not full. For valid data of the write cold point type in the first storage block, the valid data of the write cold point type is written to the fifth storage block in the data area that is not full. The heat level of the fifth storage block is matched with the heat information of the valid data of the write cold point type. For valid data of the cold read type in the first storage block, the valid data of the cold read type is compressed, and the compressed valid data of the cold read type is written into the sixth storage block of the data area that is not full.

11. The solid-state drive according to claim 8, characterized in that, When the controller writes at least one piece of data requested by the host system to the log area, it is specifically used for: For each of the at least one data items, the data item, its version, and logical block address (LBA) are appended to any one of the at least one storage blocks in the log area.

12. The solid-state drive according to claim 11, characterized in that, When migrating valid data in the first storage block, the controller is specifically used for: Select the latest valid data corresponding to the LBA from the valid data of multiple versions of the same LBA in the first storage block; The latest valid data corresponding to each LBA is migrated to the log area or the storage block in the data area that is not full.

13. An electronic device, characterized in that, include: Memory and processor; The memory is used to store computer programs; The processor is coupled to the memory for executing the computer program to perform the steps of the method according to any one of claims 1-7.

14. A computer storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method according to any one of claims 1-7.