Scheduling method, apparatus and device

By using request streams as the scheduling granularity and selecting target request streams for scheduling based on object weights, the RoundRobin strategy fails to satisfy weight fairness, thus achieving an efficient and fair scheduling method.

CN114661445BActive Publication Date: 2026-02-13ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210356760.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2026-02-13
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

The existing user-based RoundRobin strategy cannot meet scheduling requirements and cannot guarantee the weight fairness of services between requests from users with different weights.

Method used

The abstract request flow is used as the scheduling granularity, and the weight of the request flow is the weight of its corresponding object. The target request flow is first selected according to the weight of the request flow, and then the target request to be scheduled is selected from the queue for execution.

Benefits of technology

It achieves the consideration of the weight of the object to which the request to be scheduled belongs during scheduling, thus meeting the scheduling requirements. At the same time, the scheduling complexity is low, balancing weight fairness and scheduling efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114661445B_ABST
    Figure CN114661445B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a scheduling method, device and equipment. The method comprises: obtaining a to-be-scheduled request of an object; putting the to-be-scheduled request into a corresponding position of a corresponding request flow in a queue, to serve as a to-be-scheduled request of the corresponding request flow, the request flow being obtained according to the object, and a weight of the request flow being a weight of the corresponding object; selecting a target request flow from the request flows with to-be-scheduled requests according to the weights of the request flows, selecting a target to-be-scheduled request of the target request flow from the queue, and taking the target to-be-scheduled request out of the queue for executing the target to-be-scheduled request. The present application not only considers the weight of the object (for example, a user) to which the to-be-scheduled request belongs when scheduling, to meet the scheduling requirement, but also has low scheduling complexity, and is a scheduling mode that can balance the weight fairness and the scheduling efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, and particularly relates to a scheduling method, device and equipment. BACKGROUND

[0002] The distributed storage system can include data nodes, the data nodes are processes for actually storing user data in the distributed storage system, can interact with system client processes, and provide data read / write capabilities.

[0003] Generally, the input / output (Input / Output, IO) request of a user can be queued in a scheduler in the data node first, and then the dequeued IO request is selected by the scheduler according to a scheduling strategy for subsequent service. The currently adopted scheduling strategy is a user-based RoundRobin strategy. The user-based RoundRobin strategy has the advantage of low scheduling complexity, but has the problem of being unable to meet the scheduling requirements. SUMMARY

[0004] Embodiments of the present application provide a scheduling method, device and equipment to solve the problem of being unable to meet the scheduling requirements in the prior art.

[0005] In a first aspect, the embodiments of the present application provide a scheduling method, comprising:

[0006] obtaining a to-be-scheduled request of an object;

[0007] putting the to-be-scheduled request into a corresponding position of a corresponding request flow in a queue, as a to-be-scheduled request of the corresponding request flow, the request flow being abstracted according to the object, and a weight of the request flow being a weight of the corresponding object;

[0008] selecting a target request flow from the request flows with to-be-scheduled requests according to the weights of the request flows, selecting a target to-be-scheduled request of the target request flow from the queue, taking the target to-be-scheduled request out of the queue, and using the target to-be-scheduled request to execute the target to-be-scheduled request.

[0009] In a second aspect, the embodiments of the present application provide a scheduling device, comprising:

[0010] an obtaining module, configured to obtain a to-be-scheduled request of an object;

[0011] an enqueuing module, configured to put the to-be-scheduled request into a corresponding position of a corresponding request flow in a queue, as a to-be-scheduled request of the corresponding request flow, the request flow being abstracted according to the object, and a weight of the request flow being a weight of the corresponding object;

[0012] A dequeuing module is configured to select a target request flow from the request flows with pending requests according to the weights of the request flows, select a target pending request of the target request flow from the queue, and take the target pending request out of the queue for execution of the target pending request.

[0013] In a third aspect, an embodiment of the present application provides a computer device, comprising a memory and a processor, wherein the memory is configured to store one or more computer instructions, and the one or more computer instructions, when executed by the processor, implement the method in any of the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium having a computer program stored thereon, and the computer program, when executed, implements the method in any of the first aspect.

[0015] An embodiment of the present application further provides a computer program, which, when executed by a computer, is configured to implement the method in any of the first aspect.

[0016] In the embodiment of the present application, the abstract request flow is taken as the scheduling granularity, the request flow is obtained according to an object, the weight of the request flow is the weight of the corresponding object, the target request flow is selected according to the weight of the request flow, the target pending request of the target request flow is selected from the queue, and the target pending request is taken out of the queue for execution of the target pending request. This not only realizes the consideration of the weight of the object (for example, the user) to which the pending request belongs in scheduling, and meets the scheduling requirement, but also has low scheduling complexity, and is a scheduling mode that can balance the weight fairness and the scheduling efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.

[0018] Figure 1 The application scenario of the scheduling method provided by the embodiment of the present application is shown in the following figure;

[0019] Figure 2 The schematic diagram of the role of the scheduler in the prior art is shown in the following figure;

[0020] Figure 3 The schematic diagram of the scheduling by using the RoundRobin strategy in the prior art is shown in the following figure;

