Methods, devices, and computer equipment for optimizing write command processing of solid-state drives
By optimizing the write command processing method of solid-state drives, the dependence on contiguous memory is reduced, processing efficiency is improved, the problem of limited DRAM capacity is solved, and more efficient write command response is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-25
- Publication Date
- 2026-03-10
AI Technical Summary
Existing solid-state drives (SSDs) suffer from a high dependence on contiguous memory when processing write commands, which limits DRAM capacity and reduces processing efficiency.
By obtaining the write command issued by the host, the LPA range is determined and buffer storage space is allocated. The starting address of the data stored in the LBA within the LPA is recorded, the old data range buffer is released, and the new data address is merged to complete the data replacement operation, reducing copy operations.
This reduces the SSD's reliance on contiguous memory, improves the efficiency of processing and responding to write commands, and reduces copy operations for non-LPA aligned writes.
Smart Images

Figure CN115220660B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of solid-state drive (SSD) technology, and in particular to a method, apparatus, computer device, and storage medium for optimizing write command processing of SSDs. Background Technology
[0002] With the reduction in manufacturing costs and the improvement in product performance of SSDs (Solid State Drives), SSDs have been widely used in various applications. Currently, in the PC market, SSDs have gradually replaced traditional HDDs (Hard Disk Drives), providing users with a better experience in terms of reliability and performance.
[0003] Currently, when SSDs process host-side write commands, they typically convert the command access (operation) LBA Range into an LPARange, and then allocate contiguous memory space for each LPA within the Range to store the data carried by the host command. When receiving and processing these write commands, situations arise where multiple commands are associated with one or more of the same LBA; this is known as a "write hit." In such cases, the usual approach is to replace old data with new data or incorporate it into the old data. However, as SSD technology matures and market demands for SSD performance increase, SSD DRAM capacity becomes increasingly limited. Therefore, reducing the dependence of SSDs on contiguous memory and improving the efficiency of command response and processing becomes particularly important. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer device, and storage medium for optimizing write command processing of solid-state drives (SSDs) to address the aforementioned technical problems.
[0005] A method for optimizing write command processing of a solid-state drive, the method comprising:
[0006] Obtain the write command issued by the host;
[0007] Determine the LPA range accessed by the host and allocate a sufficient amount of buffer storage space according to the LPA range to store write command data;
[0008] When processing the write command, the solid-state drive records the starting address of the multiple LBA data buffers within each LPA of the LPA range accessed by the write command;
[0009] If there are multiple write command operations or access to the same LPA or several LPAs, then within the LPA, the corresponding old data LBA interval buffer is released according to the LBA interval of the new data record, thereby completing the resource reclamation.
[0010] The LBA Buffer address relationship of the new data record is merged into the corresponding relationship of the old data to complete the data replacement operation.
[0011] In one embodiment, the step of determining the LPA interval accessed by the host and allocating a sufficient number of Buffer storage spaces according to the LPA interval for storing the write command data further comprises:
[0012] Allocating a sufficient number of Buffer storage spaces of 512 Byte size according to the LPA interval for storing the write command data.
[0013] In one embodiment, the step of recording, by the solid state disk, a plurality of LBA saved data Buffer start addresses within each LPA of the LPA interval accessed by the write command when processing the write command further comprises:
[0014] Recording, by the solid state disk, 8 LBA saved data Buffer start addresses within each LPA of the LPA interval accessed by the write command when processing the write command.
[0015] A write command processing optimization device of a solid state disk, comprising:
[0016] An obtaining module, configured to obtain a write command issued by a host;
[0017] An allocating module, configured to determine an LPA interval accessed by the host and allocate a sufficient number of Buffer storage spaces according to the LPA interval for storing the write command data;
[0018] A recording module, configured to record, by the solid state disk, a plurality of LBA saved data Buffer start addresses within each LPA of the LPA interval accessed by the write command when processing the write command;
[0019] A releasing module, configured to, if there are a plurality of write command operations or the same LPA or a plurality of LPAs are accessed, complete Buffer release of a corresponding old data LBA interval in the LPA according to the LBA interval of the new data record, and further complete resource recovery;
[0020] A merging module, configured to merge the effective LBA Buffer address relationship of the new data record into the corresponding relationship of the old data to complete the data replacement operation.
[0021] In one embodiment, the allocating module is further configured to:
[0022] According to the LPA interval, a sufficient number of Buffer storage spaces of 512 Byte size are allocated for storing write command data.
[0023] In one of the embodiments, the recording module is further configured to:
[0024] The solid state disk records the start address of the 8 LBA save data Buffer when processing the write command.
[0025] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of any of the above methods when executing the computer program.
[0026] A computer readable storage medium has a computer program stored thereon, and the computer program is executable on a processor to implement the steps of any of the above methods.
[0027] The write command processing optimization method, device, computer device and storage medium of the solid state disk described above obtain a write command issued by a host; determine an LPA interval accessed by the host and allocate a sufficient number of Buffer storage spaces according to the LPA interval for storing write command data; the solid state disk records the start address of a plurality of LBA save data Buffer in each LPA of the LPA interval accessed by the write command when processing the write command; if there are a plurality of write command operations or the same LPA or a plurality of LPAs are accessed, the corresponding old data LBA interval Buffer is released according to the LBA interval of the new data record in the LPA, and the resources are recycled; the LBA Buffer address relationship of the new data record is merged into the corresponding relationship of the old data to complete the data replacement operation. The application can effectively reduce the dependence of the SSD on continuous memory Buffer when processing the write command. In addition, the copy operation of processing non-LPA aligned write is reduced, and the efficiency of processing and responding to the command on the channel of the SSD is improved. BRIEF DESCRIPTION OF DRAWINGS
[0028] Figure 1 A schematic diagram of the solid state disk processing a write command in the prior art;
[0029] Figure 2 A flowchart of the write command processing optimization method of the solid state disk in one of the embodiments;
[0030] Figure 3 A flowchart of the write command processing optimization method of the solid state disk in another of the embodiments;
[0031] Figure 4Figure 1 shows a flowchart of a method for optimizing write command processing of a solid state drive according to another embodiment;
[0032] Figure 5 Figure 2 shows a flowchart of a method for optimizing write command processing of a solid state drive according to another embodiment;
[0033] Figure 6 Figure 3 shows a block diagram of a device for optimizing write command processing of a solid state drive according to an embodiment;
[0034] Figure 7 Figure 4 shows an internal structure diagram of a computer device according to an embodiment. DETAILED DESCRIPTION
[0035] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.
[0036] Currently, referring to Figure 1 Figure 5 shows a diagram of a prior art method for processing write commands of a solid state drive, which includes the following specific process:
[0037] First, the host submits a write command to the SSD.
[0038] Next, the SSD determines the LPA range to be accessed or operated and allocates a sufficient number of 4KB-sized continuous memory buffers to store the data of the write command.
[0039] Then, when a certain LPA is associated with multiple write commands, the SSD copies the new data content to the storage space of the old data, completes the merging of the new and old data, and then releases the new data buffer to complete the memory resource recycling.
[0040] However, the DRAM capacity of the SSD is increasingly limited, and therefore, how to reduce the dependence on continuous memory when the SSD processes the write command of the host and the efficiency of responding and processing the command becomes particularly important.
[0041] In an embodiment, as shown in Figure 2 Figure 1, a method for optimizing write command processing of a solid state drive is provided, which includes:
[0042] Step 202: obtaining a write command issued by a host;
[0043] Step 204: determining an LPA range accessed by the host and allocating a sufficient number of buffer storage spaces according to the LPA range for storing data of the write command;
[0044] In step 206, the solid state disk records the starting address of the data Buffer in each LPA of the LPA interval accessed by the write command when processing the write command.
[0045] In step 208, if there are multiple write command operations or the same LPA or several LPAs are accessed, the Buffer of the corresponding old data LBA interval is released according to the LBA interval of the new data record in the LPA, and then the resource is recycled.
[0046] In step 210, the LBA Buffer address relationship of the new data record is merged into the corresponding relationship of the old data to complete the data replacement operation.
[0047] In the embodiment, a write command processing optimization method of a solid state disk is provided. The method optimizes the memory space occupation and management of the write command, can effectively reduce the dependence of the SSD on the continuous memory space when processing the write command, and reduces the copying operation between data. Specifically:
[0048] Firstly, the SSD obtains the write command issued by the host.
[0049] Then, the SSD determines the LPA interval accessed by the host, and allocates a sufficient number of Buffer storage spaces according to the LPA interval for storing the write command data. Specifically, for example, a sufficient number of 512 Byte Buffer storage spaces can be allocated according to the LPA interval for storing the write command data.
[0050] Then, the SSD records the starting address of the data Buffer in each LPA of the LPA interval accessed by the write command when processing the write command. In this way, the Buffer address can be looked up through the command index, LPA, and LBA_BMP OF LPA subsequently. Specifically, for example, the starting address of the data Buffer in each LPA of the LPA interval accessed by the write command can be recorded.
[0051] Then, if there are multiple write command operations or the same LPA or several LPAs are accessed, that is, the write command is hit. In the hit LPA, the Buffer of the corresponding old data LBA interval is released according to the LBA interval of the new data record, and then the resource is recycled.
[0052] Finally, the LBA Buffer address relationship of the new data record is merged into the corresponding relationship of the old data to complete the data replacement operation, which can reduce the copying operation between data, and then improve the efficiency of the SSD in processing and responding to the command on the channel.
[0053] In the embodiment, the dependence of the SSD on the continuous memory Buffer when processing the write command can be effectively reduced. In addition, the copy operation for processing the non-LPA-aligned write is also reduced, thereby improving the efficiency of the SSD in processing and responding to the command on the channel.
[0054] In one embodiment, as shown in Figure 3 , a write command processing optimization method of a solid state disk is provided, and the method comprises the following steps:
[0055] Step 302, obtaining a write command issued by a host;
[0056] Step 304, determining an LPA range accessed by the host and allocating a sufficient number of Buffer storage spaces of 512 Byte size according to the LPA range for storing data of the write command;
[0057] Step 306, recording, by the solid state disk, the start address of the 8-LBA data Buffer when processing the write command in each LPA of the LPA range accessed by the write command;
[0058] Step 308, if there are multiple write command operations or the same LPA or several LPAs are accessed, the Buffer of the corresponding old data LBA range is released according to the LBA range of the new data record in the LPA, thereby completing the resource recovery;
[0059] Step 310, merging the LBA Buffer address relationship of the new data record into the corresponding relationship of the old data to complete the data replacement operation.
[0060] Specifically, the write command processing optimization method of the solid state disk can refer to the schematic diagram as shown in Figure 4 and Figure 5 , and the specific process is as follows:
[0061] Step 4.1, the host submits a write command to the SSD.
[0062] Step 4.2, the SSD determines the LPA Range accessed or operated by the SSD and allocates a sufficient number of Buffer storage spaces of 512 Byte size.
[0063] Step 4.3, the SSD needs to record the start address of the 8-LBA data Buffer in each LPA, so that the Buffer address can be looked up through the command index, LPA, and LBA_BMP OF LPA subsequently.
[0064] Step 4.4, if multiple write commands are associated with the same LPA, the Buffer of the corresponding old data LBA range is released according to the LBA range of the new data record, thereby completing the resource recovery.
[0065] Step 4.5, merge the valid LBA Buffer address relationship of the new data record into the corresponding relationship of the old data to complete the data replacement operation.
[0066] In the embodiment, the processing mode of the write command is optimized, which can effectively reduce the dependence of the SSD on the continuous memory space when processing the write command, reduce the copying operation between data, and further improve the efficiency of the SSD in processing and responding to the command on the channel.
[0067] It should be understood that, although Figures 1-5 the steps in the flowchart are shown in sequence according to the arrows, these steps are not necessarily executed in sequence according to the arrows. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, Figures 1-5 at least part of the steps in the flowchart can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these sub-steps or stages is not necessarily sequential, but can be executed in rotation or alternation with other steps or sub-steps or stages of other steps.
[0068] In one embodiment, as Figure 6 shown, a write command processing optimization device 600 of a solid state disk is provided, which comprises:
[0069] The acquisition module 601 is configured to acquire a write command issued by a host.
[0070] The allocation module 602 is configured to determine an LPA interval accessed by the host and allocate a sufficient number of Buffer storage spaces according to the LPA interval for storing write command data.
[0071] The recording module 603 is configured to record, by the solid state disk, a plurality of LBA storage data Buffer start addresses in each LPA of the LPA interval accessed by the write command when processing the write command.
[0072] The release module 604 is configured to, if there are a plurality of write command operations or the same LPA or a plurality of LPAs are accessed, release, in the LPA, the Buffer of the corresponding LBA interval of the old data according to the LBA interval of the new data record, and further recycle the resources.
[0073] The merging module 605 is configured to merge the valid LBA Buffer address relationship of the new data record into the corresponding relationship of the old data to complete the data replacement operation.
[0074] In one embodiment, the allocating module 602 is further configured to:
[0075] According to the LPA interval, a sufficient number of Buffer storage spaces of 512 Byte size are allocated for storing the write command data.
[0076] In one embodiment, the recording module 603 is further configured to:
[0077] The solid state disk records the 8 LBA save data Buffer start addresses in each LPA accessed by the write command when processing the write command.
[0078] The specific limitation of the write command processing optimization device of the solid state disk can refer to the limitation of the write command processing optimization method of the solid state disk in the foregoing, and will not be described here.
[0079] In one embodiment, a computer device is provided, and an internal structure diagram of the computer device can be as shown in Figure 7 The computer device includes a processor, a memory and a network interface connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is configured to communicate with an external terminal through a network connection. The computer program is executed by the processor to implement a write command processing optimization method of a solid state disk.
[0080] Those skilled in the art can understand that Figure 7 The structure shown in the foregoing is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0081] In one embodiment, a computer device is provided, including a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps in each of the method embodiments when executing the computer program.
[0082] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps in each of the method embodiments.
[0083] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, storage, databases, or other media in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0084] The technical features of the above embodiments can be combined in any way. In order to make the description simple, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist, they should be considered as the scope of the present application.
[0085] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, some modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.
Claims
1. A method for optimizing write command processing of a solid state disk, the method comprising: obtaining a write command issued by a host; determining an LPA interval accessed by the host and allocating a sufficient number of Buffer storage spaces according to the LPA interval for storing write command data; recording, by the solid state disk, a plurality of LBA storage data Buffer start addresses in each LPA of the LPA interval accessed by the write command when processing the write command; if there are a plurality of write command operations or the same LPA or a plurality of LPAs are accessed, releasing, in the LPA, a Buffer of a corresponding old data LBA interval according to a new data recorded LBA interval, and further recycling resources; merging the effective LBA Buffer address relationship of the new data record into the corresponding relationship of the old data to complete a data replacement operation; the step of determining the LPA interval accessed by the host and allocating a sufficient number of Buffer storage spaces according to the LPA interval for storing write command data further comprises: allocating a sufficient number of 512 Byte size Buffer storage spaces according to the LPA interval for storing write command data; the step of recording, by the solid state disk, a plurality of LBA storage data Buffer start addresses in each LPA of the LPA interval accessed by the write command when processing the write command further comprises: recording, by the solid state disk, 8 LBA storage data Buffer start addresses in each LPA of the LPA interval accessed by the write command when processing the write command.
2. A device for optimizing write command processing of a solid state drive, characterized by, An apparatus for optimizing write command processing of a solid state disk, the apparatus comprising: an obtaining module, configured to obtain a write command issued by a host; an allocating module, configured to determine an LPA interval accessed by the host and allocate a sufficient number of Buffer storage spaces according to the LPA interval for storing write command data; a recording module, configured to record, by the solid state disk, a plurality of LBA storage data Buffer start addresses in each LPA of the LPA interval accessed by the write command when processing the write command; a releasing module, configured to, if there are a plurality of write command operations or the same LPA or a plurality of LPAs are accessed, release, in the LPA, a Buffer of a corresponding old data LBA interval according to a new data recorded LBA interval, and further recycle resources; a merging module, configured to merge the effective LBA Buffer address relationship of the new data record into the corresponding relationship of the old data to complete a data replacement operation; the allocating module is further configured to allocate a sufficient number of 512 Byte size Buffer storage spaces according to the LPA interval for storing write command data; the recording module is further configured to record, by the solid state disk, 8 LBA storage data Buffer start addresses in each LPA of the LPA interval accessed by the write command when processing the write command.
3. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the steps of the method of claim 1.
4. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, which is executed by a processor, implements the steps of the method as claimed in claim 1.
Citation Information
Patent Citations
Cache provided by FTL, optimization method thereof and storage device
CN110968525A
Read / write processing device and method for a disk medium
US20010011323A1