Flow Scheduling Control Method, Device, and Storage Medium Based on Partitioned Storage Devices

By determining the target proportion based on the proportion of garbage data and effective data in the partitioned storage device, controlling garbage collection and user data writing speed, the stability and performance utilization problems of partitioned storage devices are solved, and the stable operation and performance optimization of the device are achieved.

CN119065595BActive Publication Date: 2025-07-22BEIJING VOLCANO ENGINE TECH CO LTD

Patent Information

Application Number
CN202410869778.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2025-07-22
Estimated Expiration
2044-06-28

AI Technical Summary

Technical Problem

The prior art cannot effectively balance garbage collection and user data writing speed in partitioned storage devices, resulting in the inability to fully utilize the stability and performance of the device.

Method used

By determining the target ratio between writing data and user writing data based on the proportion of garbage data and effective data of the partition storage device currently to be recycled, the speed of garbage collection and user writing data is controlled to stabilize the number of free partitions.

Benefits of technology

Ensure the stability of partitioned storage devices and make full use of data writing performance to avoid device instability and performance degradation caused by speed imbalance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119065595B_ABST
    Figure CN119065595B_ABST
Patent Text Reader

Abstract

An embodiment of the present disclosure provides a traffic scheduling and control method, device, and storage medium based on a partitioned storage device. By determining the target ratio between the throughput of writing data during the garbage collection process of the currently to-be-reclaimed partition and the throughput of the user writing data to the partitioned storage device according to the ratio of garbage data to valid data in the currently to-be-reclaimed partition of the partitioned storage device; controlling the first type of requests for writing data during the garbage collection process and the second type of requests for the user to write data to the partitioned storage device by the partitioned storage device according to the target ratio. By controlling the garbage collection speed and the speed of the user writing data to the partitioned storage device according to the determined target ratio, the stability of the number of free partitions of the partitioned storage device is ensured, thereby ensuring the stability of the partitioned storage device and making full use of the writing data performance of the partitioned storage device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer and network communication technologies, and in particular, to a traffic scheduling control method, device, and storage medium based on a zoned storage device. Background Art

[0002] A zoned storage (ZNS) device divides the storage area inside the entire storage device, such as a solid-state drive (SSD), into multiple zones. Each zone manages a segment of logical block addresses (LBAs). Data between different zones can be independent. Writes within a zone are only allowed to be sequential, and random reads are possible. Moreover, the zoned storage device also needs to organize the storage space of the zoned storage device through a garbage collection (GC) process, relocate valid data segments in any zone to other zones, and erase the original zone. Since there are reads of valid data and writes to new zones during the garbage collection process, in order to minimize the impact on user write performance, it is necessary to balance the write data speed during garbage collection and the user write data speed, so that the remaining space of the zoned storage device remains stable and user writes can be satisfied.

[0003] In the prior art, when balancing the write data speed and the user write data speed during garbage collection of a zoned storage device, control strategies such as weighted fair queuing (WFQ) or class-based WFQ of traditional network quality of service (QoS) are usually applied. However, these control strategies cannot ensure the stability of the zoned storage device control and cannot fully utilize the best performance of the zoned storage device. Summary of the Invention

[0004] Embodiments of the present disclosure provide a traffic scheduling control method, device, and storage medium based on a zoned storage device to ensure the stability of the zoned storage device and fully utilize the write data performance of the zoned storage device.

[0005] In a first aspect, embodiments of the present disclosure provide a traffic scheduling control method based on a zoned storage device, including:

[0006] Determine a target ratio between the throughput of write data during the garbage collection of the current zone to be recycled of the zoned storage device and the throughput of user write data to the zoned storage device according to the proportion of garbage data and the proportion of valid data in the current zone to be recycled of the zoned storage device;

[0007] Control the first type of requests for writing data during garbage collection of the partition storage device and the second type of requests for the user to write data to the partition storage device according to the target ratio.

[0008] In a second aspect, an embodiment of the present disclosure provides a traffic scheduling control device based on a partition storage device, including:

[0009] A decision-making unit, configured to determine a target ratio between the throughput of writing data during garbage collection of the current partition to be recycled of the partition storage device and the throughput of the user writing data to the partition storage device according to the ratio of garbage data to valid data in the current partition to be recycled of the partition storage device;

[0010] A control unit, configured to control the partition storage device to process the first type of requests for writing data during garbage collection and the second type of requests for the user to write data to the partition storage device according to the target ratio.

[0011] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;

[0012] The memory stores computer-executable instructions;

[0013] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the traffic scheduling control method based on the partition storage device as described in the first aspect and various possible designs of the first aspect above.

[0014] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the traffic scheduling control method based on the partition storage device as described in the first aspect and various possible designs of the first aspect above is implemented.

[0015] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including computer-executable instructions. When a processor executes the computer-executable instructions, the traffic scheduling control method based on the partition storage device as described in the first aspect and various possible designs of the first aspect above is implemented.

[0016] The traffic scheduling control method, device, and storage medium based on a partitioned storage device provided by an embodiment of the present disclosure determine a target ratio between the throughput of writing data during the garbage collection process of the currently to-be-reclaimed partition and the throughput of a user writing data to the partitioned storage device according to the proportion of garbage data and valid data in the currently to-be-reclaimed partition of the partitioned storage device; control the first type of requests for writing data during the garbage collection process and the second type of requests for a user to write data to the partitioned storage device by the partitioned storage device according to the target ratio. By controlling the garbage collection speed and the speed of a user writing data to the partitioned storage device according to the determined target ratio, the stability of the number of free partitions of the partitioned storage device is ensured, thereby ensuring the stability of the partitioned storage device and making full use of the writing data performance of the partitioned storage device. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following briefly introduces the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0018] Figure 1 FIG. is a schematic diagram of the system architecture of the traffic scheduling control method based on a partitioned storage device provided by an embodiment of the present disclosure;

[0019] Figure 2 FIG. is a schematic flow chart of the traffic scheduling control method based on a partitioned storage device provided by an embodiment of the present disclosure;

[0020] Figure 3 FIG. is a schematic flow chart of the traffic scheduling control method based on a partitioned storage device provided by another embodiment of the present disclosure;

[0021] Figure 4 FIG. is a schematic diagram of the phased control process of a partitioned storage device provided by an embodiment of the present disclosure;

[0022] Figure 5 FIG. is a block diagram of the structure of the traffic scheduling control device based on a partitioned storage device provided by an embodiment of the present disclosure;

[0023] Figure 6 FIG. is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0024] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present disclosure with reference to the accompanying drawings in the embodiments of the present disclosure. Obviously, the described embodiments are some, but not all, of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present disclosure without creative efforts shall fall within the protection scope of the present disclosure.

