Task scheduling method and device, electronic equipment and storage medium

By obtaining the historical task share value and full-load share value, dynamically adjusting the scheduling share value of the task queue, solving the problems of low task scheduling efficiency and waste of resources in the existing technology, and achieving more efficient resource utilization and scheduling efficiency.

CN119668809APending Publication Date: 2025-03-21INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411753625.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-02
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

When the prior art performs task scheduling in a distributed business system, static allocation will lead to waste of resources in some task queues and low scheduling efficiency.

Method used

By obtaining the task share values ​​of each task queue in the most recent historical scheduling rounds as the reference share values, dynamically adjusting the scheduling share values ​​of each task queue based on the full-load share values, thereby performing task scheduling.

Benefits of technology

Dynamically adjust the task scheduling ratio to avoid resource waste, improve task scheduling efficiency and server resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668809A_ABST
    Figure CN119668809A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a task scheduling method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a task share value of each task queue scheduled by each historical scheduling round in a plurality of recent historical scheduling rounds, and obtaining a plurality of reference share values of each task queue, each task queue is used for caching one task type in multiple task types; based on the full-load share value of each task queue and the corresponding reference share value, determining the scheduling share value of each task queue in the round; and based on the corresponding scheduling share value of the current round, performing scheduling of the current round on the tasks of the task queues. According to the embodiment of the invention, the utilization rate of server resources and the task scheduling efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed technology, and in particular to a task scheduling method, device, electronic equipment and storage medium. Background Art

[0002] In a business system, such as a distributed business system of a financial business, when there are a large number of business tasks that need to be processed, the prior art usually sets different task queues for different types of tasks to cache business tasks, and then uses server resources to pull the cached business tasks in each task queue, and distributes the business tasks to the execution nodes. When scheduling business tasks, the prior art will pull a corresponding number of tasks from each team based on a static ratio and then distribute them. However, when the number of tasks in some task queues is less than the number of tasks determined based on the static ratio, and the number of tasks in another part of the task queues is greater than the number of tasks determined based on the static ratio, the prior art task scheduling method based on static ratio will have the problem of wasting server resources and low task scheduling efficiency. Summary of the invention

[0003] The embodiments of the present invention provide a task scheduling method, device, electronic device and storage medium, which can further improve the utilization rate of server resources and improve the task scheduling efficiency.

[0004] In a first aspect, an embodiment of the present invention provides a task scheduling method, including:

[0005] Obtaining task share values ​​of each task queue scheduled in each of the most recent multiple historical scheduling rounds, and obtaining multiple reference share values ​​of each task queue, wherein each task queue is used to cache one task type among multiple task types;

[0006] Determine the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share values; and

[0007] Based on the corresponding current round scheduling share value, the tasks of each task queue are scheduled in this round.

[0008] In a second aspect, an embodiment of the present invention provides a task scheduling device, including:

[0009] A reference share value acquisition module is used to acquire the task share value of each task queue scheduled in each of the most recent multiple historical scheduling rounds, and obtain multiple reference share values ​​of each task queue, wherein each task queue is used to cache one task type among multiple task types;

[0010] A current-round scheduling share value acquisition module, used to determine the current-round scheduling share value of each task queue based on the full-load share value of each task queue and the corresponding reference share values; and

[0011] The scheduling module is used to schedule the tasks of each task queue in this round based on the corresponding scheduling share value of this round.

[0012] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a task scheduling method as described in any one of the embodiments of the present invention is implemented.

[0013] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a task scheduling method as described in any one of the embodiments of the present invention.

[0014] A task scheduling method, device, electronic device and storage medium provided by an embodiment of the present invention obtains each task share value of each task queue scheduled in each historical scheduling round in the most recent multiple historical scheduling rounds as a reference share value, and determines the current round scheduling share value of each task queue in the current round of task scheduling based on the full load share value of each task queue and the corresponding reference share value, and then schedules each task queue in the current round based on the corresponding current round scheduling share value. According to the change in the number of tasks to be scheduled in each task queue, the task scheduling ratio of each task queue can be dynamically adjusted, thereby helping to avoid wasting server resources, improve the throughput of the task scheduling system, and thus improve the utilization of server resources and improve the task scheduling efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0016] Figure 1 It is a flowchart of a task scheduling method provided by an embodiment of the present invention;

