SSD Write Performance Regulation Method, Device, Equipment and Medium

By determining the time slice coefficient based on the SSD particle parameters and IOPS threshold, and reasonably allocating garbage collection and data writing time slices, the problem of insufficient SSD writing performance is solved and the writing efficiency is improved.

CN118550466BActive Publication Date: 2025-07-25CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410649891.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2025-07-25
Estimated Expiration
2044-05-24

AI Technical Summary

Technical Problem

In the prior art, when SSD performs garbage collection and data writing at the same time, garbage collection takes a long time, resulting in data writing needs to be waited and the IOPS threshold of the lowest performance requirements cannot be met.

Method used

According to the SSD particle parameters and preset IOPS threshold, determine the time slice coefficient, reasonably allocate the number of time slices for garbage collection and data writing, and dynamically adjust the allocation of time slices to optimize the operation sequence.

Benefits of technology

By reasonably allocating time slices for garbage collection and data writing, the minimum write performance of SSD is improved and the efficiency of write operations is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550466B_ABST
    Figure CN118550466B_ABST
Patent Text Reader

Abstract

The present invention provides an SSD write performance regulation method, device, equipment and medium, which relates to the technical field of flash memory storage control. The method includes: determining a first running time according to SSD particle parameters; determining a second running time according to a preset IOPS threshold; determining a time slice coefficient according to the first running time and the second running time; determining the number M of garbage collection time slices and the number N of data writing time slices according to the time slice coefficient; judging whether it is necessary to allocate data writing time slices to a data writing module according to the number N of data writing time slices. If so, performing a data writing operation on the SSD through the data writing module; if not, judging whether it is necessary to allocate garbage collection time slices to a garbage collection module according to the number M of garbage collection time slices. If so, performing a garbage collection operation on the SSD through the garbage collection module. The present invention improves the minimum write performance of the SSD.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of flash memory storage control, and particularly to a method, device, equipment and medium for regulating SSD write performance. Background Art

[0002] A solid state drive (SSD) has a garbage collection (GC) module. The input / output operations per second (IOPS) of an SSD is an important indicator for measuring the write performance of the solid state drive. In some scenarios, the IOPS of the SSD is required not to be lower than a certain threshold.

[0003] In the prior art, when an SSD performs garbage collection and data writing simultaneously, since the time consumed by garbage collection is longer than the time consumed by data writing, after the GC module is started, the physical block space released by garbage collection is often lower than the physical block space required for data writing. This results in data writing needing to wait for the garbage collection to release space, and the execution time of data writing is relatively short, thus causing the write performance of the SSD to fail to meet the minimum performance limit requirements. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and provide a method, device, equipment and medium for regulating SSD write performance, aiming to improve the write performance of the SSD by reasonably allocating the execution time of garbage collection operations and data writing operations.

[0005] The present invention provides the following technical solutions:

[0006] In a first aspect, the present invention provides a method for regulating SSD write performance, the method comprising:

[0007] Determining a first running time required for the garbage collection module to recycle a garbage block according to SSD particle parameters, where the SSD particle parameters include erase block time, page quantity, page read time, and page write time;

[0008] Determining a second running time required for the data writing module to fill a free block according to a preset IOPS threshold;

[0009] Determining a time slice coefficient according to the first running time and the second running time;

[0010] Determining the number of garbage collection time slices M and the number of data writing time slices N according to the time slice coefficient, where the ratio of the number of garbage collection time slices M to the number of data writing time slices N is equal to the time slice coefficient;

[0011] According to the number N of data writing time slices, determine whether it is necessary to allocate a data writing time slice for the data writing module. If so, allocate a data writing time slice for the data writing module, and perform a data writing operation on the SSD through the data writing module within the data writing time slice;

[0012] If not, then according to the number M of garbage collection time slices, determine whether it is necessary to allocate a garbage collection time slice for the garbage collection module. If so, allocate a garbage collection time slice for the garbage collection module, and perform a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice.

[0013] In one embodiment, the determining whether it is necessary to allocate a data writing time slice for the data writing module according to the number N of data writing time slices includes:

[0014] Determine whether the number N of data writing time slices is greater than a first preset threshold. If so, determine that it is necessary to allocate the data writing time slice for the data writing module; if not, determine that it is not necessary to allocate the data writing time slice for the data writing module.

