Solid state storage system, solid state disk and host

By performing system garbage collection in units of logical blocks at the host level, ensuring invalid data from physical blocks, eliminating write amplification, and improving the performance and life of SSDs, it solves the problem of performance degradation of SSDs during garbage collection.

CN120336203APending Publication Date: 2025-07-18HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410068315.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-16
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

In the prior art, solid-state drives have write amplification phenomenon in the garbage collection process, resulting in reduced performance and shortened service life, and the handling of effective data cannot be effectively avoided.

Method used

By performing system garbage collection in units of logical blocks at the host level, we ensure that all physical blocks corresponding to the logical block become invalid data, so that they can be erased directly without data transfer, eliminate write amplification, and control data writing through the mapping relationship between the logical block and the physical block to ensure strict alignment of the data.

Benefits of technology

Effectively eliminate write amplification, improve the performance of solid-state drives, reduce waste of storage resources, extend service life, and reduce power consumption of the entire disk and maximize media utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336203A_ABST
    Figure CN120336203A_ABST
Patent Text Reader

Abstract

The invention discloses a solid-state storage system, a solid-state disk and a host, and belongs to the technical field of storage. The solid-state storage system comprises a host and a solid-state disk, the host comprises at least one logic block, the solid state disk comprises at least one physical block, the space of each logic block is from an integer number of physical blocks in the at least one physical block, the logic block corresponds to the logic address of the integer number of physical blocks, and the host performs system garbage collection by taking the capacity of the logic block as granularity. After the host completes system garbage collection, data in the integer physical blocks corresponding to the logic block are all in an invalid state, that is, valid data do not exist in the integer physical blocks, and the solid state disk can directly erase the physical blocks without data carrying. Write amplification of the solid-state disk can be eliminated, the solid-state disk does not need to reserve space, waste of storage resources of the solid-state disk can be reduced, the performance of the solid-state disk is improved, and the service life of the solid-state disk is prolonged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of storage technologies, and particularly to a solid-state storage system, a solid-state drive, and a host computer. Background Art

[0002] A solid-state storage system includes a host computer and a solid-state drive (SSD). The SSD includes a plurality of physical blocks, and each physical block includes a plurality of pages. The SSD stores data in units of pages and erases data in units of physical blocks. When the host computer writes data to the SSD, the SSD sequentially writes the data corresponding to the input / output (IO) requests received into the physical blocks in the order of the time of receipt. However, the IOs sent by the host computer to the SSD within a certain period of time may be messy and may come from different application programs or clients. Therefore, data from different sources may be stored in the same physical block of the SSD. When the host computer performs garbage collection (GC), the host computer releases some data according to the source. For the SSD, after the host computer's GC, the physical block includes the released invalid data and the unreleased valid data. The data in the physical block is not all released. And due to the Nand characteristics of the storage medium of the SSD, the SSD cannot directly write new data at the location of the invalid data. When the SSD performs its own GC, the SSD writes the valid data in the physical block into a blank physical block, making all the data in the original physical block become invalid data, and then erases the entire physical block, and uses the blank physical block obtained after erasure for subsequent data writing. Since the SSD needs to rewrite the valid data when performing its own GC, it causes write amplification (WA) (the actual amount of data written is greater than the amount of data written by the user), resulting in a decline in the performance and service life of the SSD.

[0003] In the related art, when the host computer writes data to the SSD, the host computer identifies the heat of the data, and the SSD writes the data with similar heat into the same physical block in the SSD. However, in the above method, it is impossible to fully ensure that the host computer can make all the data in the entire physical block become invalid data during one GC. Therefore, the SSD still needs to move the valid data in the physical block, and the degree of reduction in write amplification and the degree of improvement in performance are limited. Summary of the Invention

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

[0005] In a first aspect, a solid-state storage system is provided, which includes a host and a solid-state drive;

[0006] The host includes at least one logical block, and 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 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. The host is used to perform system garbage collection in units of the capacity of the logical block.

[0007] 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. After the host completes the system garbage collection, the data in the integer number of physical blocks corresponding to the logical block can be made invalid. That is, there is no valid data in these integer number of physical blocks. Therefore, the solid-state drive can directly erase these physical blocks without the need for the solid-state drive to move data again. As a result, 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 the storage resources of the solid-state drive, improving the performance of the solid-state drive, and extending its service life.

[0008] Optionally, the host is further used to:

[0009] Send a first write request to the solid-state drive, and the first write request carries a logical block address LBA;

[0010] The solid-state drive is further used to:

[0011] Based on the LBA carried in the first write request and the capacity of each logical block, 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;

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

[0013] Wherein, 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.

[0014] Among them, in some embodiments, when the first write request is legal, based on the offset address, the solid-state drive writes the data corresponding to the first write request into the physical block corresponding to the first logical block. Among them, the first write request being legal means that: the first write request satisfies the concurrent quantity constraint between logical blocks and satisfies the write order constraint within the logical block. The first write request satisfying the concurrent quantity constraint 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 write order constraint within the logical block means that: the data corresponding to the first write request is written in the way of sequential append write, and does not support hole data, duplicate writing, and in-place modification of data.

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

[0016] When the state of the first logical block is currently writable and the LBA carried by the first write request does not duplicate the LBA corresponding to the already written data, based on the offset address, the solid-state drive writes the data corresponding to the first write request into the physical block corresponding to the first logical block.

[0017] Among them, the solid-state drive determines whether the concurrent quantity constraint between logical blocks is satisfied through the state of the first logical block corresponding to the first write request. Among them, the states of the logical block include: currently non-writable, currently writable, fully written, and write stopped. If the state of the first logical block corresponding to the first write request is currently writable, then the first write request satisfies the concurrent quantity constraint between logical blocks. If the state of the first write request is not currently writable, then the first write request does not satisfy the concurrent quantity constraint between logical blocks, and the first write request is illegal.

