Task scheduling method and device, electronic equipment and storage medium

By calculating unit busyness and the number of non-monitoring tasks, identifying the target server and executing the rebalancing strategy, the algorithm task load balancing problem in distributed deployment scenarios is solved, and the rationalization and maximum utilization of resources and normal execution of tasks are achieved.

CN120295723APending Publication Date: 2025-07-11SIEMENS (CHINA) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510277263.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-07-11

AI Technical Summary

Technical Problem

In distributed deployment scenarios, the load balancing problem of algorithm tasks leads to unbalanced resource utilization of algorithm servers, making it difficult to allocate tasks efficiently, flexibly and cost-controllable.

Method used

By calculating the unit busyness of the algorithm server and the number of non-monitoring tasks, identifying the target server for task allocation, and performing a rebalancing strategy when an exception or load imbalance is detected, ensuring the balanced allocation of tasks and the rational utilization of resources.

Benefits of technology

It realizes load balancing of algorithm tasks in distributed deployment scenarios, improves resource utilization, ensures the normal execution of tasks and the rational and maximized utilization of server hardware resources, and adapts to dynamic expansion and capacity scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120295723A_ABST
    Figure CN120295723A_ABST
Patent Text Reader

Abstract

The invention provides a task scheduling method and device, electronic equipment and a storage medium. The task scheduling method comprises the following steps: acquiring a to-be-allocated algorithm task and a busy degree list, identifying the to-be-allocated algorithm task, if the to-be-allocated algorithm task is a non-monitoring task, rejecting each algorithm server of which the number of the non-monitoring tasks reaches a given upper limit number from the busy degree list, and if the to-be-allocated algorithm task is a non-monitoring task, executing the busy degree list; and determining the algorithm server with the minimum unit busy degree in the busy degree list as a target server, and allocating the to-be-allocated algorithm task to the target server. Therefore, the load balancing of each kernel in each algorithm server in a distributed deployment scene can be realized, so that the hardware resources of each algorithm server are utilized to the maximum extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular, to a task scheduling method, apparatus, electronic device, storage medium, and computer program product. Background Art

[0002] With the rapid development of artificial intelligence technology, algorithm models have been widely used in various fields such as the Internet, finance, transportation, healthcare, industry, and education. As the number of algorithm tasks gradually increases, the pressure on algorithm servers also increases. Deploying multiple algorithm tasks to multiple algorithm servers for concurrent execution to improve task processing efficiency is the mainstream solution in the industry currently.

[0003] However, in practical applications, due to the different running intervals of different algorithm tasks, the system resource consumption required by different algorithm models is also different. Therefore, developing an efficient, flexible, and cost - controllable task scheduling strategy to ensure the load balance of different algorithm servers has become an urgent technical issue to be solved. Summary of the Invention

[0004] In view of this, this application provides a task scheduling solution, which can solve the problem of balanced allocation of algorithm tasks in a distributed deployment scenario, and rationally and maximally utilize the hardware resources of algorithm servers.

[0005] According to the first aspect of the embodiments of this application, a task scheduling method is provided, including: obtaining algorithm tasks to be allocated and a busyness list, where the algorithm tasks to be allocated are identified as one of monitoring tasks and non - monitoring tasks, and the busyness list is used to record the respective unit busyness of each algorithm server and the number of each non - monitoring task; identifying the algorithm tasks to be allocated, and if the algorithm tasks to be allocated are non - monitoring tasks, removing each algorithm server with the number of non - monitoring tasks reaching a given upper limit number from the busyness list; determining the algorithm server with the smallest unit busyness in the busyness list as the target server, and allocating the algorithm tasks to be allocated to the target server; where the unit busyness of any algorithm server in the busyness list is calculated based on the task busyness of each algorithm task in the algorithm server and the number of cores of the algorithm server, and the number of non - monitoring tasks of any algorithm server is determined based on the total number of all non - monitoring tasks in the algorithm server.

[0006] In some embodiments, the busyness list can be obtained through the following methods:

[0007] Identify the identification information of each allocated algorithm task in each algorithm server, and calculate the task busy degree of each algorithm task in each algorithm server; obtain the total task busy degree of each algorithm server according to the sum of the task busy degrees of each task in each algorithm server; obtain the unit busy degree of each algorithm server according to the total task busy degree of each algorithm server and the number of cores of each algorithm server; integrate the unit busy degrees of each algorithm server to obtain the busy degree list.

[0008] In some embodiments, the task busy degree of any algorithm task can be calculated in the following way:

[0009] Determine any algorithm task as the current task; identify the identification information of the current task. If the current task is a monitoring task, obtain the execution interval time of the current task. If the current task is a non-monitoring task, determine the given reference interval time as the execution interval time of the current task; obtain the number of executions of the current task within a given unit time according to the execution interval time of the current task, and obtain the task busy degree of the current task according to the number of executions of the current task within the given unit time and the execution weight of the current task.

[0010] In some embodiments, a task allocation request for the to-be-allocated algorithm task can be sent to the target server; if the request response to the task allocation request is not obtained from the target server within a given response time, remove the target server from the busy degree list, and re-execute the step of determining the algorithm server with the smallest unit busy degree in the busy degree list as the target server.

[0011] In some embodiments, the method further includes: in response to a rebalancing execution request, determine the algorithm server with the highest unit busy degree in the busy degree list as the server to be balanced; obtain the to-be-allocated busy degree of the server to be balanced according to the sum of the task busy degrees of each algorithm task in the server to be balanced and a given rebalancing allocation ratio; determine at least one pending task from each algorithm task according to the to-be-allocated busy degree and the task busy degree of each algorithm task in the server to be balanced; determine each pending task as a new to-be-allocated algorithm task.

[0012] In some embodiments, the candidate task determination step may be executed to determine, as a candidate task, an algorithm task in the server to be balanced that has the highest task busy degree and is not identified as a processed task or a pending task; compare the task busy degree of the candidate task with the busy degree to be allocated. If the task busy degree of the candidate task exceeds the busy degree to be allocated, mark the candidate task as a processed task; if the task busy degree of the candidate task does not exceed the busy degree to be allocated, mark the candidate task as a pending task, and update the current value of the busy degree to be allocated according to the difference between the busy degree to be allocated and the task busy degree of the candidate task to obtain the updated value of the busy degree to be allocated; return to execute the candidate task determination step until each algorithm task in the server to be balanced is marked as a processed task or a pending task.

[0013] In some embodiments, the rebalancing execution request may be generated in the following manner:

[0014] Determine the algorithm server with the highest unit busy degree and the algorithm server with the lowest unit busy degree in the busy degree list as the busiest server and the least busy server respectively; calculate the busy degree ratio between the unit busy degree of the busiest server and the unit busy degree of the least busy server. If the busy degree ratio exceeds the given rebalancing ratio, generate the rebalancing execution request.

[0015] In some embodiments, the given rebalancing allocation ratio is determined based on the given rebalancing ratio.