[0015] In one embodiment, after allocating a data writing time slice for the data writing module, it further includes: determining that the number of data writing time slices is N-1; obtaining the current number of free blocks of the SSD, and determining whether to continue to start the garbage collection module according to the current number of free blocks; if continuing to start, allocate a data writing time slice for the data writing module until the number of data writing time slices is equal to the first preset threshold.

[0016] In one embodiment, the determining whether it is necessary to allocate a garbage collection time slice for the garbage collection module according to the number M of garbage collection time slices includes: determining whether the number M of garbage collection time slices is greater than a second preset threshold. If so, determine that it is necessary to allocate the garbage collection time slice for the garbage collection module; if not, determine that it is not necessary to allocate the garbage collection time slice for the garbage collection module.

[0017] In one embodiment, after allocating a garbage collection time slice for the garbage collection module, it further includes: determining that the number of garbage collection time slices is M-1; obtaining the current number of free blocks of the SSD, and determining whether to continue to start the garbage collection module according to the current number of free blocks; if continuing to start, allocate a garbage collection time slice for the garbage collection module until the number of garbage collection time slices is equal to the second preset threshold.

[0018] In one embodiment, obtaining the current number of free blocks of the SSD and determining whether to continue starting the garbage collection module according to the current number of free blocks includes: comparing the current number of free blocks with a preset start threshold of the garbage collection module, and if the number of free blocks is less than the preset start threshold, starting the garbage collection module.

[0019] In one embodiment, the method further includes: when the number of data write time slices is equal to a first preset threshold and the number of garbage collection time slices is equal to a second preset threshold, resetting the number of garbage collection time slices to M and resetting the number of time slices to N.

[0020] In a second aspect, the present invention provides an SSD write performance regulation device, and the device includes:

[0021] A first determination module, configured to determine a first running time required for the garbage collection module to recycle a garbage block according to SSD particle parameters, where the SSD particle parameters include an erase block time, a page number, a page read time, and a page write time;

[0022] A second determination module, configured to determine a second running time required for the data write module to fill a free block according to a preset IOPS threshold;

[0023] A coefficient determination module, configured to determine a time slice coefficient according to the first running time and the second running time;

[0024] A time slice determination module, configured to determine a garbage collection time slice number M and a data write time slice number N according to the time slice coefficient, where the ratio of the garbage collection time slice number M to the data write time slice number N is equal to the time slice coefficient;

[0025] An execution module, configured to determine whether to allocate a data write time slice for the data write module according to the data write time slice number N. If so, allocate a data write time slice for the data write module, and perform a data write operation on the SSD through the data write module within the data write time slice; if not, determine whether to allocate a garbage collection time slice for the garbage collection module according to the garbage collection time slice number M. If so, allocate a garbage collection time slice for the garbage collection module, and perform a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice.

[0026] In a third aspect, the present invention provides an electronic device, including a memory and a processor, where the memory stores a computer program, and when the computer program runs on the processor, it executes the SSD write performance regulation method described in the first aspect.

[0027] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, it implements the SSD write performance regulation method described in the first aspect.

[0028] The SSD write performance regulation method, device, equipment and medium provided by the present invention determine a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, where the SSD particle parameters include an erase block time, a page quantity, a page read time and a page write time; determine a second running time required for a data writing module to fill an idle block according to a preset IOPS threshold; determine a time slice coefficient according to the first running time and the second running time; determine a garbage collection time slice quantity M and a data writing time slice quantity N according to the time slice coefficient, and a ratio of the garbage collection time slice quantity M to the data writing time slice quantity N is equal to the time slice coefficient; determine whether it is necessary to allocate a data writing time slice for the data writing module according to the data writing time slice quantity N, and if so, allocate a data writing time slice for the data writing module, and perform a data writing operation on the SSD through the data writing module within the data writing time slice; if not, determine whether it is necessary to allocate a garbage collection time slice for the garbage collection module according to the garbage collection time slice quantity M, and if so, allocate a garbage collection time slice for the garbage collection module, and perform a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice. The present invention determines the time slice coefficient according to the SSD particle parameters and the preset IOPS threshold, so as to reasonably allocate the running operation time of the garbage collection module and the data writing module, ensure the minimum write time of the SSD, and improve the minimum write performance of the SSD.