[0018] Optionally, 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 blocks in the at least one logical block. The active block refers to a logical block whose state is currently writable;

[0019] The solid-state drive is also used for:

[0020] Based on the active block identifier carried by the first write request, query the status of the first logical block in the first block status table.

[0021] Among them, if the status of any logical block in the first block status table changes from currently writable to fully written status or write stopped status, the solid-state drive removes the status of the logical block from the first block status table. If the active block identifier carried by the first write request exists in the first block status table, then the status of the first logical block is currently writable.

[0022] Optionally, the solid-state drive stores a second block status table for maintaining the status of the at least one logical block;

[0023] The solid-state drive is further configured to:

[0024] Query the status of the first logical block in the second block status table.

[0025] Wherein, 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.

[0026] Optionally, the solid-state drive is further configured to:

[0027] In the case where the first write request is illegal, report a write failure message for the first write request to the host through an asynchronous event.

[0028] Wherein, the solid-state drive processes write requests in a write-back manner. Write-back means that after the data to be written corresponding to the write request is successfully transmitted to the solid-state drive, the solid-state drive first returns a write completion message for the write request to the host, and then asynchronously executes the write operation corresponding to the write request to reduce the response latency of the solid-state storage system to the user system.

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

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

[0031] Optionally, the host is further configured to:

[0032] Receive the write failure message;

[0033] Set the first logical block to a stop-writing state;

[0034] Determine a second logical block from the at least one logical block, and re-transmit a write request based on the second logical block.

[0035] Among them, the second logical block is a logical block with an unwritten status among at least one logical block included in the host, that is, a blank logical block. The host reads the data that failed to be written from the cache in the solid-state drive based on the position of the write failure indicated by the write failure message; the solid-state drive re-initiates a write request for the data that failed to be written based on the second logical block. Among them, re-sending 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.

[0036] Through the above system, the solid-state drive will cache the data that has not been written yet, and in the case where the first write request is illegal, report the write failure message asynchronously and inform the host of the position of the write failure. Then the host can read the data that failed to be written from the cache of the solid-state drive and write it into the physical block corresponding to other logical blocks. That is to say, the solid-state drive cannot write the data at other positions in the solid-state drive by itself after the first write request fails, but the host needs to determine the unwritten logical block and then re-send the write request to ensure that the written data is strictly aligned with the physical block.

[0037] Optionally, the solid-state drive is further configured to:

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

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

[0040] Among them, the host is unaware of the status of the physical blocks in the solid-state drive, and the solid-state drive shields issues such as the reliability, concurrency, and wear leveling of the Nand medium from the storage system.

[0041] In some embodiments, there are replaceable physical blocks reserved in the solid-state drive. In the scenario where the logical addresses of the physical blocks with the same physical block identifier in multiple planes are mapped to the same logical block, if a certain physical block is a bad block, the solid-state drive replaces the bad block with a replaceable physical block in the same plane as the bad block.

[0042] Through the above system, the solid-state drive can report asynchronous events such as the loss of logical blocks caused by bad blocks, and then the host can adjust the available capacity of the system 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 will not be affected due to the capacity loss of the solid-state drive.

[0043] Optionally, the solid-state drive is further configured to:

[0044] In response to the scanning operation of the host, report the operating parameters of the solid-state drive to the host;

[0045] The host is further configured to: based on the operating parameters of the solid-state drive and the application capabilities of the solid-state storage system, establish a mapping relationship between the system garbage collection units and the logical blocks and determine the target concurrency number between the logical blocks.

[0046] Among them, when the solid-state storage system is initialized, the host scans the solid-state drives connected to the host. For example, after the host is powered on, it scans the solid-state drives connected to the host. In some embodiments, the host periodically scans the solid-state drive to regularly obtain the operating parameters of the solid-state drive, so as to be able to timely learn about the 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.

[0047] Among them, the application capabilities of the solid-state storage system refer to the capabilities of the solid-state storage system to process storage services.

[0048] 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 number supported by the solid-state drive, and the maximum concurrency number indicates the maximum number of logical blocks that the solid-state drive can write simultaneously;

[0049] The host is configured to:

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

[0051] Based on the number of physical blocks corresponding to each logical block, establish a mapping relationship between the system garbage collection units and the logical blocks.

[0052] Among them, the minimum capacity granularity of the logical block is aligned with the capacity of the physical block. The target concurrency number between the logical blocks refers to the target number of logical blocks that can be concurrently written in the solid-state drive, that is, the number of logical blocks that are simultaneously in a writable state in the solid-state drive. The target concurrency number is less than or equal to the maximum concurrency number supported by the solid-state drive.

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

[0054] In a second aspect, a data writing device is provided, which is applied to a solid-state drive in a solid-state storage system. The solid-state storage system further includes a host. The device includes at least one functional module, and the at least one functional module is used to execute the functions of the solid-state drive in the solid-state storage system provided in the foregoing first aspect or any optional manner in the first aspect.

[0055] In a third aspect, a data writing device is provided, which is applied to a host in a solid-state storage system. The solid-state storage system further includes a solid-state drive. The device includes at least one functional module, and the at least one functional module is used to execute the functions of the host in the solid-state storage system provided in the foregoing first aspect or any optional manner in the first aspect.

[0056] In a fourth aspect, a solid-state drive is provided, which 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 provided in the foregoing first aspect or any optional manner in the first aspect.

[0057] In a fifth aspect, a host is provided, which 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 provided in the foregoing first aspect or any optional manner in the first aspect.

