Solid-state storage system, solid-state disk and host

By establishing a mapping relationship between logical blocks and physical blocks between the host and the solid-state drive, system garbage collection with logical blocks is realized, the problem of write amplification of solid-state drives is solved, the performance is improved and service life is extended, and the waste of storage resources is reduced.

WO2025152482A1PCT designated stage expired Publication Date: 2025-07-24HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/118559
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-16
Filing Date
2024-09-12
Publication Date
2025-07-24

AI Technical Summary

Technical Problem

In the prior art, solid-state drives have write amplification during garbage collection, resulting in reduced performance and shortened service life, and the handling of effective data cannot be effectively avoided. The existing methods cannot fully ensure that all data in physical blocks become invalid data.

Method used

By establishing a mapping relationship between the logical block and the physical block between the host and the solid-state drive, the host performs system garbage collection in units of logical blocks, so that the data in the physical block corresponding to the logical block becomes invalid, thereby eliminating write amplification and avoiding data transfer.

Benefits of technology

Effectively eliminate write amplification, improve the performance and service life of the solid-state drive, reduce waste of storage resources, ensure that data writes are strictly aligned with physical blocks, increase write bandwidth and reduce power consumption of the entire disk.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024118559_24072025_PF_FP_ABST
    Figure CN2024118559_24072025_PF_FP_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of storage. Disclosed are a solid-state storage system, a solid-state disk and a host. The solid-state storage system comprises a host and a solid-state disk; the host comprises at least one logical block; the solid-state disk comprises at least one physical block; the space of each logical block comes from an integer number of physical blocks among the at least one physical block, the logical block corresponding to logical addresses of the integer number of physical blocks; the host performs system garbage collection in granularities of the capacity of the logical block. After the host has completed the system garbage collection, all of data in the integer number of physical blocks corresponding to the logical block is in an invalid state, that is, there is no valid data in the integer number of physical blocks, so that the solid-state disk can directly erase the physical blocks without data migration. The present application can eliminate write amplification of solid-state disks without over-provisioning for the solid-state disks, so as to reduce waste of storage resources of the solid-state disks, improve the performance of the solid-state disks and prolong the service lives of the solid-state disks.
Need to check novelty before this filing date? Find Prior Art

Description

Solid-state storage system, solid-state drive, and host

[0001] This application claims priority to Chinese patent application No. 202410068315.3 filed on January 16, 2024, entitled “Solid-state storage system, solid-state hard drive, and host,” the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present application relates to the field of storage technology, and in particular to a solid-state storage system, a solid-state hard disk, and a host. Background Art

[0003] A solid-state storage system includes a host and a solid-state disk (SSD). The SSD includes multiple physical blocks, each of which includes multiple pages. The SSD stores data in pages and erases data in physical blocks. When the host writes data to the SSD, the SSD writes the corresponding data to the physical blocks sequentially according to the time sequence of the received read and write (IO) requests. However, the IOs sent by the host to the SSD within a certain period of time may be disorganized and may originate from different applications or clients. Therefore, the same physical block of the SSD may store data from different sources. When the host performs garbage collection (GC), it releases some data based on its source. For an SSD, after GC, the physical block contains both released invalid data and unreleased valid data. Therefore, not all data in the physical block is released. Moreover, due to the Nand characteristics of the SSD's storage medium, the SSD cannot directly write new data over the location of invalid data. When the SSD performs its own garbage collection (GC), it writes valid data from the physical block to a blank physical block, rendering all the data in the original physical block invalid. The entire physical block is then erased, and the resulting blank physical block is used for subsequent data writing. Because the SSD needs to rewrite valid data during its own GC, write amplification (WA) occurs (the actual amount of data written is greater than the amount written by the user), which reduces the performance and lifespan of the SSD.

[0004] In related technologies, when a host writes data to an SSD, it identifies the popularity of the data, and the SSD writes data with similar popularity to the same physical block on the SSD. However, this method cannot fully guarantee that the host will invalidate all data in the physical block during a single garbage collection (GC). Consequently, the SSD still needs to move valid data within the physical block, which limits the reduction in write amplification and performance improvement.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a solid-state storage system, a solid-state hard drive, and a host computer, which can eliminate write amplification of the solid-state hard drive and improve the performance of the solid-state hard drive. The technical solution is as follows.

[0007] In a first aspect, a solid-state storage system is provided, the solid-state storage system comprising a host and a solid-state hard disk;

[0008] The host includes at least one logical block, the solid-state drive includes at least one physical block, the space of each logical block comes from an integer number of physical blocks in the at least one physical block, there is a mapping relationship between the logical block and the logical addresses of the integer number of physical blocks, and the host is used to perform system garbage collection based on the capacity of the logical block.

[0009] Through the above system, the system garbage collection unit is aligned to the logical block, and the logical block is aligned to the physical block. Therefore, after the host completes the system garbage collection, the data in the integer number of physical blocks corresponding to the logical block can be changed to an invalid state, that is, there is no valid data in this integer number of physical blocks, so the solid-state drive can directly erase these physical blocks without the need for the solid-state drive to move data again. Therefore, the write amplification of the solid-state drive can be eliminated and the solid-state drive does not need to reserve space (over-provisioning, OP), thereby reducing the waste of storage resources of the solid-state drive, improving the performance of the solid-state drive and extending its service life.

[0010] Optionally, the host is also used to:

[0011] Sending a first write request to the solid-state drive, where the first write request carries a logical block address LBA;

[0012] This SSD is also used for:

[0013] Determine, based on the LBA carried by the first write request and the capacity of each logical block, a first logical block in the at least one logical block and an offset address of the LBA carried by the first write request in the first logical block;

[0014] Based on the offset address, the data corresponding to the first write request is written into the physical block corresponding to the first logical block.

[0015] The capacity of each logical block is equal to the number of physical blocks corresponding to each logical block multiplied by the capacity of one physical block.

[0016] In some embodiments, when the first write request is legal, the solid-state drive writes the data corresponding to the first write request into the physical block corresponding to the first logical block based on the offset address. The legality of the first write request means that the first write request satisfies the concurrency constraint between logical blocks and satisfies the write order constraint within the logical block. The first write request satisfies the concurrency constraint between logical blocks, which means that the current concurrency of the solid-state drive is less than or equal to the target concurrency between logical blocks. The first write request satisfies the write order constraint within the logical block, which means that the data corresponding to the first write request is written in a sequential append write manner, and does not support empty data, repeated writes, and in-place data modification.

[0017] Optionally, the solid-state drive is used for:

[0018] When the status of the first logical block is currently writable and the LBA carried by the first write request does not overlap with the LBA corresponding to the written data, the data corresponding to the first write request is written into the physical block corresponding to the first logical block based on the offset address.

[0019] The solid-state drive determines whether the constraint on the number of concurrent writes between logical blocks is satisfied by the state of the first logical block corresponding to the first write request, wherein the states of the logical blocks include: currently not writable, currently writable, full, and stopped writing. If the state of the first logical block corresponding to the first write request is currently writable, then the first write request satisfies the constraint on the number of concurrent writes between logical blocks. If the state of the first write request is not currently writable, then the first write request does not satisfy the constraint on the number of concurrent writes between logical blocks and is therefore illegal.

[0020] Optionally, the first write request carries an active block identifier, and the solid-state drive stores a first block status table, the first block status table being used to maintain a status of an active block in the at least one logical block, the active block being a logical block that is currently writable;

[0021] This SSD is also used for:

[0022] Based on the active block identifier carried in the first write request, the state of the first logical block is queried in the first block state table.

[0023] If the state of any logical block in the first block status table changes from currently writable to fully written or stopped writing, the solid-state drive removes the state of the logical block from the first block status table. If the first block status table contains an active block identifier carried by the first write request, the state of the first logical block is currently writable.

[0024] Optionally, the solid-state drive stores a second block status table, and the second block status table is used to maintain the status of the at least one logical block;