[0016] In some embodiments, the given rebalancing ratio is 3, and the given rebalancing allocation ratio is between 33% and 35%.

[0017] According to a second aspect of the embodiments of the present application, a task scheduling device is provided, including: an acquisition module, configured to acquire algorithm tasks to be allocated and a busyness list, where the algorithm tasks to be allocated are identified as one of monitoring tasks and non-monitoring tasks, and the busyness list is used to record the respective unit busyness of each algorithm server and the number of each non-monitoring task; an analysis module, configured to identify the algorithm tasks to be allocated, and if the algorithm tasks to be allocated are non-monitoring tasks, remove each algorithm server with the number of non-monitoring tasks reaching a given upper limit number from the busyness list; a scheduling module, configured to determine the algorithm server with the smallest unit busyness in the busyness list as the target server, and allocate the algorithm tasks to be allocated to the target server; where the unit busyness of any algorithm server in the busyness list is calculated according to the task busyness of each algorithm task in the algorithm server and the number of cores of the algorithm server, and the number of non-monitoring tasks of any algorithm server is determined according to the total number of all non-monitoring tasks in the algorithm server.

[0018] According to a third aspect of the embodiments of the present application, an electronic device is provided, including: a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform the operations corresponding to the task scheduling method described in the first aspect.

[0019] According to a fourth aspect of the embodiments of the present application, a computer-readable storage medium is provided, on which computer instructions are stored, and when the computer instructions are executed by a processor, the processor is caused to perform the task scheduling method described in the first aspect

[0020] According to a fifth aspect of the embodiments of the present application, a computer program product is provided, including computer instructions, and the computer instructions instruct a computing device to perform the operations corresponding to the task scheduling method described in the first aspect.

[0021] The task scheduling solutions provided by the embodiments of the present application perform task scheduling according to the unit busyness of each algorithm server to achieve balanced allocation of each algorithm task in a distributed deployment scenario. In addition, by classifying algorithm tasks into monitoring tasks (i.e., loop execution tasks) and non-monitoring tasks (i.e., one-time execution tasks), and setting the execution quantity of non-monitoring tasks of each algorithm server, it can be ensured that the operation of monitoring tasks will not be affected.

[0022] The task scheduling solutions provided in the embodiments of the present application can calculate the unit busyness of an algorithm server according to the task types of the algorithm tasks already allocated in the algorithm server and the number of cores of the algorithm server, achieving load balancing among the cores in each algorithm server and enabling rational and maximized utilization of the hardware resources of each algorithm server.

[0023] The task scheduling solutions provided in the embodiments of the present application can calculate the task busyness according to the execution interval of the algorithm tasks, providing a unified busyness measurement standard for different types of algorithm tasks, ensuring the objectivity of the calculation results of the total task busyness of each algorithm server, and improving the technical effect of balanced allocation of algorithm tasks in a distributed deployment scenario.

[0024] When detecting that the communication status of an algorithm server is abnormal, the task scheduling solutions provided in the embodiments of the present application can automatically suspend each algorithm task in the abnormal server and wait for reallocation to ensure the normal execution of the algorithm tasks.

[0025] By detecting whether a request response from an algorithm server is received within a given response time, the task scheduling solutions provided in the embodiments of the present application can ensure that algorithm tasks are successfully allocated to the algorithm server for execution and can promptly exclude the abnormal server from the task scheduling operation, improving the execution efficiency of task scheduling.

[0026] By executing a rebalancing strategy, the task scheduling solutions provided in the embodiments of the present application can always ensure load balancing among algorithm servers in the event of server downtime, dynamic scaling of server resources, etc. In addition, by determining the busyness to be allocated of the server to be balanced and performing task reallocation processing on the server to be balanced, the execution efficiency of the rebalancing operation can be improved on the premise of ensuring balanced allocation of server hardware resources.

[0027] When the busyness ratio of the unit busyness between the busiest server and the least busy server exceeds a given rebalancing ratio during comparison, the task scheduling solutions provided in the embodiments of the present application trigger the execution of a rebalancing operation, which can improve the execution effect of the rebalancing operation.

[0028] The task scheduling solutions provided in the embodiments of the present application determine the rebalancing allocation ratio based on a given rebalancing ratio to reasonably plan the rebalancing allocation of algorithm tasks and achieve rational and maximized utilization of server hardware resources. Description of the Drawings

[0029] Figure 1 It is a schematic diagram of the system architecture suitable for implementing the task scheduling method and device in the embodiments of the present application.

[0030] Figure 2 It is a processing flow chart of the task scheduling method in an exemplary embodiment of the present application.

[0031] Figures 3 to 6 It is a processing flowchart of the task scheduling method for other exemplary embodiments of this application.

[0032] Figure 7 It is a schematic framework diagram of the task scheduling device for the exemplary embodiment of this application.

[0033] Figure 8 It is a schematic diagram of the electronic device for the exemplary embodiment of this application.

[0034] List of reference numerals:

[0035] 200, Task scheduling method

[0036] 202. Obtain the algorithm tasks to be allocated and the list of busy degrees

[0037] 204. Determine whether the algorithm task to be allocated is a monitoring task. If not, proceed to step 206; if so, proceed to step 208

[0038] 206. Exclude each algorithm server with the number of non-monitoring tasks reaching the given upper limit number from the list of busy degrees, and continue to step 208. 208. Determine the algorithm server with the minimum unit busy degree in the list of busy degrees as the target server, and allocate the algorithm task to be allocated to the target server

[0039] 300, Task scheduling method

[0040] 302. In response to the registration request of the algorithm server, obtain the server identifier of the algorithm server. 304. Determine whether the server identifier of the algorithm server exists in the registration information table. If not, execute step 306; if so, execute step 308. 306. Add the registration information of the algorithm server to the registration information table, and execute step 308. 308. Based on the given update interval time, periodically update the unit busy degrees and the number of non-monitoring tasks corresponding to each algorithm server in the registration information table to obtain the updated list of busy degrees

[0041] 400, Task scheduling method

[0042] 402. In response to the rebalancing execution request, determine the algorithm server with the highest unit busy degree in the list of busy degrees as the server to be balanced

[0043] 404. Obtain the busy degree to be allocated for the server to be balanced according to the sum of the task busy degrees of each algorithm task in the server to be balanced and the given rebalancing allocation ratio

[0044] 406. Determine at least one suspended task from each algorithm task according to the busy degree to be allocated and the task busy degrees of each algorithm task in the server to be balanced

[0045] 408. Determine each suspended task as a new algorithm task to be assigned.

[0046] 500. Task scheduling method

[0047] 502. Determine an algorithm task with the highest task busy degree in the server to be balanced and not marked as a processed task or a suspended task as a candidate task.