[0025] A partitioned storage device divides the storage area inside an entire storage device, such as a solid-state drive, into multiple partitions. Each partition manages a segment of logical block addresses. Data between different partitions can be independent. Writes within a partition are only allowed to be sequential writes, and random reads are possible.

[0026] To ensure sequential writing within a partition, if you want to overwrite a segment of logical block addresses inside a partitioned storage device, you need to first clear the data at the current address before sequentially writing to this segment of logical block addresses again.

[0027] The state of each partition is controlled by a state machine. The state of a partition can only be empty (unused) -> open (erased, currently no data) -> full (written with data) -> empty (unused). A partition in the empty state becomes open by activation, becomes full after writing, and becomes empty again through a reset command.

[0028] The smallest unit managed by a single-machine storage engine is a data block chunk. The size of a chunk is generally 64MB, which is much smaller than the partition size (several GB). Therefore, it is necessary to aggregate multiple chunks within a partition and write them in sequence. After the system has been running stably for some time, a part of the chunks within a partition have been deleted by upper-layer users. In the view of the users, the logical space has been released, but the actual physical space has not increased. If the users continue to write data, they need to reorganize this space, relocate and aggregate the valid chunks into a new partition, and directly erase the old partition, that is, the garbage collection process. If users continuously delete old data and write new data, then this process needs to continue. The relocation in garbage collection continues with the writing of user data. To minimize the impact on user writing performance, it is necessary to balance the garbage collection speed and the user data writing speed to keep the remaining space of the partitioned storage device stable and ensure that user writes can be satisfied.

[0029] In the prior art, when balancing the write data speed during garbage collection and the user write data speed in a partitioned storage device, control strategies of traditional Quality of Service (QoS), such as Weighted Fair Queuing (WFQ) or Class-Based WFQ (CBWFQ), are usually applied. However, these control strategies cannot ensure the stability of the partitioned storage device control and cannot fully utilize the best performance of the partitioned storage device.

[0030] Among them, the QoS control strategy provides the functions of ensuring the lower limit (guaranteed lower bound) and limiting the upper limit. When applied to the traffic scheduling control based on a partitioned storage device, the control strategy needs to meet:

[0031] 1) It is necessary to provide the function of ensuring the lower limit and limiting the upper limit, and at the same time support dynamic adjustment. For example, in the case of different numbers of free partitions in the partitioned storage device, the bandwidth of ensuring the lower limit should be dynamically adjusted to meet the speed of garbage collection releasing space;

[0032] 2) It can be scheduled according to priorities in different user write data scenarios.

[0033] However, in the actual application process, it is found that the QoS control strategy has at least the following problems:

[0034] 1) If the ability of either garbage collection or user write data to submit requests is insufficient, only the upper limit can be met, but the lower limit cannot be met, resulting in one party possibly remaining at the upper limit speed all the time, while the other party may be below the lower limit speed, causing the garbage collection speed and the user write data speed to be unbalanced and affecting stability;

[0035] 2) It is necessary to set a system bandwidth. However, in the case of different data volume sizes of a user's one-time write data request, the actual system bandwidth is completely different. For example, when the data volume (iosize) of a user's one-time write data request is 64 KB, the system bandwidth is about 3.4 GB, while when the data volume of a user's one-time write data request is 16 KB, the system bandwidth is about 1.6 GB. In the mixed case, the system bandwidth cannot be estimated. Therefore, if controlled according to the bandwidth, only the maximum bandwidth of garbage collection and user write data can be limited, but the actual bandwidth ratio of garbage collection and user write data cannot be accurately controlled, which will result in the number of free partitions in the partitioned storage device being able to be controlled, but there are many free partitions, the user write data bandwidth is low, and the system is unstable; or the number of free partitions in the partitioned storage device cannot be controlled, and finally the number of free partitions decreases to the point where the user cannot write data and the user write data bandwidth drops to 0.

[0036] To solve at least one of the above technical problems, the present disclosure provides a traffic scheduling control method based on a partitioned storage device. By determining the target ratio between the throughput of writing data during the garbage collection process of the currently to-be-recycled partition and the throughput of the user writing data to the partitioned storage device according to the ratio of garbage data to valid data in the currently to-be-recycled partition of the partitioned storage device; controlling the partitioned storage device to process the first type of requests for writing data during the garbage collection process and the second type of requests for the user to write data to the partitioned storage device according to the target ratio. By controlling the garbage collection speed and the speed of the user writing data to the partitioned storage device according to the determined target ratio, the stability of the number of free partitions of the partitioned storage device is ensured, thereby ensuring the stability of the partitioned storage device and making full use of the writing data performance of the partitioned storage device.

[0037] The traffic scheduling control method based on a partitioned storage device of the present disclosure is applied to a system architecture as shown in Figure 1 which includes a garbage collection partition selection unit, a partition management unit, a decision-making unit, a control unit, etc. The garbage collection partition selection unit is used to select the currently to-be-recycled partition and can also output the ratio of garbage data and / or valid data. The partition management unit can be used to count the number of free partitions. The decision-making unit can determine the target ratio between the throughput of writing data during the garbage collection process of the currently to-be-recycled partition and the throughput of the user writing data to the partitioned storage device. The control unit can control the partitioned storage device to process the requests for writing data during the garbage collection process and the requests for the user to write data to the partitioned storage device according to the target ratio, so as to regulate the garbage collection speed and the speed of the user writing data to the partitioned storage device. In addition, during the execution process, the control unit will also affect the decision-making unit based on some information as negative feedback to affect the control result.

[0038] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. And the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.

[0039] The traffic scheduling control method based on a partitioned storage device of the present disclosure will be introduced in detail below in combination with specific embodiments.

[0040] Refer to Figure 2 , Figure 2 which is a schematic flowchart of a traffic scheduling control method based on a partitioned storage device provided by an embodiment of the present disclosure. The method of this embodiment can be applied to electronic devices such as terminal devices or servers. The traffic scheduling control method based on a partitioned storage device includes:

[0041] S201. Determine a target ratio between the throughput of writing data during the garbage collection process for the currently to-be-recycled partition of the partition storage device and the throughput of the user writing data to the partition storage device according to the ratio of garbage data to valid data in the currently to-be-recycled partition of the partition storage device.

[0042] In this embodiment, the control index required for the scheduling control of the partition storage device may be the ratio of the writing data during the garbage collection process to the total writing bandwidth, that is:

[0043] GCbandwidth / (GCbandwidth + HOSTbandwidth)

[0044] Among them, GCbandwidth represents the writing bandwidth occupied during the garbage collection process, HOSTbandwidth represents the writing bandwidth occupied during the process of the user writing data to the partition storage device, and GCbandwidth + HOSTbandwidth represents the total writing bandwidth.

