Write performance control method, device, equipment and medium based on effective data

By dynamically allocating the running priority of the data writing module and the garbage collection module in the solid-state drive according to the preset IOPS value, the problem of low SSD writing performance is solved and more efficient data writing is achieved.

CN118227058BActive Publication Date: 2024-09-06CHENGDU BIWIN STORAGE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410649889.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-24
Publication Date
2024-09-06
Estimated Expiration
2044-05-24

AI Technical Summary

Technical Problem

In a solid-state drive (SSD), when the garbage collection module is started, data writing needs to wait for garbage collection to release space, resulting in low write performance and unable to meet the minimum performance limitations of some application scenarios.

Method used

By determining the operating priority of the data writing module and the garbage collection module based on the preset IOPS value, and dynamically allocating the allowed operating values, it ensures that the data writing module and the garbage collection module reasonably obtain the processor priority and improves the write performance of the SSD.

Benefits of technology

It effectively improves the writing performance of SSD, ensures that the writing speed meets the preset IOPS value requirements, and improves writing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118227058B
    Figure CN118227058B
Patent Text Reader

Abstract

The present invention provides a write performance control method, device, equipment and medium based on valid data, which relates to the field of storage technology. The method includes: determining the write time according to a preset IOPS value; obtaining the size of the valid data in the target garbage block, and determining the recovery time according to the size of the valid data, page read time, page write time and block erase time; determining the allowed operation coefficient according to the write time and the recovery time; determining the first allowed operation value R and the second allowed operation value S according to the allowed operation coefficient; judging whether it is necessary to run a data write module according to the first allowed operation value R, and if so, performing data writing on the SSD through the data write module; if not, judging whether it is necessary to run a garbage collection module according to the second allowed operation value S, and if so, performing garbage collection on the target garbage block through the garbage collection module. The present invention improves the 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 field of storage technology, and in particular to a write performance control method, device, equipment and medium based on valid data. Background Art

[0002] Solid State Drive (SSD) has a garbage collection (GC) module. In some application scenarios, the write performance of the SSD is required to be no less than the minimum performance limit. However, when there is a large amount of data waiting to be written to the SSD and the GC module is started, data writing often needs to wait for garbage collection to release space, which results in a small amount of data written per unit time and very low SSD write performance. Summary of the invention

[0003] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and provide a write performance control method, device, equipment and medium based on valid data, so as to improve the write performance of SSD.

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

[0005] In a first aspect, the present invention provides a write performance control method based on valid data, the method comprising:

[0006] According to the preset IOPS value, determine the writing time required for the data writing module to fill up a free block;

[0007] Obtaining the size of the valid data in the target garbage block, and determining the recycling time required for the garbage recycling module to recycle the target garbage block according to the size of the valid data, page read time, page write time and block erase time;

[0008] Determine an allowable operation coefficient according to the write time and the recycle time;

[0009] According to the allowable operation coefficient, determining a first allowable operation value R and a second allowable operation value S, wherein a ratio of the first allowable operation value R to the second allowable operation value S is equal to the allowable operation coefficient;

[0010] According to the first allowed operation value R, determining whether the data writing module needs to be run, and if so, executing data writing to the SSD through the data writing module;

[0011] If not, judging whether the garbage collection module needs to be run according to the second allowed running value S, and if so, performing garbage collection on the target garbage block through the garbage collection module.

[0012] In one embodiment, the recycling time required for the garbage collection module to recycle the target garbage block is determined according to the size of the valid data volume, the page read time, the page write time and the block erase time, and the calculation formula is:

[0013]

[0014] in, For the recycling time, is the size of the effective data volume, is the page read time, is the page write time, is the block erase time.

[0015] In one embodiment, the method further includes: if the first allowed operation value and the second allowed operation value are both equal to a preset operation threshold, determining the next garbage block to be recycled as the target garbage block.

[0016] In one embodiment, judging whether the data writing module needs to be run based on the first allowed running value R includes: if the first allowed running value is greater than the preset running threshold, determining that the data writing module needs to be run; if the first allowed running value is equal to the preset running threshold, determining that the data writing module does not need to be run.

[0017] In one embodiment, after executing data writing to the SSD through the data writing module, it also includes: determining that the first allowed operation value is R-1; judging whether the current number of free blocks of the SSD is greater than the recovery start threshold of the garbage collection module; if the current number of free blocks is greater than the recovery start threshold, executing data writing to the SSD through the data writing module until the first allowed operation value is equal to the preset operation threshold.