[0029] To make the above objects, features and advantages of the present invention more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes a detailed description as follows. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0031] Figure 1 Shows a flowchart of an SSD write performance regulation method provided by an embodiment of the present invention;

[0032] Figure 2Another flowchart showing the SSD write performance regulation method provided by an embodiment of the present invention is shown;

[0033] Figure 3 Another flowchart showing the SSD write performance regulation method provided by an embodiment of the present invention is shown;

[0034] Figure 4 A structural diagram showing an SSD write performance regulation device provided by an embodiment of the present invention is shown;

[0035] Figure 5 A structural diagram showing an electronic device provided by an embodiment of the present invention is shown.

[0036] Main element symbol description:

[0037] 400 - SSD write performance regulation device; 410 - First determination module; 420 - Second determination module; 430 - Coefficient determination module; 440 - Time slice determination module; 450 - Execution module; 500 - Electronic device; 501 - Transceiver; 502 - Processor; 503 - Memory. Detailed implementation manners

[0038] The embodiments of the present invention will be described in detail below. Examples of the embodiments are shown in the drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary and are only used to explain the present invention and should not be construed as limiting the present invention.

[0039] In addition, the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality" means two or more unless otherwise specifically defined.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which this application belongs. The terms used in the description of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0041] Embodiment 1

[0042] An embodiment of the present invention provides an SSD write performance regulation method. Specifically, please refer to Figure 1 , and the method includes steps S110 to S160.

[0043] Step S110: Determine the first running time required for the garbage collection module to recycle a garbage block according to the SSD particle parameters. The SSD particle parameters include the erase block time, the number of pages, the page read time, and the page write time.

[0044] It should be noted that due to the characteristics of non-volatile flash memory storage particles (NAND Flash Memory Chip) in the SSD, new data can only be written after erasure. Therefore, the firmware of the SSD has a garbage collection module (GarbageCollection, GC) for specifically recycling invalid physical blocks in the SSD, that is, garbage blocks. The first running time required for the garbage collection module to recycle a garbage block can be calculated based on the SSD particle parameters. Different manufacturers and models of SSDs may have different particle parameters. Specifically, it can be obtained by referring to the specification table or technical document of the SSD.

[0045] In this embodiment, the first running time can be calculated based on the erase block time, the page read time, and the page write time. The specific calculation formula is: First running time = Erase block time + Page read time × Number of pages in the garbage block + Page write time × Number of pages in the garbage block.

[0046] Step S120: Determine the second running time required for the data writing module to fill an idle block according to the preset IOPS threshold.

[0047] It should be noted that in some application scenarios, the write performance of the SSD is required not to be lower than a certain minimum performance threshold, and the write performance of the SSD is mainly measured by the input / output operations per second (IOPS) of the SSD.

[0048] In this embodiment, according to the minimum performance IOPS requirement, calculate the running time for filling an idle block at the write speed of the minimum performance IOPS, that is, the second running time. The specific calculation formula is: Second running time = Idle block capacity / Preset IOPS threshold, where the idle block capacity can be obtained by referring to the technical document of the SSD and is usually 4KB.

[0049] Step S130: Determine the time slice coefficient according to the first running time and the second running time.

[0050] In this embodiment, the ratio of the first running time to the second running time is determined as the time slice coefficient.

[0051] Step S140: Determine the number of garbage collection time slices M and the number of data writing time slices N according to the time slice coefficient, where the ratio of the number of garbage collection time slices M to the number of data writing time slices N is equal to the time slice coefficient.

[0052] In this embodiment, when there is a large amount of data waiting to be written to the SSD and the garbage collection module is enabled, the allocation of time slices can be dynamically adjusted according to the time slice coefficient and the current workload. For example, if the time slice coefficient is 1.5, it can be determined that the ratio of the time allocated to the garbage collection operation to the time allocated to the data writing operation should be 3:2, and then the number of time slices allocated to the garbage collection module and the data writing module can be determined.

[0053] Step S150: Determine whether to allocate a data writing time slice to the data writing module according to the number of data writing time slices N. If so, allocate a data writing time slice to the data writing module, and perform a data writing operation on the SSD through the data writing module within the data writing time slice.