[0017] Figure 2 is another flowchart of the task scheduling method provided by an embodiment of the present invention;

[0018] Figure 3 is another flowchart of the task scheduling method provided by an embodiment of the present invention;

[0019] Figure 4 is another flowchart of the task scheduling method provided by an embodiment of the present invention;

[0020] Figure 5 is a structural diagram of a task scheduling device provided by an embodiment of the present invention;

[0021] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0022] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0024] Figure 1 The present invention provides a flowchart of a task scheduling method. The present invention is applicable to scenarios of multi-type multi-queue task scheduling. The method can be executed by a task scheduling device provided by the present invention. The device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated into an electronic device, such as a computer, a server, etc. The following embodiments will be described by taking the device integrated into an electronic device as an example. Figure 1 , the method may specifically include the following steps:

[0025] Step 101, obtain the task share value of each task queue scheduled by each historical scheduling round in the most recent multiple historical scheduling rounds, and obtain multiple reference share values ​​of each task queue, each task queue is used to cache one task type among multiple task types. This step can obtain the task share value of each task queue scheduled by the most recent multiple scheduling rounds as the reference share value of the corresponding task queue, so as to facilitate the determination of the current round scheduling share value of each task queue with reference to the corresponding reference share value when performing the current round task scheduling.

[0026] Specifically, the above-mentioned multiple task types may be, for example, multiple business tasks of the online banking system, which may specifically include: a task of sending a text message verification code, a task of sending value-added service information, and a task of sending a repayment reminder information.

[0027] In an optional specific embodiment, the process of obtaining the task share value of each task queue scheduled in each of the most recent multiple historical scheduling rounds includes:

[0028] The task share value of each task queue scheduled in each of the most recent multiple historical scheduling rounds is obtained through a sliding observation window of a preset size.

[0029] Specifically, by obtaining the task share value of each task queue scheduled in each of the most recent multiple historical scheduling rounds through a sliding observation window of a preset size, accurate reference share value data can be easily obtained.

[0030] Specifically, the reference share value may also be obtained by other methods in the prior art, such as polling.

[0031] Specifically, the sizes of the sliding observation windows of the various task queues may be set to be the same or different.

[0032] Specifically, the size of the sliding window may be set based on empirical data, or may be set based on a characteristic of a change in the number of tasks in a corresponding task queue.

[0033] In an optional instance, the size of the sliding observation window of each task queue is set to 6, that is, the sliding observation window is used each time to obtain the task share value of each task queue scheduled in the last 6 historical scheduling rounds, and the reference share value of each task queue includes 6 reference share values.

[0034] Step 102, determining the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share value. This step determines the current round scheduling share value of each task queue with reference to the task share value of each task queue scheduled in the most recent scheduling round, and can dynamically adjust the task scheduling ratio of each task queue according to the changes in the schedulable tasks in each task queue.

[0035] Specifically, the full load share value of each of the above task queues may be predetermined according to the service characteristics of the corresponding queue.

[0036] In a specific example, the task queues include: queue 1, queue 2 and queue 3. The initially set scheduling share ratio is 1:1:1, and the full load share values ​​of the three queues are all 30.

[0037] Optionally, the process of determining the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share values ​​includes: determining the current round scheduling share value based on the full load share value of each task queue, the corresponding reference share values ​​and the task scheduling priority of each task queue.

[0038] Specifically, the above scheduling priorities can be predetermined based on the business characteristics of the task types corresponding to each task queue. For example, for a scenario including three task queues of three types, namely, SMS verification code sending tasks, repayment reminder information sending tasks, and value-added service information sending tasks, the scheduling priorities of the task queues corresponding to the SMS verification code sending tasks, the repayment reminder information sending tasks, and the value-added service information sending tasks can be determined to decrease in sequence, that is, the scheduling priority of the task queue corresponding to the SMS verification code sending tasks is the highest level 3, the scheduling priority of the task queue corresponding to the repayment reminder information sending tasks is the higher level 2, and the scheduling priority of the task queue corresponding to the value-added service information sending tasks is the lower level 1.