[0018] In one embodiment, judging whether the garbage collection module needs to be run based on the second allowed running value S includes: if the second allowed running value is greater than the preset running threshold, determining that the garbage collection module needs to be run; if the second allowed running value is equal to the preset running threshold, determining that the garbage collection module does not need to be run.

[0019] In one embodiment, after performing garbage collection on the target garbage block through the garbage collection module, it also includes: determining that the second allowed operation value is S-1; judging whether the current number of free blocks of the SSD is greater than the recovery start threshold of the garbage collection module; if the current number of free blocks is greater than the recovery start threshold, performing garbage collection on the target garbage block through the garbage collection module until the second allowed operation value is equal to the preset operation threshold.

[0020] In a second aspect, the present invention provides a write performance control device based on valid data, the device comprising:

[0021] A first determination module is used to determine the writing time required for the data writing module to fill up a free block according to a preset IOPS value;

[0022] A second determination module is used to obtain the size of the valid data in the target garbage block, and determine the recovery time required for the garbage recovery module to recover the target garbage block according to the size of the valid data, the page read time, the page write time and the block erase time;

[0023] A coefficient determination module, used to determine an allowed operation coefficient according to the write time and the recycle time;

[0024] an operation value determination module, configured to determine a first allowable operation value R and a second allowable operation value S according to the allowable operation coefficient, wherein a ratio of the first allowable operation value R to the second allowable operation value S is equal to the allowable operation coefficient;

[0025] A first execution module, configured to determine whether the data writing module needs to be run according to the first allowed running value R, and if so, to write data to the SSD through the data writing module;

[0026] The second execution module is used to determine whether the garbage collection module needs to be run according to the second allowed running value S, if not, and if so, perform garbage collection on the target garbage block through the garbage collection module.

[0027] In a third aspect, the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the write performance control method based on valid data described in the first aspect is executed.

[0028] In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, performs the write performance control method based on valid data as described in the first aspect.

[0029] The present invention provides a write performance control method, device, equipment and medium based on valid data, the method comprising: determining the write time required for a data write module to fill a free block according to a preset IOPS value; obtaining the size of the valid data in the target garbage block, and determining the recovery time required for the garbage recovery module to recover the target garbage block according to the size of the valid data, page read time, page write time and block erase time; determining an allowed operation coefficient according to the write time and the recovery time; determining a first allowed operation value R and a second allowed operation value S according to the allowed operation coefficient, the ratio of the first allowed operation value R to the second allowed operation value S being equal to the allowed operation coefficient; judging whether it is necessary to run the data write module according to the first allowed operation value R, and if so, performing data writing on the SSD through the data write module; if not, judging whether it is necessary to run the garbage recovery module according to the second allowed operation value S, and if so, performing garbage recovery on the target garbage block through the garbage recovery module. The present invention determines the garbage collection time according to the garbage block to be currently collected and the write time according to the preset IOPS value, and then allocates the allowed operation coefficient so that the data writing module and the garbage collection module can reasonably obtain the priority of the processor in turn, thereby ensuring the minimum write time of the SSD and improving the minimum write performance of the SSD.

[0030] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and understandable, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0032] Figure 1 A schematic diagram of a process of a write performance control method based on valid data provided by an embodiment of the present invention is shown;

[0033] Figure 2 Another schematic diagram of the process of the write performance control method based on valid data provided by an embodiment of the present invention is shown;

[0034] Figure 3 Another schematic diagram of a flow chart of a write performance control method based on valid data provided by an embodiment of the present invention is shown;

[0035] Figure 4 A schematic diagram of the structure of a write performance control device based on valid data provided by an embodiment of the present invention is shown;

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

[0037] Description of main component symbols:

[0038] 400 - write performance control device based on valid data; 410 - first determination module; 420 - second determination module; 430 - coefficient determination module; 440 - operation value determination module; 450 - first execution module; 460 - second execution module; 500 - electronic device; 501 - transceiver; 502 - processor; 503 - memory. DETAILED DESCRIPTION

[0039] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0040] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0041] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of the template 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.

[0042] Example 1

[0043] The embodiment of the present invention provides a write performance control method based on valid data. For details, see Figure 1 , the method includes steps S110~S160.