[0048] 504. Determine whether the task busy degree of the candidate task exceeds the busy degree to be assigned. If it exceeds, execute step 506; if not, execute step 508. 506. Mark the candidate task as a processed task and proceed to step 510. 508. Mark the candidate task as a suspended task, update the current value of the busy degree to be assigned according to the difference between the busy degree to be assigned and the task busy degree of the candidate task to obtain an updated value of the busy degree to be assigned, and proceed to step 510. 510. Determine whether each algorithm task in the server to be balanced is marked as a processed task or a suspended task. If so, proceed to step 408; if not, return to step 502.

[0049] 600. Task scheduling method

[0050] 602. Determine the rebalancing execution time of the busy degree list.

[0051] 604. Determine whether the current time meets the rebalancing execution time. If it meets, execute step 606; otherwise, repeat this step. 606. Determine an algorithm server with the highest unit busy degree and an algorithm server with the lowest unit busy degree in the busy degree list as the busiest server and the least busy server respectively.

[0052] 608. Calculate the busy degree ratio between the unit busy degree of the busiest server and the unit busy degree of the least busy server. 610. Determine whether the busy degree ratio between the busiest server and the least busy server exceeds a given rebalancing ratio. If it exceeds, proceed to step 612; if not, return to step 602.

[0053] 612. Generate a rebalancing execution request.

[0054] 100. System architecture 704. Analysis module 806. Memory

[0055] 102. Task scheduler 706. Scheduling module 808. Communication bus

[0056] 104a - 104c. Algorithm servers 800. Electronic device 810. Program

[0057] 700. Task scheduling device 802. Processor

[0058] 702, Acquisition Module 804, Communication Interface Detailed Implementation Manner

[0059] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with 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. Based on the embodiments in the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art shall fall within the protection scope of the embodiments of the present application.

[0060] Some embodiments of the present application will be described in detail below in conjunction with the accompanying drawings. Without conflict between the embodiments, the features in the following embodiments and the embodiments can be combined with each other. The steps in the following method embodiments are only for exemplary description and are not used to limit the present invention.

[0061] The goal of task scheduling is to reasonably allocate and coordinate the execution order and resource occupancy of multiple tasks under the constraint of limited computing resources, so as to optimize the overall performance indicators of the system, such as execution time, resource utilization rate, etc. In a distributed computing scenario, task scheduling technology can directly affect system efficiency, service quality, and economic efficiency. Based on this, the present application proposes a task scheduling scheme applicable to task balanced allocation in a distributed deployment scenario.

[0062] For the convenience of readers to more clearly understand the technical implementation of the embodiments of the present application, the following will be combined with Figure 1 the shown system architecture (distributed deployment architecture) 100 to briefly describe the background technology of the present application.

[0063] Referring to Figure 1 , the system architecture 100 may include a task scheduler 102 and multiple algorithm servers 104a, 104b, 104c. Among them, the task scheduler 102 can be communicatively connected to each of the algorithm servers 104a, 104b, 104c for allocating algorithm tasks to each of the algorithm servers 104a, 104b, 104c, and each of the algorithm servers 104a, 104b, 104c is used to receive and execute the algorithm tasks of the task scheduler 102. Each of the algorithm servers 104a, 104b, 104c may be composed of one or more computing devices and has its own hardware resources such as a kernel, memory, and hard disk. It should be noted that, for the sake of simplicity in description to avoid obscuring the key points of the technology of the present application, only 3 algorithm servers are shown in the example shown in Figure 1 . In actual applications, the number of algorithm servers set in the system architecture 100 may far exceed 3 and can be arbitrarily increased or decreased according to actual usage requirements, and the present application does not limit this.

[0064] The algorithm tasks executed by the algorithm server can be divided into monitoring tasks and non-monitoring tasks. In this embodiment, a monitoring task refers to an algorithm task that is executed repeatedly multiple times, and a non-monitoring task refers to an algorithm task that is executed once and has no execution gap. Therefore, the execution intervals of monitoring tasks and non-monitoring tasks must be different. For different monitoring tasks, their execution intervals can be the same or different. It can be seen that when the algorithm server executes different algorithm tasks, the system resources consumed are also different.

[0065] Based on this, the present application provides a task scheduling scheme, which uses the concept of task busy degree to provide a unified measurement standard for each algorithm task with different execution intervals, for the task scheduler 102 to perform task scheduling, so as to achieve balanced distribution of algorithm tasks in a distributed deployment scenario.

[0066] The following will describe in detail the specific implementation of each embodiment of the present application in conjunction with the respective drawings.

[0067] Task scheduling method

[0068] Figure 2 shows a flowchart of a task scheduling method 200 according to an exemplary embodiment of the present application. In this embodiment, each processing step can be executed, for example, by Figure 1 the task scheduler 102. As shown in the figure, this embodiment mainly includes the following steps:

[0069] Step 202, obtain the algorithm tasks to be allocated and the busy degree list.

[0070] In this embodiment, the algorithm tasks to be allocated are identified as one of the monitoring tasks and non-monitoring tasks. Among them, the monitoring task is a task that is executed repeatedly multiple times (for example, an algorithm task that is executed every 5 seconds), and the non-monitoring task is a one-time execution task, such as a model training task, a model verification task, etc.

[0071] In this embodiment, the busy degree list is used to record the respective unit busy degrees corresponding to each algorithm server and the number of each non-monitoring task.

[0072] In some embodiments, the unit busy degree of any algorithm server in the busy degree list is calculated according to the task busy degree of each algorithm task in this algorithm server and the number of cores (CPU cores) of the algorithm server.

[0073] Specifically, since the hardware configurations of different algorithm servers are different. For example, in Figure 1In the illustrated example, assume that the algorithm server 104a has a 16-core processor and the algorithm server 104b has an 8-core processor. Then, in an ideal balanced load state, the total task busy degree of the algorithm server 104a should be twice that of the algorithm server 104b. Based on the above conditions, the technical solution of this embodiment calculates the unit busy degree of each algorithm server according to the number of cores of each algorithm server, and performs task scheduling accordingly, which can realize the balanced allocation of resources for each core in each algorithm server, so that the hardware cooperation resources of each algorithm server are rationally and maximally utilized.

[0074] In some embodiments, the busy degree list can be obtained in the following manner:

[0075] The task busy degree of each algorithm task in each algorithm server can be calculated. According to the total sum of the task busy degrees of each task in each algorithm server, the total task busy degree of each algorithm server can be obtained. According to the total task busy degree of each algorithm server and the number of cores of each algorithm server, the unit busy degree of each algorithm server can be obtained. By integrating the unit busy degrees of each algorithm server, the busy degree list can be obtained.

[0076] In this embodiment, the task busy degree is used to identify the amount of hardware resources required to execute the algorithm task. The task busy degree of the algorithm task can be calculated in the following manner:

[0077] Any one algorithm task is determined as the current task, and the identification information of the current task is identified. If the current task is a monitoring task, the execution interval time of the current task is obtained. If the current task is a non-monitoring task, the reference interval time of the non-monitoring task is determined as the execution interval time of the current task. According to the execution interval time of the current task, the number of executions of the current task within a given unit time length is obtained, and according to the number of executions of the current task within a given unit time length and the execution weight of the current task, the task busy degree of the current task is obtained.