[0025] This SSD is also used for:

[0026] The status of the first logical block is queried in the second block status table.

[0027] The solid state drive queries the second block status table based on the identifier of the first logic block to obtain the status of the first logic block.

[0028] Optionally, the solid-state drive is also used for:

[0029] In the case that the first write request is illegal, a write failure message for the first write request is reported to the host through an asynchronous event.

[0030] SSDs use write-back to process write requests. Write-back means that after the corresponding data to be written is successfully transferred to the SSD, the SSD first returns a write completion message to the host, and then asynchronously executes the corresponding write operation, thereby reducing the response latency of the solid-state storage system to the user system.

[0031] The SSD writes the data corresponding to the first write request into a cache. The SSD caches data that has returned a write completion message to the host but has not yet been written, so that the host can read the data cached by the SSD after receiving a write failure message and then re-initiate a write request for the data that failed to be written.

[0032] Through the above system, exceptions can be handled normally while retaining the efficient data writing method of write-back.

[0033] Optionally, the host is also used to:

[0034] Receive the write failure message;

[0035] Setting the first logic block to a stop-write state;

[0036] A second logical block is determined from the at least one logical block, and the write request is resent based on the second logical block.

[0037] The second logical block is a logical block in the at least one logical block included in the host that is in an unwritten state, that is, a blank logical block. The host reads the data at which the write failed from the cache of the solid-state drive based on the location of the write failure indicated by the write failure message; the solid-state drive re-initiates a write request for the data at which the write failed based on the second logical block. Re-issuing the write request based on the second logical block means that the LBA carried in the re-sent write request corresponds to the second logical block.

[0038] Through the above system, the solid-state drive will cache data that has not been written, and when the first write request is illegal, it will report a write failure message through an asynchronous event and inform the host of the location where the write failed. The host can then read the data that failed to be written from the cache of the solid-state drive and write it to the physical block corresponding to other logical blocks. That is, the solid-state drive cannot write data to other locations in the solid-state drive on its own after the first write request fails, but requires the host to determine the logical block that has not been written, and then resend the write request to ensure that the written data is strictly aligned with the physical block.

[0039] Optionally, the solid-state drive is also used for:

[0040] If a physical block in the solid-state drive is damaged and there is no replacement physical block, the number of lost logical blocks is reported to the host;

[0041] The host is further configured to re-determine the system available capacity and the number of available logical blocks based on the number of the lost logical blocks.

[0042] Among them, the host does not perceive the status of the physical blocks in the solid-state drive, and the solid-state drive shields the storage system from issues such as the reliability, concurrency, and wear leveling of the Nand media.

[0043] In some embodiments, replaceable physical blocks are reserved in the solid-state drive. In a scenario where the logical addresses of physical blocks with the same physical block identifiers in multiple groups (planes) are mapped to the same logical block, if a physical block is a bad block, the solid-state drive replaces the bad block with a replaceable physical block on the same plane as the bad block.

[0044] Through the above system, the solid-state drive can report asynchronous events such as logical block loss due to bad blocks, and then the host can adjust the system's available capacity and the number of available logical blocks based on these asynchronous events, and then cooperate with the solid-state drive to ensure that the normal operation of the solid-state storage system is not affected by the capacity loss of the solid-state drive.

[0045] Optionally, the solid-state drive is also used for:

[0046] In response to a scanning operation by the host, reporting operating parameters of the solid-state drive to the host;

[0047] The host is further used to establish a mapping relationship between the garbage collection unit and the logical blocks of the system and determine the target concurrency number between the logical blocks based on the operating parameters of the solid state drive and the application capabilities of the solid state storage system.

[0048] The host scans the solid-state drive connected to the host when the solid-state storage system is initialized. For example, the host scans the solid-state drive connected to the host after powering on. In some embodiments, the host periodically scans the solid-state drive to regularly obtain the operating parameters of the solid-state drive, thereby being able to promptly learn changes in the operating parameters of the solid-state drive. The embodiments of the present application do not limit the timing of the host scanning the solid-state drive.

[0049] The application capability of a solid-state storage system refers to the ability of the solid-state storage system to process storage services.

[0050] Optionally, the operating parameters reported by the solid-state drive include the capacity of the physical blocks in the solid-state drive and the maximum concurrency supported by the solid-state drive, where the maximum concurrency indicates the maximum number of logical blocks that can be written to simultaneously by the solid-state drive;

[0051] This host is used to:

[0052] Determine the number of physical blocks corresponding to each logical block and the target concurrency between logical blocks based on the application capabilities of the solid-state storage system, the capacity of the physical block, and the maximum concurrency supported by the solid-state drive;

[0053] Based on the number of physical blocks corresponding to each logical block, a mapping relationship between the system garbage collection unit and the logical blocks is established.

[0054] The minimum capacity granularity of a logical block is aligned to the capacity of a physical block. The target concurrency between logical blocks refers to the target number of logical blocks that can be written concurrently on the SSD, that is, the number of logical blocks that are simultaneously writable on the SSD. This target concurrency is less than or equal to the maximum concurrency supported by the SSD.

[0055] Through the above system, the host in the solid-state storage system can obtain operating parameters such as the capacity of the physical block in the solid-state hard disk and the maximum number of concurrency supported by the solid-state hard disk, use the capacity of the physical block as the minimum capacity granularity of the logical block, and can decide the capacity of the logical block and the number of concurrent logical blocks based on these parameters and the application capabilities of the solid-state storage system, which can not only meet the application capabilities of the solid-state storage system, but also ensure the high write performance of the solid-state hard disk.

[0056] In a second aspect, a data writing device is provided, which is applied to a solid-state hard disk in a solid-state storage system. The solid-state storage system also includes a host. The device includes at least one functional module, and the at least one functional module is used to perform the function of the solid-state hard disk in the solid-state storage system provided in the first aspect or any optional method of the first aspect.

[0057] In a third aspect, a data writing device is provided, which is applied to a host in a solid-state storage system, and the solid-state storage system also includes a solid-state hard disk. The device includes at least one functional module, and the at least one functional module is used to perform the function of the host in the solid-state storage system provided in the first aspect or any optional method of the first aspect.

[0058] In a fourth aspect, a solid-state hard drive is provided, comprising an interface, a processor and a storage medium, wherein the interface is used to communicate with a host, the storage medium is used to store data, and the processor is used to implement the functions of the solid-state hard drive in the solid-state storage system provided by the first aspect or any optional method in the first aspect.

[0059] In a fifth aspect, a host is provided, comprising an interface, a processor and a memory, wherein the interface is used to communicate with a solid-state hard disk, the memory is used to store data, and the processor is used to implement the functions of a host in a solid-state storage system provided in the first aspect or any optional method in the first aspect.

[0060] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] FIG1 is a schematic structural diagram of a solid-state storage system provided in an embodiment of the present application;

[0062] FIG2 is a flowchart of a process for establishing a mapping relationship in a data writing method provided in an embodiment of the present application;

[0063] FIG3 is a flow chart of a data writing method provided in an embodiment of the present application;

[0064] FIG4 is a schematic diagram of a method for determining the state of a logic block provided in an embodiment of the present application;

[0065] FIG5 is a schematic diagram of a method for determining the state of a logic block provided in an embodiment of the present application;

[0066] FIG6 is a schematic diagram of a method for controlling data writing within a logic block provided by an embodiment of the present application;

[0067] FIG7 is a flow chart of a data writing method provided in an embodiment of the present application;

[0068] FIG8 is a schematic diagram of a data write failure provided by an embodiment of the present application;

[0069] FIG9 is a schematic diagram of a mapping rule between logical addresses of a logical block and a physical block provided by an embodiment of the present application;

[0070] FIG10 is a flow chart of a data writing method provided in an embodiment of the present application;

[0071] FIG11 is a flow chart of a data writing method provided in an embodiment of the present application;