[0045] In specific implementation, the scheduling control of the partition storage device may be performed according to the ratio of garbage data to and / or valid data in the currently to-be-recycled partition of the partition storage device.

[0046] To maintain the stability of the partition storage device and keep the number of free partitions of the partition storage device unchanged or change little, a certain balance between the production and consumption of free partitions is required. Among them, the garbage collection process is both the producer and the consumer of free partitions, while the process of the user writing data to the partition storage device is the consumer of free partitions.

[0047] Considering that the garbage collection process relocates the valid data in the partition to be recycled and reclaims the current partition to be recycled, an idle partition will be produced. However, the valid data needs to occupy another idle partition. Therefore, after the garbage collection process completes the recycling of the partition to be recycled, only the space occupied by the garbage data in this partition is actually produced. During the period when the partition to be recycled is being recycled, the process of the user writing data to the partition storage device can only consume the same amount of space as the size of the garbage data to keep the number of idle partitions stable. If the process of the user writing data to the partition storage device consumes more space than the size of the garbage data, the number of idle partitions will continue to decrease, the throughput of the user writing data to the partition storage device is relatively high, and the partition storage device cannot operate stably for a long time. If the process of the user writing data to the partition storage device consumes less space than the size of the garbage data, the number of idle partitions will continue to increase, the throughput of the user writing data to the partition storage device is relatively low, and the performance of the user writing data fails to meet expectations. Therefore, in this embodiment, based on the garbage data ratio and the valid data ratio of the current partition to be recycled in the partition storage device, the target ratio between the throughput of writing data during the garbage collection process of the current partition to be recycled and the throughput of the user writing data to the partition storage device is determined, so as to ensure both the performance of writing data during the garbage collection process and the performance of the user writing data to the partition storage device, and ensure that the number of idle partitions in the partition storage device remains stable.

[0048] Specifically, when determining the target ratio, the ratio between the valid data ratio of the current partition to be recycled and the garbage data ratio of the current partition to be recycled can be obtained and determined as the target ratio. The specific formula can be as follows:

[0049]

[0050] Wherein, X represents the throughput of writing data during the garbage collection process of the current partition to be recycled, Y represents the throughput of the user writing data to the partition storage device during the garbage collection process of the current partition to be recycled, validratio represents the valid data ratio of the current partition to be recycled, garbageratio represents the garbage data ratio of the current partition to be recycled, and the sum of validratio and garbageratio is 1. Therefore, in fact, only one of the validratio and garbageratio needs to be obtained, and the other ratio can be easily obtained.

[0051] In an example, the validratio of the current partition to be recycled is 75%, and the garbageratio is 1 - 75%. Therefore, the target ratio is X / Y = 75% / 25% = 3:1.

[0052] It should be noted that as different to-be-reclaimed partitions are reclaimed, the proportion of garbage data and the proportion of valid data in each to-be-reclaimed partition may be different. Therefore, during garbage collection in different to-be-reclaimed partitions, the corresponding target ratio is also different.

[0053] S202. Control the partition storage device to process the first type of requests for writing data during the garbage collection process and the second type of requests for the user to write data to the partition storage device according to the target ratio.

[0054] In this embodiment, during the garbage collection of the current to-be-reclaimed partition, the throughput of writing data during the garbage collection process and the throughput of the user writing data to the partition storage device can be controlled according to the target ratio, so that the throughput ratio is the target ratio. That is, by controlling the number of the first type of requests for writing data during the garbage collection process and the second type of requests for the user to write data to the partition storage device processed by the partition storage device, the ratio of the throughput of writing data during the garbage collection process and the throughput of the user writing data to the partition storage device is controlled to reach the target ratio.

[0055] When processing the first type of requests, specifically, some valid data involved in the first type of requests in the current to-be-reclaimed partition is read out and written to another writable partition, while when processing the second type of requests, specifically, the input entered by the user is written to a writable partition.

[0056] Optionally, during the garbage collection of the current to-be-reclaimed partition, multiple first type of requests are generated, and there may also be multiple second type of requests for the user to write data to the partition storage device. Therefore, in this embodiment, as Figure 3 shown, each first type of request can be added to the first queue, and each second type of request can be added to the second queue. Furthermore, the partition storage device can be controlled to obtain the requests included therein from the first queue and / or the second queue according to the target ratio and process them, so as to realize the scheduling of the first type of requests and the second type of requests based on the target ratio and realize the control of the throughput of writing data during the garbage collection process and the throughput of the user writing data to the partition storage device.

[0057] It should be noted that since the current maximum write bandwidth threshold of the partition storage device cannot be accurately evaluated, in this embodiment, the partition storage device can be controlled to process the first type of requests and the second type of requests based on the target ratio, and the current maximum write bandwidth threshold can be explored in a trial-and-error manner, so as to ensure that the current maximum write bandwidth can be fully utilized. Specifically, it can be as follows:

[0058] Obtain the requests included therein from the first queue and / or the second queue during the current sub-time period within the current unit time and process them;

[0059] Determine the cumulative data volume of writing data during the garbage collection process of the current sub - time period and the historical sub - time periods within the current unit time, as well as the actual proportion of the cumulative data volume of the user writing data to the partition storage device, and determine the offset index between the actual proportion and the target proportion;

[0060] Control the partition storage device to continue to obtain the requests included therein from the first queue and / or the second queue in the next sub - time period according to the offset index, until the total cumulative data volume of writing data within the current unit time reaches the maximum write bandwidth threshold of the current unit time.

[0061] In this embodiment, considering that the maximum write bandwidth threshold is the maximum data volume that can be written within a unit time, it can be controlled in a very short sub - time period (such as a few milliseconds or a few microseconds) within a unit - time duration range, so that the total cumulative data volume of writing data in each sub - time period of the unit time reaches the maximum write bandwidth threshold. Among them, after obtaining and processing requests from the first queue and / or the second queue in the current sub - time period within the current unit time, the cumulative data volume of writing data during the garbage collection process of the current sub - time period and the historical sub - time periods within the current unit time, as well as the cumulative data volume of the user writing data to the partition storage device can be determined. Then, calculate the actual proportion between these two cumulative data volumes, and determine the deviation between the actual proportion and the target proportion, denoted as the offset index. Furthermore, according to the offset index, guide the next sub - time period after the current sub - time period to obtain requests from the first queue and / or the second queue, and update the offset index after processing in the next sub - time period, and continue to guide subsequent sub - time periods. Through the above - mentioned trial - and - error method, until the total cumulative data volume of writing data within the current unit time reaches the maximum write bandwidth threshold of the current unit time, the processing of the first - type requests and the second - type requests for the current time unit can be stopped, and the maximum write bandwidth can be reasonably allocated according to the target proportion, as specifically Figure 3 shown.

