A scheduling method, a scheduling device, a time adaptation scheduler, and a storage medium
By adjusting the network bandwidth of some scheduled objects in the time adaptation scheduler and redetermining the configuration weight, the problem of hardware resource consumption when the configuration weight is disparate is solved, and more effective load balancing and hardware resource management are achieved.
Patent Information
- Application Number
- CN202111658325.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In the prior art, the weighted polling algorithm results in a large consumption of hardware resources when the configuration weight ratio of the scheduled object is disparate.
By obtaining the initial network bandwidth of all scheduled objects in the time adaptation scheduler, adjusting the initial network bandwidth of some scheduled objects to obtain the target network bandwidth, and determining the target configuration weight of each scheduled object based on the target network bandwidth and the initial network bandwidth of the remaining scheduled objects to achieve load balancing processing.
On the basis of ensuring the initial network bandwidth of the remaining scheduling objects, by adjusting the network bandwidth of some scheduling objects and redetermining the configuration weight, the physical depth of the hardware table entries is reduced, thereby reducing the consumption of hardware resources.
Smart Images

Figure CN116418746B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and in particular, to a scheduling method, a scheduling device, a time-adaptive scheduler, and a storage medium. Background Art
[0002] In the design of network chips, according to the scheduling principle of time adaptation, all scheduling objects waiting for scheduling in the network chip, such as queue members, are evenly scheduled out according to a preset ratio to ensure the load balance of all scheduling objects in the network chip. Currently, the most commonly used load balancing algorithms include weighted round robin, least connections, random method, source address hashing method, and least connections method.
[0003] In the related art, the weighted round robin algorithm is adopted to achieve the load balance of all scheduling objects based on the inherent network bandwidth of each scheduling object. However, since the weighted round robin algorithm only guarantees the ratio of each scheduling object, when the configuration weight ratios of each scheduling object are very different, there is at least the problem of large consumption of hardware resources. Summary of the Invention
[0004] Embodiments of this application are expected to provide a scheduling method, a scheduling device, a time-adaptive scheduler, and a storage medium to solve the problem of at least large consumption of hardware resources in the related art.
[0005] The technical solution of the embodiments of this application is implemented as follows:
[0006] In a first aspect, embodiments of this application provide a scheduling method, and the method includes:
[0007] Obtain the initial network bandwidths of all scheduling objects in the time-adaptive scheduler;
[0008] Adjust the initial network bandwidths of some of the all scheduling objects to obtain target network bandwidths, where all the target network bandwidths meet the adjustment conditions;
[0009] Based on the target network bandwidths of the some scheduling objects and the initial network bandwidths of the remaining scheduling objects in the all scheduling objects, determine the target configuration weights of each scheduling object;
[0010] Based on the target configuration weights, perform load balancing processing on the all scheduling objects to obtain the scheduling order of the all scheduling objects in multiple scheduling cycles, so that the time-adaptive scheduler schedules the all scheduling objects according to the scheduling order in each scheduling cycle.
[0011] In a second aspect, embodiments of this application provide a scheduling device, and the scheduling device includes:
[0012] An acquisition module, configured to acquire the initial network bandwidths of all scheduling objects in a time adaptation scheduler;
[0013] An adjustment module, configured to adjust the initial network bandwidths of some of the all scheduling objects to obtain target network bandwidths, wherein all the target network bandwidths meet an adjustment condition;
[0014] A processing module, configured to determine the target configuration weights of each scheduling object based on the target network bandwidths of the some scheduling objects and the initial network bandwidths of the remaining scheduling objects in the all scheduling objects;
[0015] The processing module is further configured to perform load balancing processing on the all scheduling objects based on the target configuration weights to obtain the scheduling order of the all scheduling objects in multiple scheduling cycles, so that the time adaptation scheduler schedules the all scheduling objects in each scheduling cycle according to the scheduling order.
[0016] In a third aspect, an embodiment of the present application provides a time adaptation scheduler, where the time adaptation scheduler includes: a processor, a memory, and a communication bus;
[0017] The communication bus is configured to implement a communication connection between the processor and the memory;
[0018] The processor is configured to execute a scheduling program stored in the memory to implement the scheduling method described above.
[0019] In a fourth aspect, an embodiment of the present application provides a storage medium, where the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the scheduling method described above.
[0020] Embodiments of the present application provide a scheduling method, a scheduling device, a time-adaptive scheduler, and a storage medium. By obtaining the initial network bandwidths of all scheduling objects in the time-adaptive scheduler; adjusting the initial network bandwidths of some of the scheduling objects among all the scheduling objects to obtain target network bandwidths, where all the target network bandwidths meet the adjustment conditions; determining the target configuration weights of each scheduling object based on the target network bandwidths of some of the scheduling objects and the initial network bandwidths of the remaining scheduling objects among all the scheduling objects; performing load balancing processing on all the scheduling objects based on the target configuration weights to obtain the scheduling order of all the scheduling objects in multiple scheduling cycles, so that the time-adaptive scheduler schedules all the scheduling objects in each scheduling cycle according to the scheduling order; in this way, on the basis of ensuring the initial network bandwidths of the remaining scheduling objects, by adjusting the initial network bandwidths of some of the scheduling objects and determining the target configuration weights based on the adjusted initial network bandwidths of some of the scheduling objects and the initial network bandwidths of the remaining scheduling objects, the physical depth of the hardware table entries is reduced, thereby reducing the consumption of hardware resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is an optional flowchart of the scheduling method provided by the embodiment of the present application;
[0022] Figure 2 It is a schematic diagram of the Calendar scheduling principle in the network chip provided by the embodiment of the present application;
[0023] Figure 3 It is an optional flowchart of the scheduling method provided by the embodiment of the present application;
[0024] Figure 4 It is an optional flowchart of the scheduling method provided by the embodiment of the present application;
[0025] Figure 5 It is an optional flowchart of the scheduling method provided by the embodiment of the present application;
[0026] Figure 6 It is an optional flowchart of the scheduling method provided by the embodiment of the present application;
[0027] Figure 7 It is an optional flowchart of the scheduling method provided by the embodiment of the present application;
[0028] Figure 8 It is an optional flowchart of the scheduling method provided by the embodiment of the present application;
[0029] Figure 9 It is an optional flowchart of the scheduling method provided by the embodiment of the present application;
[0030] Figure 10 An alternative structural diagram of the scheduling device provided by the embodiment of the present application;
[0031] Figure 11 An alternative structural diagram of the time adaptation scheduler provided by the embodiment of the present application. Detailed implementation manners
[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.
[0033] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or devices.
[0034] Referring to
[0035] Referring to Figure 1 , Figure 1 is an implementation process schematic diagram of the scheduling method provided by the embodiment of the present application. The scheduling method can be applied to a time adaptation scheduler, and the scheduling method includes the following steps:
[0036] Step 101, obtain the initial network bandwidth of all scheduling objects in the time adaptation scheduler.
[0037] In the embodiments of the present application, the initial network bandwidth is the actual network bandwidth set by the time-adaptive scheduler for each scheduling object, and the initial network bandwidth is a positive integer greater than 0. The general meaning of network bandwidth can be understood as the amount of data transmitted per unit time, and the narrow meaning of network bandwidth can be understood as the maximum number of data bits flowing through a specific area under given conditions such as a given time; among them, network bandwidth can also be referred to as network bandwidth rate. Here, the unit of network bandwidth is bits per second, abbreviated as bit / s, or bps. Here, taking the high-performance Ethernet chip where the time-adaptive scheduler is located as an example, the network bandwidth of each scheduling object can be set to at least one of the following bandwidths: 10 Mbps, 100 Mbps, 1 Gbps, 2.5 Gbps, 5 Gbps, 10 Gbps, 20 Gbps, 25 Gbps, 40 Gbps, 50 Gbps, 100 Gbps, 200 Gbps, 400 Gbps, 800 Gbps. Among them, Mbps and Gbps are also units of network bandwidth, where Mbps represents megabits per second and Gbps represents gigabits per second.
[0038] In the embodiments of the present application, the time-adaptive scheduler is also called the Calendar scheduler. Calendar is a scheduling method adapted to time. This method can ensure that all scheduling objects waiting for scheduling are evenly scheduled out according to a preset ratio. To implement Calendar scheduling, a two-dimensional data structure such as a Calendar data structure needs to be designed. The value of each address in this data structure corresponds to the object identifier (Identity document, ID) of the scheduling object to be scheduled. At the same time, a start address and an end address are set, and a counter is used for accumulation. When the counter accumulates to the end address, the value of the counter returns to the start address. Generally, we set the start address to 0.
[0039] In an implementable application scenario, refer to Figure 2 as shown Figure 2 The figure shows a schematic diagram of the Calendar scheduling principle in a network chip. In the Calendar scheduler, there are scheduling objects S1, S3, and S5. By polling, each scheduling object is scheduled. In the obtained Calendar data structure, starting from the start address and ending at the end address, the object identifiers of the scheduling objects scheduled in the polling order are stored. For example, the values in the Calendar data structure are 1 / 3 / 5 / 1 / 3 / 1 (the calendar data after exceeding the end address is not concerned), the start address is 0, and the end address is 5. Through this calendar, these scheduling objects 1 / 3 / 5 / 1 / 3 / 1 can be strictly and periodically scheduled.
[0040] Step 102: Adjust the initial network bandwidth of some of all the scheduling objects to obtain the target network bandwidth.
[0041] Among them, all the target network bandwidths meet the adjustment conditions.
[0042] In the embodiments of the present application, the target network bandwidth can be understood as the network bandwidth obtained after adjusting the initial network bandwidth of some of the scheduling objects. It should be noted that the target network bandwidth is greater than the initial network bandwidth, and the target network bandwidths corresponding to all the partial scheduling objects meet the adjustment conditions.
[0043] In the embodiments of the present application, all the target network bandwidths meeting the adjustment conditions include that the sum of the target network bandwidths of all the partial scheduling objects and the initial network bandwidths of all the remaining scheduling objects is less than or equal to the maximum network bandwidth of the time adaptation scheduler.
[0044] It should be noted that the maximum network bandwidth of the time adaptation scheduler is related to factors such as the clock main frequency and bus width of the chip where the time adaptation scheduler is located.
[0045] In the embodiments of the present application, when the time adaptation scheduler obtains the initial network bandwidths of all the scheduling objects in the time adaptation scheduler, it determines some of all the scheduling objects, adjusts the initial network bandwidths of the partial scheduling objects to obtain the target network bandwidth, and the sum of the target network bandwidths of all the partial scheduling objects and the initial network bandwidths of all the remaining scheduling objects is less than or equal to the maximum network bandwidth of the time adaptation scheduler. In this way, after adjusting the initial network bandwidths of the partial scheduling objects, the adjusted initial network bandwidths are the target network bandwidths, and it will not affect the initial network bandwidths actually allocable to the remaining scheduling objects on the time adaptation scheduler.
[0046] Step 103: Determine the target configuration weight of each scheduling object based on the target network bandwidth of the partial scheduling objects and the initial network bandwidths of the remaining scheduling objects among all the scheduling objects.
[0047] In the embodiments of the present application, the target configuration weight is determined based on the greatest common divisor between the target network bandwidth of the partial scheduling objects and the initial network bandwidths of the remaining scheduling objects among all the scheduling objects.
[0048] It should be noted that after the time adaptation scheduler adjusts the initial network bandwidths of the partial scheduling objects to obtain the target network bandwidth, the target configuration weights of the partial scheduling objects are greater than the initial configuration weights of the partial scheduling objects before adjustment. Here, the initial configuration weight is determined based on the initial network bandwidths of the partial scheduling objects and the initial network bandwidths of the remaining scheduling objects among all the scheduling objects.
[0049] In the embodiment of the present application, after the time adaptation scheduler adjusts the initial network bandwidth of some of all the scheduling objects to obtain the target network bandwidth, based on the target network bandwidth of some of the scheduling objects and the initial network bandwidth of the remaining scheduling objects among all the scheduling objects, the target configuration weight of each scheduling object is determined.
[0050] Step 104: Based on the target configuration weight, perform load balancing processing on all the scheduling objects to obtain the scheduling order of all the scheduling objects in multiple scheduling cycles, so that the time adaptation scheduler schedules all the scheduling objects according to the scheduling order in each scheduling cycle.
[0051] In the embodiment of the present application, when the time adaptation scheduler determines the target configuration weight of each scheduling object based on the target network bandwidth of some of the scheduling objects and the initial network bandwidth of the remaining scheduling objects among all the scheduling objects, based on the target configuration weight of each scheduling object, perform load balancing processing on all the scheduling objects to obtain the scheduling order of all the scheduling objects in multiple scheduling cycles, so that the time adaptation scheduler schedules all the scheduling objects according to the scheduling order in each scheduling cycle.
[0052] An embodiment of the present application provides a scheduling method. By obtaining the initial network bandwidth of all the scheduling objects in the time adaptation scheduler; adjusting the initial network bandwidth of some of all the scheduling objects to obtain the target network bandwidth, where all the target network bandwidths meet the adjustment conditions; determining the target configuration weight of each scheduling object based on the target network bandwidth of some of the scheduling objects and the initial network bandwidth of the remaining scheduling objects among all the scheduling objects; based on the target configuration weight, perform load balancing processing on all the scheduling objects to obtain the scheduling order of all the scheduling objects in multiple scheduling cycles, so that the time adaptation scheduler schedules all the scheduling objects according to the scheduling order in each scheduling cycle; in this way, on the basis of ensuring the initial network bandwidth of the remaining scheduling objects, by adjusting the initial network bandwidth of some of the scheduling objects and determining the target configuration weight based on the adjusted initial network bandwidth of some of the scheduling objects and the initial network bandwidth of the remaining scheduling objects, the physical depth of the hardware table entries is reduced, thereby reducing the consumption of hardware resources.
[0053] Refer to Figure 3 , Figure 3 is a schematic diagram of an implementation process of the scheduling method provided by the embodiment of the present application. This scheduling method can be applied to a time adaptation scheduler. The scheduling method includes the following steps:
[0054] Step 301: Obtain the initial network bandwidth of all the scheduling objects in the time adaptation scheduler.
[0055] Step 302: Determine that among all scheduling objects, the scheduling objects with an initial network bandwidth less than the first bandwidth threshold are partial scheduling objects.
[0056] In the embodiments of the present application, the first bandwidth threshold is used to determine, among all scheduling objects, the scheduling objects with an initial network bandwidth less than the first bandwidth threshold as partial scheduling objects. Exemplarily, the first bandwidth threshold can be 10 Gbps.
[0057] Step 303: Adjust the initial network bandwidth of the partial scheduling objects among all scheduling objects to obtain the target network bandwidth.
[0058] In an implementable application scenario, there are n scheduling objects in the time adaptation scheduler; where n is a positive integer greater than or equal to 1; and the initial network bandwidth of each scheduling object is obtained. Among them, the initial network bandwidth of each scheduling object can be expressed as a sequence BW = {BW1, BW2,..., BWn}. After adjusting the initial network bandwidth of the partial scheduling objects, the network bandwidth of each scheduling object can be expressed as a sequence BWadj = {BWadj1, BWadj2,..., BWadjn}. Exemplarily, there are two scheduling objects in the time adaptation scheduler, the initial network bandwidth of scheduling object S1 is 100 Mbps, and the initial network bandwidth of scheduling object S2 is 100 Gbps. That is, the initial network bandwidth of each scheduling object can be expressed as a sequence BW = {BW1, BW2}, and the maximum network bandwidth BWmax of the time adaptation scheduler is 200 Gbps. At this time, the time adaptation scheduler determines that among all scheduling objects, the scheduling objects with an initial network bandwidth less than the first bandwidth threshold, such as 10 Gbps, are partial scheduling objects. That is, it is determined that scheduling object S1 is a partial scheduling object, and the initial network bandwidth of scheduling object S1 is adjusted to 100 Gbps. That is, the target network bandwidth of scheduling object S1 is obtained as 100 Gbps, and the sum of the target network bandwidth of scheduling object S1 and the initial network bandwidth of scheduling object S2 does not exceed the maximum network bandwidth BWmax. At this time, the adjusted network bandwidth of each scheduling object can be expressed as a sequence BWadj = {BWadj1, BWadj2} = {100, 100}.
[0059] In the embodiments of the present application, as shown in Figure 4 Step 303 adjusts the initial network bandwidth of the partial scheduling objects among all scheduling objects to obtain the target network bandwidth, which can be achieved through the following steps:
[0060] Step 3031: Obtain the maximum network bandwidth of the time adaptation scheduler.
[0061] Step 3032: Determine a target bandwidth threshold based on the initial network bandwidth of some scheduling objects, the initial network bandwidth of the remaining scheduling objects, and the maximum network bandwidth, and adjust the initial network bandwidth of some scheduling objects to the target bandwidth threshold.
[0062] In the embodiments of the present application, considering the network bandwidth of the network ports of Ethernet, generally, the network bandwidth of each scheduling object is an integer multiple of 5 Gbps, such as 10 Gbps, 25 Gbps, 50 Gbps, and 100 Gbps, etc., and there are multiple values for the target bandwidth threshold, such as 10 Gbps, 5 Gbps, and 1 Gbps. The time adaptation scheduler determines the target bandwidth threshold from multiple values based on the initial network bandwidth of some scheduling objects, the initial network bandwidth of the remaining scheduling objects, and the maximum network bandwidth, and adjusts the initial network bandwidth of some scheduling objects to the target bandwidth threshold as the target network bandwidth of some scheduling objects, so that the sum of the target bandwidth threshold of some scheduling objects and the initial network bandwidth of the remaining scheduling objects does not exceed the maximum network bandwidth. In this way, it will not affect the initial network bandwidth that the remaining scheduling objects can actually be allocated on the time adaptation scheduler.
[0063] In another implementation scenario, first, the time adaptation scheduler sets the first bandwidth threshold to 10 Gbps and determines that among all scheduling objects, the scheduling objects with an initial network bandwidth less than the first bandwidth threshold of 10 Gbps are some scheduling objects. Secondly, the time adaptation scheduler takes the first bandwidth threshold of 10 Gbps as the first target bandwidth threshold and adjusts the initial network bandwidth of some scheduling objects to the first target bandwidth threshold to obtain the first reference network bandwidth of some scheduling objects. Then, the time adaptation scheduler calculates whether the sum of the first reference network bandwidth of all some scheduling objects and the initial network bandwidth of all the remaining scheduling objects exceeds the maximum network bandwidth BWmax; if it exceeds, the first target bandwidth threshold is lowered to the second target bandwidth threshold such as 5 Gbps, and the first reference network bandwidth of some scheduling objects is adjusted to the second target bandwidth threshold to obtain the second reference network bandwidth of some scheduling objects. Again, the time adaptation scheduler calculates whether the sum of the second reference network bandwidth of all some scheduling objects and the initial network bandwidth of all the remaining scheduling objects exceeds the maximum network bandwidth BWmax; if it does not exceed, the second reference network bandwidth is determined as the target network bandwidth; if it exceeds, the second target bandwidth threshold is lowered to the third target bandwidth threshold such as 1 Gbps, and the above steps are repeatedly executed until a suitable target bandwidth threshold is found and the initial network bandwidth of some scheduling objects is adjusted to the suitable target bandwidth threshold. It should be noted that the target bandwidth threshold includes the first target bandwidth threshold, the second target bandwidth threshold, the third target bandwidth threshold, and the suitable target bandwidth threshold.
[0064] Step 304: Determine the target configuration weight of each scheduling object based on the target network bandwidth of some scheduling objects and the initial network bandwidth of the remaining scheduling objects among all scheduling objects.
[0065] In the embodiments of this application, with reference to Figure 5 as shown, step 304 determines the target configuration weight of each scheduling object based on the target network bandwidth of some scheduling objects and the initial network bandwidth of the remaining scheduling objects among all scheduling objects, and can be implemented through the following steps:
[0066] Step 3041: Obtain the greatest common divisor between the target network bandwidth and the initial network bandwidth.
[0067] Step 3042: Determine that the ratio of the target network bandwidth of some scheduling objects to the greatest common divisor is the target configuration weight of some scheduling objects.
[0068] Step 3043: Determine that the ratio of the initial network bandwidth of the remaining scheduling objects to the greatest common divisor is the target configuration weight of the remaining scheduling objects.
[0069] It should be noted that step 3042 and step 3043 can be executed simultaneously, step 3042 can also be executed before step 3043, and step 3042 can also be executed after step 3043. In this regard, this application does not make specific restrictions.
[0070] In an implementable application scenario, after the time adaptation scheduler adjusts the initial network bandwidth of some scheduling objects, the network bandwidth of each scheduling object can be expressed as a sequence BWadj = {BWadj1, BWadj2,..., BWadjn}. Calculate the greatest common divisor M between the target network bandwidth and the initial network bandwidth in the sequence BWadj, and use the quotient of the network bandwidth BWadj of each scheduling object and the greatest common divisor as the target configuration weight of each scheduling object, that is, the sequence of the target configuration weights of each scheduling object W = {W1, W2,..., Wn} = {BWadj1 / M, BWadj2 / M,..., BWadjn / M}, that is, the target configuration weight of some scheduling objects and the target configuration weight of the remaining scheduling objects are obtained. It should be noted that the target configuration weight of each scheduling object is a positive integer. If there is a scheduling object with an initial network bandwidth of 0, then the scheduling object with an initial network bandwidth of 0 is not applicable to the scheduling method provided in this application, that is, the scheduling object with an initial network bandwidth of 0 does not participate in the scheduling method provided in this application.
[0071] Taking the above example as a further illustration, the network bandwidths of the adjusted scheduling objects can be expressed as a sequence BWadj = {BWadj1, BWadj2} = {100, 100}, and the greatest common divisor M is 100. At this time, the quotient of the network bandwidth BWadj of each scheduling object and the greatest common divisor is used as the target configuration weight of each scheduling object. Then, the target configuration weights W = {1, 1} of each scheduling object are obtained. At this time, the bandwidth that the scheduling object S2 can actually be allocated is BWmax × (1 / (1 + 1)) = 100 Gbps. It can be seen that even if the network bandwidth of the scheduling object S1 is adjusted significantly, the actual network bandwidth of the scheduling object S2 remains unchanged, and the sum of the network bandwidths of all scheduling objects after adjustment does not exceed BWmax, which does not affect the bandwidth that the scheduling object S2 can actually be allocated on the time adaptation scheduler. In this way, the physical overhead of the hardware table entries is greatly reduced.
[0072] Step 305: Mark the scheduling objects with target configuration weights greater than the first weight threshold among all scheduling objects as scheduling objects with the first priority.
[0073] In the embodiment of the present application, the first weight threshold is used to determine the scheduling objects with the first priority. Exemplarily, the first weight threshold can be 1.
[0074] In the embodiment of the present application, the first priority can be understood as the high priority, that is, the scheduling objects with target configuration weights greater than the first weight threshold are marked as scheduling objects with high priority, and the scheduling objects with target configuration weights equal to the first weight threshold are marked as scheduling objects with low priority.
[0075] Step 306: Obtain the current configuration weights of all scheduling objects and initialize the current configuration weights to the target configuration weights.
[0076] In the embodiment of the present application, when the time adaptation scheduler obtains the current configuration weights CW = {CW1, CW2,..., CWn} = {0, 0,..., 0} of all scheduling objects for the first time, and initializes the current configuration weights to the target configuration weights, that is, CW = {CW1, CW2,..., CWn} = {W1, W2,..., Wn}.
[0077] Step 307: Based on the current configuration weights, the target configuration weights, and the scheduling objects with the first priority, perform load balancing processing on all scheduling objects to obtain the scheduling order of all scheduling objects in multiple scheduling cycles, so that the time adaptation scheduler schedules all scheduling objects according to the scheduling order in each scheduling cycle.
[0078] In the embodiment of the present application, refer to Figure 6As shown, in step 307, load balancing processing is performed on all scheduling objects based on the current configuration weight, the target configuration weight, and the scheduling objects with the first priority, and the scheduling order of all scheduling objects in multiple scheduling cycles can be implemented through the following steps 3071 to 3072, steps 3074 to 3075; or 3071, steps 3073 to 3075:
[0079] Step 3071: Obtain the first maximum configuration weight from the current configuration weights of the scheduling objects with the first priority.
[0080] In the embodiment of the present application, the time adaptation scheduler obtains the first maximum configuration weight from the current configuration weights of the scheduling objects with the first priority, that is, the high priority.
[0081] In other embodiments of the present application, the time adaptation scheduler can also sort the current configuration weights CW = {CW1, CW2,..., CWn} of all scheduling objects, find the current configuration weights of the scheduling objects with the first priority, that is, the high priority, from the sorted current configuration weights, and obtain the maximum configuration weight CWi.
[0082] Step 3072: If the first maximum configuration weight is greater than the second weight threshold, determine that the scheduling object corresponding to the first maximum configuration weight is the first scheduling object in the scheduling cycle.
[0083] In the embodiment of the present application, the second weight threshold is used to determine the scheduling order of the scheduling objects in the scheduling cycle. Exemplarily, the second weight threshold can be 0.
[0084] In the real-time example of the present application, after the time adaptation scheduler obtains the first maximum configuration weight from the current configuration weights of the scheduling objects with the first priority, it determines whether the first maximum configuration weight is greater than the second weight threshold 0. If it is determined that the first maximum configuration weight is greater than the second weight threshold 0, it determines the object number of the scheduling object corresponding to the first maximum configuration weight, and determines that the scheduling object corresponding to the object number is the first scheduling object in the scheduling cycle.
[0085] Step 3073: If the first maximum configuration weight is less than or equal to the second weight threshold, obtain the second maximum configuration weight from the current configuration weights of all scheduling objects, and determine that the scheduling object corresponding to the second maximum configuration weight is the first scheduling object.
[0086] In the embodiment of the present application, after the time adaptation scheduler obtains the first maximum configuration weight from the current configuration weights of the scheduling objects with the first priority, it determines whether the first maximum configuration weight is greater than the second weight threshold 0. If it is determined that the first maximum configuration weight is less than or equal to the second weight threshold 0, it obtains the second maximum configuration weight from the current configuration weights of all scheduling objects, determines the object number of the scheduling object corresponding to the second maximum configuration weight, and determines the scheduling object corresponding to the object number as the first scheduling object scheduled in the scheduling period.
[0087] Step 3074: Update the current configuration weights of all scheduling objects based on the target configuration weights, the sum of all target configuration weights, and the current configuration weight of the (i - 1)-th scheduling object to obtain the updated current configuration weights of all scheduling objects.
[0088] Wherein, i is a positive integer greater than 1 and less than or equal to I, and I is the total number of rounds for scheduling all scheduling objects in a scheduling period.
[0089] In the embodiment of the present application, after the time adaptation scheduler determines the first scheduling object scheduled in the scheduling period, it determines the sum of all target configuration weights as a scheduling period WS, that is, the total number of rounds for scheduling all scheduling objects in a scheduling period WS, and updates the current configuration weights of all scheduling objects based on the target configuration weights, the sum of all target configuration weights, and the current configuration weight of the (i - 1)-th scheduling object to obtain the updated current configuration weights of all scheduling objects.
[0090] In the embodiment of the present application, as shown in Figure 7 Step 3074 can be implemented by the following steps to update the current configuration weights of all scheduling objects based on the target configuration weights, the sum of all target configuration weights, and the current configuration weight of the (i - 1)-th scheduling object to obtain the updated current configuration weights of all scheduling objects:
[0091] Step A1: Determine that the sum of the current configuration weight corresponding to the (i - 1)-th scheduling object and the target configuration weight minus the sum of all target configuration weights is the updated current configuration weight of the (i - 1)-th scheduling object.
[0092] Step A2: Determine that the sum of the current configuration weights corresponding to the other scheduling objects except the (i - 1)-th scheduling object among all scheduling objects and the target configuration weights is the updated current configuration weight of the other scheduling objects.
[0093] Wherein, all scheduling objects include the (i - 1)-th scheduling object and other scheduling objects; the updated current configuration weights of all scheduling objects include the updated current configuration weight of the (i - 1)-th scheduling object and the updated current configuration weight of the other scheduling objects.
[0094] Step 3075: Based on the updated current configuration weights and the scheduling objects with the first priority, determine the i-th scheduling object called in the scheduling period until the scheduling period is completed.
[0095] In the embodiments of the present application, with reference to Figure 8 As shown, the step of determining the i-th scheduling object called in the scheduling period based on the updated current configuration weights and the scheduling objects with the first priority in step 3075 can be implemented through the following steps:
[0096] Step B1: Obtain the third largest configuration weight from the updated current configuration weights of the scheduling objects with the first priority.
[0097] Step B2: If the third largest configuration weight is greater than the second weight threshold, determine the scheduling object corresponding to the third largest configuration weight as the i-th scheduling object.
[0098] Step B3: If the third largest configuration weight is less than or equal to the second weight threshold, obtain the fourth largest configuration weight from the updated current configuration weights corresponding to all scheduling objects, and determine the scheduling object corresponding to the fourth largest configuration weight as the i-th scheduling object.
[0099] In an implementable application scenario, there are three scheduling objects {S1, S2, S3} in the time adaptation scheduler, the target configuration weight of each scheduling object is W = {2, 1, 1}, and after determining a scheduling period as all the target configuration weights, that is, WS = 2 + 1 + 1 = 4. Among them, the target configuration weight 2 corresponding to the scheduling object S1 is greater than the second weight threshold, then mark the scheduling object S1 as the scheduling object with the first priority. The scheduling method at this time is as follows:
[0100] First-round scheduling: The time adaptation scheduler obtains the current configuration weights CW of all scheduling objects, and initializes the current configuration weights CW as the target configuration weights, that is, CW = W = {2, 1, 1}. Obtain the first largest configuration weight 2 from the current configuration weights of the scheduling objects with the first priority, and determine that the first largest configuration weight 2 is greater than the second weight threshold 0; at this time, the time adaptation scheduler determines the scheduling object S1 corresponding to the first largest configuration weight 2 as the first scheduling object in the scheduling period. Further, the time adaptation scheduler determines the updated current configuration weights CW corresponding to all scheduling objects = {2 + 2 - 4, 1 + 1, 1 + 1} = {0, 2, 2}.
[0101] Second-round scheduling: The time adaptation scheduler obtains the updated current configuration weights CW = {0, 2, 2} corresponding to all scheduling objects. From the updated current configuration weights of the scheduling objects with the first priority, it obtains the third-largest configuration weight 0 and determines that the third-largest configuration weight 0 is equal to the second weight threshold 0. At this time, the time adaptation scheduler obtains the fourth-largest configuration weight 2 from the current configuration weights of all scheduling objects and determines that the scheduling object S2 corresponding to the fourth-largest configuration weight 2 is the second scheduling object in the scheduling period. Further, the time adaptation scheduler determines the current configuration weights CW = {0 + 2, 2 + 1 - 4, 2 + 1} = {2, -1, 3} corresponding to all scheduling objects after another update.
[0102] Third-round scheduling: The time adaptation scheduler obtains the current configuration weights CW = {2, -1, 3} corresponding to all scheduling objects after another update. From the current configuration weights of the scheduling objects with the first priority after another update, it obtains the fifth-largest configuration weight 2 and determines that the fifth-largest configuration weight 2 is greater than the second weight threshold 0. At this time, the time adaptation scheduler determines that the scheduling object S1 corresponding to the fifth-largest configuration weight 2 is the third scheduling object in the scheduling period. Further, the time adaptation scheduler determines the current configuration weights CW = {2 + 2 - 4, -1 + 1, 3 + 1} = {0, 0, 4} corresponding to all scheduling objects after a new update.
[0103] Fourth-round scheduling: The time adaptation scheduler obtains the current configuration weights CW = {0, 0, 4} corresponding to all scheduling objects after a new update. From the current configuration weights of the scheduling objects with the first priority after a new update, it obtains the sixth-largest configuration weight 0 and determines that the sixth-largest configuration weight 0 is equal to the second weight threshold 0. At this time, the time adaptation scheduler obtains the seventh-largest configuration weight 4 from the current configuration weights of all scheduling objects after another update and determines that the scheduling object S3 corresponding to the seventh-largest configuration weight 4 is the fourth scheduling object in the scheduling period. Further, the time adaptation scheduler determines the current configuration weights CW = {0 + 2, 0 + 1, 4 + 1 - 4} = {2, 1, 1} corresponding to all scheduling objects after another new update.
[0104] From the above, it can be seen that after the fourth round of calculation, the time adaptive scheduler determines that the newly updated current configuration weight CW={2, 1, 1} corresponding to all scheduling objects is the same as the current configuration weight after initialization, and the scheduling cycle begins to cycle, and the scheduling order I={1, 2, 1, 3} corresponding to the object number of the scheduling object selected in the four rounds meets the target configuration weight ratio, and the calculation results are continued to be deduced for four rounds. It can be seen that the scheduling order I={1, 2, 1, 3, 1, 2, 1, 3}, and there are no consecutive identical members in the scheduling order. In this way, the result obtained by using the priority smooth weighted polling algorithm is the optimal solution in this case, and the setting of the priority only changes the scheduling order of the scheduling object, and does not change the scheduling weight of the scheduling object. Further, the defect of insufficient smoothness of the smooth weighted polling algorithm is corrected.
[0105] It should be noted that, according to the smooth weighted polling algorithm, the CWx of each round of scheduling object x will be fixedly added with Wx (1≤x≤n), so in one scheduling cycle (WS round), the scheduling object x will be fixedly accumulated with WSUMx=Wx×WS. Correspondingly, if the time adaptive scheduler selects the scheduling object x, CWx-WS is executed. According to expectations, the scheduling object x will be selected Wx times, that is, the scheduling object x will be cumulatively subtracted with WDELx=WS×Wx in one scheduling cycle. It can be seen that WSUMx=WDELx, which also explains the core reason why CW is restored to the initial value corresponding to the initialization after one scheduling cycle (WS round). After the high-priority scheduling object x is selected Wx times, its CWx must be a negative value, and it will no longer have the opportunity to be selected before the end of this scheduling cycle. Therefore, there is no situation where the number of times a high-priority scheduling object is selected exceeds the theoretical value, and it also explains that setting the scheduling object with a target configuration weight equal to 1 to a low priority will not destroy the weight ratio calculated by the original algorithm.
[0106] It should be noted that in the related art, when using the smooth weighted polling algorithm, its calculation structure is not "smooth" enough when a special weight ratio is used. Take the example of three scheduling objects {S1, S2, S3}, and the configuration weight W = {2, 1, 1} corresponding to each scheduling object. It can be simply calculated that WS = 2 + 1 + 1 = 4. At this time, the scheduling method in the related art is as follows:
[0107] In the first round of scheduling, the current configured weight CW = {2, 1, 1}, and the selected member number is S1. After this round, CW = {0, 2, 2}. In the second round of scheduling, CW = {0, 2, 2}, and the selected member number is S2. After this round, CW = {2, -1, 3}. In the third round of scheduling, CW = {2, -1, 3}, and the selected member number is S3. After this round, CW = {4, 0, 0}. In the fourth round of scheduling, CW = {4, 0, 0}, and the selected member number is S1. After this round, CW = {2, 1, 1}. After the fourth round of calculation, the time adaptation scheduler determines that the current configured weight CW = {2, 1, 1} corresponding to all scheduling objects is the same as the initialized current configured weight. The scheduling cycle starts to loop, and the scheduling order I = {1, 2, 3, 1} corresponding to the object numbers of the selected scheduling objects in the four rounds conforms to the configured weight ratio. Continuing to deduce the calculation results for four more rounds, it can be seen that the scheduling order I = {1, 2, 3, 1, 1, 2, 3, 1}, and there are cases of consecutive identical scheduling objects in the scheduling order.
[0108] As can be seen from the above, in the embodiments of the present application, while ensuring the initial network bandwidth of the remaining scheduling objects, by adjusting the initial network bandwidth of some scheduling objects and finding the greatest common divisor of the adjusted initial network bandwidth, the configured weight is optimized, reducing the physical depth of the hardware table entries. At the same time, by setting priorities, the smoothness of the scheduling results in some special weight cases is greatly improved, obtaining the best scheduling order for all scheduling objects.
[0109] Refer to Figure 9 , Figure 9 is a schematic flowchart of an implementation process of the scheduling method provided by the embodiments of the present application. This scheduling method can be applied to a time adaptation scheduler, and this scheduling method includes the following steps:
[0110] Step 401: Obtain the initial network bandwidth of all scheduling objects in the time adaptation scheduler.
[0111] Step 402: Adjust the initial network bandwidth of some scheduling objects among all scheduling objects according to certain rules to obtain the target network bandwidth.
[0112] Step 403: Determine the target configured weight of each scheduling object based on the target network bandwidth of some scheduling objects and the initial network bandwidth of the remaining scheduling objects among all scheduling objects.
[0113] Step 404: Mark the scheduling objects with a target configured weight greater than the first weight threshold among all scheduling objects as scheduling objects with the first priority.
[0114] Step 405: Based on the scheduling objects with the first priority and the target configuration weights, perform load balancing processing on all scheduling objects to obtain the scheduling order of all scheduling objects in multiple scheduling cycles, so that the time adaptation scheduler schedules all scheduling objects in each scheduling cycle according to the scheduling order.
[0115] As can be seen from the above, in the embodiments of the present application, on the basis of ensuring the initial network bandwidth of the remaining scheduling objects, by adjusting the initial network bandwidth of some scheduling objects and optimizing their configuration weights by finding the greatest common divisor of the adjusted initial network bandwidth, the physical depth of the hardware table entries is reduced; at the same time, by setting priorities, the smoothness of the scheduling results in some special weight cases is greatly improved, and the best scheduling order of all scheduling objects is obtained.
[0116] It should be noted that for the descriptions of the same steps and the same content in this embodiment and other embodiments, reference can be made to the descriptions in other embodiments, and details will not be repeated here.
[0117] The embodiments of the present application provide a scheduling device, which can be used to implement Figure 1 、 Figures 3 to 9 a scheduling method provided in the corresponding embodiment. As shown in Figure 10 , the scheduling device 10 includes:
[0118] An acquisition module 1001, configured to acquire the initial network bandwidth of all scheduling objects in the time adaptation scheduler;
[0119] An adjustment module 1002, configured to adjust the initial network bandwidth of some scheduling objects among all scheduling objects to obtain target network bandwidths, where all target network bandwidths meet the adjustment conditions;
[0120] A processing module 1003, configured to determine the target configuration weight of each scheduling object based on the target network bandwidth of some scheduling objects and the initial network bandwidth of the remaining scheduling objects among all scheduling objects;
[0121] The processing module 1003 is further configured to perform load balancing processing on all scheduling objects based on the target configuration weights to obtain the scheduling order of all scheduling objects in multiple scheduling cycles, so that the time adaptation scheduler schedules all scheduling objects in each scheduling cycle according to the scheduling order.
[0122] In other embodiments of the present application, the processing module 1003 is further configured to determine that the scheduling objects among all scheduling objects with an initial network bandwidth less than the first bandwidth threshold are some scheduling objects.
[0123] In other embodiments of the present application, all target network bandwidths satisfying the adjustment condition include the sum of the target network bandwidths of all partial scheduling objects and the initial network bandwidths of all remaining scheduling objects, which is less than or equal to the maximum network bandwidth of the time adaptation scheduler.
[0124] In other embodiments of the present application, the obtaining module 1001 is further configured to obtain the maximum network bandwidth of the time adaptation scheduler; the adjustment module 1002 is further configured to determine a target bandwidth threshold based on the initial network bandwidths of the partial scheduling objects, the initial network bandwidths of the remaining scheduling objects, and the maximum network bandwidth, and adjust the initial network bandwidths of the partial scheduling objects to the target bandwidth threshold.
[0125] In other embodiments of the present application, the obtaining module 1001 is further configured to obtain the greatest common divisor between the target network bandwidth and the initial network bandwidth; the processing module 1003 is further configured to determine that the ratio of the target network bandwidth of the partial scheduling objects to the greatest common divisor is the target configuration weight of the partial scheduling objects; and determine that the ratio of the initial network bandwidth of the remaining scheduling objects to the greatest common divisor is the target configuration weight of the remaining scheduling objects.
[0126] In other embodiments of the present application, the processing module 1003 is further configured to mark the scheduling objects with target configuration weights greater than the first weight threshold among all scheduling objects as scheduling objects with the first priority; obtain the current configuration weights of all scheduling objects, and initialize the current configuration weights to the target configuration weights; perform load balancing processing on all scheduling objects based on the current configuration weights, the target configuration weights, and the scheduling objects with the first priority to obtain a scheduling order.
[0127] In other embodiments of the present application, the processing module 1003 is further configured to obtain the first maximum configuration weight from the current configuration weights of the scheduling objects with the first priority; if the first maximum configuration weight is greater than the second weight threshold, determine the scheduling object corresponding to the first maximum configuration weight as the first scheduling object scheduled in the scheduling cycle; if the first maximum configuration weight is less than or equal to the second weight threshold, obtain the second maximum configuration weight from the current configuration weights of all scheduling objects, and determine the scheduling object corresponding to the second maximum configuration weight as the first scheduling object; update the current configuration weights of all scheduling objects based on the target configuration weights, the sum of all target configuration weights, and the current configuration weight of the (i - 1)-th scheduling object to obtain the updated current configuration weights of all scheduling objects; where i is a positive integer greater than 1 and less than or equal to I, and I is the total number of rounds of scheduling all scheduling objects in a scheduling cycle; determine the i-th scheduling object called in the scheduling cycle based on the updated current configuration weights and the scheduling objects with the first priority until the scheduling cycle is completed.
[0128] In other embodiments of the present application, the processing module 1003 is further configured to determine the sum of the current configuration weight and the target configuration weight corresponding to the (i - 1)-th scheduling object, subtract the sum of all target configuration weights, and obtain the updated current configuration weight of the (i - 1)-th scheduling object; determine the sum of the current configuration weight and the target configuration weight corresponding to other scheduling objects except the (i - 1)-th scheduling object among all scheduling objects, as the updated current configuration weight of other scheduling objects; where all scheduling objects include the (i - 1)-th scheduling object and other scheduling objects.
[0129] In other embodiments of the present application, the processing module 1003 is further configured to obtain the third largest configuration weight from the updated current configuration weights of the scheduling objects with the first priority; if the third largest configuration weight is greater than the second weight threshold, determine the scheduling object corresponding to the third largest configuration weight as the i-th scheduling object; if the third largest configuration weight is less than or equal to the second weight threshold, obtain the fourth largest configuration weight from the updated current configuration weights corresponding to all scheduling objects, and determine the scheduling object corresponding to the fourth largest configuration weight as the i-th scheduling object.
[0130] An embodiment of the present application provides a time adaptation scheduler, which can be used to implement Figure 1 、 Figures 3 to 9 a scheduling method provided in the corresponding embodiment, as shown in Figure 11 The time adaptation scheduler 11 ( Figure 11 the time adaptation scheduler 11 in is corresponding to the scheduling device 10 in Figure 10 ) includes: a processor 1101, a memory 1102, and a communication bus 1103, where:
[0131] The communication bus 1103 is used to implement a communication connection between the processor 1101 and the memory 1102; the processor 1101 is configured to execute a scheduling program stored in the memory 1102 to implement the following steps:
[0132] Obtain the initial network bandwidth of all scheduling objects in the time adaptation scheduler;
[0133] Adjust the initial network bandwidth of some of all scheduling objects to obtain a target network bandwidth, where all target network bandwidths meet the adjustment conditions;
[0134] Based on the target network bandwidth of some scheduling objects and the initial network bandwidth of the remaining scheduling objects among all scheduling objects, determine the target configuration weight of each scheduling object;
[0135] Based on the target configuration weights, perform load balancing processing on all scheduling objects to obtain the scheduling order of all scheduling objects in multiple scheduling cycles, so that the time adaptation scheduler schedules all scheduling objects in each scheduling cycle according to the scheduling order.
[0136] In other embodiments of the present application, the processor 1101 is used to execute the scheduling program stored in the memory 1102 to implement the following steps:
[0137] Determine that among all scheduling objects, the scheduling objects with an initial network bandwidth less than the first bandwidth threshold are partial scheduling objects.
[0138] In other embodiments of the present application, all target network bandwidths meeting the adjustment condition include the sum of the target network bandwidths of all partial scheduling objects and the initial network bandwidths of all remaining scheduling objects, which is less than or equal to the maximum network bandwidth of the time adaptation scheduler.
[0139] In other embodiments of the present application, the processor 1101 is used to execute the scheduling program stored in the memory 1102 to implement the following steps:
[0140] Obtain the maximum network bandwidth of the time adaptation scheduler; based on the initial network bandwidths of the partial scheduling objects, the initial network bandwidths of the remaining scheduling objects, and the maximum network bandwidth, determine the target bandwidth threshold, and adjust the initial network bandwidths of the partial scheduling objects to the target bandwidth threshold.
[0141] In other embodiments of the present application, the processor 1101 is used to execute the scheduling program stored in the memory 1102 to implement the following steps:
[0142] Obtain the greatest common divisor between the target network bandwidth and the initial network bandwidth; determine that the ratio of the target network bandwidth of the partial scheduling objects to the greatest common divisor is the target configuration weight of the partial scheduling objects; determine that the ratio of the initial network bandwidth of the remaining scheduling objects to the greatest common divisor is the target configuration weight of the remaining scheduling objects.
[0143] In other embodiments of the present application, the processor 1101 is used to execute the scheduling program stored in the memory 1102 to implement the following steps:
[0144] Mark the scheduling objects with a target configuration weight greater than the first weight threshold among all scheduling objects as scheduling objects with the first priority; obtain the current configuration weights of all scheduling objects, and initialize the current configuration weights to the target configuration weights; based on the current configuration weights, the target configuration weights, and the scheduling objects with the first priority, perform load balancing processing on all scheduling objects to obtain the scheduling order.
[0145] In other embodiments of the present application, the processor 1101 is configured to execute a scheduling program stored in the memory 1102 to implement the following steps:
[0146] Obtain a first maximum configuration weight from the current configuration weights of the scheduling objects with the first priority; if the first maximum configuration weight is greater than the second weight threshold, determine the scheduling object corresponding to the first maximum configuration weight as the first scheduling object scheduled in the scheduling period; if the first maximum configuration weight is less than or equal to the second weight threshold, obtain a second maximum configuration weight from the current configuration weights of all scheduling objects, and determine the scheduling object corresponding to the second maximum configuration weight as the first scheduling object; update the current configuration weights of all scheduling objects based on the target configuration weight, the sum of all target configuration weights, and the current configuration weight of the (i-1)-th scheduling object to obtain the updated current configuration weights of all scheduling objects; where i is a positive integer greater than 1 and less than or equal to I, and I is the total number of rounds of scheduling all scheduling objects in a scheduling period; determine the i-th scheduling object called in the scheduling period based on the updated current configuration weights and the scheduling objects with the first priority until the scheduling period is completed.
[0147] In other embodiments of the present application, the processor 1101 is configured to execute a scheduling program stored in the memory 1102 to implement the following steps:
[0148] Determine that the sum of the current configuration weight of the (i-1)-th scheduling object and the target configuration weight, minus the sum of all target configuration weights, is the updated current configuration weight of the (i-1)-th scheduling object; determine that the sum of the current configuration weight of the other scheduling objects other than the (i-1)-th scheduling object among all scheduling objects and the target configuration weight is the updated current configuration weight of the other scheduling objects; where all scheduling objects include the (i-1)-th scheduling object and the other scheduling objects.
[0149] In other embodiments of the present application, the processor 1101 is configured to execute a scheduling program stored in the memory 1102 to implement the following steps:
[0150] Obtain a third maximum configuration weight from the updated current configuration weights of the scheduling objects with the first priority; if the third maximum configuration weight is greater than the second weight threshold, determine the scheduling object corresponding to the third maximum configuration weight as the i-th scheduling object; if the third maximum configuration weight is less than or equal to the second weight threshold, obtain a fourth maximum configuration weight from the updated current configuration weights corresponding to all scheduling objects, and determine the scheduling object corresponding to the fourth maximum configuration weight as the i-th scheduling object.
[0151] Embodiments of the present application provide a computer storage medium. The computer storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the scheduling method provided by the embodiments of the present application. For example, as Figure 1 , Figures 3 to 9 shown in the method.
[0152] Embodiments of the present application provide a storage medium. By obtaining the initial network bandwidths of all scheduling objects in a time-adaptive scheduler; adjusting the initial network bandwidths of some of the scheduling objects among all the scheduling objects to obtain target network bandwidths, where all the target network bandwidths meet the adjustment conditions; determining the target configuration weights of each scheduling object based on the target network bandwidths of some of the scheduling objects and the initial network bandwidths of the remaining scheduling objects among all the scheduling objects; and performing load balancing processing on all the scheduling objects based on the target configuration weights to obtain the scheduling order of all the scheduling objects in multiple scheduling cycles, so that the time-adaptive scheduler schedules all the scheduling objects in each scheduling cycle according to the scheduling order; thus, on the basis of ensuring the initial network bandwidths of the remaining scheduling objects, by adjusting the initial network bandwidths of some of the scheduling objects and determining the target configuration weights based on the adjusted initial network bandwidths of some of the scheduling objects and the initial network bandwidths of the remaining scheduling objects, the physical depth of the hardware table entries is reduced, thereby reducing the consumption of hardware resources.
[0153] It should be noted here that the descriptions of the above storage medium and device embodiments are similar to those of the above method embodiments and have similar beneficial effects to the method embodiments. For the technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the descriptions of the method embodiments of the present application for understanding.
[0154] The above computer storage medium / memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a ferromagnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM), etc.; it may also be various terminals including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.
[0155] It should be understood that "an embodiment" or "one embodiment" or "an embodiment of the present application" or "the foregoing embodiment" or "some embodiments" or "some implementation manners" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the appearances of "in an embodiment" or "in one embodiment" or "an embodiment of the present application" or "the foregoing embodiment" or "some embodiments" or "some implementation manners" throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics may be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the sequence numbers of the above processes do not mean the order of execution, and the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The sequence numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments.
[0156] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of units is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units or components can be combined, or can be integrated into another system, or some features can be ignored, or not executed. In addition, the couplings, direct couplings, or communication connections between the components shown or discussed with each other may be through some interfaces, and the indirect couplings or communication connections of devices or units may be electrical, mechanical or other forms.
[0157] Those of ordinary skill in the art can understand that all or part of the steps to implement the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps including those of the above method embodiments; and the foregoing storage medium includes: various media such as removable storage devices, read-only memory (ROM), magnetic disks, or optical discs that can store program codes.
[0158] Alternatively, if the above integrated units of the present application are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiments of the present application, in essence or the part that contributes to the related art, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of the various embodiments of the present application. And the foregoing storage medium includes: various media such as removable storage devices, ROM, magnetic disks, or optical discs that can store program codes.
[0159] It should be noted that the drawings in the embodiments of the present application are only for illustrating the schematic positions of the various components on the terminal device and do not represent their actual positions in the terminal device. The actual positions of the components or regions can be changed or offset according to the actual situation (for example, the structure of the terminal device). Moreover, the ratios of different parts in the terminal device in the drawings do not represent the actual ratios.
[0160] As described above, the above are only the implementation manners of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of changes or substitutions, which should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claimed rights.
Claims
1. A scheduling method, characterized in that, the method includes: obtaining the initial network bandwidths of all scheduling objects in the time adaptation scheduler; adjusting the initial network bandwidths of some of the all scheduling objects to obtain target network bandwidths, where all the target network bandwidths meet the adjustment conditions; determining the target configuration weight of each scheduling object based on the target network bandwidths of the some scheduling objects and the initial network bandwidths of the remaining scheduling objects among the all scheduling objects; performing load balancing processing on the all scheduling objects based on the target configuration weights to obtain the scheduling order of the all scheduling objects in multiple scheduling cycles, so that the time adaptation scheduler schedules the all scheduling objects in accordance with the scheduling order in each scheduling cycle.
2. The method according to claim 1, characterized in that, after obtaining the initial network bandwidths of all scheduling objects in the time adaptation scheduler, the method includes: determining that the scheduling objects with initial network bandwidths less than the first bandwidth threshold among all scheduling objects are the some scheduling objects.
3. The method according to claim 1, characterized in that, all the target network bandwidths meet the adjustment conditions, including that the sum of the target network bandwidths of all the some scheduling objects and the initial network bandwidths of all the remaining scheduling objects is less than or equal to the maximum network bandwidth of the time adaptation scheduler.
4. The method according to claim 1, characterized in that, adjusting the initial network bandwidths of some of the all scheduling objects to obtain target network bandwidths includes: obtaining the maximum network bandwidth of the time adaptation scheduler; determining a target bandwidth threshold based on the initial network bandwidths of the some scheduling objects, the initial network bandwidths of the remaining scheduling objects, and the maximum network bandwidth, and adjusting the initial network bandwidths of the some scheduling objects to the target bandwidth threshold.
5. The method according to any one of claims 1 to 4, characterized in that, determining the target configuration weight of each scheduling object based on the target network bandwidths of the some scheduling objects and the initial network bandwidths of the remaining scheduling objects among the all scheduling objects includes: obtaining the greatest common divisor between the target network bandwidth and the initial network bandwidth; determining the ratio of the target network bandwidth of the some scheduling objects to the greatest common divisor as the target configuration weight of the some scheduling objects; determining the ratio of the initial network bandwidth of the remaining scheduling objects to the greatest common divisor as the target configuration weight of the remaining scheduling objects.
6. The method according to any one of claims 1 to 4, characterized in that, performing load balancing processing on the all scheduling objects based on the target configuration weights to obtain the scheduling order of the all scheduling objects in multiple scheduling cycles includes: marking the scheduling objects with target configuration weights greater than the first weight threshold among all scheduling objects as scheduling objects with the first priority; obtaining the current configuration weights of the all scheduling objects and initializing the current configuration weights as the target configuration weights; Based on the current configuration weights, the target configuration weights, and the scheduling objects with the first priority, perform load balancing processing on all the scheduling objects to obtain the scheduling order.
7. The method according to claim 6, wherein, the performing load balancing processing on all the scheduling objects based on the current configuration weights, the target configuration weights, and the scheduling objects with the first priority to obtain the scheduling order includes: Obtain a first maximum configuration weight from the current configuration weights of the scheduling objects with the first priority; If the first maximum configuration weight is greater than a second weight threshold, determine the scheduling object corresponding to the first maximum configuration weight as the first scheduling object scheduled in the scheduling period; If the first maximum configuration weight is less than or equal to the second weight threshold, obtain a second maximum configuration weight from the current configuration weights of all the scheduling objects, and determine the scheduling object corresponding to the second maximum configuration weight as the first scheduling object; Based on the target configuration weights, the sum of all the target configuration weights, and the current configuration weight of the (i - 1)-th scheduling object, update the current configuration weights of all the scheduling objects to obtain the updated current configuration weights of all the scheduling objects; where i is a positive integer greater than 1 and less than or equal to I, and I is the total number of rounds of scheduling all the scheduling objects in one scheduling period; Based on the updated current configuration weights and the scheduling objects with the first priority, determine the i-th scheduling object called in the scheduling period until the scheduling period is completed.
8. The method according to claim 7, wherein, the updating the current configuration weights of all the scheduling objects based on the target configuration weights, the sum of all the target configuration weights, and the current configuration weight of the (i - 1)-th scheduling object to obtain the updated current configuration weights of all the scheduling objects includes: Determine that the sum of the current configuration weight corresponding to the (i - 1)-th scheduling object and the target configuration weight, minus the sum of all the target configuration weights, is the updated current configuration weight of the (i - 1)-th scheduling object; Determine that the sum of the current configuration weights corresponding to the other scheduling objects except the (i - 1)-th scheduling object among all the scheduling objects and the target configuration weight is the updated current configuration weight of the other scheduling objects; where all the scheduling objects include the (i - 1)-th scheduling object and the other scheduling objects.
9. The method according to claim 7, wherein, the determining the i-th scheduling object called in the scheduling period based on the updated current configuration weights and the scheduling objects with the first priority includes: Obtain a third maximum configuration weight from the updated current configuration weights of the scheduling objects with the first priority; If the third maximum configuration weight is greater than the second weight threshold, determine the scheduling object corresponding to the third maximum configuration weight as the i-th scheduling object; If the third largest configured weight is less than or equal to the second weight threshold, obtain the fourth largest configured weight from the updated current configured weights corresponding to all the scheduling objects, and determine the scheduling object corresponding to the fourth largest configured weight as the i-th scheduling object.
10. A scheduling device, characterized in that the scheduling device includes: an obtaining module, configured to obtain the initial network bandwidths of all scheduling objects in a time-adaptive scheduler; an adjusting module, configured to adjust the initial network bandwidths of some of the all scheduling objects to obtain target network bandwidths, where all the target network bandwidths meet an adjustment condition; a processing module, configured to determine the target configured weight of each scheduling object based on the target network bandwidths of the some scheduling objects and the initial network bandwidths of the remaining scheduling objects among all the scheduling objects; the processing module is further configured to perform load balancing processing on all the scheduling objects based on the target configured weights to obtain the scheduling order of all the scheduling objects in multiple scheduling cycles, so that the time-adaptive scheduler schedules all the scheduling objects in each scheduling cycle according to the scheduling order.
11. A time-adaptive scheduler, characterized in that the time-adaptive scheduler includes: a processor, a memory, and a communication bus; the communication bus is configured to implement a communication connection between the processor and the memory; the processor is configured to execute a scheduling program stored in the memory to implement the scheduling method according to any one of claims 1 to 9.
12. A storage medium, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the scheduling method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Configuration method of network chip calendar under hybrid rate mode
CN108390832A
Bandwidth scheduling method and device
CN109039953A