[0072] FIG12 is a schematic structural diagram of a data writing device provided in an embodiment of the present application;

[0073] FIG13 is a schematic structural diagram of a data writing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0074] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0075] First, the implementation environment of this application is introduced.

[0076] FIG1 is a schematic diagram of the structure of a solid-state storage system provided in an embodiment of the present application. As shown in FIG1 , the solid-state storage system includes a host 101 and a solid-state drive 102. In some embodiments, the solid-state storage system is a single computing device or server, the host 101 is the part of the computing device or server from which the solid-state drive is stripped, and the solid-state drive 102 is a solid-state drive on the computing device or server. In other embodiments, the solid-state storage system is a large storage system composed of a storage array and a server or a storage array and a storage array controller, for example, a distributed storage system or a centralized storage system, the host 101 is a server or storage array controller in a large storage system, and the solid-state drive 102 is a solid-state drive in the storage array. The host 101 and the solid-state drive 102 communicate with each other through a bus via a host interface.

[0077] The host 101 includes a central processing unit (CPU), memory, a host interface, and a bus. For example, the host 101 can query the solid-state drive 102 and receive operating parameters of the solid-state drive 102 reported to the host by the solid-state drive 102. The host 101 can receive data written by the user system and send a write request to the solid-state drive. The write request carries a logical block address (LBA). The solid-state drive 102 writes the data corresponding to the write request to a physical block in the solid-state drive 102 based on the LBA carried in the write request. The host 101 can also perform garbage collection, releasing data in the solid-state drive, thereby reclaiming the storage resources of the solid-state drive.

[0078] Among them, the solid-state drive 102 includes a solid-state drive controller and a storage medium, and the solid-state drive controller includes a CPU, a random access memory (RAM), a host interface, a storage medium interface and a bus. Among them, the storage medium includes multiple physical blocks. The solid-state drive 102 can be an embedded multi-media card (embedded multi-media card, eMMC), universal flash storage (universal flash storage, UFS), serial attached SCSI solid state drives (serial attached SCSI solid state drives, SAS SSD), serial advanced technology attachment solid state drives (serial advanced technology attachment solid state drives, SATA SSD), non-volatile memory bus (non-volatile memory express, NVMe), NAND flash memory (NAND flash), or a disk, etc., and the embodiment of the present application does not limit this. The number of the solid-state drives 102 can be one or more, and the embodiment of the present application does not limit the number of solid-state drives. The bus between the SSD controller and the storage medium in the SSD 102 can be an open NAND flash interface (ONFI), a toggle, a common flash interface (CFI), a serial peripheral interface (SPI), or a DDR bus, etc., which is not limited in the embodiments of the present application. For example, the SSD 102 can report its own operating parameters to the host 101; the SSD 102 can receive a write request sent by the host 101 and write the data corresponding to the write request to a physical block in the SSD 102 based on the LBA carried in the write request. In some embodiments, the SSD 102 also stores a flash translation layer (FTL), which is used to maintain the conversion relationship between the LBA and the physical address in the SSD 102. After the host 101 performs garbage collection, the SSD 102 can erase the recycled physical blocks to facilitate subsequent data writing.

[0079] The bus between the host 101 and the solid-state drive 102 can be a high-speed serial computer expansion bus standard (Peripheral Component Interconnect Express, PCIe), UFS, eMMC, NVMe, SAS or SATA, etc., which is not limited in the embodiments of the present application. For ease of representation, only one line is used to represent the bus in Figure 1, but this does not mean that there is only one bus or one type of bus.

[0080] In the above-mentioned solid-state storage system, the host 101 includes at least one logical block, and the solid-state drive 102 includes at least one physical block. The space of each logical block comes from an integer number of physical blocks in the at least one physical block. The logical block corresponds to the logical address of the integer number of physical blocks, and the host 101 manages the system space and performs system garbage collection in units of logical block capacity. In this solid-state storage system, the host performs system garbage collection in the granularity of the capacity of the logical block. After the host completes the system garbage collection, the data in the integer number of physical blocks corresponding to the logical block are all in an invalid state, that is, there is no valid data in these integer number of physical blocks, so the solid-state drive can directly erase these physical blocks without the need for the solid-state drive to transfer data. Therefore, the write amplification of the solid-state drive can be eliminated and the solid-state drive does not need OP, thereby reducing the waste of storage resources of the solid-state drive, improving the performance of the solid-state drive and extending its service life.

[0081] Based on the above-mentioned solid-state storage system, an embodiment of the present application provides a data writing method, in which the host first establishes a mapping relationship between the system garbage collection unit and the logical block and determines the target concurrency number between the logical blocks based on the operating parameters of the solid-state hard disk and the application capabilities of the solid-state storage system. Establishing the mapping relationship between the system garbage collection unit and the logical block is to determine the capacity of the logical block, and the determined capacity of the logical block is used as the size of the system garbage collection unit; the solid-state hard disk establishes a mapping rule between the logical block and the logical address of the physical block based on the capacity of the logical block determined by the host and the target concurrency number between the logical blocks; the user system writes data to the solid-state storage system, the host receives the data, and sends a first write request to the solid-state hard disk; after receiving the first write request, the solid-state hard disk writes the data corresponding to the first write request into the physical block. In some embodiments, when the solid-state drive writes data to a physical block, it needs to satisfy the constraints of the mapping relationship between the physical block and the logical block. If the first write request satisfies the constraints of the mapping relationship, that is, the first write request is legal, the solid-state drive writes the data corresponding to the first write request; if the first write request does not satisfy the constraints of the mapping relationship, that is, the first write request is illegal, the solid-state drive reports a write failure message for the first write request to the host, and the host processes the write failure message. In some embodiments, the solid-state drive writes data in a write-back manner, that is, after receiving the first write request, the solid-state drive first returns a write completion message for the first write request to the host, and then writes the data corresponding to the first write request to the physical block. If the first write request is illegal, the solid-state drive returns a write failure message for the first write request to the host through an asynchronous event.

[0082] The process of the above method is described in detail below. First, the process of establishing the mapping relationship in the above data writing method is introduced. Figure 2 is a flowchart of the process of establishing the mapping relationship in a data writing method provided by an embodiment of the present application. Taking the process of interaction between the host and the solid-state drive as an example, the process includes the following steps 201 to 204.

[0083] 201. The host scans the solid state drive.

[0084] The host scans the solid-state drive connected to the host when the solid-state storage system is initialized. For example, the host scans the solid-state drive connected to the host after powering on. In some embodiments, the host periodically scans the solid-state drive to regularly obtain the operating parameters of the solid-state drive, thereby being able to promptly learn changes in the operating parameters of the solid-state drive. The embodiments of the present application do not limit the timing of the host scanning the solid-state drive.

[0085] 202. The solid state drive reports operating parameters of the solid state drive to the host in response to a scanning operation of the host.

[0086] Among them, the capacity of the physical block in the solid-state drive refers to the capacity of a physical block in the solid-state drive. In some embodiments, the operating parameters reported by the solid-state drive include the capacity of the physical block in the solid-state drive and the maximum concurrency supported by the solid-state drive. Among them, the maximum concurrency supported by the solid-state drive indicates the maximum number of logical blocks that the solid-state drive can write to at the same time. In some embodiments, the operating parameters reported by the solid-state drive also include the reference logical block capacity. When the capacity of the logical block is N times the reference logical block capacity, the performance of the solid-state drive can be maximized while meeting the system application capabilities, wherein N is an integer greater than or equal to 1. The operating parameters reported by the solid-state drive in the embodiments of the present application are not limited to this.

[0087] 203. The host establishes a mapping relationship between the system garbage collection unit and the logical blocks and determines a target concurrency number between the logical blocks based on the operating parameters of the solid-state hard disk and the application capabilities of the solid-state storage system.