[0078] For example, when the given unit time length is 10 minutes, if the execution interval time of the current task is 5 seconds (i.e., the algorithm task is executed every 5 seconds) and the execution weight is 1, the task busy degree of the current task is 600÷5×1 = 120. If the execution interval of the current task is 0.5 seconds and the execution weight is 1, the task busy degree of the current task is 600÷0.5×1 = 1200.

[0079] Among them, for a monitoring task, the corresponding execution interval time can be set when creating the task (algorithm task). For a non-monitoring task, since the execution of such a task is continuous without rest intervals, therefore, by setting a relatively short execution interval time, the continuous task execution characteristic can be represented. Exemplarily, the reference interval time of the non-monitoring task can be set to 0.5 seconds (that is, the algorithm task is executed every 0.5 seconds), but it is not limited thereto, and it can be adjusted according to the actual application situation, and this application does not limit it.

[0080] In some embodiments, the number of non-monitoring tasks of any algorithm server in the busyness list is determined according to the total number of all non-monitoring tasks in the algorithm server.

[0081] In this embodiment, based on a given update interval time, the unit busyness and the number of non-monitoring tasks corresponding to each algorithm server can be updated regularly (for example, the busyness list is updated every 10 minutes). However, it is not limited thereto, and the unit busyness and the number of non-monitoring tasks corresponding to each algorithm server can also be updated in batches after the scheduling and allocation of a batch of algorithm tasks (for example, the busyness list is updated every time 10 algorithm tasks are scheduled and allocated); or after each algorithm task is scheduled and allocated, the unit busyness and the number of non-monitoring tasks of the corresponding algorithm server are updated in real time. Those skilled in the art can select according to actual needs, and this application does not limit it.

[0082] Step 204: Determine whether the algorithm task to be allocated is a monitoring task. If not, go to step 206; if so, go to step 208.

[0083] Specifically, if it is identified that the algorithm task to be allocated is a non-monitoring task, go to step 206; conversely, if it is identified that the algorithm task to be allocated is a monitoring task, directly go to step 208.

[0084] Step 206: Remove each algorithm server whose non-monitoring task quantity reaches the given upper limit quantity from the busyness list, and continue to step 208.

[0085] In this embodiment, the given upper limit quantity of the non-monitoring tasks of this algorithm server can be set according to the actual hardware configuration of the algorithm server, and the given upper limit quantities of the non-monitoring tasks of different algorithm servers can be the same or different.

[0086] Reference Figure 1In the illustrated example, for instance, when the given upper limit of the non-monitoring tasks of the algorithm server 104a is 2, if the number of non-monitoring tasks of the algorithm server 104a recorded in the busyness list has reached 2, it means that the algorithm server 104a has no redundancy for processing non-monitoring tasks, and thus it will be removed from the busyness list; another example is that when the given upper limit of the non-monitoring tasks of the algorithm server 104b is 1, if the number of non-monitoring tasks of the algorithm server 104b recorded in the busyness list is 0, it means that the algorithm server 104b still has redundancy for processing non-monitoring tasks, and thus it will be retained in the busyness list.

[0087] Step 208: Determine the algorithm server with the minimum unit busyness in the busyness list as the target server, and allocate the algorithm task to be assigned to the target server.

[0088] Exemplarily, the algorithm servers in the busyness list can be sorted in ascending order of unit busyness, and the algorithm server with the minimum unit busyness (for example, the algorithm server 104a) is determined as the target server, and the algorithm task to be assigned is allocated to the target server.

[0089] In some embodiments, after the algorithm task is allocated to the target server, the execution status of the algorithm task can be marked from "to be allocated" to "in progress", indicating that this algorithm task has been successfully allocated.

[0090] In some embodiments, a task allocation request for the algorithm task to be assigned can be sent to the target server. If the request response for the task allocation request cannot be obtained from the target server within the given response time, it means that the task scheduling fails. Then, the target server is removed from the busyness list, and this step is re-executed to obtain the algorithm server with the minimum unit busyness from the busyness list, which is determined as the new target server, and a task allocation request for the algorithm task to be assigned is sent to this new target server until the task scheduling is successful.

[0091] In some embodiments, if after traversing all the algorithm servers in the busyness list, the algorithm task to be assigned still cannot be allocated, the algorithm task to be assigned can be marked as in a suspended state and wait until the busyness list is updated before performing the next task allocation.

[0092] In some embodiments, after the algorithm task to be assigned is successfully allocated to the target server, the total task busyness of the target server can be updated based on the task busyness of the newly allocated algorithm task in the target server, and the unit busyness of the target server is recalculated to ensure the load balance among the algorithm servers during subsequent task scheduling operations.

[0093] In summary, for the task scheduling method of this embodiment, by calculating the unit busyness of each algorithm server based on the number of cores of each algorithm server, the resource allocation of each core in each algorithm server can be balanced, so that the hardware resources of each algorithm server can be utilized rationally and maximally.

[0094] In addition, for the task scheduling method of this embodiment, by introducing the concept of task busyness, a unified measurement index for the resource consumption of each algorithm task with different execution intervals is provided, ensuring the objectivity and accuracy of the calculation result of the total task busyness of each algorithm server, and the balanced allocation of each algorithm task in the distributed deployment scenario can be realized.

[0095] Furthermore, for the task scheduling method of this embodiment, by dividing the algorithm tasks into monitoring tasks (i.e., loop execution tasks) and non-monitoring tasks (i.e., one-time execution tasks), and setting the execution quantity of the non-monitoring tasks of each algorithm server, the execution of the monitoring tasks can be ensured not to be affected.

[0096] For the task scheduling scheme provided by each embodiment of this application, by detecting whether the request response of the algorithm server is received within the given response time, it can be ensured that the algorithm tasks are successfully allocated to each algorithm server for execution, and at the same time, the servers with exceptions can be removed from the task scheduling operation in a timely manner to improve the execution efficiency of the task scheduling.

[0097] Figure 3 It is a processing flowchart of the task scheduling method 300 according to another exemplary embodiment of this application. This embodiment shows the maintenance scheme of the busyness list, which can be executed by Figure 1 the task scheduler 102 shown.

[0098] As Figure 3 shown, the task scheduling method 300 of this embodiment mainly includes the following steps:

[0099] Step 302, in response to the registration request of the algorithm server, obtain the server identifier of the algorithm server.

[0100] In practical applications, when a new algorithm server is deployed in a distributed deployment environment, or the system of an algorithm server already deployed in the distributed deployment environment is restarted (for example, due to system updates, system downtime, etc.), the algorithm server can send a registration request to the task scheduler to perform unified task scheduling on each algorithm server that has successfully registered through the task scheduler.

[0101] In some embodiments, the registration request sent by the algorithm server carries the server identifier (or called service ID) of the algorithm server.