[0058] Based on the implementation manners provided in the above aspects of the present application, further combinations can be made to provide more implementation manners. Description of the Drawings

[0059] Figure 1 is a schematic structural diagram of a solid-state storage system provided by an embodiment of the present application;

[0060] Figure 2 is a flowchart of the establishment process of the mapping relationship in a data writing method provided by an embodiment of the present application;

[0061] Figure 3 is a flowchart of a data writing method provided by an embodiment of the present application;

[0062] Figure 4 is a schematic diagram of a method for determining the state of a logical block provided by an embodiment of the present application;

[0063] Figure 5 is a schematic diagram of a method for determining the state of a logical block provided by an embodiment of the present application;

[0064] Figure 6 is a schematic diagram of a method for controlling the written data within a logical block provided by an embodiment of the present application;

[0065] Figure 7 It is a flowchart of a data writing method provided by an embodiment of the present application;

[0066] Figure 8 It is a schematic diagram of data writing failure provided by an embodiment of the present application;

[0067] Figure 9 It is a schematic diagram of the mapping rule between a logical block and the logical address of a physical block provided by an embodiment of the present application;

[0068] Figure 10 It is a schematic flowchart of a data writing method provided by an embodiment of the present application;

[0069] Figure 11 It is a schematic flowchart of a data writing method provided by an embodiment of the present application;

[0070] Figure 12 It is a schematic structural diagram of a data writing device provided by an embodiment of the present application;

[0071] Figure 13 It is a schematic structural diagram of a data writing device provided by an embodiment of the present application. Detailed implementation manners

[0072] To make the objectives, technical solutions, and advantages of the present application clearer, the following will further describe the embodiments of the present application in detail with reference to the accompanying drawings.

[0073] First, the implementation environment of the present application is introduced.

[0074] Figure 1 It is a schematic structural diagram of a solid-state storage system provided by an embodiment of the present application. As Figure 1 shown, 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 excluding the solid-state drive, and the solid-state drive 102 is the 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 composed of a storage array and a storage array controller. For example, a distributed storage system or a centralized storage system, the host 101 is the server or storage array controller in the large storage system, and the solid-state drive 102 is the 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.

[0075] Among them, the host 101 includes a central processing unit (CPU), a memory, a host interface, and a bus. Exemplarily, the host 101 can query the solid-state drive 102 and receive the operating parameters of the solid-state drive 102 reported by the solid-state drive 102 to the host; the host 101 can receive the data written by the user system and send a write request to the solid-state drive, and the write request carries a logical block address (LBA). Based on the LBA carried in the write request, the solid-state drive 102 writes the data corresponding to the write request into a physical block in the solid-state drive 102; the host 101 can also perform garbage collection to release the data in the solid-state drive, thereby recycling the storage resources of the solid-state drive.

[0076] Among them, the solid state drive 102 includes a solid state drive controller and a storage medium. 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 a plurality of physical blocks. The solid state drive 102 can be an embedded multi media card (eMMC), a universal flash storage (UFS), a serial attached SCSI solid state drive (SAS SSD), a serial advanced technology attachment solid state drive (SATA SSD), a non-volatile memory express (NVMe), a NAND flash, or a disk, etc. The embodiments of the present application do not make any limitations in this regard. The number of the solid state drives 102 can be one or more, and the embodiments of the present application do not make any limitations on the number of the solid state drives. Among them, the bus between the solid state drive controller and the storage medium in the solid state drive 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. The embodiments of the present application do not make any limitations in this regard. Exemplarily, the solid state drive 102 can report its own operating parameters to the host 101; the solid state drive 102 can receive a write request sent by the host 101, and based on the logical block address (LBA) carried in the write request, write the data corresponding to the write request into the physical block in the solid state drive 102; in some embodiments, the solid state drive 102 also stores a flash translation layer (FTL), and the FTL is used to maintain the conversion relationship between the LBA and the physical address in the solid state drive 102. After the host 101 performs garbage collection, the solid state drive 102 can erase the recycled physical block to facilitate subsequent data writing.

[0077] Among them, the bus between the host 101 and the solid-state drive 102 can be a peripheral component interconnect express (PCIe), UFS, eMMC, NVMe, SAS, SATA, etc. The embodiments of the present application do not limit this. For the sake of representation, Figure 1 only one line is used to represent the bus in [description], but it does not mean that there is only one bus or one type of bus.

[0078] In the above 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 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 the logical block capacity. In this solid-state storage system, the host performs system garbage collection in units 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. Therefore, 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 require OP, thereby reducing the waste of the storage resources of the solid-state drive, improving the performance of the solid-state drive, and extending the service life.

[0079] Based on the above solid-state storage system, an embodiment of the present application provides a data writing method. In this method, 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 drive 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 also 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 drive 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 drive; after receiving the first write request, the solid-state drive writes the data corresponding to the first write request into the physical block. In some embodiments, when the solid-state drive writes data into the physical block, it needs to satisfy the constraint of the mapping relationship between the physical block and the logical block. If the first write request satisfies the constraint 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 constraint 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 into 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.

[0080] The following details the process of the above method. First, the process of establishing the mapping relationship in the above data writing method is introduced. Figure 2 It 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 interaction between the host and the solid-state drive for this process as an example, this process includes the following steps 201 to 204.

[0081] 201. The host scans the solid-state drive.

[0082] Among them, the host scans the solid-state drive connected to the host during the initialization of the solid-state storage system. For example, the host scans the solid-state drive connected to the host after power-on. In some embodiments, the host periodically scans the solid-state drive to regularly obtain the operating parameters of the solid-state drive, so as to be able to timely learn about the 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.

[0083] 202. In response to a scanning operation of the host, the solid-state drive reports the operating parameters of the solid-state drive to the host.