[0021] Figure 4A flowchart of a scheduling method provided by an embodiment of the present application is shown in FIG. 1.

[0022] Figure 5 A schematic diagram of scheduling with request flow as scheduling granularity provided by an embodiment of the present application is shown in FIG. 2.

[0023] Figure 6 A schematic diagram of scheduling with request flow as scheduling granularity provided by another embodiment of the present application is shown in FIG. 3.

[0024] Figure 7 A structural schematic diagram of a scheduling apparatus provided by an embodiment of the present application is shown in FIG. 4.

[0025] Figure 8 A structural schematic diagram of a computer device provided by an embodiment of the present application is shown in FIG. 5. DETAILED DESCRIPTION

[0026] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of the present application.

[0027] The terms used in the embodiments of the present application are merely for the purpose of describing particular embodiments and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. "Plural" generally contains at least two, but does not exclude the case of containing at least one.

[0028] It should be understood that the term "and / or" used herein is merely to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which means that there are three cases of A alone, A and B together, and B alone. In addition, the character " / " in this paper generally represents that the front and rear associated objects are a "or" relationship.

[0029] Depending on the context, the words "if", "when" as used herein can be interpreted as "upon" or "as" or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determining" or "if detecting (a stated condition or event)" can be interpreted as "when determining" or "in response to determining" or "when detecting (a stated condition or event)" or "in response to detecting (a stated condition or event)".

[0030] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a product or system comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a product or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the product or system that includes said element.

[0031] Furthermore, the timing of the steps in the following method embodiments is merely an example and not a strict limitation.

[0032] Figure 1 This is a schematic diagram illustrating an application scenario of the scheduling method provided in the embodiments of this application, such as... Figure 1 As shown, this application scenario may include multiple first devices 11 and second devices 12. First devices 11 can send scheduling requests to second devices 12. Second devices 12 may run a scheduler X. Scheduler X running on second devices 12 can schedule the scheduling requests sent by multiple first devices 11, thereby enabling resource sharing among the multiple first devices 11. It should be understood that the resources shared by the multiple first devices can be resources of second device 12, or resources of other devices besides second device 12.

[0033] It should be noted that the scheduling method provided in this application can be applied to any type of scenario where scheduling requests need to be performed according to weights. The request to be scheduled can be, for example, an IO request, a network request, etc. Of course, in other embodiments, the request to be scheduled can also be other types of requests. Taking a distributed storage system as an example, the request to be scheduled can be an IO request, and the method provided in this application can be executed by data nodes in the distributed storage system, i.e. Figure 1 The second device 12 can be the device where the data node is located.

[0034] Here, the scheduler X can be understood as a queuing system, and the requests to be scheduled can be understood as queuing units. The queuing units from the first device 11 need to enter the queuing system to queue. The queuing system determines the order in which the requests to be scheduled are output from the queuing system, thereby determining the order in which the requests to be scheduled occupy resources.

[0035] In one embodiment, the first device 11 may be a user's device, on which a client process may run. The client process may execute user tasks, and during the execution of user tasks, the client process may generate scheduling requests that need to be submitted to the scheduler X for scheduling. Figure 2As shown, the pending scheduling requests generated in the process of executing user tasks can enter the queuing system as a queuing unit, and the queuing system determines the dequeue order. The dequeued pending scheduling requests can occupy actual resources. In addition, resources can feed back to the scheduling logic during use, for example, the process priority can be dynamically adjusted according to the occupied CPU time slice, the scheduling can be back-pressured according to the overall occupation of network / IO bandwidth, and the corresponding Figure 2 FeedBack in

[0036] In actual application, the scheduler X can put the obtained pending scheduling requests into a queue and schedule the pending scheduling requests in the queue, that is, a pending scheduling request is selected from the queue each time of scheduling, and the pending scheduling request is taken out from the queue for executing the pending scheduling request. It should be understood that the pending scheduling request can be executed by the second device 12 or by other devices other than the second device.

[0037] Generally, the scheduler uses a user-based Round Robin strategy to schedule the pending scheduling requests in the queue. Taking the pending scheduling requests as IO requests as an example, as shown in Figure 3 , it is assumed that the queue includes three data structures (which can be denoted as slots) for storing data, and the three slots are slot 1, slot 2 and slot 3 from front to back in the queue. In the slot 1, IO request 1 and IO request 2 of user 1 (i.e., Uid1), IO request 3, IO request 4 and IO request 5 of user 2 (i.e., Uid2), and IO request 1 and IO request 2 of user 3 (i.e., Uid3) are stored. In the slot 2, no IO request of user is stored, and in the slot 3, IO request 1 and IO request 2 of user 4 (i.e., Uid4) and IO request 1 and IO request 2 of user 5 (i.e., Uid5) are stored. The scheduling order from front to back can be: Uid1.IO request 1→Uid2.IO request 3→Uid3.IO request 1→Uid4.IO request 1→Uid5.IO request 1→Uid1.IO request 2→Uid2.IO request 4→Uid3.IO request 2→Uid4.IO request 2→Uid5.IO request 2→Uid2.IO request 5.