[0062] For example, if it is determined according to the offset index that the actual ratio is greater than the target ratio and the deviation is too large (specifically, the offset index is greater than the first offset index threshold, and the first offset index threshold is positive), that is, the cumulative data volume of writing data during the garbage collection process is too large, while the cumulative data volume of the user writing data to the partition storage device is too small, then in the next sub-time period, only the second type of requests are obtained from the second queue for processing; if it is determined according to the offset index that the actual ratio is less than the target ratio and the deviation is too large (specifically, the offset index is less than the second offset index threshold, and the second offset index threshold is negative), that is, the cumulative data volume of writing data during the garbage collection process is too small, while the cumulative data volume of the user writing data to the partition storage device is too large, then in the next sub-time period, only the first type of requests are obtained from the first queue for processing; if the offset index is between the first offset index threshold and the second offset index threshold, it can be shown that the deviation between the actual ratio and the target ratio is within an acceptable range, then in the next sub-time period, the first type of requests and the second type of requests can be obtained from the first queue and the second queue respectively for processing.

[0063] The offset index only needs to be able to reflect the deviation direction and magnitude between the actual ratio and the target ratio, and any feasible calculation method can be used for calculation, which is not limited here.

[0064] The traffic scheduling control method based on the partition storage device provided in this embodiment determines the target ratio between the throughput of writing data during the garbage collection of the current partition to be recycled of the partition storage device and the throughput of the user writing data to the partition storage device according to the garbage data ratio and the valid data ratio of the current partition to be recycled of the partition storage device; controls the first type of requests for writing data during the garbage collection of the partition storage device and the second type of requests for the user writing data to the partition storage device according to the target ratio. By controlling the garbage collection speed and the speed of the user writing data to the partition storage device according to the determined target ratio, the stability of the number of free partitions of the partition storage device is ensured, thereby ensuring the stability of the partition storage device and making full use of the writing data performance of the partition storage device.

[0065] Based on any of the above embodiments, when determining the target ratio between the throughput of writing data during the garbage collection of the current partition to be recycled of the partition storage device and the throughput of the user writing data to the partition storage device according to the garbage data ratio and the valid data ratio of the current partition to be recycled of the partition storage device in S201, it may specifically include:

[0066] Obtain the garbage data ratio of the current partition to be recycled and the average garbage data ratio of the garbage data ratios of a preset number of historically recycled partitions, and obtain the valid data ratio of the current partition to be recycled and the average valid data ratio of the valid data ratios of a preset number of historically recycled partitions;

[0067] Determine the target ratio between the throughput of writing data during the garbage collection of the current partition to be recycled and the throughput of the user writing data to the partition storage device according to the average garbage data ratio and the average valid data ratio.

[0068] In this embodiment, since garbage collection not only has the function of compressing valid data chunks but also has the function of compressing the metadata index space in the case of a small iosize pattern, generally, the principle for selecting the partition to be recycled is that the garbage rate is the main factor and other factors are secondary. If the metadata index space expands too severely, the amount of metadata on the partition will be the main factor. At this time, the garbage data ratio of the selected partition to be recycled may be low or there may be no garbage. If a partition to be recycled with compressing the metadata space as the main reason is suddenly selected, the target ratio will change violently, which will in turn cause a violent change in the number of free partitions of the partition storage device. To ensure system stability, in this embodiment, the average garbage data ratio of the current partition to be recycled and the average garbage data ratio of a preset number of historical recycled partitions can be obtained, that is, the average garbage data ratio. Similarly, the average valid data ratio of the current partition to be recycled and the average valid data ratio of a preset number of historical recycled partitions are obtained, that is, the average valid data ratio. Then, the target ratio is determined according to the average garbage data ratio and the average valid data ratio, that is, the ratio of the average garbage data ratio and the average valid data ratio is obtained and determined as the target ratio, avoiding violent fluctuations in the target ratio and improving control stability.

[0069] The preset number of historical recycled partitions can be set according to the actual situation. The larger the preset number, the smoother the control. However, if the preset number is too large, in case of an emergency, the target ratio may not be adjusted significantly in time, which may cause the number of free partitions of the partition storage device to decrease rapidly, the user cannot write data, and the system responsiveness becomes very poor. In addition, among different partition storage devices, the sizes of the partitions may be different. Therefore, the factor of partition size can also be considered when determining the preset number.