[0088] The application capability of a solid-state storage system refers to the ability of the solid-state storage system to process storage services.

[0089] Among them, taking the operating parameters reported by the solid-state hard drive as the capacity of the physical block in the solid-state hard drive and the maximum concurrency number supported by the solid-state hard drive as an example, the host establishes a mapping relationship between the system garbage collection unit and the logical block and determines the target concurrency number between the logical blocks based on the operating parameters of the solid-state hard drive and the application capabilities of the solid-state storage system. The process includes the following steps 2031 and 2032.

[0090] 2031. According to the application capability of the solid-state storage system, based on the capacity of the physical block and the maximum concurrency supported by the solid-state drive, determine the number of physical blocks corresponding to each logical block and the target concurrency between the logical blocks.

[0091] The target concurrency between logical blocks refers to the number of logical blocks that can be written concurrently in the SSD, that is, the number of logical blocks in the SSD that are simultaneously writable. This target concurrency is less than or equal to the maximum concurrency supported by the SSD.

[0092] The capacity of the physical block is the minimum capacity granularity of the logical block. In some embodiments, the solid-state drive also reports the reference logical block capacity to the host, and the host uses N times the reference logical block capacity as the capacity of the logical block. When the capacity of the logical block is N times the reference logical block capacity, the performance of the solid-state drive can be maximized while meeting the system application capability, wherein N is an integer greater than or equal to 1. In some embodiments, the reference logical block capacity is equal to the capacity of the physical block in the solid-state drive multiplied by the number of planes in the solid-state drive, which is not limited in the embodiments of the present application.

[0093] 2032. Based on the capacity of each logical block, establish a mapping relationship between the system garbage collection unit and the logical block.

[0094] It should be noted that the above steps 201 to 203 are described by taking the host scanning the solid-state hard drive and the solid-state hard drive reporting the operating parameters as an example. In some embodiments, the host is configured with the operating parameters of the solid-state hard drive, and the host establishes a mapping relationship based on the configured operating parameters of the solid-state hard drive. In other embodiments, the host is configured with the operating parameters of the solid-state hard drive. After the host is powered on, it first establishes a mapping relationship based on the configured operating parameters, and executes step 204 to send the mapping relationship to the solid-state hard drive; thereafter, the host periodically scans the solid-state hard drive connected to the host, and the solid-state hard drive periodically reports the operating parameters. When the operating parameters reported by the solid-state hard drive are updated relative to the operating parameters configured in the host, the host updates the configured operating parameters of the solid-state hard drive and re-establishes the mapping relationship based on the updated operating parameters, executes step 204, and sends the new mapping relationship to the solid-state hard drive. The embodiments of the present application do not limit the way in which the host obtains the operating parameters of the solid-state hard drive.

[0095] In some embodiments, the solid-state drive also reports the available capacity of the solid-state drive to the host. The host determines the system available capacity and the number of available logical blocks based on the available capacity reported by the solid-state drive and the number of physical blocks corresponding to the logical blocks (that is, the capacity of the logical blocks).

[0096] 204. The host sends the mapping relationship between the system garbage collection unit and the logical block and the target concurrency number between the logical blocks to the solid state drive.

[0097] In some embodiments, after the solid-state drive receives the mapping relationship between the system garbage collection unit and the logical block and the target concurrency number between the logical blocks, it establishes a mapping rule between the logical blocks and the logical addresses of the physical blocks based on the number of physical blocks corresponding to the logical blocks and the target concurrency number, and generates a physical block-level FTL table based on the mapping rule between the logical blocks and the logical addresses of the physical blocks. The FTL table is used to manage the status of the physical blocks of the entire disk.

[0098] In the above method, the host in the solid-state storage system can obtain operating parameters such as the capacity of the physical block in the solid-state hard disk and the maximum number of concurrency supported by the solid-state hard disk, use the capacity of the physical block as the minimum capacity granularity of the logical block, and can decide the capacity of the logical block and the number of concurrent logical blocks based on these parameters and the application capabilities of the solid-state storage system, which can not only meet the application capabilities of the solid-state storage system, but also ensure the high write performance of the solid-state hard disk.

[0099] The following describes the data writing process in the above data writing method, taking the case where the first write request is legitimate and the solid-state drive writes data in a write-back manner as an example. FIG3 is a flow chart of a data writing method provided by an embodiment of the present application, which is applied to the above solid-state storage system and includes the following steps 301 to 305.

[0100] 301. A host receives a data write request sent by a user system to a solid-state storage system, and generates a first write request for a solid-state drive based on the data write request. The host includes at least one logical block, and the space of each logical block comes from an integer number of physical blocks in the solid-state drive. There is a mapping relationship between the logical block and the logical addresses of the integer number of physical blocks. The host is used to perform system garbage collection, and the size of the system garbage collection unit is aligned to the capacity of the logical block.

[0101] Among them, the data write request sent by the user system to the solid-state storage system carries the logical address in the user system, and the host generates a first write request for the solid-state hard disk based on the data write request. The process includes: converting the logical address carried by the data write request into a logical block address LBA in the solid-state storage system; based on the logical block address LBA, generating a first write request for the solid-state hard disk.

[0102] 302. The host sends a first write request to the solid-state drive. The first write request carries a logical block address LBA.

[0103] Among them, the LBA carried by the first write request is the starting LBA corresponding to the data to be written, and the first write request also carries the data length of the data to be written, and the starting LBA and the data length of the data to be written indicate the LBA range corresponding to the data to be written. In some embodiments, for the same logical block, the host sends a write request to the solid-state drive in the order of the LBAs carried by the first write request. For example, the LBA range corresponding to logical block A is 1 to 4, then the host sends a write request to the solid-state drive in the order of LBA 1, 2, 3, 4. In other embodiments, the write requests sent by the host to the solid-state drive are out of order, that is, the host does not send write requests to the solid-state drive in the order of the LBAs carried by the write requests. The embodiments of the present application do not limit the order in which the host sends write requests.

[0104] 303. The solid-state drive returns a write completion message for the first write request to the host.

[0105] SSDs use write-back to process write requests. After the corresponding data to be written is successfully transferred to the SSD, the SSD first returns a write completion message to the host, and then asynchronously executes the corresponding write operation, thereby reducing the response latency of the solid-state storage system to the user system.

[0106] The SSD writes the data corresponding to the first write request into a cache. The SSD caches data that has returned a write completion message to the host but has not yet been written, so that the host can read the data cached by the SSD after receiving a write failure message and then re-initiate a write request for the data that failed to be written.

[0107] 304. The solid-state drive determines a first logical block in at least one logical block and an offset address of the LBA carried by the first write request in the first logical block based on the LBA carried by the first write request and the capacity of each logical block.

[0108] The capacity of each logical block is equal to the number of physical blocks corresponding to each logical block multiplied by the capacity of one physical block. The identification (ID) of the first logical block can be determined by the following formula (1).

[0109] In the above formula (1), Indicates rounding down; "ID" indicates the identifier of the first logical block, "LBA" indicates the LBA carried by the first write request, "sector size" indicates the capacity of a sector in a physical block, and "block size" indicates the capacity of a logical block.

[0110] The offset address of the LBA carried by the first write request in the first logical block can be determined by the following formula (2): offset(LBA×sectorsize)%blocksize (2)

[0111] In the above formula (2), "%" represents a modulo operation, and "offset" represents an offset address in the first logical block.

[0112] The following is an example of the operation process corresponding to the above formula (1) and formula (2). For example, the capacity of a physical block is 40MB (megabytes), and the space of a logical block comes from a physical block, then the capacity of the logical block is 40MB. The capacity of each sector in the physical block (sector size) is 4K (kilobytes), and the LBA carried by the first write request is 124356, then the identifier of the first logical block is The offset address of the LBA carried by the first write request within the first logical block is offset=(123456×4)%(40×1024)=2304.