[0044] Step S110: determining the writing time required for the data writing module to fill up a free block according to a preset IOPS value.

[0045] It should be noted that in some application scenarios, SSDs are required to have an IOPS value not lower than a certain threshold. When the GC module is started, since the physical block space released by garbage collection is often lower than the physical block space required for data writing, when the SSD performs garbage collection and data writing at the same time, it is easy to cause the data writing speed to decrease, resulting in a decrease in the amount of data written, and the SSD's write performance cannot meet the preset IOPS value requirements.

[0046] In this embodiment, the write time required to fill a free block is calculated according to the preset IOPS value, and the calculation formula is: write time = free block capacity / preset IOPS value, where the free block capacity can be obtained by referring to the technical manual and is generally 4KB.

[0047] Step S120, obtaining the size of the valid data in the target garbage block, and determining the recycling time required for the garbage recycling module to recycle the target garbage block according to the size of the valid data, page read time, page write time and block erase time.

[0048] It should be noted that in an SSD, the time to recycle a garbage block is proportional to the amount of valid data in the garbage block, the page read time, the page write time, and the block erase time.

[0049] In this embodiment, by scanning the data in the target garbage block, the range of valid data is identified, and then the amount of valid data is determined. According to the amount of valid data, the recovery time of the target garbage block can be further determined more accurately.

[0050] In one embodiment, the recycling time required for the garbage collection module to recycle the target garbage block is determined according to the size of the valid data volume, the page read time, the page write time and the block erase time, and the calculation formula is:

[0051]

[0052] in, For the recycling time, is the size of the effective data volume, is the page read time, is the page write time, is the block erase time.

[0053] In this embodiment, the page read time refers to the time required to read a data page from the SSD, the page write time refers to the time required to write data to a data page in the SSD, and the block erase time refers to the time required to erase an entire data block in the SSD.

[0054] Step S130, determining an allowed operation coefficient according to the write time and the recycle time.

[0055] In this embodiment, the allowed operation value can be dynamically assigned to the data writing module and the garbage collection module according to the allowed operation coefficient, and whether to run each module is determined according to the allowed operation value. It should be noted that the allowed operation value assigned to the data writing module is the first allowed operation value, and the allowed operation value assigned to the garbage collection module is the second allowed operation value.

[0056] Step S140: determining a first allowable operation value R and a second allowable operation value S according to the allowable operation coefficient, wherein a ratio of the first allowable operation value R to the second allowable operation value S is equal to the allowable operation coefficient.

[0057] It should be noted that when the first allowed operation value R of the data writing module is greater than the preset allowed operation threshold value, such as 0, it means that the data writing module is allowed to run, and its number of runs is R. Similarly, when the second allowed operation value S of the garbage collection module is greater than the preset allowed operation threshold value, such as 0, it means that the garbage collection module is allowed to run, and its number of runs is S.

[0058] Step S150: judging whether the data writing module needs to be run according to the first allowed running value R, and if so, writing data to the SSD through the data writing module.

[0059] In this embodiment, when the first allowed operation value R is greater than a preset allowed operation threshold, such as 0, the data writing module obtains the priority of the processor and writes data to the SSD. After the data writing module completes one data write, the corresponding first allowed operation value R is reduced by one.

[0060] In one embodiment, judging whether the data writing module needs to be run based on the first allowed running value R includes: if the first allowed running value is greater than the preset running threshold, determining that the data writing module needs to be run; if the first allowed running value is equal to the preset running threshold, determining that the data writing module does not need to be run.

[0061] It should be noted that the first allowed operation value and the second allowed operation value are both positive integers greater than or equal to 0, such as 1, 2, 3, etc.

[0062] In one implementation, see Figure 2 After the data is written to the SSD by the data writing module, the method further includes:

[0063] Step S151, determining that the first allowed operation value is R-1;

[0064] After the data writing module completes one data writing operation, the first allowed operation value corresponding to the data writing module is reduced by one.

[0065] Step S152, determining whether the current number of free blocks of the SSD is greater than a recycling start threshold of the garbage collection module;

[0066] Whether to continue running the garbage collection module is determined according to the current number of free blocks. If it is continued, data writing is continued until the first allowed running value corresponding to the data writing module is equal to a preset running threshold, such as 0.