[0084] Among them, the capacity of a physical block in the solid-state drive refers to the capacity of a single 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 blocks 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 simultaneously. In some embodiments, the operating parameters reported by the solid-state drive further include a reference logical block capacity. When the capacity of a logical block is N times the reference logical block capacity, the performance of the solid-state drive can be greatly exerted while meeting the system application capabilities, where 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.

[0085] 203. Based on the operating parameters of the solid-state drive and the application capabilities of the solid-state storage system, the host establishes a mapping relationship between the system garbage collection unit and the logical blocks and determines the target concurrency among the logical blocks.

[0086] Among them, the application capabilities of the solid-state storage system refer to the capabilities of the solid-state storage system to process storage services.

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

[0088] 2031. According to the application capabilities 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 among the logical blocks.

[0089] Among them, the target concurrency among the logical blocks refers to the number of logical blocks that can be concurrently written in the solid-state drive, that is, the number of logical blocks that are simultaneously in a writable state in the solid-state drive. The target concurrency is less than or equal to the maximum concurrency supported by the solid-state drive.

[0090] Among them, 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, it can greatly exert the performance of the solid-state drive while meeting the system application capabilities, where 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 groups (planes) in the solid-state drive. The embodiments of the present application do not limit this.

[0091] 2032. Establish a mapping relationship between the system garbage collection unit and the logical block based on the capacity of each logical block.

[0092] It should be noted that the above steps 201 to 203 are described by taking the host scanning the solid-state drive and the solid-state drive reporting the operating parameters as an example. In some embodiments, the host is configured with the operating parameters of the solid-state drive, and the host establishes a mapping relationship based on the configured operating parameters of the solid-state drive. In other embodiments, the host is configured with the operating parameters of the solid-state 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 drive; thereafter, the host periodically scans the solid-state drives connected to the host, and the solid-state drives periodically report the operating parameters. When the operating parameters reported by the solid-state drive are updated relative to the operating parameters configured in the host, the host updates the configured operating parameters of the solid-state drive and re-establishes a mapping relationship based on the updated operating parameters, and executes step 204 to send the new mapping relationship to the solid-state drive. The embodiments of the present application do not limit the way for the host to obtain the operating parameters of the solid-state drive.

[0093] In some embodiments, the solid-state drive also reports the available capacity of the solid-state drive to the host, and 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 block (i.e., the capacity of the logical block).

[0094] 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.

[0095] Among them, in some embodiments, after receiving the mapping relationship between the system garbage collection unit and the logical block and the target concurrency number between the logical blocks, the solid-state drive establishes a mapping rule between the logical block and the logical address of the physical block based on the number of physical blocks corresponding to the logical block and the target concurrency number, and generates a physical block-level FTL table based on the mapping rule between the logical block and the logical address of the physical block. The FTL table is used to manage the status of all physical blocks.

[0096] In the above method, the host in the solid-state storage system can obtain operating parameters such as the capacity of physical blocks in the solid-state drive and the maximum concurrency supported by the solid-state drive. The capacity of the physical block is used as the minimum capacity granularity of the logical block, and based on these parameters and the application capabilities of the solid-state storage system, the capacity of the logical block and the number of concurrent logical blocks can be determined, which can not only meet the application capabilities of the solid-state storage system but also ensure better write performance of the solid-state drive.

[0097] First, taking the case where the first write request is legal and the solid-state drive writes data in a write-back manner as an example, the data writing process in the above data writing method will be introduced. Figure 3 FIG. is a flowchart of a data writing method provided by an embodiment of the present application. This method is applied to the above solid-state storage system and includes the following steps 301 to 305.

[0098] 301. The host receives a data writing request sent by the user system to the solid-state storage system. Based on this data writing request, a first write request for the solid-state drive is generated. 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 for system garbage collection, and the size of the system garbage collection unit is aligned with the capacity of the logical block.

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

[0100] 302. The host sends the first write request to the solid-state drive, and this first write request carries the logical block address LBA.

[0101] Among them, the LBA carried in this first write request is the starting LBA corresponding to the data to be written, and this first write request also carries the data length of the data to be written. 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 write requests to the solid-state drive in the order of the LBA carried in this first write request. For example, if the LBA range corresponding to logical block A is 1 to 4, then the host sends write requests to the solid-state drive in the order of LBA being 1, 2, 3, and 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 LBA carried in the write requests. The embodiments of the present application do not limit the order in which the host sends write requests.

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

[0103] Among them, the solid-state drive processes write requests in a write-back manner. Write-back means that after the data to be written corresponding to the write request is successfully transmitted to the solid-state drive, the solid-state drive first returns a write completion message for the write request to the host, and then asynchronously executes the write operation corresponding to the write request to reduce the response latency of the solid-state storage system to the user system.

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

[0105] 304. The solid-state drive determines the first logical block in 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 LBA carried in the first write request and the capacity of each logical block.

[0106] Among them, 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 determination method of the identity (ID) of the first logical block can be expressed by the following formula (1).

[0107]

[0108] In the above formula (1), represents rounding down; "ID" represents the identity of the first logical block, "LBA" represents the LBA carried in the first write request, "sector size" represents the capacity of one sector in the physical block, and "block size" represents the capacity of one logical block.

[0109] The determination method of the offset address of the LBA carried in the first write request in the first logical block can be expressed by the following formula (2).

[0110] offset = (LBA × sector size) % block size (2)

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

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

[0113] It should be noted that the operation processes shown in the above formulas (1) and (2) are only exemplary, and the embodiments of the present application do not limit the specific operation processes.

[0114] 305. When the first write request is legal, based on this offset address, the data corresponding to the first write request is written into the physical block corresponding to the first logical block.

