Data writing method, data reading method, data processing method, and related device
By setting up a write cache table in the partition namespace SSD to record failed write data and their status, and storing the data in the cache table when a write failure occurs, the read and write performance problem when data write fails is solved, thereby improving data processing efficiency and service quality.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2026-03-24
AI Technical Summary
In partitioned namespace solid-state drives, when data write fails, existing technologies cannot effectively improve data read and write performance, thus affecting the quality of host data processing services.
In the partition namespace SSD, a write cache table is set up to record failed write data and its status. When a write fails, the data is stored in the cache table. Failed data can be quickly retrieved and rewritten through the write cache table, and a mapping relationship between the flash physical address and the target logical address is established.
In the event of a data write failure, the failed data can be quickly retrieved and rewritten by writing to a cache table, thereby improving data read and write performance and enhancing data processing efficiency and service quality.
Smart Images

Figure CN119668493B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a data writing method, a data reading method, a data processing method, and related equipment. Background Technology
[0002] Zoned Namespace Solid State Drives (ZNS SSDs) migrate the Flash Translation Layer (FTL) from within the SSD to the host machine, exposing the SSD's internals to the host. This allows users to flexibly configure specific FTLs according to their needs. ZNS SSDs can then write data from write requests originating from the host into the flash cache based on the specified FTL.
[0003] However, during the process of writing data to flash memory using ZNS SSDs, write failures can occur, which can impact the host's read and write performance. Therefore, providing a technical solution to improve read and write performance and enhance the quality of data processing services in the event of write failures has become a pressing technical problem for those skilled in the art. Summary of the Invention
[0004] In view of this, embodiments of the present invention provide a data writing method, a data reading method, a data processing method, and related equipment to improve data reading and writing performance and enhance the service quality of data processing in the event of data writing failure.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions.
[0006] In a first aspect, embodiments of the present invention provide a data writing method applied to a partitioned namespace solid-state drive, comprising:
[0007] Data write request;
[0008] When the data write in the data write request fails, the data in the data write request is stored in the write cache table at the position corresponding to the flash physical address according to the target logical address in the data write request. The data write status of the failed data is recorded as writing in progress at the position corresponding to the flash physical address in the write cache table.
[0009] The write cache table is pre-configured on the partition namespace solid-state drive and includes entries corresponding to each flash memory physical address, so as to store the write failure data and the data write status in the entries.
[0010] Secondly, embodiments of the present invention provide a data reading method applied to a partitioned namespace solid-state drive, comprising:
[0011] Get data read request;
[0012] Based on the flash physical address corresponding to the target logical address in the data read request, obtain the data write status and physical address remapping flag at the position corresponding to the flash physical address in the write cache table;
[0013] When the data writing status is in the writing state and there is no physical address remapping flag at the position corresponding to the physical address of the flash memory in the write cache table, the data stored at the position corresponding to the physical address of the flash memory in the write cache table is read.
[0014] Thirdly, embodiments of the present invention provide a data processing method applied to a host computer, comprising:
[0015] When a data write failure signal is received, a data read request containing the data write failure signal is generated and sent to the solid-state drive of the partition namespace to retrieve the data stored in the write cache table and rewrite the data.
[0016] Fourthly, embodiments of the present invention provide an electronic device, including a memory and a processor. The memory stores a program, and the processor calls the program stored in the memory to execute a data writing method as described in the first aspect, or a data reading method as described in the second aspect, or a data processing method as described in the third aspect.
[0017] Fifthly, embodiments of the present invention also provide a storage medium storing a program, which, when executed, implements the data writing method as described in the first aspect, or the data reading method as described in the second aspect, or the data processing method as described in the third aspect.
[0018] In a sixth aspect, embodiments of the present invention also provide a computer program, which, when executed, implements the data writing method as described in the first aspect, or the data reading method as described in the second aspect, or the data processing method as described in the third aspect.
[0019] This invention provides a data writing method applied to a partitioned namespace solid-state drive (SSD), comprising: acquiring a data write request; when the data write in the data write request fails, storing the data in the data write request at the location corresponding to the flash physical address in the write cache table according to the flash physical address corresponding to the target logical address in the data write request, and recording the data write status of the failed data as "writing in progress" at the location corresponding to the flash physical address in the write cache table; wherein, the write cache table is pre-set in the partitioned namespace SSD and includes entries corresponding to each flash physical address, so as to store the failed data and the data write status in the entries.
[0020] As can be seen, the data writing method provided in this embodiment of the invention pre-sets a write cache table in the partition namespace solid-state drive. When the partition namespace solid-state drive executes a received data write request and writes the data in the request to the target address (i.e., the flash memory physical address), if the data write fails, the data that failed to write can be directly stored in the write cache table based on the flash memory physical address in the received write failure signal. Since the write cache table includes entries corresponding to various flash memory physical addresses, it can store data in the write cache table based on the flash memory physical address in the write failure signal. Furthermore, while storing the write failure data, this embodiment of the invention records the data writing status of the write failure data as "writing in progress" at the corresponding flash memory physical address in the write cache table. Therefore, when it is necessary to rewrite the write failure data and read the corresponding data, the write cache table can be accessed based on the recorded "writing in progress" status marker, and the write failure data that needs to be rewritten can be quickly obtained from the write cache table. This improves data read / write performance and data processing efficiency in the event of a data write failure, thereby enhancing the service quality of data processing. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0022] Figure 1 This is a diagram illustrating the address mapping relationship between the host and the partition namespace solid-state drive;
[0023] Figure 2This is a schematic diagram illustrating the implementation structure of data processing between a partitioned namespace solid-state drive and the host computer.
[0024] Figure 3 This is a flowchart illustrating the data processing method provided in an embodiment of the present invention;
[0025] Figure 4 This is a schematic flowchart of the data writing method provided in an embodiment of the present invention;
[0026] Figure 5 This is a flowchart illustrating the data reading method provided in an embodiment of the present invention;
[0027] Figure 6 This is a schematic diagram illustrating the correspondence between the write cache table and the physical superblock in the data writing method provided in this embodiment of the invention.
[0028] Figure 7 This is a schematic diagram illustrating the address mapping relationship between the write cache table, the target logical address, and the physical superblock in the data writing method provided in this embodiment of the invention.
[0029] Figure 8 This is a schematic diagram illustrating an implementation process of storing failed write data in the data writing method provided in this embodiment of the invention;
[0030] Figure 9 This is a schematic diagram illustrating an implementation process of physical address remapping in the data writing method provided in this embodiment of the invention;
[0031] Figure 10 This is an architecture diagram of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0032] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0033] Zoned Namespaces is a new command set in the NVMe specification. This command set exposes a zoned block storage interface to the host, dividing its capacity into multiple zones. Within each zone, random reads are allowed, but only sequential writes are permitted. This design simplifies data placement strategies within the SSD, ensuring data is aligned with the physical media and optimizing throughput, QoS, capacity, and lifespan. However, effectively utilizing this read / write interface requires additional software-level adaptation. SSDs that support the Zoned Namespaces command set are called Zoned Namespaces SSDs (ZNS SSDs).
[0034] In the ZNS specification, the entire logical block address (LBA) range of the SSD namespace is divided into several equal-length intervals. Each equal-length LBA interval becomes a zone. Writes must be performed sequentially within each zone, and each zone has its own independent state machine for management.
[0035] For easier understanding, please refer to Figure 1 and Figure 2 , Figure 1 This is a diagram illustrating the address mapping relationship between the host and the partition namespace of the solid-state drive. Figure 2 This is a schematic diagram illustrating the implementation structure of data processing between a partitioned namespace solid-state drive and the host.
[0036] like Figure 1 and Figure 2 As shown, the ZNS SSD includes a host 20, a ZNS SSD controller 10, and a storage medium 30.
[0037] The storage medium 30 can be a non-volatile random access memory (NAND flash, NA NDFlash), which can latch charge using transistors, allowing information to be retained even without a power supply. NAND flash data is stored in memory cells in bits, with each memory cell storing only one bit. These memory cells are connected in a certain number of units to form bit lines, which is the bit width of the NAND device. These bit lines are then combined into pages, and multiple pages form a block. The specific number of blocks on a flash chip depends on the requirements. NAND flash reads and writes data in units of pages, while erasing data in units of blocks. The number of erase / write cycles per block is limited; the maximum number of erase / write cycles is called PE Cycles (Program erase cycles). The process of writing PEs to NAND flash is also called the programming process.
[0038] The ZNS SSD controller 10 includes a front end (FE) 11, a front end (FE) 12, and a front end (FE) 13, which are functional modules used for parsing and transmitting data for the NVMe protocol.
[0039] Cache 14 is used to cache frequently used data.
[0040] The memory controller 15 is used to control the retrieval of corresponding data from memory according to the target logical address. One memory controller 15 controls the reading of data in the corresponding connected memory.
[0041] When data processing is performed inside the ZNS SSD, the host 20 sends a data processing request to the ZNS SSD controller 10, and at the same time, the host 20 requests multiple space resources. The ZNS SSD controller 10, based on the data processing request, such as a data write request, first receives the data write request sent by the host 20 through the front end 11, and then transmits the data obtained from the cache based on the target logical address in the data write request to the front end 12 through the front end 11, and then to the front end 13 through the front end 12. This allows the front end 13 to determine the flash physical address obtained by converting the target logical address according to the mapping relationship, and transmit the data to the die in the storage medium corresponding to the flash physical address.
[0042] Of course, when there is no data stored in the cache, the memory controller 15 is used to retrieve the data from the corresponding connected memory according to the target logical address, and then store it in the cache 14. The data is then transferred from the cache 14 to the front end 13 via the front end 12.
[0043] However, when a partitioned namespace solid-state drive executes a data write request and writes the data in the data write request to the physical address of the flash memory, a media write failure may occur during the writing process. However, the data that failed to write is still inside the storage medium. Since the target logical address of the data in the ZNS is mapped one-to-one with the physical address of the flash memory, the data at the physical address of the flash memory where the write failed needs to be stored in an additional area. Otherwise, if the host 20 tries to read the physical address of the flash memory where the write failed, a read failure will occur, resulting in data loss.
[0044] If failed write data is transferred to another flash physical address, the pre-established mapping between the target logical block address (LBA) in the data write request sent by Host20 and the flash physical address (FPA) inside the ZNS SSD is disrupted. The ZNS SSD needs to quickly establish a new mapping between the flash physical address and the target logical address in the Host's data write request, and it also needs to effectively address read performance issues. Therefore, to address the above problems, this invention provides a data processing method applied to partitioned namespace solid-state drives to improve data read / write performance and increase data processing efficiency in the event of a write failure, thereby improving the quality of service for data processing.
[0045] Please refer to Figure 3 , Figure 3 This is a flowchart illustrating a data processing method provided in an embodiment of the present invention.
[0046] Firstly, regarding solid-state drives with partitioned namespaces, such as Figure 3 As shown, the data processing method may include the following steps:
[0047] Step S101: Obtain the data write request.
[0048] The data write request is issued by the host according to the data write requirement and sent to the partition namespace solid-state drive. The data write request may include the data to be written and the target logical address (LBA) corresponding to the physical location (i.e., flash physical address) where the data needs to be written, so that the partition namespace solid-state drive can write the data to the corresponding physical address according to the flash physical address corresponding to the target logical address.
[0049] Step S102: When the data writing in the data writing request fails, the data in the data writing request is stored in the write cache table at the position corresponding to the flash physical address, according to the flash physical address corresponding to the target logical address in the data writing request.
[0050] The partition namespace solid-state drive processes the data write request according to the obtained data write request, that is, the partition namespace solid-state drive writes the data to the flash physical address corresponding to the target logical address according to the target logical address in the data write request.
[0051] When a write failure occurs during the process of writing data to the flash physical address, the partition namespace SSD will process the failed data (i.e., the write failure data) based on the flash physical address corresponding to the time of the write failure.
[0052] The write cache table is pre-configured in the partition namespace solid-state drive and includes entries corresponding to each flash memory physical address, so as to store the write failure data and record the data write status in the entries.
[0053] Step S103: In the write cache table, the data write status of the failed write data is recorded as being written at the physical address location of the flash memory.
[0054] The write cache table is used to store write failure data. To facilitate the subsequent retrieval and rewriting of write failure data, each entry in the write cache table is mapped one-to-one with the flash memory physical address. That is, when the partition namespace SSD executes a data write request, the flash memory physical address is mapped to each entry in the write cache table according to the order in which data is written according to the flash memory physical address corresponding to the target logical address. When a data write failure signal is obtained, the write failure data can be directly stored in the write cache table according to the returned flash memory physical address, and the position corresponding to the physical flash memory address is the corresponding entry.
[0055] To facilitate the acquisition and judgment of write failure data, the write cache table can further set the data writing status of the corresponding table entry to "writing in progress" (Buffer) after storing the write failure data into the corresponding table entry. This indicates that the table entry stores data that was not successfully written. When it is necessary to retrieve write failure data later, the corresponding stored write failure data can be quickly obtained directly based on the "writing in progress" status flag, so that the write failure data can be rewritten.
[0056] As can be seen, the data writing method provided in this embodiment of the invention has a pre-set write cache table in the partition namespace solid-state drive. Therefore, when the partition namespace solid-state drive executes a received data write request and writes the data in the write request to the target address (i.e., the flash memory physical address), if the data write fails, the data that failed to write can be directly stored in the write cache table based on the flash memory physical address at that time. Since the write cache table includes entries corresponding to various flash memory physical addresses, the data can be stored in the write cache table entries based on the flash memory physical address. Furthermore, while storing the write failure data, this embodiment of the invention records the data write status of the write failure data as "writing in progress" at the corresponding flash memory physical address position in the write cache table. Therefore, when it is necessary to rewrite the write failure data and read the corresponding data, the write cache table can be accessed based on the recorded "writing in progress" status marker, and the write failure data that needs to be rewritten can be quickly obtained from the write cache table. This improves data read / write performance and data processing efficiency in the event of a data write failure, thereby improving the service quality of data processing.
[0057] To facilitate the differentiation of data write statuses recorded in the cache table and thus enable faster execution of data write requests, one implementation method utilizes different flags to record different data write statuses. Please refer to [reference needed]. Figure 4 , Figure 4 This is a schematic flowchart of the data writing method provided in an embodiment of the present invention.
[0058] As shown in the figure, the process may include the following steps:
[0059] Step S110: Obtain the data write request.
[0060] The data write request is issued by the host according to the data write requirement and sent to the partition namespace solid-state drive. The data write request may include the data to be written and the target logical address (LBA) corresponding to the physical location (i.e., flash physical address) where the data needs to be written, so that the partition namespace solid-state drive can write the data to the corresponding address according to the flash physical address corresponding to the target logical address.
[0061] Step S111: Based on the flash physical address corresponding to the target logical address in the data write request, write the data in the data write request into the physical superblock of the pre-allocated partition namespace solid-state drive corresponding to the flash physical address.
[0062] The physical superblock is a pre-allocated physical superblock set in the solid-state drive of the partition namespace, and the physical superblock corresponds one-to-one with the write cache table.
[0063] The partition namespace SSD responds to the data write request by writing data to the flash physical address corresponding to the target logical address in the data write request.
[0064] Step S112: Determine whether the data in the data write request has failed to be written. If yes, proceed to step S113; otherwise, proceed to step S115.
[0065] Step S113: Write the data to the physical address of the flash memory corresponding to the target logical address in the data write request at the corresponding physical address of the flash memory in the data cache table.
[0066] Step S114: In the write cache table, the data write status of the failed write data is kept as being written at the physical address location of the flash memory.
[0067] Record the writing status (buffer) at the table entry corresponding to the failed data write. The writing status indicates that the data is being written but has not yet been successfully written.
[0068] In one implementation, the "writing in progress" state can be recorded as "writing in progress" in the corresponding entry of the write cache table during the execution of the data write request, i.e., during the process of writing data to the corresponding flash physical address based on the target logical address. When the data write fails, the data write state (writing in progress) recorded in the write cache table entry corresponding to the flash physical address in the data write signal is maintained based on the returned data write failure signal.
[0069] In another embodiment, the data writing status can also be recorded as "writing in progress" in the write cache table entry when the data write request fails, based on the flash memory physical address of the failed data. That is, the data write status can be recorded in the write cache table beforehand during data writing, or it can be recorded in real-time after a data write failure.
[0070] Step S115: In the write cache table, the data write status recorded at the physical address location of the flash memory is "write complete".
[0071] When a successful data write is detected, it indicates that the data has been successfully written to the physical superblock. Based on the different data write detection signals, subsequent operations on the partition namespace SSD can be facilitated. To help distinguish different data write states in the write cache table, after determining that the data in the data write request has been successfully written to the physical superblock, a corresponding write success flag can be recorded in the write cache table.
[0072] The write complete status (Flash) indicates that the data has been written to the physical superblock according to the flash physical address. Therefore, the data write status can be recorded in the entry of the write cache table corresponding to the flash physical address as write complete.
[0073] If the entry in the write cache table corresponding to the flash memory physical address does not have a pre-recorded write status, the write completion status (Flash) can be recorded in real time based on the real-time determination of whether the data has been successfully written. If the entry in the write cache table corresponding to the flash memory physical address already has a pre-recorded write status, the write status is updated to the write completion status (Flash).
[0074] By using different markers recorded in the write cache table for different data write states, it is easy to determine the data status of each entry in the write cache table, so as to retrieve the write failure data in the corresponding entry.
[0075] In order to enable the host to quickly obtain the write failure data that needs to be rewritten, in one implementation, the partition namespace solid-state drive can also send a data write failure signal to the host.
[0076] Please continue to refer to this. Figure 3 ,like Figure 3 As shown, the process may also include:
[0077] Step S104: Send a data write failure signal to the host.
[0078] The partitioned namespace solid-state drive sends a data write failure signal to the host. This signal includes the flash memory physical address. When the host receives the signal, it can directly retrieve the failed data from the corresponding entry in the write cache table based on the record flag indicating the data write status at the flash memory physical address. This allows the host to rewrite the failed data, facilitating its retrieval of the data and improving its efficiency. Ultimately, this enhances the quality of data reading and writing services.
[0079] As the number of write failure signals received by the ZNS SSD accumulates, the amount of write failure data stored in the write cache table increases, which slows down the speed at which the host reads the write failure data that needs to be rewritten. Therefore, in order to solve the problem of reduced host read speed caused by storing a large amount of write failure data, in one implementation, the physical address of the successfully written data and the write cache table that stores a large amount of write failure data can be remapped.
[0080] Please refer to Figure 5 , Figure 5 This is a flowchart illustrating the data reading method provided in an embodiment of the present invention.
[0081] like Figure 5 As shown, for partitioned namespace solid-state drives, this process may include the following steps:
[0082] Step S120: Obtain the data write request.
[0083] Step S121: When the data writing in the data writing request fails, obtain the number of failures of the data writing.
[0084] To facilitate determining whether physical address remapping is needed for the write cache table and the physical superblock containing successfully written data, we can use the number of failed write attempts as a reference. When the amount of failed write data stored in the write cache table due to the number of failures is large, then physical address remapping can be performed between the write cache table and the physical superblock.
[0085] Step S122: Determine whether the number of failures corresponding to the same write cache table has reached the write threshold. If it has reached the write threshold, proceed to step S123; otherwise, proceed to step S124.
[0086] The number of failures corresponds to the amount of data that failed to be written when a data write request fails. This amount of data is the number of data that the partition namespace solid-state drive stores in the write cache table when a data write failure occurs.
[0087] The write threshold is the maximum amount of data that causes a decrease in the rate at which the host reads failed write data that needs to be rewritten.
[0088] Step S123: Migrate the data in the super cache block corresponding to the write cache table that has reached the write threshold to another super cache block, perform physical address remapping, and set the physical address remapping flag in the write cache table.
[0089] At this point, a physical address remapping flag is added to the data write cache table when the data reaches the write threshold. This allows the host to determine the address for retrieving the failed data based on whether the data write failure signal contains the physical address remapping flag. This enables the host to quickly retrieve the failed data without affecting the host's read / write efficiency.
[0090] Step S124: Based on the flash physical address corresponding to the target logical address in the data write request, store the data in the data write request in the write cache table at the position corresponding to the flash physical address, and record the data write status of the failed data as being in the write state at the position corresponding to the flash physical address in the write cache table.
[0091] When the write threshold is not reached, it means that the number of write failure data stored in the write cache table will not affect the host's efficiency in reading write failure data. Therefore, the write failure data in the write failure signal can be directly stored in the original write cache table without remapping the physical address of the write cache table and the physical superblock.
[0092] Step S125: Send a data write failure signal to the host.
[0093] The data write failure signal can be the data write failure signal with the physical address remapping flag in step S123, or the data write failure signal without the physical address remapping flag in step S124.
[0094] In one implementation, step S123 may include:
[0095] The write cache table, and the data written to the super physical block of the partition namespace solid-state drive corresponding to the write cache table, are transferred to the physical super block of the partition namespace solid-state drive that does not correspond to the write cache table.
[0096] The non-corresponding physical superblock of the solid-state drive in the partition namespace refers to any physical superblock other than the physical superblock that corresponds to the initial write cache table.
[0097] It should be noted that multiple physical superblocks can be determined simultaneously when initially determining the physical superblocks used to store data.
[0098] Since the data stored in the physical superblock corresponds to the target logical address in the data write request and the various entries in the write cache table, when performing physical address remapping on the write cache table, it is necessary to synchronously perform physical address remapping on the data already written in the physical superblock corresponding to the write cache table, so as to avoid affecting the data read and write performance of the subsequent host.
[0099] In one implementation, to enable the host to successfully complete data read and write operations, a mapping relationship can be established between the write cache table, the target logical address, and the physical superblock corresponding to the flash memory physical address. Please refer to [reference needed]. Figure 6 and Figure 7 , Figure 6 This is a schematic diagram illustrating the correspondence between the write cache table and the physical superblock in the data writing method provided in this embodiment of the invention. Figure 7 This is a schematic diagram illustrating the address mapping relationship between the write cache table, the target logical address, and the physical superblock in the data writing method provided in this embodiment of the invention.
[0100] like Figure 6 and Figure 7 As shown, the allocation status of the partition namespace solid-state drive is recorded through a space resource table. The space resource table includes the correspondence between each space resource, each write cache table, and the physical starting address in the flash physical address of each physical superblock of the partition namespace solid-state drive. The write cache table includes a write cache table in the set state and a write cache table in the unset state.
[0101] Based on the settings, determine whether the space resources have a write cache table. This allows you to determine the space resources that can be configured based on actual usage and to reasonably set the number of write cache tables.
[0102] In the unconfigured space resources, the correspondence between space resources and physical superblocks is established according to the correspondence when the write cache table is not set normally, so as to meet the processing of data write requests under different conditions.
[0103] By establishing the correspondence, the host can quickly determine the physical address of the flash memory and the physical superblock corresponding to the written data when the write failed.
[0104] In one implementation, the data write status recorded in the write cache table also includes a no-data-write status.
[0105] The "Invalid" status indicates that there is no related failed write data in the write cache table entries.
[0106] To facilitate understanding of the specific implementation of the data processing method provided in the embodiments of the present invention, please refer to...Figure 6 , Figure 7 refer to Figure 8 and Figure 9 , Figure 8 This is a schematic diagram illustrating an implementation process of storing failed write data in the data writing method provided in this embodiment of the invention. Figure 9 This is a schematic diagram illustrating an implementation process of physical address remapping in the data writing method provided in this embodiment of the invention.
[0107] like Figure 8 As shown, when a data write fails, the partition namespace SSD writes the data in the data write request to the corresponding entry in the write cache table based on the flash physical address at the time of the write failure. The entry is then set to record the data write status as "writing in progress," thus preventing the host from repeatedly using the entry corresponding to the write failure to record the data write status of new data when writing data. This also makes it easier for the host to retrieve the failed data from the corresponding entry based on the flash physical address.
[0108] like Figure 9 As shown, when the number of write failures for a data write request reaches the write threshold, it indicates that writing failed data to the same write cache table at this point will affect the host's read and write efficiency. Therefore, based on the data in the failed write requests and the flash memory physical address at this time, the write efficiency will be adjusted accordingly. Figure 6 The correspondence shown indicates that the data written to the physical superblock corresponding to the write cache table and the write cache table have undergone physical address remapping. A physical address remapping flag is set in the write cache table so that when the host receives a data write failure signal and tries to reread the failed write data, it can determine the new write cache table and the position of the corresponding table entry storing the failed write data based on the physical address remapping flag set in the write cache table. This improves the efficiency of the host in reading the failed write data without affecting the host's ability to read the failed write data.
[0109] Based on the aforementioned use of a write cache table to store failed write data on the partition namespace SSD, when the host receives a data write failure signal from the partition namespace SSD, it can retrieve and rewrite the failed data. Please refer to [link / reference needed]. Figure 3 .
[0110] like Figure 3 As shown, for the host side, the data processing method may include the following steps:
[0111] Step S201: Obtain the data write failure signal.
[0112] The write failure signal is sent to the host by the partition namespace solid-state drive when a write failure occurs. The data write failure signal includes the physical address of the flash memory corresponding to the written failure data, so that the host can directly index the written failure data in the write cache table based on the flash memory physical address.
[0113] Step S202: Generate and send a data read request containing the data write failure signal to the partition namespace solid-state drive to obtain the data stored in the write cache table and rewrite the data.
[0114] Since the partition namespace SSD has stored the failed write data in the corresponding entry of the write cache table according to the flash physical address, the host can generate a data read request to retrieve the failed write data based on the received data write failure signal. The data read request is then sent to the partition namespace SSD, which can determine the corresponding writing status based on the flash physical address in the data write failure signal carried in the data read request. The SSD can then index the failed write data in the write cache table according to the writing status and finally rewrite the failed write data.
[0115] When the partition namespace SSD is in the writing state based on the physical address of the flash memory, after indexing the failed write data from the corresponding entry in the write cache table, it returns the failed write data to the host. This allows the host to regenerate a data write request based on the failed write data, thereby enabling the rewriting of the failed write data. In other words, the host reissues a data write request to the partition namespace SSD to determine a new physical flash memory address based on the new target logical address for the failed write data in the new data write request, and then writes the failed write data to the new physical flash memory address.
[0116] As can be seen, the data processing method provided in this embodiment of the invention pre-sets a write cache table in the partition namespace solid-state drive. When the partition namespace solid-state drive executes a received data write request and writes the data in the write request to the target address (i.e., the flash memory physical address), if the data write fails, the data that failed to write can be directly stored in the write cache table as the corresponding write failure data based on the flash memory physical address in the received write failure signal. Since the write cache table includes entries corresponding to various flash memory physical addresses, the data can be stored in the write cache table based on the flash memory physical address in the write failure signal. Furthermore, while storing the write failure data, this embodiment of the invention records the data write status of the write failure data as "writing in progress" at the corresponding flash memory physical address position in the write cache table. Therefore, when it is necessary to rewrite the write failure data and read the corresponding data, the write cache table can be accessed based on the recorded "writing in progress" status marker, and the write failure data that needs to be rewritten can be quickly obtained from the write cache table. This improves data read / write performance and data processing efficiency in the event of a data write failure, thereby enhancing the service quality of data processing.
[0117] In one implementation, the host can also send a data write request to the partition namespace solid-state drive based on the data write signal. Please refer to [link to relevant documentation]. Figure 3 .
[0118] like Figure 3 As shown, the data processing method for the host may further include:
[0119] Step S2001: Obtain the user's region activation signal; based on the region activation signal, allocate a write cache table and a super physical block of the partition namespace solid-state drive to the user, and request the partition namespace solid-state drive to record the write cache table and the corresponding super physical block.
[0120] After the host obtains the user's zone activation signal based on the data write requirements, it can determine multiple open zones based on the zone activation signal. Each open zone corresponds to an application with data write requirements, and each open zone contains multiple flash physical addresses for storing data for a specific application.
[0121] In order to enable the storage of failed write data and quickly establish the address mapping between the failed write data and the host, the host requests a Write Cache Table and multiple physical superblocks when it determines multiple space resources. Each physical superblock corresponds to one space resource.
[0122] After obtaining the write cache table and multiple physical superblocks, the obtained write cache table and multiple physical superblocks are recorded on the partition namespace solid-state drive. This allows the partition namespace solid-state drive to store the write failure data in the write cache table corresponding to the flash physical address of the physical superblock, facilitating subsequent reading by the host.
[0123] Furthermore, in order to trigger the writing of data in the partition namespace, the host requests the partition namespace solid-state drive to record the write cache table and the corresponding super physical block, and then sends a data write request to the partition namespace solid-state drive.
[0124] Step S2002: Send a data write request.
[0125] In one implementation, the requested write cache table and multiple physical superblocks can be recorded in the space resource table of the partition namespace solid-state drive.
[0126] Because storing a large amount of failed write data in the cache table can affect the host's read efficiency, once the amount of failed write data in the cache table reaches a write threshold, a physical address remapping is performed on the cache table and the successfully written data. A physical address remapping flag is set in the corresponding failed write signal. Therefore, when the host receives a failed write signal and detects the physical address remapping flag in the signal, it re-determines the read address and then reads the failed write data based on the new address. Please refer to [reference needed]. Figure 5 .
[0127] like Figure 5 As shown, regarding the host side, the data processing method may further include the following steps:
[0128] Step S210: Send a data write request.
[0129] The data write request is generated by the host based on data write requirements. When the subsequent partition namespace solid-state drive responds to the data write request and fails to execute (i.e., the data write fails), it returns a data write failure signal to the host.
[0130] Step S211: Obtain the data write failure signal.
[0131] Step S212: Generate and send a data read request containing the data write failure signal to the partition namespace solid-state drive.
[0132] This facilitates the retrieval of data stored in the write cache table according to data read requests, and the rewriting of the data.
[0133] It should be noted that the data write request containing the data write failure signal also includes the target logical address that needs to be rewritten, so that after the write failure data is obtained, it can be rewritten based on the new target logical address, avoiding writing to the flash physical address where the write failure exists.
[0134] The host sends a data write request containing the data write failure signal to the partition namespace solid-state drive, so that the partition namespace solid-state drive can quickly retrieve the write failure data from the write cache table according to the writing status corresponding to the previously recorded write failure data, and rewrite the write failure data.
[0135] For partitioned namespace SSDs, please refer to [link / reference]. Figure 5 It may also include the following steps:
[0136] Step S217: Obtain a data read request; and based on the flash physical address corresponding to the target logical address in the data read request, obtain the data write status and physical address remapping flag at the position corresponding to the flash physical address in the cache table.
[0137] The data read request is generated by the host based on the data write failure signal sent by the solid-state drive of the partition namespace, and is used to read the failed data for rewriting.
[0138] Step S218: Detect whether the data writing status is in the writing state and whether a physical address remapping flag is set at the position corresponding to the physical address of the flash memory in the write cache table. If yes, proceed to step S219; otherwise, proceed to step S220.
[0139] The physical address remapping flag indicates that the write cache table used to store write failure data in the data write failure signal, and the physical superblock used to store data in the data write request, have been changed.
[0140] Step S219: Determine the remapped flash physical address based on the flash physical address and the physical address remapping flag, and read the data requested by the data read request based on the remapped flash physical address.
[0141] When the data writing status is "writing in progress" and there is a physical address remapping flag at the corresponding position of the flash physical address in the write cache table, it means that the flash physical address included in the data read request needs to be recalculated to determine the remapped flash physical address, so that the host can accurately obtain the corresponding write failure data. Since the time required to recalculate the remapped flash physical address based on the flash physical address with the physical address remapping flag is less than the time required for the host to directly read the write failure data stored in the write cache table without physical address remapping, it will not affect the host's reading of write failure data and can improve the efficiency of the host's reading of write failure data, thereby not affecting the service quality of the host reading and rewriting the write failure data.
[0142] Step S220: Read the data stored in the write cache table at the location corresponding to the physical address of the flash memory.
[0143] When the data write status is not in the writing state and there is no physical address remapping flag, it means that the number of write failure data stored in the write cache table will not affect the host's read efficiency. Therefore, the corresponding writing status can be determined directly based on the flash physical address corresponding to the data write failure, so as to read the write failure data from the write cache table based on the writing status and perform subsequent rewriting.
[0144] In one implementation, before executing step S217, since the partition namespace SSD contains entries in the write cache table recording the writing status when a data write failure occurs, and the partition namespace SSD may contain physical superblocks with unset write cache tables (i.e., physical superblocks that do not require write cache tables), when the partition namespace SSD receives a data read request from the host containing a data write failure signal, it can first determine whether a write cache table is set in the physical superblock corresponding to the flash memory physical address in the data read request, based on the correspondence between space resources, the write cache table setting status, and the physical superblock's physical starting address; and then, if a write cache table is set, the partition namespace SSD can further determine whether a write cache table is set in the physical superblock corresponding to the flash memory physical address in the data read request. If the data is entered into the cache table, then it is determined whether the physical address of the flash memory has a corresponding writing state. Since the data read request received by the partition namespace SSD at this time is based on the data write failure signal, that is, the partition namespace SSD has recorded the data write state when the data write failed as the writing state in the corresponding entry of the write cache table. Therefore, the corresponding writing state can be determined based on the physical address of the flash memory. If the corresponding writing state is determined, since there may be a situation where physical address remapping is performed to avoid limiting the data read speed, before obtaining the write failure data, it is possible to check whether the write cache table has a physical address remapping flag, i.e., step S217, so as to accurately obtain the write failure data.
[0145] As can be seen, the data reading method provided in this embodiment of the invention has a pre-set write cache table in the partition namespace solid-state drive. Therefore, when the partition namespace solid-state drive executes a received data write request and writes the data in the write request to the target address (i.e., the flash memory physical address), if the data write fails, the data that failed to write can be directly stored in the write cache table based on the flash memory physical address at that time. Since the write cache table includes entries corresponding to various flash memory physical addresses, the data can be stored in the write cache table entries based on the flash memory physical address. Furthermore, while storing the write failure data, this embodiment of the invention records the data write status of the write failure data as "writing in progress" at the corresponding flash memory physical address position in the write cache table. Therefore, when it is necessary to rewrite the write failure data and read the corresponding data, the write cache table can be accessed based on the recorded "writing in progress" status marker, and the write failure data that needs to be rewritten can be quickly obtained from the write cache table. This improves data read / write performance and data processing efficiency in the event of a data write failure, thereby improving the service quality of data processing.
[0146] This invention also provides a data writing device applied to a partitioned namespace solid-state drive, comprising:
[0147] The data write request acquisition module is used to acquire data write requests;
[0148] The data write failure handling module is used to store the data in the data write request into the write cache table at the position corresponding to the flash physical address according to the flash physical address corresponding to the target logical address in the data write request when the data write fails, and to record the data write status of the failed data as being in the write state at the position corresponding to the flash physical address in the write cache table.
[0149] The write cache table is pre-configured on the partition namespace solid-state drive and includes entries corresponding to each flash memory physical address, so as to store the write failure data and the data write status in the entries.
[0150] In one embodiment, the data writing device further includes:
[0151] The data write request processing module is used to write the data to the physical address of the flash memory corresponding to the target logical address in the data write request, and to record the writing status at the position of the physical address of the flash memory in the write cache table.
[0152] The data write failure handling module is used to record the data write status of the failed data as being in progress at the corresponding physical address location in the write cache table, including:
[0153] In the write cache table, the data write status of the failed write data is kept as being written at the corresponding physical address location of the flash memory.
[0154] In one embodiment, the data writing device further includes:
[0155] The data writing module is used to write the data in the data writing request into the physical superblock of the partition namespace solid-state drive corresponding to the flash physical address, according to the target logical address in the data writing request. The physical superblock is a pre-allocated physical superblock set in the partition namespace solid-state drive, and the physical superblock corresponds one-to-one with the write cache table.
[0156] In one embodiment, the data processing apparatus may further include:
[0157] The data write success processing module is used to record the data write status as write complete at the corresponding physical address location of the flash memory in the write cache table when the data write is successful.
[0158] In one embodiment, the data processing apparatus may further include:
[0159] The failure count acquisition module is used to acquire the number of times the data writing failed.
[0160] The physical address remapping module is used to migrate the data in the super cache block corresponding to the write cache table that has reached the write threshold to another super cache block when the number of failures corresponding to the same write cache table reaches the write threshold, and to perform physical address remapping, and to set a physical address remapping flag in the write cache table.
[0161] In one embodiment, the data writing device may further include:
[0162] The data write failure signal sending module is used to send the data write failure signal to the host.
[0163] In one implementation, the data write status recorded in the write cache table also includes a no-data-write status.
[0164] The data writing device provided in this embodiment of the invention has a pre-configured write cache table in the partition namespace solid-state drive. When the partition namespace solid-state drive executes a received data write request and writes the data in the write request to the target address (i.e., the flash memory physical address), if the data write fails, the data that failed to write can be directly stored in the write cache table based on the flash memory physical address at that time. Since the write cache table includes entries corresponding to various flash memory physical addresses, data can be stored in the write cache table entries based on the flash memory physical address. Furthermore, while storing the write failure data, this embodiment of the invention records the data write status of the write failure data as "writing in progress" at the corresponding flash memory physical address position in the write cache table. Therefore, when it is necessary to rewrite the write failure data and read the corresponding data later, the write cache table can be accessed based on the recorded "writing in progress" status marker, and the write failure data that needs to be rewritten can be quickly obtained from the write cache table. This improves data read / write performance and data processing efficiency in the event of a data write failure, thereby enhancing the quality of data processing services.
[0165] This invention also provides a data reading device, comprising:
[0166] The data read request acquisition module is used to acquire data read requests.
[0167] The data read request processing module obtains the data write status and physical address remapping flag at the position corresponding to the flash physical address in the cache table based on the flash physical address corresponding to the target logical address in the data read request.
[0168] The first data reading module is used to read the data stored in the write cache table at the location corresponding to the physical address of the flash memory when the data writing state is in the writing state and there is no physical address remapping flag at the location corresponding to the physical address of the flash memory in the write cache table.
[0169] In one embodiment, the data reading device further includes:
[0170] The second data reading module is used to determine the remapped flash physical address based on the flash physical address and the physical address remapping flag when the data writing state is in the writing state and there is a physical address remapping flag at the position corresponding to the flash physical address in the write cache table, and to read the data requested by the data reading request based on the remapped flash physical address.
[0171] In one implementation, the allocation status of the partition namespace solid-state drive is recorded through a space resource table. The space resource table includes the correspondence between each space resource, each write cache table, and the physical starting address in the flash physical address of each physical superblock of the partition namespace solid-state drive. The write cache table includes a write cache table in a set state and a write cache table in a non-set state.
[0172] The data reading device provided in this embodiment of the invention has a pre-configured write cache table in the partition namespace solid-state drive. When the partition namespace solid-state drive executes a received data write request and writes the data in the write request to the target address (i.e., the flash memory physical address), if the data write fails, the data that failed to write can be directly stored in the write cache table based on the flash memory physical address at that time. Since the write cache table includes entries corresponding to various flash memory physical addresses, data can be stored in the write cache table entries based on the flash memory physical address. Furthermore, while storing the write failure data, this embodiment of the invention records the data write status of the write failure data as "writing in progress" at the corresponding flash memory physical address position in the write cache table. Therefore, when it is necessary to rewrite the write failure data and read the corresponding data, the write cache table can be accessed based on the recorded "writing in progress" status marker, and the write failure data that needs to be rewritten can be quickly obtained from the write cache table. This improves data read / write performance and data processing efficiency in the event of a data write failure, thereby enhancing the quality of data processing services.
[0173] This invention also provides a data processing apparatus applied to a host computer, the apparatus comprising:
[0174] The data write failure signal receiving module is used to receive data write failure signals;
[0175] The write failure data reading module is used to read the write failure data stored in the write cache table at the position corresponding to the flash physical address, based on the flash physical address in the data write failure signal.
[0176] The write failure data rewrite module is used to rewrite the data as data after the write failure.
[0177] In one embodiment, the data processing apparatus may further include:
[0178] A data write request sending module is used to acquire a data write signal; according to the data write signal, apply for writing to the cache table and the super physical block of the partition namespace solid-state drive, and record the write cache table and the multiple super physical blocks to the partition namespace solid-state drive accordingly; and send a data write request based on the data write signal.
[0179] The data processing apparatus provided in this embodiment of the invention has a pre-configured write cache table in the partition namespace solid-state drive. When the partition namespace solid-state drive executes a received data write request and writes the data in the write request to the target address (i.e., the flash memory physical address), if the data write fails, the data that failed to write can be directly stored in the write cache table based on the flash memory physical address at that time. Since the write cache table includes entries corresponding to various flash memory physical addresses, data can be stored in the write cache table entries based on the flash memory physical address. Furthermore, while storing the write failure data, this embodiment of the invention records the data write status of the write failure data as "writing in progress" at the corresponding flash memory physical address position in the write cache table. Therefore, when it is necessary to rewrite the write failure data and read the corresponding data later, the write cache table can be accessed based on the recorded "writing in progress" status marker, and the write failure data that needs to be rewritten can be quickly obtained from the write cache table. This improves data read / write performance and data processing efficiency in the event of a data write failure, thereby enhancing the quality of data processing services.
[0180] This invention also provides an electronic device, including a memory and a processor. The memory stores a program, and the processor calls the program stored in the memory to execute a data writing method as described in any of the foregoing embodiments, or to execute a data reading method as described in any of the foregoing embodiments, or to execute a data processing method as described in any of the foregoing embodiments.
[0181] Optionally, Figure 10 This is an architectural diagram of an electronic device provided in an embodiment of the present invention, such as a server device or a terminal device; see reference. Figure 10 The electronic device may include at least one processor 41, at least one communication interface 42, at least one memory 43, and at least one communication bus 44.
[0182] In this embodiment, the number of processor 41, communication interface 42, memory 43 and communication bus 44 is at least one, and processor 41, communication interface 42 and memory 43 communicate with each other through communication bus 44.
[0183] Optionally, the communication interface 42 can be an interface for a communication module used for network communication.
[0184] Optionally, the processor 41 may be a CPU (Central Processing Unit), GPU (Graphics Processing Unit), NPU (Embedded Neural Network Processor), FPGA (Field Programmable Gate Array), TPU (Tensor Processing Unit), AI chip, ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.
[0185] The memory 43 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0186] As an optional implementation of the disclosed content in the embodiments of the present invention, the memory 43 may store a program, and the processor 41 may call the program to execute the data writing method, data reading method, or data processing method provided in the above embodiments of the present invention.
[0187] This invention also provides a storage medium storing a program that, when executed, implements the data writing method as described in the foregoing embodiments, or implements the data reading method as described in any of the foregoing embodiments, or implements the data setting method as described in any of the foregoing embodiments.
[0188] This invention also provides a computer program that, when executed, implements the data writing method as described in the foregoing embodiments, or the data reading method as described in the foregoing embodiments, or the data processing method as described in the foregoing embodiments.
[0189] The foregoing describes multiple embodiment schemes provided by the embodiments of this application. The optional methods described in each embodiment scheme can be combined and cross-referenced with each other without conflict, thereby extending to a variety of possible embodiment schemes. These can all be considered as the embodiment schemes disclosed and published by the embodiments of this application.
[0190] While the embodiments disclosed above are described in this application, this application is not limited thereto. Any person skilled in the art can make various modifications and alterations without departing from the spirit and scope of this application; therefore, the scope of protection of this application should be determined by the scope defined in the claims.
Claims
1. A data writing method, wherein, Applications to partitioned namespace solid-state drives include: Data write request; When the data write in the data write request fails, the data in the data write request is stored in the write cache table at the position corresponding to the flash physical address according to the target logical address in the data write request. The data write status of the failed data is recorded as writing in progress at the position corresponding to the flash physical address in the write cache table. The write cache table is pre-configured on the partition namespace solid-state drive and includes entries corresponding to each flash memory physical address, so as to store the write failure data and the data write status in the entries.
2. The data writing method as described in claim 1, wherein, Before the step of handling data write failure in the data write request, the method further includes: According to the flash physical address corresponding to the target logical address in the data write request, write to the data cache table at the corresponding flash physical address, and record the writing status at the corresponding flash physical address position in the write cache table; The step of recording the write status of the failed data as being in a write state at the corresponding physical address location in the write cache table includes: In the write cache table, the data write status of the failed write data is kept as being written at the corresponding physical address location of the flash memory.
3. The data writing method as described in claim 2, wherein, Before the step of handling data write failure in the data write request, the method further includes: According to the flash physical address corresponding to the target logical address in the data write request, the data in the data write request is written to the physical superblock of the pre-approved partition namespace solid-state drive corresponding to the flash physical address. The physical superblock is a pre-approved physical superblock set in the partition namespace solid-state drive, and the physical superblock corresponds one-to-one with the write cache table.
4. The data writing method as described in claim 3, wherein, Also includes: When the data is successfully written, the write cache table records the data write status as write complete at the physical address location of the flash memory.
5. The data writing method as described in claim 4, wherein, Also includes: Get the number of times the data writing failed; When the number of failures corresponding to the same write cache table reaches the write threshold, the data in the super cache block corresponding to the write cache table that has reached the write threshold is migrated to another super cache block, and physical address remapping is performed, and a physical address remapping flag is set in the write cache table.
6. The data writing method according to any one of claims 1-5, wherein, After the step of recording the data write status of the failed write data at the corresponding physical address location in the write cache table, the method further includes: Send a data write failure signal to the host.
7. The data writing method according to any one of claims 1-5, wherein, The data write status also includes a no-data-write status.
8. A data reading method, wherein, Applications to partitioned namespace solid-state drives include: Get data read request; Based on the flash physical address corresponding to the target logical address in the data read request, obtain the data write status and physical address remapping flag at the position corresponding to the flash physical address in the write cache table; When the data writing status is in the writing state and there is no physical address remapping flag at the position corresponding to the physical address of the flash memory in the write cache table, read the data stored at the position corresponding to the physical address of the flash memory in the write cache table; The write cache table is pre-configured on the solid-state drive of the partition namespace, and includes entries corresponding to each physical address of the flash memory. The entries store write failure data and the data write status. The write failure data is the data recorded at the physical address of the flash memory when the data write status is in the writing state.
9. The data reading method as described in claim 8, wherein, Also includes: When the data writing status is in the writing state and there is a physical address remapping flag at the position corresponding to the physical address of the flash memory in the write cache table, the remapped flash memory physical address is determined according to the flash memory physical address and the physical address remapping flag, and the data requested by the data read request is read according to the remapped flash memory physical address.
10. The data reading method as described in claim 9, wherein, The allocation status of the partition namespace solid-state drive is recorded through a space resource table. The space resource table includes the correspondence between each space resource, each write cache table, and the physical starting address in the flash physical address of each physical superblock of the partition namespace solid-state drive. The write cache table includes a write cache table in the set state and a write cache table in the unset state.
11. A data processing method, wherein, Applied to the host, including: When a data write failure signal is received from the partition namespace SSD, a data read request containing the data write failure signal is generated and sent to the partition namespace SSD to retrieve the data stored in the write cache table and rewrite the data. The data write failure signal includes a flash memory physical address. When the host receives the data write failure signal, it reads the failed write data from the corresponding entry in the write cache table based on the record flag of the data write status corresponding to the flash memory physical address, thereby rewriting the failed write data. The write cache table is pre-set on the partition namespace SSD and includes entries corresponding to each flash memory physical address to store the failed write data and the data write status in the entries.
12. The data processing method as described in claim 11, wherein, Also includes: Obtain the user's regional activation signal; Based on the region activation signal, the system allocates a write cache table and a super physical block for the partition namespace solid-state drive to the user, and requests the partition namespace solid-state drive to record the write cache table and the corresponding super physical block.
13. An electronic device, wherein, The device includes a memory and a processor. The memory stores a program, and the processor calls the program stored in the memory to execute the data writing method as described in any one of claims 1-7, or to execute the data reading method as described in any one of claims 8-10, or to execute the data processing method as described in any one of claims 11-12.
14. A storage medium, wherein, The storage medium stores a program, which, when executed, implements the data writing method as described in any one of claims 1-7, or the data reading method as described in any one of claims 8-10, or the data processing method as described in any one of claims 11-12.
Citation Information
Patent Citations
Hardware cache management data backup and quick recovery method and system
CN110287062A