[0102] Step 304: Determine whether the server identifier of the algorithm server exists in the registration information table. If it does not exist, execute Step 306; if it exists, execute Step 308.

[0103] In this embodiment, if it is determined that the server identifier of the algorithm server does not exist in the registration information table, it means that this algorithm server has not been successfully registered in the task scheduler, and then Step 306 is executed; conversely, if it is determined that the server identifier of the algorithm server already exists in the registration information table, it means that this algorithm server has been successfully registered in the task scheduler, and then Step 308 is executed.

[0104] Step 306: Add the registration information of the algorithm server to the registration information table and execute Step 308.

[0105] In some embodiments, the registration information of the algorithm server may include information such as the server identifier, registered IP address, number of CPU cores, etc.

[0106] In practical applications, an algorithm server may include one or more IP addresses. The task scheduler can perform connectivity tests on each IP address of the algorithm server to be registered (such as algorithm server 104a) to determine a valid IP address from each IP address. After obtaining the valid IP address of the algorithm server (algorithm server 104a), it is necessary to detect whether there is a registered IP address in the registration information table that is the same as this valid IP address. If it exists, the algorithm server with the same registered IP address is de-registered to avoid the problem of server scheduling conflicts. The allocated algorithm tasks in the de-registered algorithm server can be marked as suspended tasks to wait for reallocation by the task scheduler, and the registration information of the algorithm server to be registered (algorithm server 104a) is added to the registration information table, thus completing the registration process of algorithm server 104a.

[0107] Step 308: Based on the given update interval time, periodically update the unit busy degrees and non-monitoring task quantities corresponding to each algorithm server in the registration information table to obtain an updated busy degree list.

[0108] In this embodiment, the update interval time can be set according to actual usage requirements. For example, it can be set to update once every 10 minutes.

[0109] In some embodiments, the communication status of each algorithm server in the registration information table can be periodically detected to ensure the availability of each algorithm server.

[0110] For example, the task scheduler 102 can use the ping command to perform a connectivity test on the registered IP addresses of each algorithm server 104a, 104b, and 104c, detect the communication status between the task scheduler 102 and each algorithm server 104a, 104b, and 104c, mark the algorithm servers in the effective communication state (i.e., the ping command detection is successful) as available algorithm servers, and mark the algorithm servers in the non-effective communication state (i.e., the ping command detection fails) as unavailable algorithm servers.

[0111] Among them, for any one of the algorithm servers marked as available algorithm servers (for example, algorithm server 104a), each algorithm task in the algorithm server 104a can be re-obtained, the unit busyness and the number of non-monitored tasks of the algorithm server 104a can be calculated, and the busyness list can be updated accordingly; for any one of the algorithm servers marked as unavailable algorithm servers (for example, algorithm server 104b), each algorithm task in the algorithm server 104b can be marked as a suspended task to wait for reallocation by the task scheduler, and the registration information of the algorithm server 104b can be cleared from the registration information table.

[0112] In some embodiments, the communication status of each algorithm server can be checked every 5 minutes, and if no effective response from the algorithm server is obtained within a given response time of 15 minutes, this algorithm server can be marked as an unavailable algorithm server. Among them, the given response time is set longer to prevent the impact caused by network fluctuations or temporary network isolation.

[0113] In summary, through the technical solution provided by this embodiment, the task execution status of each algorithm server can be monitored in a timely manner to implement the balanced scheduling of each algorithm task and ensure the load balance of each kernel in each algorithm server. In addition, by regularly detecting the communication status of each algorithm server, each algorithm task in the abnormal server is automatically suspended and waits for reallocation to ensure the normal execution of the algorithm task.

[0114] Figure 4 The processing flow of the task scheduling method 400 according to another exemplary embodiment of the present application mainly describes the task scheduling scheme in the scenario of dynamic resource scaling. For example, in the case of adding a new algorithm server (i.e., resource expansion) in a distributed deployment scenario, or a running failure of an already deployed algorithm server in a distributed deployment scenario (i.e., resource contraction), the task scheduling rebalancing scheme. In the actual application process, Figure 4 The technical solution of Figure 2 can be combined with the technical solution of

[0115] such as Figure 4As shown in the figure, this embodiment mainly includes the following steps:

[0116] Step 402: In response to the rebalancing execution request, determine the algorithm server with the highest unit busy degree in the busy degree list as the server to be balanced.

[0117] Exemplarily, according to the unit busy degrees corresponding to each algorithm server in the busy degree list, determine the algorithm server with the highest unit busy degree (for example, algorithm server 104c) as the server to be balanced.

[0118] In some embodiments, the number of algorithm tasks in the server to be balanced can be detected. If there is only 1 algorithm task in the server to be balanced, it means that this server to be balanced cannot perform rebalancing processing. Then, remove this server to be balanced from the busy degree list and re-execute this step to determine a new server to be balanced.

[0119] Step 404: Obtain the busy degree to be allocated for the server to be balanced according to the sum of the task busy degrees of each algorithm task in the server to be balanced and the given rebalancing allocation ratio.

[0120] In some embodiments, the total task busy degree of the server to be balanced can be calculated according to the task busy degrees of each algorithm task in the server to be balanced, and the busy degree to be allocated for the server to be balanced can be obtained according to the product result of the total task busy degree of the server to be balanced and the given rebalancing allocation ratio.

[0121] In some embodiments, the given rebalancing allocation ratio can be between 33% and 35%.

[0122] For example, assume that the total busy degree of the server to be balanced 104c is 100, and the given rebalancing allocation ratio is set to 35%. Then, the busy degree to be allocated for the server to be balanced is 35% × 100 = 35.

[0123] Step 406: Determine at least one suspended task from each algorithm task according to the busy degree to be allocated and the task busy degrees of each algorithm task in the server to be balanced.

[0124] In some embodiments, an algorithm candidate with a task busy degree closest to and not exceeding the busy degree to be allocated can be determined as the suspended task. Update the current value of the busy degree to be allocated based on the task busy degree of the suspended task to obtain the updated value of the busy degree to be allocated, and re-execute this step based on the updated value of the busy degree to be allocated to determine the next suspended task in the server to be balanced until there is no algorithm task with a task busy degree less than the busy degree to be allocated in the server to be balanced, so as to batch-determine each suspended task in the server to be balanced.

[0125] For example, when the pending workload of the server to be balanced 104c is 35, the first pending task in the server to be balanced 104c can be queried based on the pending workload of 35. If the task workload of the first pending task found is 25, the pending workload of the server to be balanced 104c is updated to 35 - 25 = 10, and based on the pending workload of 10, the second pending task in the server to be balanced 104c is continued to be queried, and so on, until there is no algorithm task in the server to be balanced 104c with a task workload less than the pending workload.

[0126] Step 408: Determine each pending task as a newly to-be-allocated algorithm task.

[0127] In this embodiment, after determining the pending task as a newly to-be-allocated algorithm task, step 202 can be continued to perform the reallocation operation.