[0054] It should be noted that the data writing time slice refers to the maximum execution time allocated to the data writing module to perform the data writing operation. When the data writing module obtains the data writing time slice, it means obtaining the right to use the processor.

[0055] In this embodiment, when there is a large amount of data waiting to be written to the SSD and the garbage collection module is enabled, the data writing module first initiates a request for a time slice. When it is detected that the number of time slices allocated to the data writing module according to the time slice coefficient and the current workload of the SSD is N and N is greater than the first preset threshold, a data writing time slice is allocated to the data writing module, and the number of time slices N pre-allocated to the data writing module is correspondingly reduced by one.

[0056] In one embodiment, the determining whether to allocate a data writing time slice to the data writing module according to the number of data writing time slices N includes: determining whether the number of data writing time slices N is greater than the first preset threshold. If so, it is determined that a data writing time slice needs to be allocated to the data writing module; if not, it is determined that a data writing time slice does not need to be allocated to the data writing module.

[0057] In this embodiment, the first preset threshold can be 0. In other embodiments, the first preset threshold can also be other values, which can be determined according to the actual situation and are not limited here.

[0058] After allocating a data writing time slice to the data writing module, steps S151 - S153 are further included. Specifically, please refer to Figure 2 .

[0059] Step S151, determine that the number of data writing time slices is N - 1.

[0060] Step S152, obtain the current number of free blocks of the SSD, and determine whether to continue to start the garbage collection module according to the current number of free blocks.

[0061] It should be noted that the garbage collection module is only enabled when the number of free blocks in the SSD is less than the preset startup threshold of the garbage collection module.

[0062] Step S153, if it continues to start, allocate one of the data writing time slices to the data writing module until the number of data writing time slices is equal to the first preset threshold.

[0063] In this embodiment, when the data writing operation is completed within the data writing time slice by the data writing module, due to new data being written, the number of free blocks changes. At this time, it is necessary to re-determine whether to continue to enable the garbage collection module. If the garbage collection module is continued to be enabled, continue to allocate data writing time slices to the data writing module and repeat this operation until the data writing time slice is equal to the first preset threshold, such as 0.

[0064] Step S160, if not, then determine whether to allocate a garbage collection time slice to the garbage collection module according to the number of garbage collection time slices M. If so, allocate one of the garbage collection time slices to the garbage collection module, and perform garbage collection operation on the SSD by the garbage collection module within the garbage collection time slice.

[0065] In this embodiment, when the number of data writing time slices of the data writing module is exhausted, that is, when the number of data writing time slices is equal to the first preset threshold, the garbage collection module starts to request a time slice. When it is detected that the number of garbage collection time slices is M and M is greater than the second preset threshold, such as 0, allocate one garbage collection time slice to the garbage collection module, and at the same time, the number of garbage collection time slices M is correspondingly reduced by one.

[0066] In an embodiment, the determining whether to allocate a garbage collection time slice to the garbage collection module according to the number of garbage collection time slices M includes: determining whether the number of garbage collection time slices M is greater than the second preset threshold. If so, determine that it is necessary to allocate the garbage collection time slice to the garbage collection module; if not, determine that it is not necessary to allocate the garbage collection time slice to the garbage collection module.

[0067] In this embodiment, when the number M of garbage collection time slices is greater than a second preset threshold, for example, 0, a garbage collection time slice is allocated to the garbage collection module. At this time, the garbage collection module obtains the right to use the processor and starts to perform garbage collection operations on the SSD. The operation time is the length of the garbage collection time slice.

[0068] After allocating a garbage collection time slice to the garbage collection module, the following steps S161 to S163 are further included. Specifically, please refer to Figure 3 。

[0069] Step S161: Determine that the number of garbage collection time slices is M - 1.

[0070] Step S162: Obtain the current number of free blocks of the SSD, and determine whether to continue to start the garbage collection module according to the current number of free blocks.

[0071] In this embodiment, after the garbage collection module obtains a garbage collection time slice and finishes the garbage collection operation, the number of free blocks of the SSD changes at this time. Therefore, it is necessary to re-determine whether to continue to start the garbage collection module according to the current number of free blocks. If it continues to be started, the garbage collection module continues to request a time slice.

[0072] Step S163: If it continues to be started, allocate a garbage collection time slice to the garbage collection module until the number of garbage collection time slices is equal to the second preset threshold.

