Optimization processing method, device and computer equipment for large file writing of solid state disk

By optimizing the method of writing large files to solid-state drives (SSDs), determining the write point and distinguishing the write type, write amplification is avoided, thereby improving the performance and lifespan of SSDs.

CN116679880BActive Publication Date: 2026-07-31SUZHOU UNIONMEMORY INFORMATION SYST LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU UNIONMEMORY INFORMATION SYST LTD
Filing Date
2023-06-08
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Traditional solid-state drives (SSDs) suffer from write amplification when writing large files, which leads to a decrease in performance and lifespan, especially when large file writes occur simultaneously with other writes.

Method used

By determining whether the current write point is in the SLC cache area, if a large file write point exists, it is determined whether the logical address of the write request belongs to the range of the large file write point. If it does, the write command is written to the large file write point; otherwise, it is written to the existing user data write point. If no large file write point exists, it is determined whether it belongs to continuous large file writes. If it does, a large file write point is created; otherwise, it is written to the existing user data write point.

Benefits of technology

In scenarios where large files and other writes occur simultaneously, additional write amplification is avoided, thus improving the performance and lifespan of the solid-state drive.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116679880B_ABST
    Figure CN116679880B_ABST
Patent Text Reader

Abstract

This application relates to an optimized processing method, apparatus, computer device, and storage medium for large file writing on a solid-state drive (SSD). The method includes: determining whether the current write point is in the SLC cache region; if the current write point is in the SLC cache region, obtaining a write command for the SSD; determining whether a large file write point already exists; if a large file write point already exists, further determining whether the logical address of the write request belongs to the range of large file write points; if it does, the write command is sent to the large file write point; otherwise, the write is sent to the existing user data write point; if no large file write point exists, further determining whether the current write command is a continuous large file write; if it does, a large file write point is created; otherwise, the write is sent to the existing user data write point. This invention can avoid additional write amplification in scenarios where large files and other writes coexist, thereby improving the performance and lifespan of the SSD.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of solid-state drive (SSD) technology, and in particular to an optimized processing method, apparatus, computer device, and storage medium for writing large files to a solid-state drive. Background Technology

[0002] Solid-state drives (SSDs) are widely used in various applications and have gradually replaced traditional hard disk drives (HDDs) in the PC market, providing users with a better experience in terms of reliability and performance. Currently, most mainstream SSD manufacturers use Triple Level Cell (TLC) as their storage medium. To improve read and write performance, a portion of the TLC NAND is converted to Single Level Cell (SLC) mode for use as an SLC cache. In SLC mode, the NAND capacity is only one-third that of TLC mode, but it offers significantly higher read and write performance. The read performance of SLC mode is generally more than twice that of TLC mode.

[0003] In traditional technologies, due to the limited space of the SLC cache, after detecting a large file write, the system typically switches to writing to the TLC region to prevent large file data from being moved from the SLC to the TLC region, causing additional write amplification and thus affecting the performance and lifespan of the SSD. The common detection method is to detect external input commands; if it is a continuous write operation, it enters the TLC write state. However, during a large file write operation, if other writes occur simultaneously, traditional solutions will consider the large file write operation complete and switch to writing to the SLC cache, leading to subsequent additional write amplification and thus impacting the performance and lifespan of the SSD. Summary of the Invention

[0004] Therefore, it is necessary to provide an optimized processing method, apparatus, computer device, and storage medium for writing large files to solid-state drives in response to the above-mentioned technical problems.

[0005] An optimized method for writing large files to a solid-state drive, the method comprising:

[0006] Determine if the current write point is in the SLC cache area;

[0007] If the current write point is in the SLC cache area, then obtain the SSD write command;

[0008] Determine if a large file write point already exists;

[0009] If a large file write point already exists, continue to determine whether the logical address of the write request belongs to the range of large file write points. If it does, the write command is written to the large file write point; otherwise, it is written to the existing user data write point.

[0010] If no large file write point exists, continue to determine whether the current write command is a continuous large file write. If it is, create a large file write point; otherwise, write to the existing user data write point.

[0011] In one embodiment, the step of creating a large file write point further includes:

[0012] The starting point of the large file write point is the starting logical address of the write command that triggers the creation of the large file write point, and the range of the large file write point can be customized.

[0013] In one embodiment, the step of writing the write command to the large file write point further includes:

[0014] Check if the write volume of the large file write point has reached the range of the write point. If it has, close the large file write point.

[0015] In one embodiment, the method further includes:

[0016] Periodically compare the current time with the latest write time of the large file to determine if the time difference exceeds a preset threshold;

[0017] If the time difference exceeds the threshold, the large file write point is closed and subsequent judgments determine that the large file write point does not exist. If the time difference does not exceed the threshold, no action is taken.