[0039] Optionally, the above process of determining the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share values ​​includes: determining the current round scheduling ratio of each task queue based on the full load share value of each task queue and the corresponding reference share values, and determining the current round scheduling share value of each task queue based on the corresponding current round scheduling ratio.

[0040] It can be understood that based on the task share values ​​of each task queue scheduled in each historical scheduling round in the most recent multiple scheduling rounds, queues with more full-load rounds and more under-load rounds in each task queue can be determined. A large number of full-load rounds indicates that the number of tasks that need to be scheduled in the corresponding queue is large, and a large number of under-load rounds indicates that the number of tasks that need to be scheduled in the corresponding queue is small. Therefore, based on the task share values ​​of each task queue scheduled in each historical scheduling round in the most recent multiple scheduling rounds, the proportion of the current round of scheduling shares corresponding to the task queue with a small number of tasks to be scheduled can be reduced, and at the same time, the proportion of the current round of scheduling shares corresponding to the task queue with a large number of tasks to be scheduled can be increased, thereby avoiding wasting server resources and improving task scheduling efficiency.

[0041] Step 103, based on the corresponding current round scheduling share value, perform current round scheduling on the tasks of each task queue. Based on step 101 and step 102, this step obtains the task share values ​​of each task queue scheduled in each historical scheduling round in the most recent multiple historical scheduling rounds as reference share values, and determines the current round scheduling share value of each task queue in the current round of task scheduling based on the full load share value of each task queue and the corresponding reference share values, and then performs current round scheduling on each task queue based on the corresponding current round scheduling share value, which can dynamically adjust the task scheduling ratio of each task queue according to the change in the number of tasks to be scheduled in each task queue, thereby helping to avoid wasting server resources, improve the throughput of the task scheduling system, and thus improve the utilization of server resources and improve task scheduling efficiency.

[0042] Specifically, the process of scheduling tasks in each task queue in this round based on the corresponding scheduling share value in this round may include: pulling business tasks with corresponding scheduling share values ​​in this round from each task queue, and distributing the corresponding business tasks to corresponding task execution nodes.

[0043] The following further describes the task scheduling method provided by the embodiment of the present invention. Figure 2 As shown, Figure 1 Step 102 in may include the following steps:

[0044] Step 1021 : For each task queue, when each reference share value of the current task queue is less than the full load share value of the current task queue, the current task queue is determined as the lending queue of this round.

[0045] Specifically, when the number of reference share values ​​of the current task queue that is smaller than the corresponding full-load share value exceeds a certain number, the current task queue may be determined as the lending queue of this round.

[0046] In an optional specific example, the reference share values ​​of each task queue are shown in Table 1:

[0047]

[0048] Table 1

[0049] In this example, the full load share values ​​of queue 1, queue 2, and queue 3 are all 30. Since each reference share value of queue 2 is less than 30, queue 2 is determined as the lending queue in this round.

[0050] Step 1022: determine the maximum reference share value among the multiple reference share values ​​of the current task queue as the current round scheduling share value of the current task queue.

[0051] Specifically, the average value or median value of multiple reference share values ​​may also be determined as the current round scheduling share value of the current task queue.

[0052] In a specific example, when the reference share values ​​of each task queue are as shown in Table 1, the maximum share among the multiple reference shares 20, 20, 10, 10, 8 and 6 of the current lending queue, i.e., queue 2, i.e., 20, is determined as the scheduling share value of queue 2 in this round.

[0053] Step 1023, calculate the difference between the full load share value of the current task queue and the maximum reference share value, and obtain the share value of the current task queue lent out in this round.

[0054] In a specific example, when the reference share values ​​of each task queue are as shown in Table 1, queue 2 is the lending queue for this round. The full load share value 30 of queue 2 minus the maximum reference share value 20 of queue 2 is calculated to obtain the share value 10 of queue 2 for this round.