[0073] It should be noted that if the garbage collection module is not started, the data writing module can directly perform data writing operations.

[0074] In an embodiment, the obtaining the current number of free blocks of the SSD and determining whether to continue to start the garbage collection module according to the current number of free blocks includes: comparing the current number of free blocks with a preset start threshold of the garbage collection module. If the number of free blocks is less than the preset start threshold, start the garbage collection module.

[0075] In this embodiment, monitor the number of free blocks. When the number of free blocks is less than the preset start threshold of the garbage collection module, start the garbage collection module.

[0076] In an embodiment, the method further includes: when the number of data writing time slices is equal to a first preset threshold and the number of garbage collection time slices is equal to a second preset threshold, reset the number of garbage collection time slices to M and reset the number of time slices to N.

[0077] In this embodiment, when the number of data write time slices is equal to the first preset threshold and the number of garbage collection time slices is equal to the second preset threshold, it means that the current data writing and garbage collection processes are completed. At this time, it is necessary to reset the number of garbage collection time slices and the number of data write time slices according to the time slice coefficient.

[0078] The SSD write performance regulation method provided by the present invention includes: determining, according to the SSD particle parameters, the first running time required for the garbage collection module to recycle a garbage block, where the SSD particle parameters include the erase block time, the number of pages, the page read time, and the page write time; determining, according to the preset IOPS threshold, the second running time required for the data writing module to fill an idle block; determining the time slice coefficient according to the first running time and the second running time; determining the number of garbage collection time slices M and the number of data write time slices N according to the time slice coefficient, where the ratio of the number of garbage collection time slices M to the number of data write time slices N is equal to the time slice coefficient; judging whether it is necessary to allocate a data write time slice for the data writing module according to the number of data write time slices N. If so, allocate a data write time slice for the data writing module, and perform a data writing operation on the SSD through the data writing module within the data write time slice; if not, judge whether it is necessary to allocate a garbage collection time slice for the garbage collection module according to the number of garbage collection time slices M. If so, allocate a garbage collection time slice for the garbage collection module, and perform a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice. The present invention determines the time slice coefficient according to the particle parameters of the SSD and the preset IOPS threshold, thereby reasonably allocating the running operation time of the garbage collection module and the data writing module, ensuring the minimum write time of the SSD, and improving the minimum write performance of the SSD.

[0079] Embodiment 2

[0080] In addition, an embodiment of the present invention further provides an SSD write performance regulation device. Specifically, please refer to Figure 4 , and the SSD write performance regulation device 400 includes:

[0081] A first determination module 410, configured to determine, according to the SSD particle parameters, the first running time required for the garbage collection module to recycle a garbage block, where the SSD particle parameters include the erase block time, the number of pages, the page read time, and the page write time;

[0082] A second determination module 420, configured to determine, according to the preset IOPS threshold, the second running time required for the data writing module to fill an idle block;

[0083] A coefficient determination module 430, configured to determine a time slice coefficient according to the first running time and the second running time;

[0084] A time slice determination module 440, configured to determine the number M of garbage collection time slices and the number N of data writing time slices according to the time slice coefficient, where the ratio of the number M of garbage collection time slices to the number N of data writing time slices is equal to the time slice coefficient;

[0085] An execution module 450, configured to determine whether to allocate a data writing time slice for the data writing module according to the number N of data writing time slices. If so, allocate a data writing time slice for the data writing module, and perform a data writing operation on the SSD through the data writing module within the data writing time slice; if not, determine whether to allocate a garbage collection time slice for the garbage collection module according to the number M of garbage collection time slices. If so, allocate a garbage collection time slice for the garbage collection module, and perform a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice.