[0115] Among them, the first write request being legal means that: the first write request satisfies the constraint of the concurrent quantity between logical blocks and the constraint of the write order within the logical block. The first write request satisfying the constraint of the concurrent quantity between logical blocks means that: the current concurrency number of the solid-state drive is less than or equal to the target concurrent number between logical blocks. The first write request satisfying the constraint of the write order within the logical block means that: the data corresponding to the first write request is written in the way of sequential append write, and does not support hole data, duplicate writing, and in-place modification of data.

[0116] In some embodiments, the solid-state drive determines whether the constraint of the concurrent quantity between logical blocks is satisfied through the state of the first logical block corresponding to the first write request. Among them, the state of the logical block includes: currently non-writable, currently writable, fully written, and write stopped. 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 of the concurrent quantity between logical blocks. If the state of this first write request is not currently writable, then the first write request does not satisfy the constraint of the concurrent quantity between logical blocks, and this first write request is illegal.

[0117] The following first introduces the method for the solid-state drive to determine the state of the first logical block.

[0118] In some embodiments, the first write request carries an active block identifier. The solid-state drive stores a first block status table, which is used to maintain the status of active blocks in at least one logical block. An 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 fully written or write stop status, 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 in the first write request. Among them, if the active block identifier carried in the first write request exists in the first block status table, the status of the first logical block is currently writable. The following is through Figure 4 an example to illustrate the first method. Figure 4 is a schematic diagram of a method for determining the status of a logical block provided by an embodiment of the present application. As Figure 4 shown, the solid-state drive determines the identifier of the first logical block based on the LBA carried in 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 in the first write request. It should be noted that Figure 4 it is illustrated by taking the case where the solid-state drive synchronously executes the process of determining the identifier of the first logical block and the process of determining the status of the first logical block when determining the status of the first logical block by this method. In some embodiments, the solid-state drive first executes the process of determining the identifier of the first logical block and the offset address, and then executes the process of determining the status of the first logical block; in other embodiments, the solid-state drive first executes the process of determining the status of the first logical block, and then executes the process of determining the identifier of the first logical block and the offset address; 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 following is through Figure 5 an example to illustrate the second method. Figure 5 is a schematic diagram of a method for determining the status of a logical block provided by an embodiment of the present application. As Figure 5 shown, the solid-state drive determines the identifier of the first logical block based on the LBA carried in 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 the method for the solid - state drive to control 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 the 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 in the first write request is continuous with the LBA range corresponding to the data to be written carried in the previous write request received by the solid - state drive, then the first write request meets 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 in the first write request is not continuous with the LBA range corresponding to the data to be written carried in the previous write request received by the solid - state drive, then the first write request does not meet 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 in the multiple received write requests. If the smallest LBA carried in the multiple sorted write requests is the smallest unwritten LBA corresponding to the logical block, it indicates that the sorting of these multiple write requests is completed, and the solid - state drive writes the data corresponding to the multiple sorted write requests. If the smallest LBA carried in the multiple sorted write requests is greater than the smallest unwritten LBA corresponding to the logical block, it indicates that the sorting of these multiple write requests is not completed, and the solid - state drive continues to receive write requests and writes the data after the sorting of the unwritten write requests is completed. For example, the LBA range corresponding to the logical block is 1 - 5, and the LBA addresses carried in the three write requests received by the solid - state drive are 2, 3, and 1 respectively. The solid - state drive sorts these three write requests, and the smallest LBA after sorting is 1, which is the smallest unwritten LBA corresponding to the logical block, and the solid - state drive writes the data corresponding to these three sorted write requests. The LBAs carried in the subsequent write requests received by the solid - state drive are 5 and 4 respectively. The solid - state drive sorts these two write requests, and the smallest LBA carried in these two sorted write requests is 4, which is the smallest unwritten LBA corresponding to the logical block, and the solid - state drive writes the data corresponding to these two sorted write requests.

[0124] In this embodiment, for the same logical block, if the LBA carried by the first write request does not duplicate the LBA corresponding to the data already written, then the first write request meets 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 duplicates the LBA corresponding to the data already written, 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 write requests that have not been sorted is greater than 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 in the write requests that have not been sorted has an error. Among them, the number of write requests that have not been sorted being greater than the target threshold indicates that: the amount of data that has not been written is greater than the capacity of the logical block that has not been written. If the maximum LBA corresponding to the logical block has been written, then the logical block is full.

[0125] In some other embodiments, when the host sends write requests to the solid state drive out of order, the solid state drive stores a flash translation table FTL, which is used to maintain the conversion relationship between the LBA and the physical address in the solid state drive and the write status of the physical address in the solid state drive. The write status of the physical address in the solid state drive includes not written and already written. Before writing data into 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 address corresponding to the logical block is all not written. After receiving the first write request, the solid state drive determines the LBA carried by the first write request based on the FTL, determines the physical address corresponding to the LBA, and when the write status of the physical address is not written, the solid state drive writes the data corresponding to the first write request into the physical address, modifies the write status of the physical address to already written in the FTL, and records the total amount of data already written corresponding to the logical block, so as to determine whether the logical block is full based on the total amount of data already 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 volume corresponding to the first write request and the data volume already written is less than or equal to the capacity of the logical block, then the first write request meets 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 already written, or the sum of the data volume corresponding to the first write request and the data volume already written is greater than the capacity of the logical block, then the first write request does not meet the write order constraint within the logical block, that is, the first write request is illegal.