[0070] Based on any of the above embodiments, the partition storage device can be dynamically controlled according to the situation of the number of free partitions of the partition storage device. For example, Figure 4 as shown, where the abscissa is the number of free partitions and the ordinate is the ratio of the throughput of writing data during garbage collection to the total throughput of writing data ( Figure 4 abbreviated as the garbage collection ratio in

[0071] Specifically, considering that the higher the proportion of garbage data in the partition to be recycled, the higher the working efficiency of garbage collection (only a small amount of valid data needs to be relocated to recycle most of the space), so the longer the start time of garbage collection is postponed, the better, until the system idle water level drops to a certain level. If garbage collection is not performed, there may be a risk of write suspension. Only when garbage collection control starts to work at this time is it the most efficient.

[0072] Therefore, when the number of free partitions in the partition storage device is relatively large, for example, more than the first preset threshold, at this time, it may not be necessary to control the partition storage device to process the first type of requests and the second type of requests according to the target ratio. Optionally, since the number of free partitions is relatively large and the number of partitions that need garbage collection is relatively small, the processing of the first type of requests can be minimized, and even garbage collection can be not performed, and the processing of the second type of requests can be increased as much as possible, so as to minimize the write data throughput during garbage collection and increase the throughput of user writing data to the partition storage device, that is, to minimize the ratio between the write data throughput during garbage collection and the throughput of user writing data to the partition storage device, and ensure the performance of user write data.

[0073] When the number of free partitions in the partition storage device gradually decreases, if the number of free partitions in the partition storage device decreases below the first preset threshold and is above the second preset threshold, then the partition storage device can start to be controlled to process the first type of requests and the second type of requests according to the target ratio, that is, execute the above S202 and related solutions, where the second preset threshold is less than the first preset threshold, which will not be elaborated here.

[0074] When the number of free partitions in the partition storage device further decreases and decreases below the second preset threshold, then the number of free partitions in the partition storage device is already very small at this time. Then, the partition storage device can be controlled to only process the first type of requests and stop processing the second type of requests, so as to produce more empty partitions through garbage collection to increase the number of free partitions in the partition storage device and ensure the normal operation of the partition storage device. Until the number of free partitions in the partition storage device increases above the second preset threshold, the partition storage device can continue to be controlled to process the first type of requests and the second type of requests according to the target ratio.

[0075] In addition, in order to prevent repeated oscillations near each amplitude value during the above process, smooth transitions can be performed near the prefabrication, such as gradually strengthening and gradually weakening the control.

[0076] In addition, when starting to control the partition storage device to process the first type of requests and the second type of requests according to the target ratio during the stage of decreasing the number of free partitions in the partition storage device, and when ending to control the partition storage device to process the first type of requests and the second type of requests according to the target ratio during the stage of increasing the number of free partitions in the partition storage device, an interval is also added, such as Figure 4In the process, when the number of free partitions of the partition storage device decreases to the first preset threshold during the stage of decreasing the number of free partitions of the partition storage device, the partition storage device starts to process the first type of requests and the second type of requests according to the target ratio, and when the number of free partitions of the partition storage device increases to the third preset threshold during the stage of increasing the number of free partitions of the partition storage device, the control of the partition storage device to process the first type of requests and the second type of requests according to the target ratio ends. The third preset threshold is greater than the first preset threshold. Through the interval between the first preset threshold and the third preset threshold, the control stability can be improved, and it can be avoided that when the partition storage device starts to process the first type of requests and the second type of requests according to the target ratio, the number of free partitions of the partition storage device increases, resulting in the end of the control of the partition storage device to process the first type of requests and the second type of requests according to the target ratio, that is, repeatedly oscillating between control and non-control.

[0077] Optionally, in the ideal state where there is no disturbance in the partition storage device system, after the number of free partitions of the partition storage device decreases below the first preset threshold, the partition storage device processes the first type of requests and the second type of requests according to the target ratio, and the number of free partitions of the partition storage device will drop to an ideal number and then remain stable, that is, the number of free partitions reaches equilibrium; however, in the actual partition storage device system, there must be disturbances, which will cause the number of free partitions to continue to decrease. Therefore, in this embodiment, a positive compensation can be performed on the target ratio in the case where the number of free partitions continues to decrease, that is, if the number of free partitions of the partition storage device is below the fourth preset threshold (that is, the above-mentioned ideal number, and the fourth preset threshold is between the first preset threshold and the second preset threshold), a positive compensation is performed on the target ratio to increase the target ratio, that is, to increase the throughput of writing data during the garbage collection process, and the partition storage device processes the first type of requests and the second type of requests according to the target ratio after the positive compensation; and if the number of free partitions of the partition storage device is above the fourth preset threshold, a negative compensation is performed on the target ratio to decrease the target ratio, that is, to reduce the throughput of writing data during the garbage collection process, and the partition storage device processes the first type of requests and the second type of requests according to the target ratio after the negative compensation. That is, the fourth preset threshold is the inflection point of positive compensation and negative compensation. Through the above negative feedback compensation process, faster and more efficient control can be ensured, so that the number of free partitions of the partition storage device quickly returns to the ideal number.

[0078] Corresponding to the traffic scheduling control method based on the partition storage device in the above embodiment, Figure 5 This is a structural block diagram of a traffic scheduling control device based on a partition storage device provided by an embodiment of the present disclosure. For the sake of convenience of description, only the parts related to the embodiment of the present disclosure are shown. Referring to Figure 5 The traffic scheduling control device 500 based on the partition storage device includes: a decision-making unit 501 and a control unit 502.

[0079] Among them, the decision-making unit 501 is configured to determine a target ratio between the throughput of writing data during the garbage collection of the current recyclable partition and the throughput of the user writing data to the partition storage device according to the proportion of garbage data and the proportion of valid data in the current recyclable partition of the partition storage device;

[0080] The control unit 502 is configured to control the partition storage device to process a first type of request for writing data during the garbage collection process and a second type of request for the user to write data to the partition storage device according to the target ratio.

[0081] In one or more embodiments of the present disclosure, when determining the target ratio between the throughput of writing data during the garbage collection of the current recyclable partition and the throughput of the user writing data to the partition storage device according to the proportion of garbage data and the proportion of valid data in the current recyclable partition of the partition storage device, the decision-making unit 501 is configured to:

[0082] Obtain the ratio between the proportion of valid data in the current recyclable partition and the proportion of garbage data in the current recyclable partition, and determine it as the target ratio.

[0083] In one or more embodiments of the present disclosure, when determining the target ratio between the throughput of writing data during the garbage collection of the current recyclable partition and the throughput of the user writing data to the partition storage device according to the proportion of garbage data and the proportion of valid data in the current recyclable partition of the partition storage device, the decision-making unit 501 is configured to:

[0084] Obtain the average proportion of garbage data of the proportion of garbage data in the current recyclable partition and the proportion of garbage data in a preset number of historical recycled partitions, and obtain the average proportion of valid data of the proportion of valid data in the current recyclable partition and the proportion of valid data in a preset number of historical recycled partitions;

[0085] According to the average proportion of garbage data and the average proportion of valid data, determine the target ratio between the throughput of writing data during the garbage collection of the current recyclable partition and the throughput of the user writing data to the partition storage device.

[0086] In one or more embodiments of the present disclosure, when determining the target ratio between the throughput of writing data during the garbage collection of the current recyclable partition and the throughput of the user writing data to the partition storage device according to the average proportion of garbage data and the average proportion of valid data, the decision-making unit 501 is configured to:

[0087] Obtain the ratio between the average proportion of garbage data and the average proportion of valid data, and determine it as the target ratio.

[0088] In one or more embodiments of the present disclosure, when the control unit 502 controls the partition storage device to process a first type of request for writing data during the garbage collection process and a second type of request for a user to write data to the partition storage device according to the target ratio, it is configured to:

[0089] If the number of free partitions of the partition storage device decreases to below a first preset threshold and is above a second preset threshold, control the partition storage device to process the first type of request and the second type of request according to the target ratio, where the second preset threshold is less than the first preset threshold.

[0090] In one or more embodiments of the present disclosure, the control unit 502 is further configured to:

[0091] If the number of free partitions of the partition storage device decreases to below the second preset threshold, control the partition storage device to only process the first type of request and stop processing the second type of request.

[0092] In one or more embodiments of the present disclosure, the control unit 502 is further configured to:

[0093] If the number of free partitions of the partition storage device increases to above a third preset threshold, cancel the control of the partition storage device to process the first type of request and the second type of request according to the target ratio, where the third preset threshold is greater than the first preset threshold.

[0094] In one or more embodiments of the present disclosure, when the control unit 502 controls the partition storage device to process the first type of request and the second type of request according to the target ratio if the number of free partitions of the partition storage device decreases to below a first preset threshold and is above a second preset threshold, it is configured to:

[0095] If the number of free partitions of the partition storage device is below a fourth preset threshold, perform a positive compensation on the target ratio to increase the target ratio, and control the partition storage device to process the first type of request and the second type of request according to the positively compensated target ratio; or

[0096] If the number of free partitions of the partition storage device is above a fourth preset threshold, perform a negative compensation on the target ratio to decrease the target ratio, and control the partition storage device to process the first type of request and the second type of request according to the negatively compensated target ratio;

[0097] where the fourth preset threshold is between the first preset threshold and the second preset threshold.

[0098] In one or more embodiments of the present disclosure, when the control unit 502 controls the partition storage device to process a first type of request for writing data during the garbage collection process and a second type of request for the user to write data to the partition storage device according to the target ratio, it is configured to:

[0099] Add each of the first type of requests to a first queue, and add each of the second type of requests to a second queue;

[0100] Control the partition storage device to obtain the requests included therein from the first queue and / or the second queue according to the target ratio, and process them.

[0101] In one or more embodiments of the present disclosure, when the control unit 502 controls the partition storage device to obtain the requests included therein from the first queue and / or the second queue according to the target ratio and process them, it is configured to:

[0102] Obtain the requests included therein from the first queue and / or the second queue during the current sub-period within the current unit time, and process them;

[0103] Determine the actual ratio of the cumulative data volume of writing data during the garbage collection process in the current sub-period and historical sub-periods within the current unit time, and the cumulative data volume of the user writing data to the partition storage device, and determine the offset index between the actual ratio and the target ratio;

[0104] Control the partition storage device to continue to obtain the requests included therein from the first queue and / or the second queue in the next sub-period according to the offset index until the total cumulative data volume of writing data within the current unit time reaches the maximum write bandwidth threshold of the current unit time.

[0105] The device provided in this embodiment can be used to execute the technical solutions of the above method embodiments, and its implementation principles and technical effects are similar, which will not be elaborated here in this embodiment.

[0106] Refer to Figure 6, which shows a schematic structural diagram of an electronic device 600 suitable for implementing the embodiments of the present disclosure. The electronic device 600 can be a terminal device or a server. Among them, the terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable media players (PMPs), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.

[0107] As Figure 6 shown, the electronic device 600 can include a processing device (such as a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage device 608 into the random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other through a bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.

[0108] Generally, the following devices can be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 can allow the electronic device 600 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 6 the electronic device 600 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. More or fewer devices can be alternatively implemented or had.

[0109] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a computer-readable medium, and the computer program includes program code for performing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by a processing device 601, the above-described functions defined in the method of the embodiment of the present disclosure are performed.

[0110] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, and the computer-readable signal medium can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0111] The above-mentioned computer-readable medium can be included in the above-mentioned electronic device; or it can exist separately without being assembled into the electronic device.

[0112] The above-mentioned computer-readable medium carries one or more programs, and when the above one or more programs are executed by the electronic device, the electronic device is caused to perform the method shown in the above embodiment.

[0113] Computer program code for performing the operations of this disclosure may be written in one or more programming languages or combinations thereof. The foregoing programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partially on the user's computer, execute as a stand-alone software package, execute partially on the user's computer and partially on a remote computer, or execute entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or alternatively, may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0114] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0115] The units described in the embodiments of this disclosure may be implemented in software or in hardware. Among them, the name of the unit does not constitute a limitation on the unit itself in some cases. For example, the first acquisition unit may also be described as "the unit for acquiring at least two Internet protocol addresses".