[0018] An optimized processing device for writing large files to a solid-state drive, the device comprising:

[0019] The first judgment module is used to determine whether the current write point is in the SLC cache area;

[0020] The command acquisition module is used to acquire the SSD's write command if the current write point is in the SLC cache area.

[0021] The second judgment module is used to determine whether a large file write point already exists.

[0022] The third judgment module is used to determine whether the logical address of the write request belongs to the range of the large file write point if a large file write point already exists. If it does, the write command is written to the large file write point; otherwise, it is written to the original user data write point.

[0023] The fourth judgment module is used to determine whether the current write command belongs to continuous large file write if there is no large file write point. If it does, a large file write point is created; otherwise, the data is written to the existing user data write point.

[0024] In one embodiment, the fourth determination module is further configured to:

[0025] The starting point of the large file write point is the starting logical address of the write command that triggers the creation of the large file write point, and the range of the large file write point can be customized.

[0026] In one embodiment, the apparatus further includes an inspection module, the inspection module being used to:

[0027] Check if the write volume of the large file write point has reached the range of the write point. If it has, close the large file write point.

[0028] In one embodiment, the device further includes a timeout shutdown module, the timeout shutdown module being configured to:

[0029] Periodically compare the current time with the latest write time of the large file to determine if the time difference exceeds a preset threshold;

[0030] If the time difference exceeds the threshold, the large file write point is closed and subsequent judgments determine that the large file write point does not exist. If the time difference does not exceed the threshold, no action is taken.

[0031] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.

[0032] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above methods.

[0033] The aforementioned optimized processing method, apparatus, computer device, and storage medium for large file writing on solid-state drives (SSDs) determine whether a large file write point already exists. If a large file write point already exists, it further determines whether the logical address of the write request belongs to the range of large file write points. If it does, the write command is sent to the large file write point; otherwise, it is sent to the existing user data write point. If no large file write point exists, it further determines whether the current write command is a continuous large file write. If it does, a large file write point is created; otherwise, it is sent to the existing user data write point. This invention enables the direct writing of large files to the TLC region in scenarios where large files and other writes coexist, avoiding additional write amplification in such scenarios, thereby improving SSD performance and lifespan. Attached Figure Description

[0034] Figure 1 A flowchart illustrating the traditional large file write process for SSDs;

[0035] Figure 2 This is a flowchart illustrating an optimized method for writing large files to a solid-state drive in one embodiment.

[0036] Figure 3 This is a schematic diagram of the optimized SSD large file write processing flow in one embodiment;

[0037] Figure 4 This is a schematic diagram of the process of closing the SSD large file write point timeout in one embodiment;

[0038] Figure 5 This is a structural block diagram of an optimized processing device for writing large files to a solid-state drive in one embodiment.

[0039] Figure 6 This is a structural block diagram of an optimized processing device for writing large files to a solid-state drive in another embodiment.

[0040] Figure 7 This is a structural block diagram of the optimized processing device for writing large files to a solid-state drive in another embodiment;

[0041] Figure 8 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0042] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0043] like Figure 1The diagram illustrates the traditional SSD large file write process. First, it determines whether the current write point is in the SLC cache area. If not, it writes directly to the current user data write point (TLC area). If the current write point is in the SLC cache area, it retrieves the SSD's write command and determines whether it is a consecutive large file write command. (One implementation of this condition is that the command size is 128KB and the logical address is contiguous with several previous write commands.) If it is not a consecutive large file write command, it writes directly to the current user data write point (SLC cache area). If it is a consecutive large file write command, it switches the user data write point to the normal (TLC area).

[0044] Therefore, it can be seen that in the traditional solution, if other writes occur at the same time while a large file is being written, the large file write will be judged to be finished, and the write point will switch back to the SLC cache area.

[0045] Based on this, this solution provides an optimized processing method for writing large files to solid-state drives, aiming to avoid the additional write amplification caused in the above scenarios.

[0046] In one embodiment, such as Figure 2 As shown, an optimized method for writing large files to a solid-state drive is provided, the method including:

[0047] Step 202: Determine whether the current write point is in the SLC cache area;

[0048] Step 204: If the current write point is in the SLC cache area, obtain the SSD write command;

[0049] Step 206: Determine if a large file write point already exists;

[0050] Step 208: If a large file write point already exists, continue to determine whether the logical address of the write request belongs to the range of the large file write point. If it does, the write command is written to the large file write point; otherwise, it is written to the existing user data write point.

[0051] Step 210: If there is no large file write point, continue to determine whether the current write command belongs to continuous large file write. If it does, create a large file write point; otherwise, write to the existing user data write point.