[0127] The following takes Figure 6 as an example to illustrate the third method.Figure 6 It is a schematic diagram of a method for controlling data writing within a logical block provided by an embodiment of the present application. As Figure 6 shown, assume that logical block A corresponds to 10 sectors in a solid-state drive, and the LBAs corresponding to these 10 sectors are 1 to 10 respectively. The solid-state drive maintains an FTL table. Before writing data to the 10 sectors corresponding to logical block A, the solid-state drive clears the write statuses corresponding to these 10 sectors in the FTL table. At this time, the write statuses of these 10 sectors can be represented by Figure 6 the FTL table 601 in Figure 6 When the solid-state drive receives 3 write requests, and the LBAs carried by these 3 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, records in the FTL table that the sectors with LBAs of 2, 3, and 5 have been written, and records that three sectors have been written and the total data volume corresponding to these three sectors. At this time, the FTL is as shown in Figure 6 table 602 in

[0128] When the solid-state drive receives another 3 write requests, and the LBAs carried by these 3 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, records in the FTL table that the sectors with LBAs of 4, 1, and 7 have been written, and records that six sectors have been written and the total data volume corresponding to these six sectors. At this time, the FTL is as shown in

[0129] Figure 6 table 603 in

[0128] And so on. If the LBAs carried by the subsequent 4 write requests received by the solid-state drive do not repeat the LBAs corresponding to the already written data, then the 10 sectors corresponding to logical block A are all full. At this time, these 10 write requests all satisfy the write order constraint within the logical block, that is, these 10 write requests are all legal; if a write request carrying a repeated LBA is received, for example, the LBA carried is 7, and at this time the FTL records that the write status of the sector corresponding to the LBA of 7 has been written, then this write request is illegal; if the sum of the data volume corresponding to the received write request and the already written data volume exceeds the capacity of the logical block, then this write request is illegal.

[0128] It should be noted that the above method for determining whether the first write request is legal is from the perspective of concurrent control between logical blocks and data writing control within a logical block. In some embodiments, if the physical address corresponding to the first write request is incorrect, for example, the Nand medium at this physical address is incorrect, or the physical block corresponding to the first write request becomes a non-writable state in order to ensure Nand reliability, then this first write request is also illegal. That is, if the first write request fails to be written due to an exception, then this 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 offset address and the mapping rule between the first logical block and the logical addresses of 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 described by taking the example of a 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. After the data corresponding to the write request is written successfully, the solid-state hard disk returns a write completion message for the write request to the host, that is, the solid-state hard disk 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 writes the data corresponding to the first write request only when the first write request satisfies the concurrent number constraint between the logical blocks and the write order constraint within the logical block, which can ensure that the written data is written strictly in accordance with the requirements of the mapping rule between the logical block and the physical block, thereby ensuring that the written data corresponding to each logical block is strictly aligned with an integer number of physical blocks, and then when the host performs garbage collection in units of logical blocks, the data in the integer number of physical blocks corresponding to the logical block are all invalid data, and then the solid state drive can directly erase the integer number of physical blocks, thereby eliminating the write amplification of the solid state drive, improving the write bandwidth of the solid state drive, reducing the power consumption of the entire disk, and removing the OP in the disk to maximize the medium utilization rate (the industry's SSD with a daily full disk write count (drive writes per day, DWPD) of 1, that is, an SSD with 1 DWPD generally needs to be configured with about 12% OP); in addition, it is possible to achieve the effect of strict alignment of the written data with the physical block on the basis of continuing to use the standard LBA operation mode, with little change to the solid state storage system, which can reduce the application difficulty of the solid state storage system.

[0132] The data writing process in the above data writing method is described below by taking the case where the first write request is illegal and the solid state drive writes data in a write-back manner as an example. Figure 7 It is a flow chart of a data writing method provided in an embodiment of the present application. The method is applied to the above-mentioned 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 hard disk.

[0134] 702. The host sends a first write request to the solid state drive, and 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 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.

[0137] It should be noted that the above steps 701 to 704 are the same as the above steps 301 to 304 and will not be elaborated 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] Among them, the process for the solid state drive to determine whether the first write request is legal is the same as that in the above step 305 and will not be elaborated here.

[0140] Among them, the write failure message is used to indicate that the first write request fails to be written and the position where the write fails, and the position where the write fails is also the LBA carried in the first write request.

[0141] The following is through Figure 8 to illustrate the process shown in the above step 705 by way of example. Figure 8 is a schematic diagram of data write failure provided by an embodiment of the present application. As Figure 8 shown, the position where the write completion message returned by the solid state drive to the host indicates that the write has been completed is L1, that is, the position where the host sees the write as completed is L1, and the position where the write fails during the actual data writing process is L2, that is, the position where the write failure message indicates the write failure is L2.

[0142] It should be noted that the above steps 703 to 705 are described by taking the case where the solid-state drive writes data in a write-back manner as an example. In some embodiments, after receiving a write request, the solid-state drive writes the data carried in the write request. When the write request is illegal, the solid-state drive returns a write failure message for the write request to the host, that is, the solid-state drive executes the above steps 704 and 705, and does not execute the above step 703. The embodiments of the present application do not make any limitations on this. In some other embodiments, in the case of using a non-write-back manner, the solid-state drive does not execute the above step 703. If the write request is illegal, after step 704, the solid-state drive can directly return a write failure message for the write request to the host, and does not execute the above step 705 either. The embodiments of the present application do not make any limitations on this.

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

[0144] Among them, 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 based on the second logical block, resending a write request. Among them, 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 that failed to be written from the cache in the solid-state drive based on the position where the write failure indicated by the write failure message; the host re-initiates a write request for the data that failed to be written based on the second logical block. Among them, resending the write request based on the second logical block means that the LBA carried in the re-initiated write request corresponds to the second logical block.