[0055] Step 1024, calculate the sum of the share value lent out by the current task queue in this round and the share value lent out by other lending queues in this round, and obtain the share value available for lending in this round.

[0056] Specifically, when the lending queue in this round only includes the current task queue, the share value lent out in this round by the current task queue is directly determined as the share value available for lending in this round.

[0057] In a specific example, when the reference share values ​​of each task queue are as shown in Table 1, the current round of lending queues only includes queue 2, and the current round of lending share value of queue 2 is directly determined as the current round of borrowable share value.

[0058] Step 1025: Determine the current round scheduling share value of the current round borrowing queue based on the current round borrowable share value.

[0059] Optionally, the above process of determining the scheduling share value of the current round of the borrowing queue based on the borrowable share value of the current round includes: when the number of borrowing queues in the current round is 1, directly calculating the sum of the full load share value of the borrowing queue in the current round and the borrowable share value of the current round to obtain the scheduling share value of the current round of the borrowing queue in the current round.

[0060] In an optional specific embodiment, if Figure 3 As shown, before step 1025, the task scheduling method provided by the present invention further includes:

[0061] Step 102A1 , for each task queue, when the number of reference share values ​​less than the corresponding full load share value among the multiple reference share values ​​of the current task queue is no more than a preset number threshold, the current task queue is determined as the queue to be borrowed in this round.

[0062] Specifically, the preset number threshold may be set based on empirical data or after multiple tests and according to test results. For example, when the number of reference share values ​​of each task queue is 6, the preset number threshold may be set to 2.

[0063] In a specific example, when the reference share values ​​of each task queue are as shown in Table 1, the number of reference share values ​​of queue 1 and queue 3 that are less than the corresponding full load share value is 0, which is less than 2. Therefore, queue 1 and queue 2 are determined as the queues to be borrowed in this round.

[0064] Step 102A2: determine the current round borrowing queue based on the current round proposed borrowing queue.

[0065] Optionally, there are multiple queues to be borrowed in this round, and the process of determining the borrowing queue in this round based on the queues to be borrowed in this round includes:

[0066] Based on the borrowing priorities of the queues to be borrowed in this round, a borrowing queue for this round is determined from the multiple queues to be borrowed in this round.

[0067] Specifically, the borrowing priority of each of the queues to be borrowed in this round may be determined based on the task scheduling priority of the corresponding task queue. Specifically, the task scheduling priority of the corresponding task queue may be determined as the borrowing priority of the task queue.

[0068] Optionally, the above process of determining the borrowing queue for this round from multiple borrowing queues for this round based on the borrowing priorities of each borrowing queue for this round includes: determining one or more borrowing queues for this round with the highest borrowing priority among the multiple borrowing queues for this round as the borrowing queues for this round, and obtaining one or more borrowing queues for this round accordingly.

[0069] In a specific example, for the queues to be borrowed in this round, which include queue 1 and queue 3, queue 1 with the highest borrowing priority is determined as the borrowing queue in this round.

[0070] Specifically, the embodiment of the present invention determines the current round of borrowing queues from the current round of proposed borrowing queues based on the priority, which helps the teams with higher priorities to obtain more server resources.

[0071] Optionally, when the number of queues to be borrowed in this round is one, the process of determining the borrowing queue in this round based on the queues to be borrowed in this round includes: directly determining the one queue to be borrowed as the borrowing queue in this round.

[0072] In a specific example, for the only borrowing queue 1 in this round, the sum of the full load share value 30 of queue 1 and the borrowable share value 10 in this round is calculated to obtain the scheduling share value 40 of queue 1 in this round.

[0073] In an optional specific embodiment, if Figure 3 As shown, before step 1025, the task scheduling method provided by the present invention further includes:

[0074] In step 102B, for each task queue, when the number of reference share values ​​less than the corresponding full load share value among the multiple reference share values ​​of the current task queue is no more than a preset number threshold, the current task queue is determined as the current round borrowing queue.

[0075] In an optional specific embodiment, the process of determining the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share value includes:

[0076] For each task queue, when, among the multiple reference share values ​​of the current task queue, the number of reference share values ​​that are smaller than the corresponding full load share value is greater than a preset number threshold and less than the total number of the multiple reference share values ​​of the current task queue, the full load share value of the current task queue is used to determine the current round scheduling share value of the current task queue.

[0077] Optionally, the aforementioned process of determining the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share values ​​includes: for each unsuccessful queue that has not been determined as the current round borrowing queue among the aforementioned multiple current round of proposed borrowing queues, the full load share value of the current unsuccessful queue is determined as the current round scheduling share value of the current unsuccessful queue.

[0078] In a specific example, for the queues 1 and 3 included in the current round of borrowing queues, since queue 3 is a failed queue that is not determined as the current round of borrowing queues, the full load share value 30 of queue 3 is determined as the scheduling share value of queue 3 in this round.

[0079] The embodiment of the present invention lends the task share of the corresponding task queue when each reference share value is less than the corresponding full-load share value. This can determine that the number of tasks in a task queue is small and the task share can be lent out only when the task queue is underloaded for multiple consecutive times. The lent share can be controlled to a minimum, thereby avoiding the impact on the normal task scheduling of the task queue as much as possible and maximizing the use of server resources for scheduling the task queue.

[0080] The task scheduling method provided by the embodiment of the present invention is further described below.

[0081] Optionally, there are multiple borrowing queues in this round.

[0082] Optional, such as Figure 4 As shown, Figure 2 and Figure 3 Step 1025 in may include the following steps:

[0083] Step 1025a: Determine the borrowing share ratio of each borrowing queue in this round based on the borrowing priority of each borrowing queue in this round.

[0084] Optionally, the process of determining the borrowing share ratio of each borrowing queue in the current round based on the borrowing priority of each borrowing queue in the current round may be performed based on the following formula:

[0085]

[0086] Among them, P i Indicates the borrowing share ratio of the i-th task queue; a is a constant that can be set based on experience; i p Indicates the borrowing priority of the i-th task queue.

[0087] Specifically, the borrowing share ratio of each borrowing queue in this round may also be determined based on a predetermined fixed ratio corresponding to each borrowing priority, or an initial scheduling share ratio of each access queue in this round.

[0088] Step 1025b: Determine the current round borrowing share value of each current round borrowing queue based on the current round borrowable share value and the borrowing share ratio of each current round borrowing queue.

[0089] Specifically, the product of the current round borrowable share value and the corresponding borrowing share ratio may be calculated, and the current round borrowing share value of each current round borrowing queue may be obtained based on the corresponding product.

[0090] Step 1025c: Determine the current round scheduling share value of each current round borrowing queue based on the current round borrowing share value and the full load share value of each current round borrowing queue.

[0091] Specifically, the sum of the current-round borrowing share value and the full-load share value of each current-round borrowing queue may be calculated to obtain the current-round scheduling share value of each current-round borrowing queue.

[0092] The embodiment of the present invention determines the borrowing shares of multiple borrowing queues in this round by corresponding borrowing priorities, so that the borrowing queues in this round with higher borrowing priorities have higher borrowing shares in this round, so that high-priority tasks can get priority in resource use, ensuring that high-priority tasks can be processed first, thereby improving user experience.

[0093] Figure 5 is a structural diagram of a task scheduling device provided by an embodiment of the present invention, and the device is suitable for executing the task scheduling method provided by an embodiment of the present invention. Figure 5 As shown, the device may specifically include:

[0094] The reference share value acquisition module 501 is used to acquire the task share values ​​of each task queue scheduled by each historical scheduling round in the most recent multiple historical scheduling rounds, and obtain multiple reference share values ​​of each task queue, each task queue is used to cache one task type among multiple task types. The task share value of each task queue scheduled by the most recent scheduling round can be acquired as the reference share value of the corresponding task queue, so as to facilitate the determination of the current round scheduling share value of each task queue with reference to the corresponding reference share value when performing the current round task scheduling.

[0095] Optionally, the reference share value acquisition module 501 can be specifically used to acquire the task share value of each task queue scheduled in each of the most recent multiple historical scheduling rounds through a sliding observation window of a preset size.