[0113] It should be noted that the calculation process shown in the above formula (1) and formula (2) is only exemplary, and the embodiments of the present application do not limit the specific calculation process.

[0114] 305. If the first write request is valid, the solid state drive writes the data corresponding to the first write request into the physical block corresponding to the first logical block based on the offset address.

[0115] The first write request being legitimate means that the first write request satisfies the constraints on the number of concurrent writes between logical blocks and the write order within a logical block. The first write request satisfying the constraints on the number of concurrent writes between logical blocks means that the current concurrency of the solid-state drive is less than or equal to the target concurrency between logical blocks. The first write request satisfying the constraints on the write order within a logical block means that the data corresponding to the first write request is written in a sequential append-write manner, and void data, duplicate writes, and in-place data modifications are not supported.

[0116] In some embodiments, the solid-state drive determines whether the constraint on the number of concurrent writes between logical blocks is satisfied by the state of the first logical block corresponding to the first write request, wherein the states of the logical blocks include: currently not writable, currently writable, full, and stopped writing. If the state of the first logical block corresponding to the first write request is currently writable, then the first write request satisfies the constraint on the number of concurrent writes between logical blocks. If the state of the first write request is not currently writable, then the first write request does not satisfy the constraint on the number of concurrent writes between logical blocks and the first write request is illegal.

[0117] The following first introduces how the solid state drive determines the status of the first logical block.

[0118] In some embodiments, the first write request carries an active block identifier, and the solid-state drive stores a first block status table, which is used to maintain the status of the active block in at least one logical block. The active block refers to a logical block whose status is currently writable. If the status of any logical block in the first block status table changes from currently writable to full or stopped writing, the solid-state drive removes the status of the logical block from the first block status table; the solid-state drive queries the status of the first logical block in the first block status table based on the active block identifier carried by the first write request. Wherein, if the active block identifier carried by the first write request exists in the first block status table, the status of the first logical block is currently writable. The following is an example of the first method using Figure 4. Figure 4 is a schematic diagram of a method for determining the status of a logical block provided in an embodiment of the present application. As shown in Figure 4, the solid-state drive determines the identifier of the first logical block based on the LBA carried by the first write request. At the same time, the solid-state drive queries the status of the first logical block in the first block status table based on the active block identifier (active ID) carried by the first write request. It should be noted that Figure 4 is an example of an example in which the solid-state drive simultaneously executes the process of determining the identification of the first logical block and the process of determining the state of the first logical block when the state of the first logical block is determined in this way. In some embodiments, the solid-state drive first executes the process of determining the identification and offset address of the first logical block, and then executes the process of determining the state of the first logical block; in other embodiments, the solid-state drive first executes the process of determining the state of the first logical block, and then executes the process of determining the identification and offset address of the first logical block; the embodiments of the present application do not limit the execution order of these two processes.

[0119] In other embodiments, the solid-state drive stores a second block status table, which is used to maintain the status of at least one logical block included in the host, that is, the status of all logical blocks; the solid-state drive queries the status of the first logical block in the second block status table. Among them, the solid-state drive queries the second block status table based on the identifier of the first logical block to obtain the status of the first logical block. The second method is illustrated below with reference to Figure 5. Figure 5 is a schematic diagram of a method for determining the status of a logical block provided in an embodiment of the present application. As shown in Figure 5, the solid-state drive determines the identifier of the first logical block based on the LBA carried by the first write request, and then queries the second block status table based on the identifier of the first logical block to obtain the status of the first logical block.

[0120] The following describes how a solid-state drive controls the write order within a logical block.

[0121] In some embodiments, when the host sends write requests to the solid-state drive in the order of LBAs carried in the write requests, the solid-state drive writes the data corresponding to the first write request into the physical block corresponding to the logical block in the order of the received write requests.

[0122] In this embodiment, the write request carries the starting LBA and data length corresponding to the data to be written. For the same logical block, if the LBA range corresponding to the data to be written carried by the first write request is continuous with the LBA range corresponding to the data to be written carried by the previous write request received by the solid-state drive, then the first write request satisfies the write order constraint within the logical block, that is, the first write request is legal; if the LBA range corresponding to the data to be written carried by the first write request is not continuous with the LBA range corresponding to the data to be written carried by the previous write request received by the solid-state drive, then the first write request does not satisfy the write order constraint within the logical block, that is, the first write request is illegal.

[0123] In other embodiments, when the host sends write requests to the solid-state drive out of order, for the same logical block, the solid-state drive sorts the LBAs carried by the received multiple write requests. If the smallest LBA carried by the multiple write requests after sorting is the smallest unwritten LBA corresponding to the logical block, it means that the sorting of the multiple write requests is complete, and the solid-state drive writes the data corresponding to the sorted multiple write requests. If the smallest LBA carried by the multiple write requests after sorting is greater than the smallest unwritten LBA corresponding to the logical block, it means that the sorting of the multiple write requests is not complete, and the solid-state drive continues to receive write requests and writes data after the sorting of the unwritten write requests is complete. For example, the LBA range corresponding to the logical block is 1 to 5, and the LBA addresses carried by the three write requests received by the solid-state drive are 2, 3, and 1 respectively. The solid-state drive sorts the three write requests, and the smallest LBA after sorting is 1, which is the smallest unwritten LBA corresponding to the logical block. The solid-state drive writes the data corresponding to the three sorted write requests. The SSD subsequently receives write requests carrying LBAs 5 and 4, respectively. The SSD sorts these two write requests. After sorting, the smallest LBA carried by the two write requests is 4, which is the smallest unwritten LBA corresponding to the logical block. The SSD writes the data corresponding to the two sorted write requests.

[0124] In this embodiment, for the same logical block, if the LBA carried by the first write request does not overlap with the LBA corresponding to the written data, then the first write request satisfies the write order constraint within the logical block, that is, the first write request is legal; if the LBA carried by the first write request overlaps with the LBA corresponding to the written data, then the first write request does not meet the write order constraint within the logical block, that is, the first write request is illegal; if the number of unsorted write requests exceeds the target threshold, the solid-state drive reports a write failure message to the host, and the write failure message indicates that the write request with the smallest LBA carried by the unsorted write requests has an error. The fact that the number of unsorted write requests exceeds the target threshold indicates that the amount of unwritten data is greater than the unwritten capacity in the logical block. If the maximum LBA corresponding to the logical block has been written, then the logical block is full.

[0125] In some further embodiments, when a host sends write requests out of order to a solid-state drive, the solid-state drive stores a flash translation table (FTL), which is used to maintain the conversion relationship between LBAs and physical addresses in the solid-state drive, as well as the write status of the physical addresses in the solid-state drive, where the write status of the physical addresses in the solid-state drive includes "unwritten" and "written." Before writing data to the physical block corresponding to the logical block, the solid-state drive erases the physical block corresponding to the logical block to ensure that the write status recorded in the FTL for the physical addresses corresponding to the logical block is "unwritten." After receiving a first write request, the solid-state drive determines the LBA carried by the first write request based on the FTL, and determines the physical address corresponding to the LBA. If the write status of the physical address is "unwritten," the solid-state drive writes the data corresponding to the first write request to the physical address, modifies the write status of the physical address in the FTL to "written," and records the total amount of data written to the logical block, so as to determine whether the logical block is full based on the total amount of data written and the capacity of the logical block.

[0126] In this embodiment, for the same logical block, if the write status of the physical address corresponding to the LBA carried by the first write request recorded in the FTL is not written, and the sum of the data amount corresponding to the first write request and the data amount already written is less than or equal to the capacity of the logical block, then the first write request satisfies the write order constraint within the logical block, that is, the first write request is legal; if the write status of the physical address corresponding to the LBA carried by the first write request recorded in the FTL is written, or the sum of the data amount corresponding to the first write request and the data amount already written is greater than the capacity of the logical block, then the first write request does not satisfy the write order constraint within the logical block, that is, the first write request is illegal.