[0067] Step S153: if the current number of free blocks is greater than the recycling start threshold, data is written to the SSD through the data writing module until the first allowed operation value is equal to the preset operation threshold.

[0068] In this embodiment, when the first allowed operation value is equal to a preset operation threshold, such as 0, it means that the data writing has been completed at this time.

[0069] Step S160: If not, judging whether the garbage collection module needs to be run according to the second allowed running value S, and if so, performing garbage collection on the target garbage block through the garbage collection module.

[0070] In this embodiment, the processor priority time obtained by the data writing module and the garbage collection module is pre-allocated according to the allowed operation coefficient. When the first allowed operation value of the data writing module is equal to the preset operation threshold, it means that the data writing module loses the processing priority at this time. At this time, it can be determined whether to run the garbage collection module for garbage collection.

[0071] In one embodiment, judging whether the garbage collection module needs to be run based on the second allowed running value S includes: if the second allowed running value is greater than the preset running threshold, determining that the garbage collection module needs to be run; if the second allowed running value is equal to the preset running threshold, determining that the garbage collection module does not need to be run.

[0072] In this embodiment, when the second allowed operation value S of the garbage collection module is greater than a preset allowed operation threshold, such as 0, it means that the garbage collection module is allowed to run, and its running times is S.

[0073] In one implementation, see Figure 3 After the garbage collection module performs garbage collection on the target garbage block, the method further includes:

[0074] Step S161, determining that the second allowed operation value is S-1;

[0075] After the garbage collection module is run once, its corresponding second allowed run value is reduced by one.

[0076] Step S162, determining whether the current number of free blocks of the SSD is greater than a recycling start threshold of the garbage collection module;

[0077] In this embodiment, after the garbage collection module completes garbage collection, since the number of available free blocks currently in the SSD has changed, it is necessary to re-determine whether to continue to enable the garbage collection module to perform garbage collection.

[0078] Step S163: If the current number of free blocks is greater than the recycling start threshold, garbage collection is performed on the target garbage block through the garbage collection module until the second allowed running value is equal to the preset running threshold.

[0079] In this embodiment, when the second allowed operation value of the garbage collection module is equal to the preset operation threshold, it means that the garbage collection module loses the priority of the processor at this time.

[0080] In one embodiment, the method further includes: if the first allowed operation value and the second allowed operation value are both equal to a preset operation threshold, determining the next garbage block to be recycled as the target garbage block.

[0081] In this embodiment, when the first allowed operation value and the second allowed operation value are both equal to the preset allowed operation value, the allowed operation coefficient is re-determined according to the recycling time of the next garbage block to be recycled, so that the allowed operation value can be allocated more accurately.

[0082] The embodiment of the present invention provides a write performance control method based on valid data, the method comprising: determining the write time required for a data write module to fill a free block according to a preset IOPS value; obtaining the size of the valid data in the target garbage block, and determining the recovery time required for the garbage recovery module to recover the target garbage block according to the size of the valid data, page read time, page write time and block erase time; determining an allowed operation coefficient according to the write time and the recovery time; determining a first allowed operation value R and a second allowed operation value S according to the allowed operation coefficient, the ratio of the first allowed operation value R to the second allowed operation value S being equal to the allowed operation coefficient; judging whether it is necessary to run the data write module according to the first allowed operation value R, and if so, performing data writing on the SSD through the data write module; if not, judging whether it is necessary to run the garbage recovery module according to the second allowed operation value S, and if so, performing garbage recovery on the target garbage block through the garbage recovery module. The present invention determines the garbage collection time according to the garbage block to be currently collected and the write time according to the preset IOPS value, and then allocates the allowed operation coefficient so that the data writing module and the garbage collection module can reasonably obtain the priority of the processor in turn, thereby ensuring the minimum write time of the SSD and improving the minimum write performance of the SSD.

[0083] Example 2

[0084] In addition, the embodiment of the present invention also provides a write performance control device based on valid data. For details, see Figure 4 , the write performance control device 400 based on valid data includes:

[0085] A first determination module 410 is used to determine the writing time required for the data writing module to fill up a free block according to a preset IOPS value;

[0086] A second determination module 420 is used to obtain the size of the valid data in the target garbage block, and determine the recycling time required for the garbage recycling module to recycle the target garbage block according to the size of the valid data, the page read time, the page write time and the block erase time;