[0145] In the above method, the solid-state drive will cache the data that has not been written yet, and in the case where the first write request is illegal, report the write failure message through an asynchronous event and inform the host of the position where the write failed. Then the host can read the data that failed to be written from the cache of the solid-state drive and write it into the physical block corresponding to other logical blocks. That is, the solid-state drive cannot write the data to other positions in the solid-state drive by itself after the first write request fails, but the host needs to determine the unwritten logical block according to the mapping rule 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, exceptions can be processed normally.

[0146] Next, through Figures 9 to 11 the above Figure 3 and Figure 7 the process of the data writing method shown is illustrated by way of example. Figure 9It is a schematic diagram of the mapping rule between a logical block and the logical address of a physical block provided by an embodiment of the present application. As Figure 9 shown, there is a mapping relationship between each logical block and the logical addresses of an integer number of physical blocks in the solid-state drive. The host performs system garbage collection in units of logical blocks. Figure 10 It is a schematic flowchart of a data writing method provided by an embodiment of the present application. As Figure 10 shown, the host obtains the capacity of the physical blocks in the solid-state drive and the maximum concurrency supported by the solid-state drive by scanning the solid-state drive; the host writes data to the solid-state drive through a write request; the solid-state drive performs a legality check on the write request; in the case where the write request is illegal, the solid-state drive reports a write failure message to the host; the host processes the write failure message. Figure 11 It is a schematic flowchart of a data writing method provided by an embodiment of the present application. As Figure 11 shown, the user system sends a data writing 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 writing request into the logical address in the solid-state storage system, that is, the host processes the write mapping to align to the logical block; the host sends a write request to the solid-state drive, and the write request carries the LBA; the solid-state drive returns a write completion message for the write request to the host; the solid-state drive determines whether the write request is legal. In the case where the write request is legal, the solid-state drive writes the data corresponding to the write request. In the case where the write request is illegal, the solid-state drive reports a write failure message for the write request to the host; after receiving the write failure message, the host processes the write failure message; after the solid-state drive successfully writes the data, the host returns a write result to the user system.

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

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

[0149] In the above embodiments, the SSD can report asynchronous events such as the loss of logical blocks caused by bad blocks and the capacity loss caused by die failures. Furthermore, the host can adjust the available system capacity and the number of available logical blocks based on these asynchronous events, and then cooperate with the SSD to ensure that the normal operation of the solid-state storage system will not be affected by the capacity loss of the SSD.

[0150] It should be noted that the data writing method in the solid-state storage system is introduced above. In the data reading scenario, the method by which the host reads data from the SSD through the logical block address (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 FIG. 13 is a schematic structural diagram of a data writing device provided by an embodiment of the present application. The device is applied to a host in a solid-state storage system, and the solid-state storage system further includes an SSD. The host includes at least one logical block, and the SSD includes multiple physical blocks. Among them, 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 addresses 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 in units of the capacity of logical blocks.

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

[0154] Optionally, the device further includes:

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

[0156] A setting module, configured to set the first logical block to a stop writing state;

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

[0158] Optionally, the device further includes:

[0159] An establishing module, configured to determine 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 establishing module is further configured to:

[0161] Establish a mapping relationship between the system garbage collection unit and logical blocks based on the operating parameters of the solid-state drive reported by the solid-state drive and the application capabilities of the solid-state storage system.

[0162] Optionally, the operating parameters reported by the solid-state drive include the capacity of 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; the establishing module includes:

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

[0164] An establishing unit, configured to establish a mapping relationship between the system garbage collection unit and 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 to be implemented by the above modules can be specified as needed. The above modules respectively implement different steps in the above data writing method to implement all functions of the above device. That is, the data writing device provided in the above embodiments only takes the division of the above function modules as an example when implementing the data writing method. In practical applications, the above functions can be allocated to different function modules as needed, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above. In addition, the device provided in the above embodiments and the corresponding method embodiments belong to the same concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here.

[0166] Figure 13 FIG. 4 is a schematic structural diagram of a data writing device provided by an embodiment of the present application. The device is applied to a solid-state drive in a solid-state storage system. The solid-state storage system further includes a host, the host includes at least one logical block, and 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 among the plurality of physical blocks, 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 to perform system garbage collection in units of the capacity of the logical block; the device includes: a receiving module 1301, a determining module 1302, and a writing module 1303.

[0167] The receiving module 1301 is configured to receive a first write request sent by the host, and 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 writing unit, 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 when the state of the first logical block is currently writable and the LBA carried in the first write request does not repeat the LBA corresponding to the already written data.

[0172] Optionally, the first write request carries an active block identifier. The solid-state drive stores a first block status table for maintaining the status of active blocks in the at least one logical block. The active block refers to a logical block with a status of currently writable. The write module 1303 further includes:

[0173] A first query unit, configured to query the status of the first logical block in the first block status table based on the active block identifier carried in the first write request.

[0174] Optionally, the solid-state drive stores a second block status table for maintaining the status of the at least one logical block. The write module 1303 further includes:

[0175] A second query unit, configured to query the status of the first logical block in the second block status table.

[0176] Optionally, the device further includes:

[0177] A reporting module, 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 there is a damaged physical block in the solid-state drive and there is no replaceable physical block, report the number of lost logical blocks to the host.

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

[0181] In response to a scanning operation of the host, report the operating parameters of the solid-state drive to the host.

[0182] It should be noted that in other embodiments, the steps to be implemented by the above modules can be specified as needed. The above modules respectively implement different steps in the above data writing method to implement all functions of the above device. That is, the data writing device provided in the above embodiments is only illustrated by dividing the above function modules when implementing the data writing method. In actual applications, the above functions can be allocated to different function modules as needed, that is, the internal structure of the device is divided into different function modules to complete all or part of the functions described above. In addition, the device provided in the above embodiments and the corresponding method embodiments belong to the same concept. For the specific implementation process, please refer to the method embodiments and will not be elaborated here.

[0183] Among them, the garbage collection module 1201, the sending module 1202, the receiving module 1301, the determining module 1302, and the writing module 1303 can all be implemented by software or by hardware. Exemplarily, taking the garbage collection module 1201 as an example, the implementation manner of the garbage collection module 1201 will be introduced below. Similarly, the implementation manners of the sending module 1202, the receiving module 1301, the determining module 1302, and the writing module 1303 can refer to the implementation manner 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. Among them, the computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Further, the above 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 for running this code may be distributed in the same region or in different regions. Further, the multiple hosts / virtual machines / containers for running this code may be distributed in the same availability zone (AZ) or in different AZs, and each AZ includes one data center or multiple geographically proximate data centers. Usually, one region may include multiple AZs.

[0185] Similarly, the multiple hosts / virtual machines / containers for running this code may be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Usually, one VPC is set within one region. For cross-region communication between two VPCs within the same region and between VPCs in different regions, a communication gateway needs to be set in each VPC, and the interconnection between VPCs is realized through the communication gateway.

[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, etc. Alternatively, the garbage collection module 1201 may also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). Among them, the above PLD may be implemented by a complex programmable logic 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 may be distributed in the same region or in different regions. The multiple computing devices included in the garbage collection module 1201 may be distributed in the same availability zone (AZ) or in different AZs. Similarly, the multiple computing devices included in the garbage collection module 1201 may be distributed in the same virtual private cloud (VPC) or in multiple VPCs. Among them, the multiple computing devices may 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 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 need to comply with the relevant laws, regulations, and standards of relevant countries and regions. For example, the data involved in this application is obtained under full authorization.

[0189] Those of ordinary skill in the art can realize that, in combination with the method steps and units described in the embodiments disclosed herein, they can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described according to their functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.

[0190] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0191] In several embodiments provided in the present 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 merely illustrative. For example, the division of the unit is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed couplings or direct couplings or communication connections to each other can be indirect couplings or communication connections through some interfaces, devices, or units, and can also be electrical, mechanical, or other forms of connection.