[0038] The scheduling complexity of the Round Robin strategy is low, but it cannot utilize the weight attribute of the pending scheduling request, and cannot guarantee the weight fairness of the service between the requests of users with different weights. However, with the introduction of QoS functions and priority characteristics, scheduling needs to be performed according to the weight of the user.

[0039] To solve the technical problem of how to schedule a pending request according to a weight in the prior art, in the embodiments of the present application, an abstract request flow is taken as a scheduling granularity, the request flow is obtained according to an object, the weight of the request flow is the weight of the corresponding object, a target request flow is selected according to the weight of the request flow, a target pending request of the target request flow is selected from a queue, and the target pending request is taken out of the queue to be executed, which not only considers the weight of the object (for example, a user) to which the pending request belongs when scheduling, meets the scheduling requirement, but also has low scheduling complexity, and is a scheduling mode that can balance the weight fairness and scheduling efficiency.

[0040] Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. In the case of no conflict, the embodiments described below and the features in the embodiments can be combined with each other.

[0041] Figure 4 The flowchart of the scheduling method provided by an embodiment of the present application, the execution subject of the embodiment can be the second device 12 in Figure 1 As shown in Figure 4 , the method of the embodiment can include:

[0042] Step 41, obtaining a pending request of an object;

[0043] Step 42, putting the pending request into a corresponding position of a corresponding request flow in a queue to be a pending request of the corresponding request flow, the request flow being obtained according to the object, and the weight of the request flow being the weight of the corresponding object;

[0044] Step 43, selecting a target request flow from the request flows with pending requests according to the weight of the request flow, selecting a target pending request of the target request flow from the queue, and taking the target pending request out of the queue to be executed.

[0045] In the embodiments of the present application, the meaning of the object can be related to a specific application scenario. For example, in the scenario of scheduling to realize resource sharing by different users, the object can be specifically a user. For another example, in the scenario of scheduling to realize resource sharing by different programs, the object can be specifically a program. Different objects can have different weights, and the weight of the object can be considered when scheduling.

[0046] In the embodiments of the present application, the request flow can be obtained according to the object, the pending requests of the same object can be abstracted into the same request flow, and the pending requests of different objects can be abstracted into different request flows. The request flow has a weight, and the weight of the request flow is the weight of the corresponding object. The greater the weight, the higher the importance, that is, the more important, and the weights of all the abstracted request flows can be completely different or partially the same.

[0047] For example, assuming that the objects sending the pending scheduling requests can be object A, object B and object C, and the weight of object A is 10, the weight of object B is 10, and the weight of object C is 30, the pending scheduling request of object A can be abstracted as one request flow (which can be denoted as request flow x), the weight of request flow x is 10, the pending scheduling request of object B can be abstracted as another request flow (which can be denoted as request flow y), the weight of request flow y is 10, and the pending scheduling request of object C can be abstracted as another request flow (which can be denoted as request flow z), the weight of request flow z is 30.

[0048] The request flow has a corresponding position in the queue for storing the pending scheduling request. For example, the queue can include a plurality of storage structures for storage, and one storage structure can serve as the corresponding position of one or more request flows in the queue. The corresponding position of a certain request flow in the queue is used to store the pending scheduling request of the object corresponding to the request flow. For example, the corresponding position of request flow x in the queue is used to store the pending scheduling request of object A.

[0049] After obtaining the pending scheduling request of the object, the pending scheduling request can be placed in the corresponding position of the corresponding request flow in the queue as the pending scheduling request of the corresponding request flow. For the specific manner of obtaining the pending scheduling request, the present application does not make any limitation. For example, the pending scheduling request of the object can be received. For example, assuming that the obtained pending scheduling request is of object A, the pending scheduling request can be placed in the corresponding position of request flow x in the queue as the pending scheduling request of request flow x.

[0050] In the embodiments of the present application, the request flow can be used as the scheduling granularity. First, the target request flow is selected according to the weight of the request flow, and then the pending scheduling request of the target request flow is selected for scheduling, so as to realize scheduling the pending scheduling request of the request flow according to the weight of the request flow (i.e. the weight of the corresponding object), thereby realizing that the request flows of different objects can share resources according to the weight. By using the request flow as the scheduling granularity, the scheduling complexity can be reduced, and the scheduling complexity of using the request flow as the scheduling granularity is log(k), wherein k is the number of request flows with pending scheduling requests, thereby improving the scheduling efficiency.

[0051] Specifically, the target request flow can be selected from the request flows with pending scheduling requests according to the weight of the request flow, the target pending scheduling request of the target request flow can be selected from the queue, and the target pending scheduling request can be taken out from the queue for executing the target pending scheduling request. The request flow with the pending scheduling request can also be referred to as a non-empty request flow.

[0052] In an embodiment, selecting the target to-be-scheduled request of the target request flow from the queue can specifically include: selecting the target to-be-scheduled request of the target request flow from the queue according to a first-in first-out principle. In this way, the to-be-scheduled request of the target request flow that is placed in the queue first can be taken out of the queue first, so that the to-be-scheduled request of the same request flow that is placed in the queue first can be executed first.