[0086] The SSD write performance regulation device provided by the embodiment of the present invention includes a first determination module, configured to determine the first running time required for the garbage collection module to recycle a garbage block according to the SSD particle parameters, where the SSD particle parameters include the erase block time, the number of pages, the page read time, and the page write time; a second determination module, configured to determine the second running time required for the data writing module to fill a free block according to a preset IOPS threshold; a coefficient determination module, configured to determine a time slice coefficient according to the first running time and the second running time; a time slice determination module, configured to determine the number M of garbage collection time slices and the number N of data writing time slices according to the time slice coefficient, where the ratio of the number M of garbage collection time slices to the number N of data writing time slices is equal to the time slice coefficient; an execution module, configured to determine whether to allocate a data writing time slice for the data writing module according to the number N of data writing time slices. If so, allocate a data writing time slice for the data writing module, and perform a data writing operation on the SSD through the data writing module within the data writing time slice; if not, determine whether to allocate a garbage collection time slice for the garbage collection module according to the number M of garbage collection time slices. If so, allocate a garbage collection time slice for the garbage collection module, and perform a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice. The present invention determines the time slice coefficient according to the particle parameters of the SSD and the preset IOPS threshold, thereby reasonably allocating the running operation time of the garbage collection module and the data writing module, ensuring the minimum writing time of the SSD, and improving the minimum write performance of the SSD.

[0087] Embodiment 3

[0088] In addition, an embodiment of the present invention provides an electronic device, including a memory and a processor. The memory stores a computer program, and when the computer program runs on the processor, it executes the SSD write performance regulation method provided in Embodiment 1.

[0089] Specifically, please refer to Figure 5 , the electronic device 500 includes: a transceiver 501, a bus interface, and a processor 502. The processor 502 is configured to determine a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, where the SSD particle parameters include an erase block time, a page number, a page read time, and a page write time; determine a second running time required for a data writing module to fill an idle block according to a preset IOPS threshold; determine a time slice coefficient according to the first running time and the second running time; determine a garbage collection time slice number M and a data writing time slice number N according to the time slice coefficient, where a ratio of the garbage collection time slice number M to the data writing time slice number N is equal to the time slice coefficient; determine whether to allocate a data writing time slice for the data writing module according to the data writing time slice number N. If so, allocate a data writing time slice for the data writing module, and perform a data writing operation on the SSD through the data writing module within the data writing time slice; if not, determine whether to allocate a garbage collection time slice for the garbage collection module according to the garbage collection time slice number M. If so, allocate a garbage collection time slice for the garbage collection module, and perform a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice.

[0090] In the embodiment of the present invention, the electronic device 500 further includes: a memory 503. In Figure 5 , the bus architecture may include any number of interconnected buses and bridges. Specifically, various circuits of one or more processors represented by the processor 502 and a memory represented by the memory 503 are linked together. The bus architecture can also link various other circuits, such as peripheral devices, voltage regulators, and power management circuits, etc. These are well known in the art, so they will not be further described herein. The bus interface provides an interface. The transceiver 501 may be multiple elements, that is, including a transmitter and a receiver, and provides a unit for communicating with various other devices on a transmission medium. The processor 502 is responsible for managing the bus architecture and general processing, and the memory 503 can store data used by the processor 502 when performing operations.

[0091] The electronic device 500 provided by the embodiment of the present invention can execute the SSD write performance regulation method provided by the above-mentioned method embodiment 1. To avoid repetition, it will not be elaborated here.

[0092] Embodiment 4

[0093] In addition, the embodiment of the present invention provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the SSD write performance regulation method provided by Embodiment 1 is implemented.

[0094] In this embodiment, the computer-readable storage medium can be a read-only memory (ROM for short), a random access memory (RAM for short), a magnetic disk, an optical disk, or the like.

[0095] The computer-readable storage medium provided by this embodiment can implement the SSD write performance regulation method provided by Embodiment 1. To avoid repetition, it will not be elaborated here.

[0096] In all the examples shown and described here, any specific value should be construed as merely exemplary, not as a limitation. Therefore, other examples of the exemplary embodiments may have different values.

[0097] It should be noted that: similar reference numerals and letters denote similar items in the following figures. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0098] The above-described embodiments merely represent several implementation manners of the present invention. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the scope of the present invention. It should be pointed out that for those of ordinary skill in the art, without departing from the concept of the present invention, several modifications and improvements can still be made, and these all belong to the protection scope of the present invention.

Claims