[0192] The unit described as a separated component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit, that is, it may be located in one place, or may be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiments of the present application.

[0193] In addition, in each embodiment of the present application, the units can be integrated into a processing unit, or each unit exists physically alone, or two or more units are integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software unit.

[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 such an understanding, the technical solution of the present application, in essence, 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. The computer software product is stored in a storage medium and includes several instructions for causing 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 methods in the various embodiments of the present application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), RAM, magnetic disks, or optical discs that can store program codes.

[0195] In this application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions. It should be understood that there is no logical or chronological dependency between "first", "second", and "nth", nor are the quantity and execution order limited. It should also be understood that although the following description uses terms such as first and second to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another.

[0196] In this application, the meaning of the term "at least one" refers to one or more, and the meaning of the term "a plurality" refers to two or more. In this text, the terms "system" and "network" are often used interchangeably.

[0197] It should also be understood that the term "if" can be interpreted to mean "when" (either "when" or "upon") or "in response to a determination" or "in response to detecting". Similarly, depending on the context, the phrase "if a determination is made..." or "if [the stated condition or event] is detected" can be interpreted to mean "when a determination is made..." or "in response to a determination..." or "when [the stated condition or event] is detected" or "in response to detecting [the stated condition or event]".

[0198] The above description is only a specific implementation manner of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art in the technical field disclosed in this application can easily think of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

[0199] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part 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 in the embodiments of this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

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

[0201] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware or by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk, or an optical disc, etc.

[0202] The above embodiments are only used to illustrate the technical solutions of the present application and are not intended to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments or perform equivalent replacements for some of the technical features. 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, Including: 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 among 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 to perform system garbage collection in units of the capacity of the logical block.

2. The solid-state storage system according to claim 1, wherein The host is further used to: Send a first write request to the solid-state drive, and the first write request carries a logical block address LBA; The solid-state drive is further used to: Based on the LBA carried in the first write request and the capacity of each logical block, determine the first logical block among 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, write 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 to: When the state of the first logical block is currently writable and the LBA carried in the first write request does not repeat the LBA corresponding to the already written data, based on the offset address, write 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 to maintain the status of active blocks among 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 to: Based on the active block identifier carried in the first write request, query 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 to maintain the status of the at least one logical block; The solid-state drive is further used to: Query 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 to: In the case where the first write request is illegal, report 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 to: Receive the write failure message; Set the first logical block to a stop-writing state; Determine a second logical block from the at least one logical block, and based on the second logical block, resend a write request.

8. The solid-state storage system according to claim 1, wherein The solid-state drive is further used to: If there is a damaged physical block in the solid-state drive and there is no replaceable physical block, report the number of lost logical blocks to the host; The host is further used to: Based on the number of lost logical blocks, determine 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 to: In response to the host's scanning operation, report the operating parameters of the solid-state drive to the host; The host is further used to: Based on the operating parameters of the solid-state drive and the application capabilities of the solid-state storage system, establish a mapping relationship between the system garbage collection unit and the logical block and determine the target concurrency number between logical blocks.

10. The solid-state storage system according to claim 9, wherein 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 number of logical blocks that the solid-state drive can write simultaneously; The host is configured to: Based on the application capabilities of the solid-state storage system, determine the number of physical blocks corresponding to each logical block and the target concurrency among the logical blocks based on the capacity of the physical blocks and the maximum concurrency supported by the solid-state drive; Establish a mapping relationship between the system garbage collection unit and the logical blocks based on the number of physical blocks corresponding to each logical block.

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.