[0087] A coefficient determination module 430, configured to determine an allowed operation coefficient according to the write time and the reclaim time;

[0088] An operation value determination module 440, configured to determine a first allowable operation value R and a second allowable operation value S according to the allowable operation coefficient, wherein a ratio of the first allowable operation value R to the second allowable operation value S is equal to the allowable operation coefficient;

[0089] A first execution module 450, configured to determine whether the data writing module needs to be executed according to the first allowed operation value R, and if so, execute data writing to the SSD through the data writing module;

[0090] The second execution module 460 is used to determine whether the garbage collection module needs to be run according to the second allowed running value S, if not, and if so, perform garbage collection on the target garbage block through the garbage collection module.

[0091] The write performance control device based on valid data provided in the embodiment of the present invention can execute the write performance control method based on valid data provided in the above method embodiment 1, which will not be described again here to avoid repetition.

[0092] The write performance control device based on valid data provided by an embodiment of the present invention comprises a first determination module, which is used to determine the write time required for a data write module to fill a free block according to a preset IOPS value; a second determination module, which is used to obtain the size of the valid data in the target garbage block, and determine the recovery time required for the garbage recovery module to recover the target garbage block according to the size of the valid data, the page read time, the page write time and the block erase time; a coefficient determination module, which is used to determine the allowed operation coefficient according to the write time and the recovery time; an operation value determination module, which is used to determine a first allowed operation value R and a second allowed operation value S according to the allowed operation coefficient, wherein the ratio of the first allowed operation value R to the second allowed operation value S is equal to the allowed operation coefficient; a first execution module, which is used to determine whether the data write module needs to be run according to the first allowed operation value R, and if so, perform data writing on the SSD through the data write module; and a second execution module, which is used to determine whether the garbage recovery module needs to be run according to the second allowed operation value S if not, and if so, perform garbage recovery on the target garbage block through the garbage recovery module. The present invention determines the garbage collection time according to the garbage block to be currently collected and the write time according to the preset IOPS value, and then allocates the allowed operation coefficient so that the data writing module and the garbage collection module can reasonably obtain the priority of the processor in turn, thereby ensuring the minimum write time of the SSD and improving the minimum write performance of the SSD.

[0093] Example 3

[0094] In addition, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, the write performance control method based on valid data provided in Example 1 is executed.

[0095] For details, see Figure 5The electronic device 500 includes: a transceiver 501, a bus interface and a processor 502, wherein the processor 502 is used to determine the writing time required for the data writing module to fill a free block according to a preset IOPS value; obtain the size of the effective data in the target garbage block, and determine the recovery time required for the garbage collection module to recover the target garbage block according to the size of the effective data, the page read time, the page write time and the block erase time; determine an allowable operation coefficient according to the writing time and the recovery time; determine a first allowable operation value R and a second allowable operation value S according to the allowable operation coefficient, and the ratio of the first allowable operation value R to the second allowable operation value S is equal to the allowable operation coefficient; determine whether it is necessary to run the data writing module according to the first allowable operation value R, and if so, perform data writing on the SSD through the data writing module; if not, determine whether it is necessary to run the garbage collection module according to the second allowable operation value S, and if so, perform garbage collection on the target garbage block through the garbage collection module.

[0096] In the embodiment of the present invention, the electronic device 500 further includes a memory 503. Figure 5 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits of one or more processors represented by processor 502 and memory represented by memory 503. The bus architecture may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 501 may be a plurality of components, i.e., including a transmitter and a receiver, providing 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 may store data used by the processor 502 when performing operations.

[0097] The electronic device 500 provided in the embodiment of the present invention can execute the write performance control method based on valid data provided in the above method embodiment 1, which will not be described again here to avoid repetition.

[0098] Example 4

[0099] In addition, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the write performance control method based on valid data provided in Example 1 is implemented.

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

[0101] The computer-readable storage medium provided in this embodiment can implement the write performance control method based on valid data provided in Example 1, and will not be described again here to avoid repetition.

[0102] In all examples shown and described herein, any specific values ​​should be interpreted as merely exemplary and not as limiting, and thus other examples of the exemplary embodiments may have different values.

[0103] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.

[0104] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the present invention. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention.

Claims