[0116] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and so on.

[0117] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0118] In a first aspect, according to one or more embodiments of the present disclosure, there is provided a traffic scheduling control method based on a partitioned storage device, including:

[0119] Determining a target ratio between the throughput of writing data during garbage collection of the current partition to be recycled of the partitioned storage device and the throughput of the user writing data to the partitioned storage device according to the ratio of garbage data to valid data in the current partition to be recycled of the partitioned storage device;

[0120] Controlling, according to the target ratio, a first type of request for writing data during garbage collection of the partitioned storage device and a second type of request for the user to write data to the partitioned storage device by the partitioned storage device.

[0121] According to one or more embodiments of the present disclosure, the determining a target ratio between the throughput of writing data during garbage collection of the current partition to be recycled of the partitioned storage device and the throughput of the user writing data to the partitioned storage device according to the ratio of garbage data to valid data in the current partition to be recycled of the partitioned storage device includes:

[0122] Obtaining the ratio between the ratio of valid data in the current partition to be recycled and the ratio of garbage data in the current partition to be recycled, and determining it as the target ratio.

[0123] According to one or more embodiments of the present disclosure, the determining a target ratio between the throughput of writing data during garbage collection of the current partition to be recycled of the partitioned storage device and the throughput of the user writing data to the partitioned storage device according to the ratio of garbage data to valid data in the current partition to be recycled of the partitioned storage device includes:

[0124] Obtain the average garbage data ratio of the garbage data ratio of the current partition to be recycled and the garbage data ratios of a preset number of historically recycled partitions, and obtain the average valid data ratio of the valid data ratio of the current partition to be recycled and the valid data ratios of a preset number of historically recycled partitions;

[0125] According to the average garbage data ratio and the average valid data ratio, determine the target ratio between the throughput of writing data during the garbage collection process for the current partition to be recycled and the throughput of the user writing data to the partition storage device.

[0126] According to one or more embodiments of the present disclosure, the determining, according to the average garbage data ratio and the average valid data ratio, the target ratio between the throughput of writing data during the garbage collection process for the current partition to be recycled and the throughput of the user writing data to the partition storage device includes:

[0127] Obtain the ratio between the average garbage data ratio and the average valid data ratio, and determine it as the target ratio.

[0128] According to one or more embodiments of the present disclosure, the controlling, according to the target ratio, the partition storage device to process the first type of requests for writing data during the garbage collection process and the second type of requests for the user to write data to the partition storage device includes:

[0129] If the number of free partitions of the partition storage device decreases to below a first preset threshold and is above a second preset threshold, control the partition storage device to process the first type of requests and the second type of requests according to the target ratio, where the second preset threshold is less than the first preset threshold.

[0130] According to one or more embodiments of the present disclosure, the method further includes:

[0131] If the number of free partitions of the partition storage device decreases to below the second preset threshold, control the partition storage device to only process the first type of requests and stop processing the second type of requests.

[0132] According to one or more embodiments of the present disclosure, the method further includes:

[0133] If the number of free partitions of the partition storage device increases to above a third preset threshold, cancel the control of the partition storage device to process the first type of requests and the second type of requests according to the target ratio, where the third preset threshold is greater than the first preset threshold.