[0052] In this embodiment, an optimized processing method for writing large files to a solid-state drive is provided. Specifically, when the SSD is writing user data to the SLC cache area, the write commands of the SSD are checked one by one, and it is determined whether a large file write point already exists.

[0053] If a large file write point already exists, determine whether the logical address of the write request belongs to the range of the large file write point. If it does, the write command is written to the large file write point (i.e., the TLC area). If it does not, the write is written to the existing user data write point (i.e., the SLC cache area).

[0054] If no large file write point exists, determine whether the current write command is a continuous large file write. If it is, create a large file write point; otherwise, write to the existing user data write point (i.e., the SLC cache area).

[0055] In one embodiment, the step of creating a large file write point further includes: the starting point of the large file write point is the starting logical address of the write command that triggers the creation of the large file write point, and the range of the large file write point can be customized.

[0056] The range of the large file write point created starts at the logical address of the write command that triggered the creation of the large file write point, and the size of the range can be customized. Specifically, it can be a fixed value, or the available size of the physical block allocated to the write point.

[0057] In the above embodiments, the system determines whether a large file write point already exists. If a large file write point already exists, it further determines whether the logical address of the write request belongs to the range of the large file write point. If it does, the write command is sent to the large file write point; otherwise, it is sent to the existing user data write point. If no large file write point exists, it further determines whether the current write command is a continuous large file write. If it does, a large file write point is created; otherwise, it is sent to the existing user data write point. This solution can directly write large files to the TLC area in scenarios where large files and other writes coexist, avoiding additional write amplification in this scenario, thereby improving SSD performance and lifespan.

[0058] In one embodiment, the step of writing the write command to the large file write point further includes:

[0059] Check if the write volume of the large file write point has reached the range of the write point. If it has, close the large file write point.

[0060] Specifically, refer to Figure 3 The optimized SSD large file write processing flowchart shown below includes the following steps:

[0061] 3.1 Determine whether the current write point is in the SLC cache area. If not, write directly to the current user data write point (TLC area).

[0062] 3.2 If the current write point is an SLC cache area, obtain the SSD write command and determine whether a large file write point already exists.

[0063] 3.3 If a large file write point already exists, determine whether the logical address of the write request belongs to the range of the large file write point. If it does, the write command is written to the large file write point (i.e., the TLC area). If it does not, the write is written to the existing user data write point (i.e., the SLC cache area).

[0064] 3.4 If no large file write point exists, determine whether the current write command is a continuous large file write. If it is, create a large file write point. If it is not, write to the existing user data write point (i.e., the SLC cache area).

[0065] 3.5. The range of the large file write point is the starting logical address of the write command that triggered the creation of the large file write point. The size of the range can be customized, such as a fixed value or the available size of the physical block allocated to the write point.

[0066] 3.6 After writing to the large file write point, check whether the write volume of the large file write point is equal to the write point range size. If it is equal, then close the large file write point.

[0067] In one embodiment, the method further includes:

[0068] Periodically compare the current time with the latest write time of the large file to determine if the time difference exceeds a preset threshold;

[0069] If the time difference exceeds the threshold, the large file write point is closed and subsequent judgments determine that the large file write point does not exist. If the time difference does not exceed the threshold, no action is taken.

[0070] Specifically, such as Figure 4 The flowchart shown illustrates the process of closing the SSD large file write point timeout, including the following steps:

[0071] Periodically compare the current time with the latest write time of the large file write point. If the time difference exceeds the threshold, the large file write is considered to be finished, the large file write point is closed, and subsequent judgments determine that there is no large file write point. If the time difference does not exceed the threshold, no action is taken.

[0072] In this embodiment, if the amount written at the large file write point is equal to the size of the write point range, or if no write command belonging to the large file write point is received within a certain period of time, the large file writing is considered to be completed, and the large file write point is closed.

[0073] It should be understood that, although Figures 1-4The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figures 1-4 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0074] In one embodiment, such as Figure 5 As shown, an optimized processing device 500 for writing large files to a solid-state drive is provided. The device includes:

[0075] First judgment module 501, the first judgment module is used to determine whether the current write point is in the SLC cache area;

[0076] Command acquisition module 502, the command acquisition module is used to acquire the SSD's write command if the current write point is in the SLC cache area;

[0077] The second judgment module 503 is used to determine whether a large file write point already exists.

[0078] The third judgment module 504 is used to determine whether the logical address of the write request belongs to the range of the large file write point if a large file write point already exists. If it does, the write command is written to the large file write point; otherwise, it is written to the original user data write point.

[0079] The fourth judgment module 505 is used to determine whether the current write command belongs to continuous large file write if there is no large file write point. If it does, a large file write point is created; otherwise, the data is written to the existing user data write point.