[0053] In an embodiment of the present application, a scheduling value of a request flow can be maintained, and the scheduling value of the request flow can be related to a scheduled quantity and a weight of the request flow. The scheduled quantity of the request flow can refer to a total number of to-be-scheduled requests that have been scheduled since the request flow starts to participate in scheduling. Optionally, the scheduling value can be a scheduling cumulative value, and the scheduling cumulative value of a request flow can be positively related to a scheduled quantity of the request flow and negatively related to a weight of the request flow.

[0054] Based on this, in an embodiment, the target request flow is selected from the request flows that have to-be-scheduled requests according to the weight of the request flow, and specifically includes: selecting a request flow with a minimum scheduling cumulative value from the request flows that have to-be-scheduled requests as the target request flow. Correspondingly, the method provided in the embodiment can further include: updating the scheduling cumulative value of the target request flow. For example, the scheduling cumulative value of the target request flow can be updated once for each to-be-scheduled request of the target request flow that is scheduled.

[0055] Since the scheduling cumulative value is negatively related to the weight, the greater the weight of the request flow is, the lower the change rate of the scheduling cumulative value is. In addition, since the target request flow with the minimum scheduling cumulative value is selected, the greater the weight of the request flow is, the lower the change rate of the scheduling cumulative value is, and the request flow is more preferentially scheduled compared with a request flow with a low weight.

[0056] Further optionally, the scheduling cumulative value of the target request flow can be updated according to a cumulative factor of the target request flow, and the size of the cumulative factor of the request flow is negatively related to the weight of the request flow. For example, the sum of the cumulative factor of the target request flow and the scheduling cumulative value of the target request flow can be taken as the updated scheduling cumulative value of the target request flow.

[0057] Optionally, in order to facilitate determination of the cumulative factor of a newly added request flow in a scenario where the number of request flows is allowed to increase, the cumulative factor of the request flow can be determined according to a reference weight. In an embodiment, the cumulative factor of the request flow can be equal to a ratio of the reference weight and the weight of the request flow. For example, for a request flow x, a request flow y, and a request flow z, assuming that the reference weight is 10, the cumulative factor of the request flow x can be equal to 1, the cumulative factor of the request flow y can be equal to 1, and the cumulative factor of the request flow z can be equal to 1 / 3.

[0058] Optionally, the target request flow can be determined each time the scheduling is performed. Based on this, in one embodiment, step 43 can specifically include: each time the scheduling is performed, selecting a target request flow from the request flows that have pending requests to be scheduled, selecting a target pending request to be scheduled of the target request flow from the queue, and taking the pending request to be scheduled from the queue. Thus, the request flow that is scheduled each time can be the request flow with the smallest cumulative scheduling value.

[0059] Alternatively, the determined target request flow can be used for continuous multiple times of scheduling. Based on this, in another embodiment, step 43 can specifically include: each time the scheduling is performed, if the first target request flow corresponding to the previous scheduling has reached a threshold of the number of single-round scheduling of the first target request flow in the number of continuous scheduling in the current round of scheduling, or the first target request flow currently does not have a pending request to be scheduled, selecting a second target request flow from the request flows that have pending requests to be scheduled, selecting a target pending request to be scheduled of the second target request flow from the queue, and taking the pending request to be scheduled from the queue, otherwise, selecting a target pending request to be scheduled of the first target request flow from the queue, and taking the pending request to be scheduled from the queue. Thus, the multiple pending requests to be scheduled of the same request flow can be continuously output before switching to the next request flow, and the scheduling overhead of each pending request to be scheduled is further reduced.

[0060] The number of continuous scheduling of the request flow in the current round of scheduling can refer to the number of pending requests to be scheduled that are continuously scheduled in the current round of scheduling. The threshold of the number of single-round scheduling of the request flow is positively correlated with the weight of the request flow. In one embodiment, the threshold of the number of single-round scheduling of the request flow can be equal to the ratio of the weight of the request flow to the reference weight multiplied by a reference threshold, where the reference threshold corresponds to the reference weight. The reference threshold can be understood as the threshold of the number of single-round scheduling of the request flow whose weight is the reference weight.

[0061] In the embodiments of the present application, from the beginning of the scheduling, each time N pending requests to be scheduled are scheduled, it can be considered as one round of scheduling, where N is a positive integer, and N can be referred to as the total number of single-round scheduling. The time occupied by one round of scheduling can be understood as one scheduling period. The total number of single-round scheduling can be equal to the sum of the thresholds of the number of single-round scheduling of all request flows. Since the threshold of the number of single-round scheduling of the request flow is positively correlated with the weight of the request flow, the proportion of the threshold of the number of single-round scheduling of the request flow in the total number of single-round scheduling is positively correlated with the weight of each request flow.

[0062] The number of scheduling of the request flow in the single round of scheduling can be equal to the threshold of the number of single-round scheduling of the request flow, and / or the number of scheduling of the first request flow in the single round of scheduling can be less than the threshold of the number of single-round scheduling of the first request flow, and the number of scheduling of the second request flow can be greater than the threshold of the number of single-round scheduling of the second request flow.