[0134] According to one or more embodiments of the present disclosure, if the number of free partitions of the partition storage device decreases to below a first preset threshold and is above a second preset threshold, controlling the partition storage device to process the first type of requests and the second type of requests according to the target ratio includes:

[0135] If the number of free partitions of the partition storage device is below a fourth preset threshold, perform a positive compensation on the target ratio to increase the target ratio, and control the partition storage device to process the first type of requests and the second type of requests according to the positively compensated target ratio; or

[0136] If the number of free partitions of the partition storage device is above a fourth preset threshold, perform a negative compensation on the target ratio to decrease the target ratio, and control the partition storage device to process the first type of requests and the second type of requests according to the negatively compensated target ratio;

[0137] Wherein the fourth preset threshold is between the first preset threshold and the second preset threshold.

[0138] According to one or more embodiments of the present disclosure, controlling the partition storage device to process the first type of requests for writing data during the garbage collection process and the second type of requests for a user to write data to the partition storage device according to the target ratio includes:

[0139] Add each of the first type of requests to a first queue, and add each of the second type of requests to a second queue;

[0140] Control the partition storage device to obtain the requests included therein from the first queue and / or the second queue according to the target ratio, and process them.

[0141] According to one or more embodiments of the present disclosure, controlling the partition storage device to obtain the requests included therein from the first queue and / or the second queue according to the target ratio, and process them includes:

[0142] Obtain the requests included therein from the first queue and / or the second queue during the current sub-time period within the current unit time, and process them;

[0143] Determine the actual ratio of the cumulative data volume of writing data during the garbage collection process in the current sub-time period and the historical sub-time periods within the current unit time, and the cumulative data volume of a user writing data to the partition storage device, and determine the offset index between the actual ratio and the target ratio;

[0144] Control the partition storage device to continue to obtain the requests included therein from the first queue and / or the second queue in the next sub-time period according to the offset index until the total accumulated data volume of writing data within the current unit time reaches the maximum write bandwidth threshold of the current unit time.

[0145] In a second aspect, according to one or more embodiments of the present disclosure, there is provided a traffic scheduling control device based on a partition storage device, including:

[0146] A decision-making unit, configured to determine a target ratio between the throughput of writing data during the garbage collection process of the current partition to be recycled and the throughput of the user writing data to the partition storage device according to the ratio of garbage data to valid data in the current partition to be recycled of the partition storage device;

[0147] A control unit, configured to control the partition storage device to process a first type of request for writing data during the garbage collection process and a second type of request for the user to write data to the partition storage device according to the target ratio.

[0148] According to one or more embodiments of the present disclosure, when determining the target ratio between the throughput of writing data during the garbage collection process of the current partition to be recycled and the throughput of the user writing data to the partition storage device according to the ratio of garbage data to valid data in the current partition to be recycled of the partition storage device, the decision-making unit is configured to:

[0149] Obtain the ratio between the ratio of valid data in the current partition to be recycled and the ratio of garbage data in the current partition to be recycled, and determine it as the target ratio.

[0150] According to one or more embodiments of the present disclosure, when determining the target ratio between the throughput of writing data during the garbage collection process of the current partition to be recycled and the throughput of the user writing data to the partition storage device according to the ratio of garbage data to valid data in the current partition to be recycled of the partition storage device, the decision-making unit is configured to:

[0151] Obtain the average ratio of garbage data of the ratio of garbage data in the current partition to be recycled and the ratio of garbage data in a preset number of historically recycled partitions, and obtain the average ratio of valid data of the ratio of valid data in the current partition to be recycled and the ratio of valid data in a preset number of historically recycled partitions;

[0152] According to the average ratio of garbage data and the average ratio of valid data, determine the target ratio between the throughput of writing data during the garbage collection process of the current partition to be recycled and the throughput of the user writing data to the partition storage device.

[0153] According to one or more embodiments of the present disclosure, when determining a target ratio between the throughput of writing data during garbage collection of the current partition to be recycled and the throughput of a user writing data to the partition storage device based on the average garbage data ratio and the average valid data ratio, the decision-making unit is configured to:

[0154] Obtain the ratio between the average garbage data ratio and the average valid data ratio, and determine it as the target ratio.

[0155] According to one or more embodiments of the present disclosure, when controlling the partition storage device to process a first type of request for writing data during garbage collection and a second type of request for a user to write data to the partition storage device based on the target ratio, the control unit is configured to:

[0156] If the number of free partitions of the partition storage device decreases to below a first preset threshold and is above a second preset threshold, control the partition storage device to process the first type of request and the second type of request according to the target ratio, where the second preset threshold is less than the first preset threshold.

[0157] According to one or more embodiments of the present disclosure, the control unit is further configured to:

[0158] If the number of free partitions of the partition storage device decreases to below the second preset threshold, control the partition storage device to only process the first type of request and stop processing the second type of request.

[0159] According to one or more embodiments of the present disclosure, the control unit is further configured to:

[0160] If the number of free partitions of the partition storage device increases to above a third preset threshold, cancel the control of the partition storage device to process the first type of request and the second type of request according to the target ratio, where the third preset threshold is greater than the first preset threshold.

[0161] According to one or more embodiments of the present disclosure, when, if the number of free partitions of the partition storage device decreases to below a first preset threshold and is above a second preset threshold, the control unit controls the partition storage device to process the first type of request and the second type of request according to the target ratio, the control unit is configured to:

[0162] If the number of free partitions of the partition storage device is below a fourth preset threshold, perform a positive compensation on the target ratio to increase the target ratio, and control the partition storage device to process the first type of request and the second type of request according to the positively compensated target ratio; or

[0163] If the number of free partitions of the partition storage device is above a fourth preset threshold, a negative compensation is performed on the target ratio to reduce the target ratio, and the partition storage device is controlled to process the first type of requests and the second type of requests according to the negatively compensated target ratio;

[0164] Wherein the fourth preset threshold is between the first preset threshold and the second preset threshold.

[0165] According to one or more embodiments of the present disclosure, when the control unit controls the partition storage device to process the first type of requests for writing data during the garbage collection process and the second type of requests for a user to write data to the partition storage device according to the target ratio, it is configured to:

[0166] Add each of the first type of requests to a first queue, and add each of the second type of requests to a second queue;

[0167] Control the partition storage device to obtain the requests included therein from the first queue and / or the second queue according to the target ratio, and process them.

[0168] According to one or more embodiments of the present disclosure, when the control unit controls the partition storage device to obtain the requests included therein from the first queue and / or the second queue according to the target ratio, and process them, it is configured to:

[0169] Obtain the requests included therein from the first queue and / or the second queue during the current sub-time period within the current unit time, and process them;