[0080] In one embodiment, the fourth determination module 505 is further configured to:

[0081] The starting point of the large file write point is the starting logical address of the write command that triggers the creation of the large file write point, and the range of the large file write point can be customized.

[0082] In one embodiment, such as Figure 6 As shown, an optimized processing device 500 for writing large files to a solid-state drive is provided. This device further includes a checking module 506, which is used for:

[0083] Check if the write volume of the large file write point has reached the range of the write point. If it has, close the large file write point.

[0084] In one embodiment, such as Figure 7 As shown, an optimized processing device 500 for writing large files to a solid-state drive is provided. This device further includes a timeout shutdown module 507, which is used for:

[0085] Periodically compare the current time with the latest write time of the large file to determine if the time difference exceeds a preset threshold;

[0086] If the time difference exceeds the threshold, the large file write point is closed and subsequent judgments determine that the large file write point does not exist. If the time difference does not exceed the threshold, no action is taken.

[0087] For specific limitations on the optimization processing device for large file writing on solid-state drives, please refer to the limitations on the optimization processing method for large file writing on solid-state drives mentioned above, which will not be repeated here.

[0088] In one embodiment, a computer device is provided, the internal structure of which can be shown as follows: Figure 8 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements an optimized processing method for writing large files to a solid-state drive.

[0089] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0090] 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, wherein the processor executes the computer program to implement the steps in the various method embodiments described above.

[0091] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the various method embodiments described above.

[0092] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this 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. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0093] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0094] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. An optimized processing method for writing large files to a solid-state drive, the method comprising: Determine if the current write point is in the SLC cache area; If the current write point is in the SLC cache area, then obtain the SSD write command; Determine whether a large file write point already exists, wherein the large file write point is located in the TLC area and is used to directly write large file data into the TLC area; If a large file write point already exists, then it is further determined whether the logical address of the write command belongs to the range of the large file write point. If it does, the write command writes to the large file write point; otherwise, it writes to the original user data write point, wherein the original user data write point is located in the SLC cache area. If no large file write point exists, continue to determine whether the current write command is a continuous large file write. If it is, create a large file write point; otherwise, write to the existing user data write point.

2. The optimized processing method for writing large files to a solid-state drive according to claim 1, characterized in that, The steps for creating a large file write point also include: The starting point of the large file write point is the starting logical address of the write command that triggers the creation of the large file write point, and the range of the large file write point is user-defined.

3. The optimized processing method for writing large files to a solid-state drive according to claim 2, characterized in that, The step following the step of writing the write command to the large file write point also includes: Check if the write volume of the large file write point has reached the range of the write point. If it has, close the large file write point.

4. The optimized processing method for writing large files to a solid-state drive according to any one of claims 1-3, characterized in that, The method further includes: Periodically compare the current time with the latest write time of the large file to determine if the time difference exceeds a preset threshold; If the time difference exceeds the threshold, the large file write point is closed and subsequent judgments determine that the large file write point does not exist. If the time difference does not exceed the threshold, no action is taken.

5. An optimized processing device for writing large files to a solid-state drive, characterized in that, The device includes: The first judgment module is used to determine whether the current write point is in the SLC cache area; The command acquisition module is used to acquire the SSD's write command if the current write point is in the SLC cache area. The second judgment module is used to determine whether a large file write point already exists. The third judgment module is used to determine whether the logical address of the write command belongs to the range of the large file write point if a large file write point already exists. If it does, the write command writes to the large file write point; otherwise, it writes to the original user data write point. The fourth judgment module is used to determine whether the current write command belongs to continuous large file write if there is no large file write point. If it does, a large file write point is created; otherwise, the data is written to the existing user data write point.

6. The optimized processing apparatus for writing large files to a solid-state drive according to claim 5, characterized in that, The fourth judgment module is also used for: The starting point of the large file write point is the starting logical address of the write command that triggers the creation of the large file write point, and the range of the large file write point is user-defined.

7. The optimized processing apparatus for writing large files to a solid-state drive according to claim 6, characterized in that, The device further includes an inspection module, the inspection module being used for: Check whether the write volume of the large file write point has reached the range of the write point. If it has, close the large file write point.

8. The optimized processing apparatus for writing large files to a solid-state drive according to any one of claims 5-7, characterized in that, The device further includes a timeout shutdown module, the timeout shutdown module being used for: Periodically compare the current time with the latest write time of the large file to determine if the time difference exceeds a preset threshold; If the time difference exceeds the threshold, the large file write point is closed and subsequent judgments determine that the large file write point does not exist. If the time difference does not exceed the threshold, no action is taken.

9. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.