[0063] For example, assuming that the reference weight is equal to 10 and the reference quantity threshold is equal to 1, the single round scheduling quantity threshold of the request flow x is 1, the single round scheduling quantity threshold of the request flow y is equal to 1, and the single round scheduling quantity threshold of the request flow z is equal to 3. The scheduling order of the request flow x (i.e., Flow x), the request flow y (i.e., Flow y), and the request flow z (i.e., Flow z) in the multi-round scheduling can be as shown in Table 1. Figure 5 As shown in Table 1, in the first scheduling period (i.e., ScheduleEpoch1), a total of 1+1+3=5 IO requests are scheduled, which are the IO request z1 of the request flow z, the IO request x1 of the request flow x, the IO request y1 of the request flow y, the IO request z2 of the request flow z, and the IO request z3 of the request flow z. In the second scheduling period (i.e., ScheduleEpoch2), the 5 IO requests scheduled are the IO request z4 of the request flow z, the IO request x2 of the request flow x, the IO request y2 of the request flow y, the IO request z5 of the request flow z, and the IO request z6 of the request flow z. In the third scheduling period (i.e., ScheduleEpoch2), since the request flow z does not have a request to be scheduled, the 5 IO requests scheduled are the IO request x3 of the request flow x, the IO request x4 of the request flow x, the IO request y3 of the request flow y, the IO request y4 of the request flow y, and the IO request x5 of the request flow x.

[0064] As can be seen, in the first round of scheduling and the second round of scheduling, the scheduling quantity of each request flow is equal to the single round scheduling quantity threshold of the request flow. In the third round of scheduling, the scheduling quantity of the request flow x is greater than the single round scheduling quantity threshold of the request flow x, the scheduling quantity of the request flow y is greater than the single round scheduling quantity threshold of the request flow y, and the scheduling quantity of the request flow z is less than the single round scheduling quantity threshold of the request flow z.

[0065] In one embodiment, taking the IO request as an example, the request flow can be recorded as an IO flow, and the i-th IO flow can be recorded as IO flow (i). The scheduling attribute of the IO flow (i) can include the single round scheduling quantity threshold of the IO flow (i) and the scheduling cumulative value of the IO flow (i).

[0066] The single round scheduling quantity threshold of the IO flow (i) can satisfy the following formula (1).

[0067]

[0068] Wherein, DispatchSlice (i) represents the single round scheduling quantity threshold of the IO flow (i), Weight (i) represents the weight of the IO flow (i), DefaultWeight represents the reference weight, and DefaultDispatchSlice represents the reference quantity threshold.

[0069] The scheduling cumulative value of the IO stream (i) can satisfy formula (2) as follows:

[0070]

[0071] wherein VirtualDispatchSlice(i) represents the scheduling cumulative value of the IO stream (i), DefaultWeight represents the benchmark weight, Weight(i) represents the weight of the IO stream (i), and CurrentSlice(i) represents the continuous scheduling quantity of the IO stream (i) in the current scheduling cycle, ranging from 0 to DispatchSlice(i).

[0072] It should be noted that formula (2) is used in the continuous multiple scheduling of the determined target request stream, and the VirtualDispatchSlice(i) of the IO stream (i) is updated once for each continuous scheduling of CurrentSlice(i) IO requests of the IO stream (i). In this case, CurrentSlice(i) can be set to 0 after updating the VirtualDispatchSlice(i) of the IO stream (i). The VirtualDispatchSlice(i) can be initialized to 0 by the scheduler in the initialization process.

[0073] The IO stream scheduling strategy can be to select the non-empty IO stream corresponding to MinVirtualDispatchSlice

[0074] MinVirtualDispatchSlice can satisfy formula (3) as follows.

[0075] MinVirtualDispatchSlice = Min(VirtualDispatchSlice(i)) formula (3)

[0076] In the initialization process, the MinVirtualDispatchSlice can be initialized to 0 by the scheduler.

[0077] It can be seen from the above formula (1) to formula (3) that the greater the Weight(i) of the IO stream (i) is, the greater the DipatchSlice(i) proportion is, and the lower the VirtualDispatchSlice(i) change rate is, and the IO stream is more preferentially scheduled compared with the IO stream with low Weight.

[0078] Assuming that the weight of Flow1 is 10 (i.e., Weight(Flow1) = 10), the weight of Flow2 is 20 (i.e., Weight(Flow2) = 20), the weight of Flow3 is 30 (i.e., Weight(Flow3) = 30), the default weight is 10 (i.e., DefaultWeight = 10), the default quantity threshold is 1 (i.e., DefaultDispatchSlice = 1), the single round dispatch quantity threshold of Flow1 is 1 (i.e., DispatchSlice(Flow1) = 1), the single round dispatch quantity threshold of Flow2 is 2 (i.e., DispatchSlice(Flow2) = 2), the single round dispatch quantity threshold of Flow3 is 3 (i.e., DispatchSlice(Flow3) = 3), and the total single round dispatch quantity is 6 (i.e., ScheduleEpoch = 6), then as shown in FIG. 8A, the VDSlice of Flow1, Flow2 and Flow3 (i.e., VDSlice) is initialized to 0. In the case that the VDSlice of Flow1, Flow2 and Flow3 is equal to 0, any non-empty Flow among Flow1, Flow2 and Flow3 can be selected as the target Flow (i.e., target request flow), assuming that Flow1 is selected as the target Flow, then as shown in FIG. 8B, the IO request a1 of Flow1 in the queue can be dequeued, and the VDSlice of Flow1 is updated to 1 (i.e., VDSlice = 0 + 1). Figure 6