[0127] The third method is described below using Figure 6 as an example. Figure 6 is a schematic diagram of a data write control method within a logical block provided by an embodiment of the present application. As shown in Figure 6, assuming that logical block A corresponds to 10 sectors in a solid-state drive, the LBAs corresponding to these 10 sectors are 1 to 10, and the solid-state drive maintains an FTL table. Before the solid-state drive writes data to the 10 sectors corresponding to logical block A, it clears the write status corresponding to these 10 sectors in the FTL table. At this time, the write status of these 10 sectors can be represented by the FTL table 601 in Figure 6. When the solid-state drive receives three write requests, the LBAs carried by these three write requests are 2, 3, and 5 respectively. The solid-state drive writes the data carried by these three write requests to the corresponding sectors, and records in the FTL table that the sectors with LBAs 2, 3, and 5 have been written, and records that the three sectors have been written and the total amount of data corresponding to these three sectors. The FTL at this time is shown in Table 602 in Figure 6; when the solid-state drive receives three more write requests, the LBAs carried by these three write requests are 4, 1, and 7 respectively. The solid-state drive writes the data carried by these three write requests to the corresponding sectors, and records in the FTL table that the sectors with LBAs 4, 1, and 7 have been written, and records that six sectors have been written and the total amount of data corresponding to these six sectors. The FTL at this time is shown in Table 603 in Figure 6; by analogy, if the LBAs carried by the four subsequent write requests received by the solid-state drive do not repeat the LBAs corresponding to the written data, then the 10 sectors corresponding to logical block A are all full, and at this time these 10 write requests all meet the write order constraints within the logical block, that is, these 10 write requests are all legal; if a write request carrying a duplicate LBA is received, for example, the LBA carried is 7, at this time the FTL records the write status of the sector corresponding to LBA 7 as having been written, then the write request is illegal; if the sum of the amount of data corresponding to the received write request and the amount of data already written exceeds the capacity of the logical block, then the write request is illegal.

[0128] It should be noted that the above-mentioned method of determining whether the first write request is legal is from the perspective of concurrency control between logical blocks and write data control within a logical block. In some embodiments, if the physical address corresponding to the first write request is wrong, for example, the Nand medium at the physical address is wrong, or the physical block corresponding to the first write request is changed to a state where it cannot be written to in order to ensure the reliability of the Nand, then the first write request is also illegal. In other words, if the first write request fails to write due to an exception, then the first write request is illegal. The embodiments of the present application do not limit the type and cause of the exception.

[0129] Among them, when the first write request is legal, the process of the solid-state drive writing the data corresponding to the first write request into the physical block corresponding to the first logical block based on the offset address includes: reading the data corresponding to the first write request from the cache; determining the physical block corresponding to the offset address and the offset address in the physical block based on the mapping rule between the offset address and the logical addresses of the first logical block and an integer number of physical blocks; and writing the data corresponding to the first write request into the offset address in the physical block.

[0130] It should be noted that the above steps 303 to 305 are explained by taking the solid-state hard drive writing data in a write-back manner as an example. In some embodiments, after the solid-state hard drive receives a write request, it writes the data carried by the write request. After the data corresponding to the write request is successfully written, the solid-state hard drive returns a write completion message for the write request to the host, that is, the solid-state hard drive first executes the above steps 304 and 305, and then executes the above step 303. The embodiments of the present application do not limit this.

[0131] In the above method, the solid-state drive (SSD) writes the data corresponding to the first write request only when the first write request satisfies the concurrency constraint between logical blocks and the write order constraint within the logical block. This ensures that the written data is written strictly in accordance with the mapping rules between logical blocks and physical blocks, thereby ensuring that the written data corresponding to each logical block is strictly aligned with an integer number of physical blocks. Furthermore, when the host performs garbage collection on a logical block basis, the data in the integer number of physical blocks corresponding to the logical block is invalid data. The SSD can then directly erase this integer number of physical blocks, thereby eliminating write amplification (WA), improving the SSD's write bandwidth, and reducing overall drive power consumption. Furthermore, it can eliminate on-disk OOPs and maximize media utilization. (In the industry, an SSD with a drive writes per day (DWPD) of 1, i.e., an SSD with 1 DWPD, generally has approximately 12% OOP.) Furthermore, while maintaining the standard LBA operation mode, the SSD can achieve strict alignment of written data with physical blocks, requiring minimal changes to the solid-state storage system and reducing the difficulty of using the system.

[0132] The following describes the data writing process in the above data writing method using an example in which the first write request is illegal and the solid-state drive writes data using a write-back method. FIG7 is a flow chart of a data writing method provided by an embodiment of the present application, which is applied to the above solid-state storage system and includes the following steps 701 to 706.

[0133] 701. A host receives a data write request sent by a user system to a solid-state storage system, and converts the data write request into a first write request for a solid-state drive.

[0134] 702. The host sends a first write request to the solid state drive. The first write request carries a logical block address LBA.

[0135] 703. The solid state drive returns a write completion message for the first write request to the host.

[0136] 704. The solid-state drive determines a first logical block in at least one logical block and an offset address of the LBA carried by the first write request in the first logical block based on the LBA carried by the first write request and the capacity of each logical block.

[0137] It should be noted that the above steps 701 to 704 are similar to the above steps 301 to 304 and will not be repeated here.

[0138] 705. When the first write request is illegal, the solid state drive reports a write failure message for the first write request to the host through an asynchronous event.

[0139] The process of the solid state drive determining whether the first write request is legal is the same as that in step 305 above, and will not be repeated here.

[0140] The write failure message is used to indicate that the first write request has failed to write and the location of the write failure. The location of the write failure is the LBA carried by the first write request.

[0141] The process shown in step 705 is illustrated below with reference to FIG8 . FIG8 is a schematic diagram of a data write failure provided by an embodiment of the present application. As shown in FIG8 , the write completion message returned by the solid-state drive to the host indicates that the write has been completed at location L1, that is, the write completion location seen by the host is L1, and the location where the write failed during the actual data writing process is L2, that is, the write failure message indicates that the write failed at location L2.

[0142] It should be noted that the above steps 703 to 705 are described by taking the example of the solid-state hard disk writing data in a write-back manner. In some embodiments, after receiving a write request, the solid-state hard disk writes the data carried by the write request. If the write request is illegal, the solid-state hard disk returns a write failure message for the write request to the host, that is, the solid-state hard disk executes the above steps 704 and 705, but does not execute the above step 703. The embodiments of the present application do not limit this. In other embodiments, when a non-write-back manner is adopted, the solid-state hard disk does not execute the above step 703. If the write request is illegal, then after step 704, the solid-state hard disk can directly return a write failure message for the write request to the host, and does not execute the above step 705. The embodiments of the present application do not limit this.

[0143] 706. The host receives the write failure message and processes the write failure message.

[0144] The process of the host processing the write failure message includes: setting the first logical block to a stop write state; determining a second logical block from at least one logical block included in the host, and resending a write request based on the second logical block. The second logical block is a logical block in the at least one logical block included in the host that is in an unwritten state, that is, a blank logical block. The host reads the write-failed data from the cache in the solid-state drive based on the write failure location indicated by the write failure message; the host re-initiates a write request for the write-failed data based on the second logical block. Re-sending the write request based on the second logical block means that the LBA carried by the re-initiated write request corresponds to the second logical block.

[0145] In the above method, the solid-state drive will cache data that has not been written, and when the first write request is illegal, it will report a write failure message through an asynchronous event and inform the host of the location of the write failure. The host can then read the data that failed to be written from the cache of the solid-state drive and write it to the physical block corresponding to other logical blocks. That is, the solid-state drive cannot write data to other locations in the solid-state drive on its own after the first write request fails to write. Instead, the host needs to determine the logical block that has not been written based on the mapping rules between the logical block and the physical block, and then resend the write request to ensure that the written data is strictly aligned with the physical block. Under the premise of retaining the efficient data writing method of write-back, the exception can be handled normally.