[0096] The current round scheduling share value acquisition module 502 is used to determine the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share value. The current round scheduling share value of each task queue can be determined with reference to the task share value of each task queue scheduled in the most recent scheduling round, and the task scheduling ratio of each task queue can be dynamically adjusted according to the change in the number of schedulable tasks in each task queue.

[0097] Optionally, the current round scheduling share value acquisition module 502 can be specifically used to, for each task queue, determine the current task queue as the current round lending queue when each reference share value of the current task queue is less than the full load share value of the current task queue;

[0098] Determine the maximum reference share value among multiple reference share values ​​of the current task queue as the current round scheduling share value of the current task queue;

[0099] Calculate the difference between the full load share value of the current task queue and the maximum reference share value to get the share value of the current task queue lent out in this round;

[0100] Calculate the sum of the loaned shares of the current task queue and the loaned shares of other loan queues to obtain the loanable shares; and

[0101] The current round scheduling share value of the current round borrowing queue is determined based on the current round borrowable share value.

[0102] Optionally, the current round scheduling share value acquisition module 502 can be specifically used to, for each task queue, determine the current task queue as the current round proposed borrowing queue when the number of reference share values ​​less than the corresponding full load share value among multiple reference share values ​​of the current task queue is no more than a preset number threshold; and determine the current round borrowing queue based on the current round proposed borrowing queue; or

[0103] For each task queue, when the number of reference share values ​​less than the corresponding full load share value among the multiple reference share values ​​of the current task queue is no more than a preset number threshold, the current task queue is determined as the borrowing queue for this round.

[0104] Optionally, there are multiple queues to be borrowed in this round.

[0105] Optionally, there are multiple borrowing queues in this round.

[0106] Optionally, the current-round scheduling share value acquisition module 502 can be specifically configured to determine a current-round borrowing queue from a plurality of current-round borrowing queues based on the borrowing priorities of the current-round borrowing queues.

[0107] Optionally, the current round scheduling share value acquisition module 502 can be specifically used to determine the borrowing share ratio of each current round borrowing queue based on the borrowing priority of each current round borrowing queue;

[0108] Determine the current round borrowing share value of each current round borrowing queue based on the current round borrowable share value and the borrowing share ratio of each current round borrowing queue; and

[0109] Based on the current-round borrowing share value and the full-load share value of each current-round borrowing queue, the current-round scheduling share value of each current-round borrowing queue is determined.

[0110] Scheduling module 503 is used to schedule the tasks of each task queue in this round based on the corresponding share value of this round of scheduling. In combination with modules 501 and 502, by obtaining the task share values ​​of each task queue scheduled in each historical scheduling round in the most recent multiple historical scheduling rounds as reference share values, and based on the full load share value of each task queue and the corresponding reference share values, the current scheduling share value of each task queue in this round of task scheduling is determined, and then the current scheduling of each task queue is performed based on the corresponding share value of this round of scheduling. According to the change in the number of tasks to be scheduled in each task queue, the task scheduling ratio of each task queue can be dynamically adjusted, thereby helping to avoid wasting server resources, improve the throughput of the task scheduling system, and thus improve the utilization of server resources and improve the efficiency of task scheduling.

[0111] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. The specific working process of the functional modules described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0112] An embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the task scheduling method provided in any of the above embodiments when executing the program.

[0113] An embodiment of the present invention further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the task scheduling method provided by any of the above embodiments is implemented.

[0114] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the task scheduling method as described in any one of the embodiments of the present invention.

[0115] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of an electronic device suitable for implementing an embodiment of the present invention. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0116] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0117] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0118] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.

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

[0120] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0121] The modules and / or units involved in the embodiments of the present invention may be implemented in software or hardware. The modules and / or units described may also be set in a processor, for example, may be described as: a processor includes a reference share value acquisition module, a current round scheduling share value acquisition module and a scheduling module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0122] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device implements: obtaining the task share values ​​of each task queue scheduled by each historical scheduling round in the most recent multiple historical scheduling rounds, obtaining multiple reference share values ​​of each task queue, each task queue is used to cache one task type among multiple task types; determining the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share values; and scheduling the tasks of each task queue in this round based on the corresponding current round scheduling share value.