[0079] Initially, the VDSlice of Flow1, Flow2 and Flow3 (i.e., VDSlice) is initialized to 0. In the case that the VDSlice of Flow1, Flow2 and Flow3 is equal to 0, any non-empty Flow among Flow1, Flow2 and Flow3 can be selected as the target Flow (i.e., target request flow), assuming that Flow1 is selected as the target Flow, then as shown in FIG. 8B, the IO request a1 of Flow1 in the queue can be dequeued, and the VDSlice of Flow1 is updated to 1 (i.e., VDSlice = 0 + 1). Figure 6

[0080] Afterwards, in the case that the VDSlice of Flow1 is equal to 1, and the VDSlice of Flow2 and Flow3 is equal to 0, any non-empty Flow among Flow2 and Flow3 can be selected as the target Flow, assuming that Flow3 is selected as the target Flow, then as shown in FIG. 8C, the IO request c1, the IO request c2 and the IO request c3 of Flow3 in the queue can be dequeued in sequence, and the VDSlice of Flow3 is updated to 1 (i.e., VDSlice = 0 + 1). Figure 6

[0081] Afterwards, in the case that the VDSlice of Flow1 and Flow3 is equal to 1, and the VDSlice of Flow2 is equal to 0, if Flow2 is a non-empty Flow, then as shown in FIG. 8D, Flow2 can be selected as the target Flow, the IO request b1 and the IO request b2 of Flow2 in the queue can be dequeued, and the VDSlice of Flow2 is updated to 1 (i.e., VDSlice = 0 + 1). Figure 6 ).​​​​​

[0082] Then, with VDSlice equal to 1 for Flow1, Flow2, and Flow3, any non-empty Flow among Flow1, Flow2, and Flow3 can be selected as the target Flow. Assuming Flow2 is selected as the target Flow, then... Figure 6 As shown, IO request b3 of Flow2 can be dequeued from the queue, and the VDSlice of Flow2 can be updated to 1.5 (i.e., ).

[0083] Then, with the VDSlice of Flow1 and Flow3 equal to 1, and the VDSlice of Flow2 equal to 1.5, any non-empty Flow from Flow1 and Flow3 can be selected as the target Flow. Assuming Flow3 is selected as the target Flow, then... Figure 6 As shown, IO requests c4 and c5 of Flow3 can be dequeued sequentially, and the VDSlice of Flow3 can be updated to 1.66 (i.e., ).

[0084] Then, given that Flow1's VDSlice equals 1, Flow2's VDSlice equals 1.5, and Flow3's VDSlice equals 1.66, if Flow1 is a non-empty Flow, then as follows: Figure 6 As shown, Flow1 can be selected as the target Flow, the IO request a2 of Flow1 in the queue is dequeued, and the VDSlice of Flow1 is updated to 2 (i.e., VDSlice = 1 + 1).

[0085] ...

[0086] It should be noted that, Figure 6 The scheduling process shown is for illustrative purposes only. Figure 6 In this context, ScheduleEpoch1' represents the first scheduling cycle, and ScheduleEpoch2' represents the second scheduling cycle. Figure 6 Only the first four scheduling events in the second scheduling cycle are shown.

[0087] The scheduling method provided by the embodiments of the present application takes an abstract request flow as a scheduling granularity, the request flow is obtained according to an object, the weight of the request flow is the weight of the corresponding object, a target request flow is selected according to the weight of the request flow, a target to-be-scheduled request of the target request flow is selected from the queue, and the target to-be-scheduled request is taken out from the queue to execute the target to-be-scheduled request. The scheduling method not only considers the weight of the object (for example, a user) to which the to-be-scheduled request belongs when scheduling, meets the scheduling requirement, but also has low scheduling complexity, and is a scheduling mode that can balance the weight fairness and the scheduling efficiency.

[0088] Figure 7 The structure diagram of the scheduling device provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the embodiment provides a device, which can execute the method described above. Specifically, the device can include: Figure 7

[0089] The obtaining module 71 is configured to obtain a to-be-scheduled request of an object.

[0090] The enqueuing module 72 is configured to place the to-be-scheduled request into a corresponding position of a corresponding request flow in the queue to serve as a to-be-scheduled request of the corresponding request flow. The request flow is obtained according to an object, and the weight of the request flow is the weight of the corresponding object.

[0091] The dequeuing module 73 is configured to select a target request flow from the request flows with to-be-scheduled requests according to the weight of the request flow, select a target to-be-scheduled request of the target request flow from the queue, and take the target to-be-scheduled request out of the queue to execute the target to-be-scheduled request.