[0128] Figure 5 This is the processing flow of the task scheduling method 500 according to another embodiment of the present application. In this embodiment, it can continue Figure 4 from step 404 to continue the execution, and is used to describe the specific implementation of step 406, which mainly includes:

[0129] Step 502: Determine an algorithm task with the highest task workload in the server to be balanced and not marked as a processed task or a pending task as a candidate task.

[0130] In some embodiments, the algorithm tasks in the server to be balanced can be sorted in descending order of task workload, and an algorithm task with the highest task workload in the rebalancing service weapon and not marked as a processed task or a pending task is determined as a candidate task.

[0131] Step 504: Determine whether the task workload of the candidate task exceeds the pending workload. If it exceeds, execute step 506; if not, execute step 508.

[0132] Specifically, the task workload of the candidate task can be compared with the pending workload of the server to be balanced. If the task workload exceeds the pending workload, step 506 is performed; if not, step 508 is performed.

[0133] Step 506: Mark the candidate task as a processed task and perform step 510.

[0134] Specifically, since the task workload of the candidate task exceeds the pending workload, it means that it does not meet the rebalancing allocation condition. The candidate task can be marked as a processed task to exclude it from the current round of rebalancing process, and step 510 is executed.

[0135] Step 508: Mark the candidate task as a pending task, update the current value of the pending workload according to the difference between the pending workload and the task workload of the candidate task, obtain the updated value of the pending workload, and execute Step 510.

[0136] Specifically, for a candidate task that meets the rebalancing allocation condition, it can be marked as a pending task to wait for subsequent task reallocation, and based on the task workload of this candidate task, update the current value of the pending workload to obtain the updated value of the pending workload. For example, if the task workload of the candidate task is 30 and the current value of the pending workload is updated to 35, then the updated value of the pending workload is 35 - 30 = 5.

[0137] Step 510: Determine whether each algorithm task in the server to be balanced is marked as a processed task or a pending task. If so, proceed to Step 408; if not, return to Step 502.

[0138] Specifically, if each algorithm task in the server to be balanced is marked as a processed task or a pending task, it means that there are no algorithm tasks available for performing balanced allocation in this server to be balanced, and then continue to execute Figure 4 Step 408 to determine the pending tasks in the server to be balanced as the new algorithm tasks to be allocated, waiting for task reallocation. If there are algorithm tasks in the server to be balanced that are not marked as processed tasks or pending tasks, return to Step 502 to determine new candidate tasks.

[0139] In summary, through the execution of the rebalancing strategy, each embodiment of the present application can always ensure load balancing among algorithm servers in the event of server downtime, dynamic scaling of server resources, etc., solve the problem of task balanced allocation of algorithm servers in a distributed deployment scenario, and rationally and maximally utilize hardware resources, especially adapted to the dynamic scaling scenario of cloud services. In addition, by determining the pending workload of the server to be balanced and starting the rebalancing process from the algorithm task with the highest task workload in the server to be balanced, the execution efficiency of the rebalancing process can be improved on the premise of ensuring balanced allocation of server hardware resources.

[0140] Figure 6 The processing flow of a task scheduling method 600 according to another exemplary embodiment of the present application is shown, which describes the acquisition method of the rebalancing execution request in Step 402. As shown in the figure, this embodiment mainly includes:

[0141] Step 602: Determine the rebalancing execution time of the workload list.

[0142] In some embodiments, the rebalancing execution interval of the busyness list can be set (for example, executed once every 10 minutes), based on which each rebalancing execution time of the busyness list is determined.

[0143] Step 604: Determine whether the current time meets the rebalancing execution time. If it meets, execute Step 606; otherwise, repeat this step.

[0144] Step 606: Determine the busiest server and the least busy server as the algorithm server with the highest unit busyness and the algorithm server with the lowest unit busyness in the busyness list, respectively.

[0145] In some embodiments, in the case where only one algorithm server is included in the busyness list, or in the case where the unit busyness of the busiest server in the busyness list is 0, there is no need to continue executing the processing flow of this embodiment.

[0146] In some embodiments, a busyness threshold can be set. If the unit busyness of the busiest server in the busyness list is lower than the busyness threshold, the processing flow of this embodiment can also be stopped to reduce the operating load of the task scheduler.

[0147] Step 608: Calculate the busyness ratio between the unit busyness of the busiest server and the unit busyness of the least busy server.

[0148] Specifically, the busyness ratio between the busiest server and the least busy server can be obtained according to the calculation result of the quotient of the unit busyness of the busiest server and the unit busyness of the least busy server.

[0149] Step 610: Determine whether the busyness ratio between the busiest server and the least busy server exceeds the given rebalancing ratio. If it exceeds, proceed to Step 612; if it does not exceed, return to Step 602.

[0150] In some embodiments, the given rebalancing ratio can be set to 3.

[0151] In some embodiments, the given rebalancing allocation ratio in Step 404 can be determined according to the given rebalancing ratio. Through this linked setting method, reasonable allocation of server hardware resources can be achieved, enabling the maximized utilization of server hardware resources.

[0152] Step 612: Generate a rebalancing execution request.

[0153] In this embodiment, when the gap between the unit busyness of the busiest server and the least busy server exceeds 3 times, a rebalancing execution request can be automatically generated to trigger the execution Figure 4 of the rebalancing process.

[0154] In addition, after generating the rebalancing execution request, step 602 may be returned to perform the next round of rebalancing evaluation process on the busyness list.

[0155] In summary, for the task scheduling solution provided in this embodiment, when the busyness ratio of the unit busyness between the busiest server and the least busy server exceeds the given rebalancing ratio, the rebalancing operation is triggered, which can improve the execution efficiency of the rebalancing operation. In addition, by jointly setting the given rebalancing ratio and the rebalancing allocation ratio, the rebalancing allocation of algorithm tasks can be planned more reasonably, realizing the rationalization and maximization of the utilization of server hardware resources.

[0156] Task scheduling device

[0157] Figure 7 It is a structural block diagram of a task scheduling device 700 according to an exemplary embodiment of the present application. As shown in the figure, the task scheduling device 700 of this embodiment may be, for example, Figure 1 the task scheduler 102 shown, which mainly includes: an acquisition module 702, an analysis module 704, and a scheduling module 706.

[0158] The acquisition module 702 is configured to acquire the algorithm tasks to be allocated and the busyness list, where the algorithm tasks to be allocated are identified as one of the monitoring tasks and the non-monitoring tasks, and the busyness list is used to record the respective unit busyness and the respective non-monitoring task quantities corresponding to each algorithm server. The unit busyness of any algorithm server in the busyness list is calculated according to the task busyness of each algorithm task in the algorithm server and the number of cores of the algorithm server, and the non-monitoring task quantity of any algorithm server is determined according to the total number of all non-monitoring tasks in the algorithm server.