1. A method for regulating the write performance of an SSD, characterized in that, The method includes: Determining a first running time required for a garbage collection module to recycle a garbage block according to SSD particle parameters, where the SSD particle parameters include an erase block time, a page quantity, a page read time, and a page write time; Determining a second running time required for a data writing module to fill an idle block according to a preset IOPS threshold; Determining a time slice coefficient according to the first running time and the second running time; Determining a garbage collection time slice quantity M and a data writing time slice quantity N according to the time slice coefficient, where the ratio of the garbage collection time slice quantity M to the data writing time slice quantity N is equal to the time slice coefficient; Judging whether to allocate a data writing time slice for the data writing module according to the data writing time slice quantity N. If so, allocating a data writing time slice for the data writing module, and performing a data writing operation on the SSD through the data writing module within the data writing time slice; If not, judging whether to allocate a garbage collection time slice for the garbage collection module according to the garbage collection time slice quantity M. If so, allocating a garbage collection time slice for the garbage collection module, and performing a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice.

2. The SSD write performance regulation method according to claim 1, wherein The judging whether to allocate a data writing time slice for the data writing module according to the data writing time slice quantity N includes: Judging whether the data writing time slice quantity N is greater than a first preset threshold. If so, determining that a data writing time slice needs to be allocated for the data writing module; If not, determining that a data writing time slice does not need to be allocated for the data writing module.

3. The SSD write performance regulation method according to claim 2, wherein After allocating a data writing time slice for the data writing module, it further includes: Determining that the data writing time slice quantity is N - 1; Obtaining the current idle block quantity of the SSD, and judging whether to continue to start the garbage collection module according to the current idle block quantity; If continuing to start, allocating a data writing time slice for the data writing module until the data writing time slice quantity is equal to the first preset threshold.

4. The SSD write performance regulation method according to claim 1, characterized in that The judging whether to allocate a garbage collection time slice for the garbage collection module according to the garbage collection time slice quantity M includes: Judging whether the garbage collection time slice quantity M is greater than a second preset threshold. If so, determining that a garbage collection time slice needs to be allocated for the garbage collection module; If not, determining that a garbage collection time slice does not need to be allocated for the garbage collection module.

5. The SSD write performance regulation method according to claim 4, wherein After allocating a garbage collection time slice for the garbage collection module, it further includes: Determining that the garbage collection time slice quantity is M - 1; Obtaining the current idle block quantity of the SSD, and judging whether to continue to start the garbage collection module according to the current idle block quantity; If continuing to start, allocating a garbage collection time slice for the garbage collection module until the garbage collection time slice quantity is equal to the second preset threshold.

6. The SSD write performance regulation method according to claim 3 or 5, characterized in that, Obtaining the current number of free blocks of the SSD, and determining whether to continue starting the garbage collection module according to the current number of free blocks, includes: Comparing the current number of free blocks with a preset start threshold of the garbage collection module, and if the number of free blocks is less than the preset start threshold, starting the garbage collection module.

7. The SSD write performance regulation method according to claim 6, characterized in that, The method further includes: When the number of data write time slices is equal to a first preset threshold and the number of garbage collection time slices is equal to a second preset threshold, resetting the number of garbage collection time slices to M and resetting the number of time slices to N.

8. A SSD write performance regulation device, characterized in that, The device includes: A first determination module, configured to determine a first running time required for the garbage collection module to recycle a garbage block according to SSD particle parameters, where the SSD particle parameters include erase block time, number of pages, page read time, and page write time; A second determination module, configured to determine a second running time required for the data write module to fill a free block according to a preset IOPS threshold; A coefficient determination module, configured to determine a time slice coefficient according to the first running time and the second running time; A time slice determination module, configured to determine a garbage collection time slice number M and a data write time slice number N according to the time slice coefficient, where a ratio of the garbage collection time slice number M to the data write time slice number N is equal to the time slice coefficient; An execution module, configured to determine whether to allocate a data write time slice for the data write module according to the data write time slice number N. If so, allocate a data write time slice for the data write module, and perform a data write operation on the SSD through the data write module within the data write time slice; if not, determine whether to allocate a garbage collection time slice for the garbage collection module according to the garbage collection time slice number M. If so, allocate a garbage collection time slice for the garbage collection module, and perform a garbage collection operation on the SSD through the garbage collection module within the garbage collection time slice.

9. An electronic device, characterized in that, It includes a memory and a processor. The memory stores a computer program, and when the computer program runs on the processor, it executes the SSD write performance regulation method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the SSD write performance regulation method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Management method, system and equipment of memory chip and storage medium

    CN108089822A

  • User write-in speed control method and device, equipment and medium

    CN112416255A