[0092] In one embodiment, the dequeuing module 73 is specifically configured to select the target to-be-scheduled request of the target request flow from the queue according to the first-in first-out principle.

[0093] In one embodiment, the dequeuing module 73 is specifically configured to select a request flow with the minimum scheduling cumulative value from the request flows with to-be-scheduled requests as the target request flow. The scheduling cumulative value of the request flow is positively correlated with the number of scheduled requests of the request flow and is negatively correlated with the weight of the request flow.

[0094] The dequeuing module 73 is further configured to update the scheduling cumulative value of the target request flow.

[0095] In one embodiment, the dequeuing module 73 is specifically configured to update the scheduling cumulative value of the target request flow according to the cumulative factor of the target request flow. The size of the cumulative factor of the request flow is negatively correlated with the weight of the request flow.

[0096] In one embodiment, the cumulative factor of the request flow is equal to the ratio of the reference weight to the weight of the request flow. ​

[0097] In one embodiment, the dequeuing module 73 is specifically configured to, each time when scheduling, select a target request flow from the request flows with pending requests, select a target pending request of the target request flow from the queue, and take the pending request out of the queue.

[0098] In one embodiment, the dequeuing module 73 is specifically configured to, each time when scheduling, if the number of continuous scheduling of a first target request flow corresponding to the previous scheduling in the current scheduling reaches a single-round scheduling quantity threshold of the first target request flow, or the first target request flow currently has no pending request, select a second target request flow from the request flows with pending requests, select a target pending request of the second target request flow from the queue, and take the pending request out of the queue, otherwise, select a target pending request of the first target request flow from the queue, and take the pending request out of the queue.

[0099] In one embodiment, the sum of the single-round scheduling quantity thresholds of all request flows is equal to the single-round total scheduling quantity, and the single-round scheduling quantity threshold of a request flow is positively correlated with the weight of the request flow.

[0100] In one embodiment, the single-round scheduling quantity threshold of a request flow is equal to the ratio of the weight of the request flow to a reference weight, multiplied by a reference quantity threshold.

[0101] In one embodiment, the number of scheduled request flows in a single round of scheduling is equal to the single-round scheduling quantity threshold of the request flow; and / or, in a single round of scheduling, the number of scheduled first request flows is less than the single-round scheduling quantity threshold of the first request flow, and the number of scheduled second request flows is greater than the single-round scheduling quantity threshold of the second request flow.

[0102] Figure 7 The apparatus shown can perform Figure 4 The method of the embodiment shown, the part not described in detail in the embodiment, can refer to the related description of the Figure 4 Embodiment shown. The execution process and technical effects of the technical solution are described in the Figure 4 Embodiment shown, which will not be repeated here.

[0103] In one possible implementation, Figure 7 The structure of the apparatus shown can be implemented as a computer device. As Figure 8 Shown, the computer device can include a processor 81 and a memory 82. Wherein the memory 82 is used to store the program supporting the computer device to execute the method provided in the above Figure 4 Embodiment shown, the processor 81 is configured to execute the program stored in the memory 82.

[0104] The program includes one or more computer instructions, wherein the one or more computer instructions are executed by the processor 81 to implement the following steps:

[0105] Obtaining a to-be-scheduled request of the object;

[0106] Putting the to-be-scheduled request into a corresponding position of a corresponding request flow in a queue, as a to-be-scheduled request of the corresponding request flow, the request flow being abstracted according to the object, and a weight of the request flow being a weight of the corresponding object;

[0107] According to the weight of the request flow, selecting a target request flow from the request flows with the to-be-scheduled requests, selecting a target to-be-scheduled request of the target request flow from the queue, and taking the target to-be-scheduled request out of the queue for executing the target to-be-scheduled request.

[0108] Optionally, the processor 81 is further configured to execute all or part of the steps of the method in the foregoing Figure 4 embodiment 8.

[0109] The computer device can further include a communication interface 83 for communication between the computer device and other devices or communication networks.

[0110] In addition, the embodiment of the present application provides a computer readable storage medium, which stores a computer program, and when the computer program is executed, the method provided in the above method embodiment is implemented.

[0111] The device embodiments described above are only schematic, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiment. Those skilled in the art can understand and implement without creative labor.

[0112] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of general hardware platforms as necessary, and of course, can also be realized by means of combination of hardware and software. Based on such understanding, the above technical solutions can be embodied in the form of computer products, and the present application can be in the form of computer program products implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0113] The computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart or flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart or flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart or flowchart block or blocks.

[0114] The computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart or flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart or flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart or flowchart block or blocks.

[0115] The computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart or flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart or flowchart block or blocks. Figure 1 The computer program instructions can also be loaded onto a computer or other programmable device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that the instructions which execute on the computer or other programmable device provide steps for implementing the functions specified in the flowchart or flowchart block or blocks.

[0116] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0117] The memory can include non-persistent memory, random access memory (RAM), and / or non-volatile memory such as read-only memory (ROM) or flash memory, among others. The memory is an example of computer-readable media.