[0123] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A task scheduling method, characterized in that: include: Obtaining task share values ​​of each task queue scheduled in each of the most recent multiple historical scheduling rounds, and obtaining multiple reference share values ​​of each task queue, wherein each task queue is used to cache one task type among multiple task types; Determine the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share values; as well as Based on the corresponding current round scheduling share value, the tasks of each task queue are scheduled in this round.

2. The task scheduling method according to claim 1, characterized in that: The obtaining of the task share value of each task queue scheduled in each of the most recent multiple historical scheduling rounds includes: The task share value of each task queue scheduled in each of the most recent multiple historical scheduling rounds is obtained through a sliding observation window of a preset size.

3. The task scheduling method according to claim 1, characterized in that: The determining of the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share values ​​includes: For each task queue, when each reference share value of the current task queue is less than the full load share value of the current task queue, the current task queue is determined as the lending queue of this round; Determine the maximum reference share value among multiple reference share values ​​of the current task queue as the current round scheduling share value of the current task queue; Calculate the difference between the full load share value of the current task queue and the maximum reference share value to obtain the share value of the current task queue lent out in this round; Calculate the sum of the loaned shares of the current task queue and the loaned shares of other loan queues to obtain the loanable shares; and The current round scheduling share value of the current round borrowing queue is determined based on the current round borrowable share value.

4. The task scheduling method according to claim 3, characterized in that: Before determining the current round scheduling share value of the current round borrowing queue based on the current round borrowable share value, the task scheduling method further includes: For each task queue, when the number of reference share values ​​less than the corresponding full load share value among the multiple reference share values ​​of the current task queue is no more than a preset number threshold, the current task queue is determined as the queue to be borrowed in this round; and the borrowing queue in this round is determined based on the queue to be borrowed in this round; or For each task queue, when the number of reference share values ​​less than the corresponding full load share value among the multiple reference share values ​​of the current task queue is no more than a preset number threshold, the current task queue is determined as the borrowing queue for this round.

5. The task scheduling method according to claim 4, characterized in that: The number of queues to be borrowed in this round is multiple; The determining the current round borrowing queue based on the current round proposed borrowing queue includes: Based on the borrowing priorities of the queues to be borrowed in this round, the borrowing queue in this round is determined from a plurality of the queues to be borrowed in this round.

6. The task scheduling method according to claim 4 or 5, characterized in that: The number of the borrowing queues in this round is multiple, and determining the scheduling share value of the borrowing queue in this round based on the borrowable share value in this round includes: Determine the borrowing share ratio of each borrowing queue in this round based on the borrowing priority of each borrowing queue in this round; Determining the current round borrowing share value of each current round borrowing queue based on the current round borrowable share value and the borrowing share ratio of each current round borrowing queue; and Based on the current-round borrowing share values ​​and the full-load share values ​​of the current-round borrowing queues, the current-round scheduling share values ​​of the current-round borrowing queues are determined.

7. The task scheduling method according to claim 1, characterized in that: The determining of the current round scheduling share value of each task queue based on the full load share value of each task queue and the corresponding reference share values ​​includes: For each task queue, when, among the multiple reference share values ​​of the current task queue, the number of reference share values ​​that are smaller than the corresponding full load share value is greater than a preset number threshold and less than the total number of the multiple reference share values ​​of the current task queue, the full load share value of the current task queue is used to determine the current round scheduling share value of the current task queue.

8. A task scheduling device, characterized in that: include: A reference share value acquisition module is used to acquire the task share value of each task queue scheduled in each of the most recent multiple historical scheduling rounds, and obtain multiple reference share values ​​of each task queue, wherein each task queue is used to cache one task type among multiple task types; A current-round scheduling share value acquisition module, used to determine the current-round scheduling share value of each task queue based on the full-load share value of each task queue and the corresponding reference share values; as well as The scheduling module is used to schedule the tasks of each task queue in this round based on the corresponding scheduling share value of this round.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the task scheduling method as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the task scheduling method as described in any one of claims 1 to 7 is implemented.