[0146] The following is an example of the process of the data writing method shown in Figures 3 and 7 above, using Figures 9 to 11. Figure 9 is a schematic diagram of a mapping rule between a logical block and a logical address of a physical block provided in an embodiment of the present application. As shown in Figure 9, there is a mapping relationship between each logical block and the logical address of an integer number of physical blocks in the solid-state hard disk, and the host performs system garbage collection in units of logical blocks. Figure 10 is a schematic diagram of the process of a data writing method provided in an embodiment of the present application. As shown in Figure 10, the host obtains the capacity of the physical block in the solid-state hard disk and the maximum number of concurrency supported by the solid-state hard disk by scanning the solid-state hard disk; the host writes data to the solid-state hard disk through a write request; the solid-state hard disk performs a validity check on the write request; if the write request is illegal, the solid-state hard disk reports a write failure message to the host; the host processes the write failure message. Figure 11 is a flow chart of a data writing method provided by an embodiment of the present application. As shown in Figure 11, the user system sends a data write request to the solid-state storage system; the host in the solid-state storage system converts the logical address in the user system carried by the data write request into a logical address in the solid-state storage system, that is, the host processes the write mapping to align the logical block; the host sends a write request to the solid-state hard disk, and the write request carries LBA; the solid-state hard disk returns a write completion message for the write request to the host; the solid-state hard disk determines whether the write request is legal. If the write request is legal, the solid-state hard disk writes the data corresponding to the write request. If the write request is illegal, the solid-state hard disk reports the write failure information for the write request to the host; after receiving the write failure message, the host processes the write failure message; after the solid-state hard disk successfully writes the data, the host returns the write result to the user system.

[0147] In some embodiments, if a physical block in a solid-state drive is damaged and there are no replacement physical blocks, the solid-state drive reports the number of lost logical blocks to the host; the host adjusts the system's available capacity and the number of available logical blocks based on the number of lost logical blocks. The solid-state drive reserves replaceable physical blocks. In some embodiments, when the logical addresses of physical blocks with the same physical block identifiers in multiple planes are mapped to the same logical block, if a physical block is bad, the solid-state drive replaces it with a replaceable physical block on the same plane as the bad block. For example, the solid-state drive reserves 100 replaceable physical blocks. When more than 100 physical blocks in the solid-state drive are damaged, the solid-state drive reports the number of lost logical blocks to the host. The host is unaware of the status of the physical blocks in the solid-state drive, and the solid-state drive shields the storage system from issues such as the reliability, concurrency, and wear leveling of the Nand media. It should be noted that the above description of the number of replaceable physical blocks in the solid-state drive is merely exemplary, and the embodiments of the present application do not limit the number of replaceable physical blocks in the solid-state drive.

[0148] In some embodiments, the solid-state drive includes multiple dies. When a die failure occurs in the solid-state drive, the solid-state drive reports the number and capacity of the failed dies to the host. Based on the number and capacity of the lost dies, the host re-establishes the mapping rules between the logical addresses of the physical blocks and the logical blocks in the solid-state drive.

[0149] In the above embodiment, the solid-state drive can report asynchronous events such as logical block loss due to bad blocks and capacity loss due to die failure, and then the host can adjust the system's available capacity and the number of available logical blocks based on these asynchronous events, and then cooperate with the solid-state drive to ensure that the normal operation of the solid-state storage system is not affected by the capacity loss of the solid-state drive.

[0150] It should be noted that the above describes the data writing method in the solid-state storage system. In the data reading scenario, the method by which the host reads data from the solid-state drive through LBA is the same as the method by which the host reads data from a standard NVMe disk, SAS, or UFS, and will not be elaborated here.

[0151] Figure 12 is a structural schematic diagram of a data writing device provided in an embodiment of the present application, which is applied to a host in a solid-state storage system, which also includes a solid-state hard disk. The host includes at least one logical block, and the solid-state hard disk includes multiple physical blocks, wherein the space of each logical block comes from an integer number of physical blocks among the multiple physical blocks, and there is a mapping relationship between the logical block and the logical address of the integer number of physical blocks; the device includes: a garbage collection module 1201 and a sending module 1202.

[0152] The garbage collection module 1201 is used to perform system garbage collection based on the capacity of the logical block;

[0153] The sending module 1202 is configured to send a first write request to the solid state drive, where the first write request carries a logical block address LBA.

[0154] Optionally, the device further comprises:

[0155] a receiving module, configured to receive a write failure message for a first write request reported by the solid-state drive, where the first write request corresponds to a first logical block in the at least one logical block;

[0156] A setting module, configured to set the first logic block to a stop-write state;

[0157] The sending module 1202 is further configured to determine a second logical block from the at least one logical block, and resend the write request based on the second logical block.

[0158] Optionally, the device further comprises:

[0159] A module is established for determining the system available capacity and the number of available logical blocks based on the number of lost logical blocks reported by the solid-state drive.

[0160] Optionally, the establishment module is further configured to:

[0161] Based on the operating parameters of the solid-state hard disk reported by the solid-state hard disk and the application capability of the solid-state storage system, a mapping relationship between the garbage collection unit of the system and the logical block is established.

[0162] Optionally, the operating parameters reported by the solid-state drive include the capacity of the physical blocks in the solid-state drive and the maximum concurrency supported by the solid-state drive, where the maximum concurrency indicates the maximum number of write requests that the solid-state drive can process simultaneously; and the establishing module includes:

[0163] a determining unit, configured to determine, according to the application capability of the solid-state storage system, the capacity of the physical block and the maximum concurrency supported by the solid-state drive, the number of physical blocks corresponding to each logical block and the target concurrency between the logical blocks;

[0164] The establishing unit is used to establish a mapping relationship between the garbage collection unit of the system and the logical blocks based on the number of physical blocks corresponding to each logical block.

[0165] It should be noted that, in other embodiments, the steps that the above modules are responsible for implementing can be specified as needed, and the above modules can respectively implement different steps in the above data writing method to realize all the functions of the above device. That is, the data writing device provided in the above embodiment only uses the division of the above functional modules as an example to illustrate when implementing the data writing method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the corresponding method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0166] Figure 13 is a structural schematic diagram of a data writing device provided in an embodiment of the present application, which is applied to a solid-state hard disk in a solid-state storage system. The solid-state storage system also includes a host, which includes at least one logical block, and the solid-state hard disk includes at least one physical block, wherein the space of each logical block comes from an integer number of physical blocks among the multiple physical blocks, and there is a mapping relationship between the logical block and the logical address of the integer number of physical blocks, and the host is used to perform system garbage collection with the capacity of the logical block as the granularity; the device includes: a receiving module 1301, a determination module 1302 and a writing module 1303.

[0167] The receiving module 1301 is configured to receive a first write request sent by a host, where the first write request carries a logical block address LBA;

[0168] The determining module 1302 is configured to determine a first logical block in the at least one logical block and an offset address of the LBA carried in the first write request in the first logical block based on the LBA carried in the first write request and the capacity of each logical block;

[0169] The writing module 1303 is configured to write the data corresponding to the first write request into the physical block corresponding to the first logical block based on the offset address.

[0170] Optionally, the writing module 1303 includes:

[0171] A write unit is used to write the data corresponding to the first write request into the physical block corresponding to the first logical block based on the offset address when the status of the first logical block is currently writable and the LBA carried by the first write request does not overlap with the LBA corresponding to the written data.

[0172] Optionally, the first write request carries an active block identifier, the solid-state drive stores a first block status table, and the first block status table is used to maintain the status of an active block in the at least one logical block, where the active block refers to a logical block that is currently writable; the write module 1303 further includes:

[0173] The first query unit is configured to query the first logical block status table for a status of the first logical block based on the active block identifier carried in the first write request.