[0118] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, linked lists, modules of programs or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.

[0119] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A scheduling method, characterized by, The method is applied to a scenario where a to-be-scheduled request belongs to an object, and resources are shared between different objects, and comprises: obtaining a to-be-scheduled request; putting the to-be-scheduled request into a corresponding position of a request flow corresponding to an object in a queue according to the object to which the to-be-scheduled request belongs, so as to serve as a to-be-scheduled request of the request flow corresponding to the object, different request flows in the to-be-scheduled request queue being abstracted according to different objects, and a weight of a request flow being a weight of the object corresponding to the request flow; selecting a target request flow from request flows with to-be-scheduled requests according to the weights of the request flows, selecting a target to-be-scheduled request of the target request flow from the queue, and taking the target to-be-scheduled request out of the queue for executing the target to-be-scheduled request.

2. The method of claim 1, wherein, The selecting of the target to-be-scheduled request of the target request flow from the queue comprises selecting the target to-be-scheduled request of the target request flow from the queue according to a first-in-first-out principle.

3. The method of claim 1, wherein, The selecting of the target request flow from the request flows with to-be-scheduled requests according to the weights of the request flows comprises: selecting a request flow with a minimum scheduling cumulative value from the request flows with to-be-scheduled requests as a target request flow, the scheduling cumulative value of a request flow being positively correlated with a scheduled number of the request flow and negatively correlated with a weight of the request flow. The method further comprises updating the scheduling cumulative value of the target request flow.

4. The method of claim 3, wherein, The updating of the scheduling cumulative value of the target request flow comprises updating the scheduling cumulative value of the target request flow according to a cumulative factor of the target request flow, and the size of the cumulative factor of a request flow being negatively correlated with the weight of the request flow.

5. The method of claim 4, wherein, The cumulative factor of a request flow is equal to a ratio of a reference weight to the weight of the request flow.

6. The method of claim 1, wherein, The selecting of the target request flow from the request flows with to-be-scheduled requests according to the weights of the request flows, the selecting of the target to-be-scheduled request of the target request flow from the queue, and the taking of the target to-be-scheduled request out of the queue comprise: each time a scheduling is performed, a target request flow is selected from the request flows with to-be-scheduled requests, a target to-be-scheduled request of the target request flow is selected from the queue, and the to-be-scheduled request is taken out of the queue.

7. The method of claim 1, wherein, The selecting of the target request flow from the request flows with to-be-scheduled requests according to the weights of the request flows, the selecting of the target to-be-scheduled request of the target request flow from the queue, and the taking of the target to-be-scheduled request out of the queue comprise: each time a scheduling is performed, if a continuous scheduling number of a first target request flow corresponding to a previous scheduling in a current scheduling reaches a single-round scheduling number threshold of the first target request flow, or the first target request flow currently has no to-be-scheduled request, a second target request flow is selected from the request flows with to-be-scheduled requests, a target to-be-scheduled request of the second target request flow is selected from the queue, and the to-be-scheduled request is taken out of the queue, otherwise, a target to-be-scheduled request of the first target request flow is selected from the queue, and the to-be-scheduled request is taken out of the queue.

8. The method of claim 1, wherein, The sum of the single-round scheduling number thresholds of all request flows is equal to a single-round total scheduling number, and the single-round scheduling number threshold of a request flow is positively correlated with the weight of the request flow.

9. The method of claim 8, wherein, The single round scheduling quantity threshold of the request flow is equal to the ratio of the weight of the request flow to the reference weight, multiplied by the reference quantity threshold.

10. The method of claim 8, wherein, The scheduling quantity of the request flow in the single round scheduling is equal to the single round scheduling quantity threshold of the request flow; and / or, in the single round scheduling, the scheduling quantity of the first request flow is less than the single round scheduling quantity threshold of the first request flow, and the scheduling quantity of the second request flow is greater than the single round scheduling quantity threshold of the second request flow.

11. A scheduling apparatus characterized by comprising: The application is applied to a scenario in which a to-be-scheduled request exists in an object to which the to-be-scheduled request belongs, and resources are shared between different objects, and the scenario includes: An obtaining module is configured to obtain a to-be-scheduled request. An enqueuing module is configured to place the to-be-scheduled request into a corresponding position of a request flow corresponding to an object to which the to-be-scheduled request belongs in a queue, as a to-be-scheduled request of the request flow corresponding to the object, different request flows in the to-be-scheduled request queue being respectively abstracted according to different objects, and the weight of a request flow being the weight of the object corresponding to the request flow. A dequeuing module is configured to select a target request flow from request flows in which a to-be-scheduled request exists according to the weight of the request flow, select a target to-be-scheduled request of the target request flow from the queue, and take the target to-be-scheduled request out of the queue, so as to execute the target to-be-scheduled request.

12. A computer device, comprising: The application includes: A memory and a processor, wherein the memory is configured to store one or more computer instructions, and the one or more computer instructions are executed by the processor to implement the method in any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer program is stored on the computer program product and is executed to implement the method in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Task scheduling method and device

    CN110096353A

  • Video auditing method and device and electronic equipment

    CN110225373A