1. A write performance control method based on valid data, It is characterized in that The method comprises: According to the preset IOPS value, determine the writing time required for the data writing module to fill up a free block; Obtaining the size of the valid data in the target garbage block, and determining the recycling time required for the garbage recycling module to recycle the target garbage block according to the size of the valid data, page read time, page write time and block erase time; Determine an allowable operation coefficient according to the write time and the recycle time; According to the allowable operation coefficient, determining a first allowable operation value R and a second allowable operation value S, wherein a ratio of the first allowable operation value R to the second allowable operation value S is equal to the allowable operation coefficient; According to the first allowed operation value R, determining whether the data writing module needs to be run, and if so, executing data writing to the SSD through the data writing module; If not, then judging whether it is necessary to run the garbage collection module according to the second allowed operation value S, and if so, performing garbage collection on the target garbage block through the garbage collection module; The step of judging whether the data writing module needs to be run according to the first run-allowed value R includes: if the first run-allowed value is greater than a preset run threshold, determining that the data writing module needs to be run; if the first run-allowed value is equal to the preset run threshold, determining that the data writing module does not need to be run; The determining whether the garbage collection module needs to be run based on the second allowed running value S includes: if the second allowed running value is greater than the preset running threshold, determining that the garbage collection module needs to be run; if the second allowed running value is equal to the preset running threshold, determining that the garbage collection module does not need to be run.

2. The write performance control method based on valid data according to claim 1, It is characterized in that The recycling time required for the garbage recycling module to recycle the target garbage block is determined according to the size of the effective data volume, the page read time, the page write time and the block erase time. The calculation formula is: in, For the recycling time, is the size of the effective data volume, is the page read time, is the page write time, is the block erase time.

3. The write performance control method based on valid data according to claim 2, It is characterized in that The method further comprises: If the first allowed operation value and the second allowed operation value are both equal to the preset operation threshold, the next garbage block to be recycled is determined as the target garbage block.

4. The write performance control method based on valid data according to claim 3, It is characterized in that After the data is written to the SSD by the data writing module, the method further includes: Determine the first allowable operating value as R-1; Determine whether the current number of free blocks of the SSD is greater than a recycling start threshold of the garbage collection module; If the current number of free blocks is greater than the recycling start threshold, data is written to the SSD through the data writing module until the first allowed operation value is equal to the preset operation threshold.

5. The write performance control method based on valid data according to claim 3, It is characterized in that After performing garbage collection on the target garbage block by the garbage collection module, the method further includes: Determine the second allowed operation value as S-1; Determine whether the current number of free blocks of the SSD is greater than a recycling start threshold of the garbage collection module; If the current number of free blocks is greater than the recycling start threshold, garbage collection is performed on the target garbage block through the garbage collection module until the second allowed running value is equal to the preset running threshold.

6. A write performance control device based on valid data, It is characterized in that The device comprises: A first determination module is used to determine the writing time required for the data writing module to fill up a free block according to a preset IOPS value; A second determination module is used to obtain the size of the valid data in the target garbage block, and determine the recovery time required for the garbage recovery module to recover the target garbage block according to the size of the valid data, the page read time, the page write time and the block erase time; A coefficient determination module, used to determine an allowed operation coefficient according to the write time and the recycle time; an operation value determination module, configured to determine a first allowable operation value R and a second allowable operation value S according to the allowable operation coefficient, wherein a ratio of the first allowable operation value R to the second allowable operation value S is equal to the allowable operation coefficient; A first execution module, configured to determine whether the data writing module needs to be run according to the first allowed running value R, and if so, to write data to the SSD through the data writing module; a second execution module, configured to, if not, determine whether the garbage collection module needs to be run according to the second allowed run value S, and if so, perform garbage collection on the target garbage block through the garbage collection module; The first execution module is further configured to determine that the data writing module needs to be executed if the first allowed operation value is greater than a preset operation threshold value; and determine that the data writing module does not need to be executed if the first allowed operation value is equal to the preset operation threshold value; The second execution module is also used to determine that the garbage collection module needs to be run if the second allowed operation value is greater than the preset operation threshold; if the second allowed operation value is equal to the preset operation threshold, determine that the garbage collection module does not need to be run.

7. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is run on the processor, the method for controlling write performance based on valid data according to any one of claims 1 to 5 is executed.

8. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the write performance control method based on valid data according to any one of claims 1 to 5 is implemented.