[0174] Optionally, the solid-state drive stores a second block status table, where the second block status table is used to maintain the status of the at least one logical block; the writing module 1303 further includes:

[0175] The second query unit is configured to query the status of the first logic block in the second block status table.

[0176] Optionally, the device further comprises:

[0177] The reporting module is configured to report a write failure message for the first write request to the host through an asynchronous event when the first write request is illegal.

[0178] Optionally, the reporting module is further configured to:

[0179] If a physical block in the solid state drive is damaged and there is no replaceable physical block, the number of lost logical blocks is reported to the host.

[0180] Optionally, the reporting module is further configured to:

[0181] In response to the host's scanning operation, the operating parameters of the solid-state drive are reported to the host.

[0182] It should be noted that, in other embodiments, the steps that the above modules are responsible for implementing can be specified as needed, and the above modules can respectively implement different steps in the above data writing method to realize all the functions of the above device. That is, the data writing device provided in the above embodiment only uses the division of the above functional modules as an example to illustrate when implementing the data writing method. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the corresponding method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0183] Among them, the garbage collection module 1201, the sending module 1202, the receiving module 1301, the determination module 1302, and the writing module 1303 can all be implemented by software or by hardware. For example, the implementation of the garbage collection module 1201 is described below using the garbage collection module 1201 as an example. Similarly, the implementation of the sending module 1202, the receiving module 1301, the determination module 1302, and the writing module 1303 can refer to the implementation of the garbage collection module 1201.

[0184] As an example of a software functional unit, the garbage collection module 1201 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the garbage collection module 1201 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0185] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0186] As an example of a hardware functional unit, the garbage collection module 1201 may include at least one computing device, such as a server. Alternatively, the garbage collection module 1201 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0187] The multiple computing devices included in the garbage collection module 1201 can be distributed in the same region or in different regions. The multiple computing devices included in the garbage collection module 1201 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the garbage collection module 1201 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.

[0188] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the data involved in this application were obtained with full authorization.

[0189] Those skilled in the art will appreciate that the various method steps and units described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0190] Those skilled in the art will clearly understand that, for the sake of convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0191] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the unit is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.

[0192] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0193] In addition, each unit in each embodiment of the present application may be integrated into a processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The above-mentioned integrated units may be implemented in the form of hardware or software units.

[0194] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computing device (which can be a personal computer, a server, or a computing device, etc.) to execute all or part of the steps of the method in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk or an optical disk.

[0195] In this application, the terms "first," "second," and the like are used to distinguish between identical or similar items having substantially the same function or effect. It should be understood that "first," "second," and "nth" do not have a logical or temporal dependency, nor do they limit the quantity or order of execution. It should also be understood that although the following description uses the terms "first," "second," and the like to describe various elements, these elements should not be limited by these terms. These terms are simply used to distinguish one element from another.

[0196] In this application, the term "at least one" means one or more, and the term "plurality" means two or more. In this document, the terms "system" and "network" are often used interchangeably.

[0197] It should also be understood that the term "if" may be interpreted to mean "when" or "upon" or "in response to determining" or "in response to detecting." Similarly, the phrase "if it is determined that..." or "if [stated condition or event] is detected" may be interpreted to mean "upon determining that..." or "in response to determining that..." or "upon detecting [stated condition or event]" or "in response to detecting [stated condition or event]," depending on the context.

[0198] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

[0199] In the above embodiments, all or part of the embodiments may be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer program instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.

[0200] The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired or wireless method. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, or a magnetic tape), an optical medium (e.g., a digital video disc (DVD), or a semiconductor medium (e.g., a solid-state drive)), etc.

[0201] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0202] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A solid-state storage system, characterized in that, Comprising: A host and a solid - state drive; The host includes at least one logical block; The solid - state drive includes at least one physical block; Wherein, the space of each logical block comes from an integer number of physical blocks in the at least one physical block, and there is a mapping relationship between the logical block and the logical addresses of the integer number of physical blocks; The host is used for performing system garbage collection with the capacity of the logical block as the granularity.

2. The solid-state storage system according to claim 1, wherein The host is further used for: Sending a first write request to the solid - state drive, the first write request carrying a logical block address LBA; The solid - state drive is further used for: Based on the LBA carried in the first write request and the capacity of each logical block, determining a first logical block in the at least one logical block and the offset address of the LBA carried in the first write request in the first logical block; Based on the offset address, writing the data corresponding to the first write request into the physical block corresponding to the first logical block.

3. The solid-state storage system according to claim 2, wherein The solid - state drive is used for: When the state of the first logical block is currently writable and the LBA carried in the first write request does not repeat with the LBA corresponding to the already written data, based on the offset address, writing the data corresponding to the first write request into the physical block corresponding to the first logical block.

4. The solid-state storage system according to claim 3, wherein The first write request carries an active block identifier, and the solid - state drive stores a first block status table, and the first block status table is used for maintaining the status of active blocks in the at least one logical block, and the active block refers to a logical block whose state is currently writable; The solid - state drive is further used for: Based on the active block identifier carried in the first write request, querying the status of the first logical block in the first block status table.

5. The solid-state storage system according to claim 3, wherein The solid - state drive stores a second block status table, and the second block status table is used for maintaining the status of the at least one logical block; The solid - state drive is further used for: Querying the status of the first logical block in the second block status table.

6. The solid-state storage system according to claim 2, wherein The solid - state drive is further used for: When the first write request is illegal, reporting a write - failure message for the first write request to the host through an asynchronous event.

7. The solid-state storage system according to claim 6, wherein The host is further used for: Receiving the write - failure message; Setting the first logical block to a stop - writing state; Determining a second logical block from the at least one logical block, and based on the second logical block, resending a write request.

8. The solid-state storage system according to claim 1, wherein The solid - state drive is further used for: If there is a damaged physical block in the solid - state drive and there is no replaceable physical block, reporting the number of lost logical blocks to the host; The host is further used for: Based on the number of lost logical blocks, determining the system available capacity and the number of available logical blocks.

9. The solid-state storage system according to claim 1, wherein The solid - state drive is further used for: In response to the host's scanning operation, reporting the operating parameters of the solid - state drive to the host; The host is further used for: Based on the operating parameters of the solid - state drive and the application capabilities of the solid - state storage system, establishing a mapping relationship between the system garbage collection unit and the logical block and determining the target concurrency number between logical blocks. ​ 10. The solid-state storage system according to claim 9, characterized in that, The operating parameters reported by the solid-state drive include the capacity of the physical blocks in the solid-state drive and the maximum concurrency supported by the solid-state drive, and the maximum concurrency indicates the number of logical blocks that the solid-state drive can write simultaneously; The host is used for: According to the application capabilities of the solid-state storage system, based on the capacity of the physical blocks and the maximum concurrency supported by the solid-state drive, determine the number of physical blocks corresponding to each logical block and the target concurrency between logical blocks; Based on the number of physical blocks corresponding to each logical block, establish a mapping relationship between the system garbage collection unit and the logical blocks.

11. A solid state drive, characterized in that, It includes an interface, a processor, and a storage medium. The interface is used to communicate with the host, the storage medium is used to store data, and the processor is used to implement the functions of the solid-state drive in the solid-state storage system according to any one of claims 1 to 10 above.

12. A host, characterized in that, It includes an interface, a processor, and a memory. The interface is used to communicate with the solid-state drive, the memory is used to store data, and the processor is used to implement the functions of the host in the solid-state storage system according to any one of claims 1 to 10 above.

Citation Information

Patent Citations

  • Method for processing data, storage apparatus, solid state disk and storage system

    CN109690681A

  • Method and device for writing data in solid state disk, electronic equipment and readable medium

    CN115933995A

  • Data writing method and device for partition namespace solid state disk and electronic equipment

    CN115951839A

  • Garbage collection in storage devices based on flash memories

    US20080282045A1