[0170] Determine the actual ratio of the cumulative data volume of writing data during the garbage collection process in the current sub-time period and the historical sub-time periods within the current unit time, and the cumulative data volume of the user writing data to the partition storage device, and determine the offset index between the actual ratio and the target ratio;

[0171] Control the partition storage device to continue to obtain the requests included therein from the first queue and / or the second queue in the next sub-time period according to the offset index, until the total cumulative data volume of writing data within the current unit time reaches the maximum write bandwidth threshold of the current unit time.

[0172] In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, including: at least one processor and a memory;

[0173] The memory stores computer execution instructions;

[0174] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the traffic scheduling control method based on a partitioned storage device as described in the first aspect above and various possible designs of the first aspect.

[0175] In a fourth aspect, according to one or more embodiments of the present disclosure, there is provided a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the traffic scheduling control method based on a partitioned storage device as described in the first aspect above and various possible designs of the first aspect.

[0176] In a fifth aspect, according to one or more embodiments of the present disclosure, there is provided a computer program product including computer-executable instructions, which, when executed by a processor, implement the traffic scheduling control method based on a partitioned storage device as described in the first aspect above and various possible designs of the first aspect.

[0177] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the present disclosure.

[0178] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features described in the context of separate embodiments may also be implemented combinatorially in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.

[0179] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.

Claims

1. A traffic scheduling control method based on a partitioned storage device, characterized in that, Including: Determine a target ratio between the throughput of writing data during garbage collection of the current partition to be recycled in the partition storage device and the throughput of the user writing data to the partition storage device according to the proportion of garbage data and the proportion of valid data in the current partition to be recycled of the partition storage device; Control the partition storage device to process a first type of request for writing data during garbage collection and a second type of request for the user to write data to the partition storage device according to the target ratio; The determining a target ratio between the throughput of writing data during garbage collection of the current partition to be recycled in the partition storage device and the throughput of the user writing data to the partition storage device according to the proportion of garbage data and the proportion of valid data in the current partition to be recycled of the partition storage device includes: Obtain the proportion of garbage data in the current partition to be recycled and the average proportion of garbage data of a preset number of historically recycled partitions, and obtain the proportion of valid data in the current partition to be recycled and the average proportion of valid data of a preset number of historically recycled partitions; Determine a target ratio between the throughput of writing data during garbage collection of the current partition to be recycled and the throughput of the user writing data to the partition storage device according to the average proportion of garbage data and the average proportion of valid data.

2. The method according to claim 1, wherein The controlling the partition storage device to process a first type of request for writing data during garbage collection and a second type of request for the user to write data to the partition storage device according to the target ratio includes: If the number of free partitions in the partition storage device decreases to below a first preset threshold and is above a second preset threshold, control the partition storage device to process the first type of request and the second type of request according to the target ratio, where the second preset threshold is less than the first preset threshold.

3. The method according to claim 2, wherein The method further includes: If the number of free partitions in the partition storage device decreases to below the second preset threshold, control the partition storage device to only process the first type of request and stop processing the second type of request.

4. The method according to claim 2, characterized in that, The method further includes: If the number of free partitions in the partition storage device increases to above a third preset threshold, cancel the control of the partition storage device to process the first type of request and the second type of request according to the target ratio, where the third preset threshold is greater than the first preset threshold.

5. The method according to claim 2, wherein The if the number of free partitions in the partition storage device decreases to below a first preset threshold and is above a second preset threshold, control the partition storage device to process the first type of request and the second type of request according to the target ratio includes: If the number of free partitions in the partition storage device is below a fourth preset threshold, perform a positive compensation on the target ratio to increase the target ratio, and control the partition storage device to process the first type of request and the second type of request according to the positively compensated target ratio; or If the number of free partitions of the partition storage device is above a fourth preset threshold, perform negative compensation on the target ratio to reduce the target ratio, and control the partition storage device to process the first type of requests and the second type of requests according to the negatively compensated target ratio; wherein the fourth preset threshold is between the first preset threshold and the second preset threshold.

6. The method according to claim 1, characterized in that The controlling the partition storage device to process the first type of requests for writing data during garbage collection and the second type of requests for the user to write data to the partition storage device according to the target ratio includes: Adding each of the first type of requests to a first queue, and adding each of the second type of requests to a second queue; Controlling the partition storage device to obtain the requests included therein from the first queue and / or the second queue according to the target ratio, and process them.

7. The method according to claim 6, characterized in that, The controlling the partition storage device to obtain the requests included therein from the first queue and / or the second queue according to the target ratio, and process them includes: Obtaining the requests included therein from the first queue and / or the second queue during the current sub-period within the current unit time, and process them; Determining the actual ratio of the cumulative data volume of writing data during garbage collection in the current sub-period and historical sub-periods within the current unit time, and the cumulative data volume of the user writing data to the partition storage device, and determining the offset index between the actual ratio and the target ratio; Controlling the partition storage device to continue to obtain the requests included therein from the first queue and / or the second queue in the next sub-period according to the offset index, until the total cumulative data volume of writing data within the current unit time reaches the maximum write bandwidth threshold of the current unit time.

8. A traffic scheduling and control device based on a partitioned storage device, characterized in that, including: A decision unit, configured to determine the target ratio between the throughput of writing data during garbage collection of the current partition to be recycled of the partition storage device and the throughput of the user writing data to the partition storage device according to the garbage data ratio and the valid data ratio of the current partition to be recycled; A control unit, configured to control the partition storage device to process the first type of requests for writing data during garbage collection and the second type of requests for the user to write data to the partition storage device according to the target ratio; When determining the target ratio between the throughput of writing data during garbage collection of the current partition to be recycled of the partition storage device and the throughput of the user writing data to the partition storage device according to the garbage data ratio and the valid data ratio of the current partition to be recycled, the decision unit is configured to: Obtain the average garbage data ratio of the garbage data ratio of the current partition to be recycled and the garbage data ratios of a preset number of historically recycled partitions, and obtain the average valid data ratio of the valid data ratio of the current partition to be recycled and the valid data ratios of a preset number of historically recycled partitions; Determine a target ratio between the throughput of writing data during the garbage collection process for the current partition to be recycled and the throughput of a user writing data to the partition storage device according to the average garbage data ratio and the average valid data ratio.

9. An electronic device, characterized in that, Comprising: At least one processor and a memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, the method according to any one of claims 1-7 is implemented.

11. A computer program product, characterized in that, Comprising computer-executable instructions, and when the processor executes the computer-executable instructions, the method according to any one of claims 1-7 is implemented.

Citation Information

Patent Citations

  • Junk data recovery control method and device

    CN109977032A

Cited By

  • Traffic scheduling control method and device based on zoned storage device, and storage medium

    US12743240B2