[0159] The analysis module 704 is configured to identify the algorithm tasks to be allocated. If the algorithm tasks to be allocated are non-monitoring tasks, each algorithm server with the non-monitoring task quantity reaching the given upper limit quantity is removed from the busyness list.

[0160] The scheduling module 706 is configured to determine the algorithm server with the smallest unit busyness in the busyness list as the target server, and allocate the algorithm tasks to be allocated to the target server.

[0161] In some embodiments, the obtaining module 702 is configured to identify the identification information of each allocated algorithm task in each algorithm server, calculate the task busy degree of each algorithm task in each algorithm server; obtain the total task busy degree of each algorithm server according to the sum of the task busy degrees of each task in each algorithm server; obtain the unit busy degree of each algorithm server according to the total task busy degree of each algorithm server and the number of cores of each algorithm server; integrate the unit busy degrees of each algorithm server to obtain the busy degree list.

[0162] In some embodiments, the obtaining module 702 may calculate the task busy degree of any algorithm task in the following manner:

[0163] Determine any algorithm task as the current task; identify the identification information of the current task. If the current task is a monitoring task, obtain the execution interval time of the current task. If the current task is a non-monitoring task, determine the given reference interval time as the execution interval time of the current task; obtain the number of executions of the current task within a given unit time according to the execution interval time of the current task, and obtain the task busy degree of the current task according to the number of executions of the current task within the given unit time and the execution weight of the current task.

[0164] In some embodiments, the scheduling module 702 is configured to: send a task allocation request for the to-be-allocated algorithm task to the target server; if the request response for the task allocation request is not obtained from the target server within a given response time, remove the target server from the busy degree list, and re-execute the step of determining the algorithm server with the smallest unit busy degree in the busy degree list as the target server.

[0165] In some embodiments, the task scheduling device 700 further includes a rebalancing module (not shown), configured to, in response to a rebalancing execution request, determine the algorithm server with the highest unit busy degree in the busy degree list as the server to be balanced; obtain the to-be-allocated busy degree of the server to be balanced according to the sum of the task busy degrees of each algorithm task in the server to be balanced and a given rebalancing allocation ratio; determine at least one suspended task from each algorithm task according to the to-be-allocated busy degree and the task busy degree of each algorithm task in the server to be balanced; determine each suspended task as a new to-be-allocated algorithm task.

[0166] In some embodiments, the rebalancing module is configured to: perform a candidate task determination step of determining, as a candidate task, an algorithm task with the highest task busy degree in the to-be-balanced server that is not marked as a processed task or a pending task; compare the task busy degree of the candidate task with the to-be-allocated busy degree, and if the task busy degree of the candidate task exceeds the to-be-allocated busy degree, mark the candidate task as a processed task; if the task busy degree of the candidate task does not exceed the to-be-allocated busy degree, mark the candidate task as a pending task, and update the current value of the to-be-allocated busy degree according to the difference between the to-be-allocated busy degree and the task busy degree of the candidate task to obtain an updated value of the to-be-allocated busy degree; return to execute the candidate task determination step until each algorithm task in the to-be-balanced server is marked as a processed task or a pending task.

[0167] In some embodiments, the rebalancing module generates the rebalancing execution request in the following manner:

[0168] Determine the busiest server and the least busy server as the algorithm server with the highest unit busy degree and the algorithm server with the lowest unit busy degree in the busy degree list respectively; calculate the busy degree ratio between the unit busy degree of the busiest server and the unit busy degree of the least busy server, and if the busy degree ratio exceeds a given rebalancing ratio, generate the rebalancing execution request.

[0169] In some embodiments, the given rebalancing allocation ratio is determined based on the given rebalancing ratio. Preferably, the given rebalancing ratio is 3, and the given rebalancing allocation ratio is between 33% and 35%.

[0170] Electronic device

[0171] Figure 8 is a schematic diagram of an electronic device provided by an embodiment of the present application. The specific implementation of the electronic device is not limited in the specific embodiments of the present application. Refer to Figure 8 , the electronic device 800 provided by the embodiment of the present application includes: a processor 802, a communication interface 804, a memory 806, and a bus 808. Among them:

[0172] The processor 802, the communication interface 804, and the memory 806 communicate with each other through the bus 808.

[0173] The communication interface 804 is used to communicate with other electronic devices or servers.

[0174] A processor 802 for executing a program 810, specifically capable of executing the relevant steps in the embodiment of the above task scheduling method.

[0175] Specifically, the program 810 may include program code, and the program code includes computer operation instructions.

[0176] The processor 802 may be a central processing unit (CPU), or a specific integrated circuit (ASIC) (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. One or more processors included in the intelligent device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.

[0177] A memory 806 for storing the program 810. The memory 806 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.

[0178] The program 810 is specifically configured to cause the processor 802 to execute the task scheduling method in any of the foregoing embodiments.

[0179] For the specific implementation of each step in the program 810, reference may be made to the corresponding steps and descriptions in the units in the above-mentioned embodiment of the task scheduling method, which will not be elaborated herein. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding process descriptions in the foregoing method embodiments, which will not be repeated herein.

[0180] Computer-readable storage medium

[0181] The present application also provides a computer-readable storage medium storing instructions for causing a machine to execute the task scheduling method as described herein. Specifically, a system or device equipped with a storage medium may be provided, on which software program code for implementing the functions of any one of the above embodiments is stored, and the computer (or CPU or MPU) of the system or device is caused to read and execute the program code stored in the storage medium.

[0182] In this case, the program code read from the storage medium itself can implement the functions of any one of the above embodiments, so the program code and the storage medium storing the program code constitute a part of the present application.

[0183] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Optionally, the program code can be downloaded from a server computer via a communication network.

[0184] Computer program product

[0185] Embodiments of this application also provide a computer program product, including computer instructions that direct a computing device to perform any corresponding operation in the above-mentioned multiple method embodiments.

[0186] It should be noted that, according to the needs of implementation, each component / step described in the embodiments of this application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the objectives of the embodiments of this application.

[0187] The methods according to the embodiments of this application can be implemented in hardware, firmware, or be implemented as software or computer code that can be stored in a recording medium (such as a CD ROM, RAM, floppy disk, hard disk, or magneto-optical disk), or be implemented as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium and downloaded via a network and to be stored in a local recording medium, so that the methods described herein can be processed by such software stored on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware (such as an ASIC or FPGA). It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component (such as RAM, ROM, flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by the computer, the processor, or the hardware, the methods described herein are implemented. In addition, when a general-purpose computer accesses the code for implementing the methods shown herein, the execution of the code converts the general-purpose computer into a dedicated computer for executing the methods shown herein.

[0188] It should be noted that not all steps and modules in the above-mentioned various processes and system structure diagrams are necessary, and some steps or modules can be ignored according to actual needs. The execution order of each step is not fixed and can be adjusted according to needs. The system structures described in the above-mentioned various embodiments can be physical structures or logical structures, that is, some modules may be implemented by the same physical entity, or some modules may be implemented by multiple physical entities respectively, or some components in multiple independent devices can be jointly implemented.

[0189] In this patent application, nouns and pronouns related to people are not limited to specific genders.

[0190] In the above embodiments, the hardware module may be implemented mechanically or electrically. For example, a hardware module may include dedicated permanent circuits or logic (such as a dedicated processor, FPGA, or ASIC) to perform corresponding operations. The hardware module may also include programmable logic or circuits (such as a general-purpose processor or other programmable processor), which can be temporarily set by software to perform corresponding operations. The specific implementation method (mechanical method, or dedicated permanent circuit, or temporarily set circuit) can be determined based on cost and time considerations.

[0191] The present invention has been described in detail above with reference to the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above-mentioned multiple embodiments, those skilled in the art can know that more embodiments of the present invention can be obtained by combining the code review means in the above different embodiments, and these embodiments are also within the protection scope of the present invention.

Claims

1. A task scheduling method (200), the method comprising: Obtaining an algorithm task to be allocated and a busyness list (202), wherein the algorithm task to be allocated is identified as one of a monitoring task and a non - monitoring task, and the busyness list is used to record the respective unit busyness corresponding to each algorithm server and the number of each non - monitoring task; Identifying the algorithm task to be allocated (204), if the algorithm task to be allocated is a non - monitoring task, removing each algorithm server with the number of non - monitoring tasks reaching a given upper limit number from the busyness list (206); Determining the algorithm server with the minimum unit busyness in the busyness list as the target server, and allocating the algorithm task to be allocated to the target server (208); Wherein, the unit busyness of any algorithm server in the busyness list is calculated based on the task busyness of each algorithm task in the algorithm server and the number of cores of the algorithm server, and the number of non - monitoring tasks of any algorithm server is determined according to the total number of all non - monitoring tasks in the algorithm server.

2. The method according to claim 1, wherein, The busyness list is obtained by the following method: Identifying the identification information of each allocated algorithm task in each algorithm server, and calculating the task busyness of each algorithm task in each algorithm server; Obtaining the total task busyness of each algorithm server according to the sum of the task busyness of each task in each algorithm server; Obtaining the unit busyness of each algorithm server according to the total task busyness of each algorithm server and the number of cores of each algorithm server; Integrating the unit busyness of each algorithm server to obtain the busyness list.

3. The method according to claim 2, wherein, The task busyness of any algorithm task is calculated by the following method: Determining any algorithm task as the current task; Identifying the identification information of the current task, if the current task is a monitoring task, obtaining the execution interval time of the current task, if the current task is a non - monitoring task, determining the given reference interval time as the execution interval time of the current task; Obtaining the number of executions of the current task within a given unit time according to the execution interval time of the current task, and obtaining the task busyness of the current task according to the number of executions of the current task within the given unit time and the execution weight of the current task.

4. The method according to claim 1, wherein, The allocating the algorithm task to be allocated to the target server includes: Sending a task allocation request for the algorithm task to be allocated to the target server; If the request response for the task allocation request is not obtained from the target server within a given response time, removing the target server from the busyness list, and re - executing the step of determining the algorithm server with the minimum unit busyness in the busyness list as the target server.

5. The method according to claim 1 or 2, wherein The method further includes (400): In response to a re - balancing execution request, determining the algorithm server with the highest unit busyness in the busyness list as the server to be balanced (402); Obtain the to-be-allocated busy degree (404) of the to-be-balanced server according to the total task busy degree of each algorithm task in the to-be-balanced server and the given rebalancing allocation ratio; Determine at least one suspended task from each algorithm task according to the to-be-allocated busy degree and the task busy degree of each algorithm task in the to-be-balanced server (406); Determine each suspended task as a new to-be-allocated algorithm task (408).

6. The method according to claim 5, wherein, The step of determining at least one suspended task from each algorithm task according to the to-be-allocated busy degree and the task busy degree of each algorithm task in the to-be-balanced server includes (500): Execute the candidate task determination step, and determine an algorithm task with the highest task busy degree in the to-be-balanced server and not marked as a processed task or a suspended task as a candidate task (502); Compare the task busy degree of the candidate task with the to-be-allocated busy degree (504). If the task busy degree of the candidate task exceeds the to-be-allocated busy degree, mark the candidate task as a processed task (506); if the task busy degree of the candidate task does not exceed the to-be-allocated busy degree, mark the candidate task as a suspended task, and update the current value of the to-be-allocated busy degree according to the difference between the to-be-allocated busy degree and the task busy degree of the candidate task to obtain the updated value of the to-be-allocated busy degree (508); Return to execute the candidate task determination step until each algorithm task in the to-be-balanced server is marked as a processed task or a suspended task (510).

7. The method according to claim 5, wherein Generate the rebalancing execution request in the following manner (600): Determine an algorithm server with the highest unit busy degree and an algorithm server with the lowest unit busy degree in the busy degree list as the busiest server and the least busy server respectively (606); Calculate the busy degree ratio between the unit busy degree of the busiest server and the unit busy degree of the least busy server (608). If the busy degree ratio exceeds the given rebalancing ratio, generate the rebalancing execution request (612).

8. The method according to claim 7, Among them, The given rebalancing allocation ratio is determined based on the given rebalancing ratio; wherein, the given rebalancing ratio is 3, and the given rebalancing allocation ratio is between 33% and 35%.

9. A task scheduling device (700), the device includes: An obtaining module (702), configured to obtain to-be-allocated algorithm tasks and a busy degree list, wherein the to-be-allocated algorithm tasks are marked as one of monitoring tasks and non-monitoring tasks, and the busy degree list is used to record the unit busy degrees corresponding to each algorithm server and the number of each non-monitoring task; An analysis module (704), configured to identify the to-be-allocated algorithm tasks. If the to-be-allocated algorithm tasks are non-monitoring tasks, remove each algorithm server with the number of non-monitoring tasks reaching the given upper limit number from the busy degree list; A scheduling module (706) for determining, as a target server, an algorithm server with the minimum unit busy degree in the busy degree list, and allocating the to-be-allocated algorithm task to the target server; wherein the unit busy degree of any algorithm server in the busy degree list is calculated based on the task busy degree of each algorithm task in the algorithm server and the number of cores of the algorithm server, and the number of non-monitoring tasks of any algorithm server is determined based on the total number of all non-monitoring tasks in the algorithm server.

10. An electronic device (800), comprising: A processor (802), a communication interface (804), a memory (806), and a communication bus (808), where the processor (802), the communication interface (804), and the memory (806) complete communication with each other through the communication bus (808); The memory (806) is used to store at least one executable instruction, and the executable instruction causes the processor (802) to perform operations corresponding to the task scheduling method according to any one of claims 1 to 8.

11. A computer-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the processor is caused to execute the task scheduling method according to any one of claims 1 to 8.

12. A computer program product, including computer instructions, and the computer instructions instruct a computing device to perform operations corresponding to the task scheduling method according to any one of claims 1 to 8.