A timing task scheduling method and an electronic device
By dividing tasks into subsets and using a binary search algorithm to optimize the execution time window and the number of devices, the problem of unreasonable resource allocation in existing technologies is solved, achieving efficient execution of scheduled tasks and rational utilization of resources, thereby improving the operational efficiency of the cloud management platform.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INSPUR SUZHOU INTELLIGENT TECH CO LTD
- Filing Date
- 2026-06-23
- Publication Date
- 2026-07-21
AI Technical Summary
Existing technologies cannot rationally plan resources while ensuring the efficient execution of scheduled tasks, resulting in resource waste and low operational efficiency, and making it difficult to adapt to dynamically changing task scale and execution sequence requirements.
By dividing tasks into subsets based on dependencies between scheduled tasks, estimating execution time and cumulative device time, and using a binary search algorithm to optimize the execution time window and the number of devices, automated scheduling and balanced resource allocation are achieved.
By rationally planning resources while ensuring efficient task execution, resource waste is avoided, the operational and maintenance efficiency and resource utilization efficiency of the cloud management platform are improved, and manpower and time costs are saved.
Smart Images

Figure CN122431845A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a timed task scheduling method and electronic device. Background Technology
[0002] Currently, cloud management platform systems contain numerous scheduled tasks that need to be executed regularly, such as scheduled database backups, cluster node restarts, and algorithm model resets. To avoid disrupting business operations, these tasks are typically scheduled during off-peak hours. To prevent system performance fluctuations caused by concentrated concurrent execution of tasks and contention for service resources, additional service resource pools are usually temporarily planned to execute these tasks. Furthermore, these tasks often have dependencies on their execution order, with strict requirements on the execution sequence. The number of tasks is not fixed and is adjusted in real time according to business expansion and operational needs, resulting in a dynamic change in task scale.
[0003] However, the current practice of relying on the experience of operations and maintenance personnel to configure the execution order of multiple related scheduled tasks is not only unable to rationally plan resources while ensuring efficient task execution, which can easily lead to resource waste, but also cannot dynamically adjust the execution period and resource quota according to the real-time task volume. This makes it difficult to adapt to increasingly complex operation and maintenance scheduling scenarios and reduces the overall system operation and maintenance efficiency and resource utilization efficiency. Summary of the Invention
[0004] In view of this, this application provides a scheduled task scheduling method and electronic device to at least solve the problem in related technologies that it is impossible to reasonably plan resources while ensuring the efficient execution of scheduled tasks. It realizes the scheduling of scheduled tasks automatically, saves manpower and time costs, and can reasonably plan the execution time of scheduled tasks and the required task execution equipment. It can reasonably plan resources while ensuring the efficient execution of tasks, avoids resource waste, and improves the overall operation and maintenance efficiency and resource utilization efficiency of the platform.
[0005] This application provides a scheduled task method for use in a cloud management platform, including: The task subsets are divided based on the dependencies between the scheduled tasks in the scheduled task set to obtain at least two task subsets; the scheduled tasks in any task subset have no dependencies on the scheduled tasks in other task subsets. Estimate the execution time of each task subset, obtain the estimated execution time, and obtain the cumulative execution time of each task execution device in the cloud management platform; According to the preset window selection rules, the optimal execution time window is determined when using a preset maximum number of task execution devices to execute multiple task subsets. The preset window selection rules are to calculate the sum of a single estimated execution time and a single cumulative execution time to obtain the sum of multiple execution times, and take the maximum value among the sums of multiple execution times as the current optimal window. Based on the estimated execution time and cumulative execution time, and using a binary search algorithm, find the optimal number of task execution devices required to execute each subset of tasks within a preset upper limit execution time window; By balancing the optimal execution time window and the optimal number of devices, a new time window and a new number of devices are obtained. If the new time window or the window compression degree of the new time window relative to the old time window is less than or equal to the corresponding preset threshold, then the new time window will be used as the target execution time window, and the number of new devices will be used as the target number of devices. Within the target execution time window, each task subset is scheduled to the target number of task execution devices to obtain the corresponding task execution results.
[0006] This application also provides an electronic device, including: a memory for storing a computer program; and a processor for implementing any of the above-described timed task scheduling methods when executing the computer program.
[0007] This application first divides the set of scheduled tasks into multiple task subsets based on the dependencies between them (there are no dependencies between scheduled tasks in different task subsets). This ensures both task integrity and independence, preventing different task subsets from affecting each other. Next, based on the window selection rule that the maximum value between the estimated execution time of a subset and the sum of the cumulative execution time of the devices is the current optimal window, the optimal execution time window is determined when using a preset upper limit number of task execution devices to execute multiple task subsets. A binary search algorithm is then used to find the optimal number of task execution devices required to execute each task subset within the preset upper limit execution time window. The optimal execution time window and the optimal number of devices are then balanced. If the new time window obtained after the balance, or the window compression degree of the new time window relative to the old time window, is less than or equal to a corresponding preset threshold, then the new time window is used as the target execution window. The time window is used, and the new number of devices obtained after balancing is taken as the target number of devices. Finally, within the target execution time window, each subset of tasks is scheduled to be executed on the target number of task execution devices. It can be seen that the task execution method in this application is not generated based on a single dimension of optimality, such as the optimal number of devices required when the execution time window has a preset upper limit, or the optimal execution time window corresponding to the preset upper limit number of task execution devices. Instead, it further balances the scheduling results when two single dimensions are optimal, and considers both the number of devices and the time window. This allows for more reasonable planning of the execution time of scheduled tasks and the number of task execution devices required. It can reasonably plan resources while ensuring efficient task execution, avoiding resource waste. At the same time, it improves the overall operation and maintenance efficiency and resource utilization efficiency of the cloud management platform. In addition, it realizes automated scheduling of scheduled tasks, saving manpower and time costs. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0009] Figure 1 This is a flowchart of a timed task scheduling method disclosed in this application; Figure 2 This is a flowchart of a specific timed task scheduling method disclosed in this application. Detailed Implementation
[0010] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0011] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0012] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0013] This application discloses a timed task scheduling method applied to a cloud management platform. (See also...) Figure 1 As shown, the method includes: Step S11: Divide the task subsets based on the dependencies between the timed tasks in the timed task set to obtain at least two task subsets; the timed tasks in any task subset have no dependencies on the timed tasks in other task subsets.
[0014] It should be noted that the scheduled task scheduling method proposed in this application is specifically applied to a cloud management platform. When scheduling scheduled tasks (such as scheduled database backup, cluster node restart, algorithm model reset, etc.), the platform first obtains all scheduled tasks that need to be scheduled, forming a set of scheduled tasks. Then, based on the dependency relationship between different scheduled tasks in the set, the entire set of scheduled tasks is divided into multiple task subsets (such as Job1, Job2, Job3, ..., Jobi).
[0015] In this subset, there is no dependency between timed tasks in any given task subset and timed tasks in other task subsets. That is, each task subset is independent and contains a complete, independent task sequence. Specifically, the same timed task is allowed to exist in multiple task subsets simultaneously, but one task subset cannot be part of another, nor can two task subsets be combined to form a new dependent subset. For example, Jobi=(a,b,c) and Jobj=(b,c), or Jobi=(a,b) and Jobj=(b,c), are not allowed. Through these subset partitioning rules, multiple task subsets with no dependencies on each other can be obtained, ensuring that the execution results of different task subsets (such as task failures) have no impact on the execution of other task subsets.
[0016] Step S12: Estimate the execution time of each task subset, obtain the estimated execution time, and obtain the cumulative execution time of each task execution device in the cloud management platform.
[0017] In this embodiment, after dividing all scheduled tasks into multiple task subsets (Jobi), the execution time of each task subset (Jobi) is estimated to obtain the estimated execution time Ti. Then, the cumulative execution time W(t) of each task execution device (such as a service resource pool) in the current cloud management platform is obtained. Here, the service resource pool can be a resource pool formed by multiple servers, or it can be multiple resource devices in a single server.
[0018] In this embodiment, the estimated execution time of each task subset is obtained by estimating the estimated execution time. Specifically, this may include: reading the preset execution time corresponding to each timed task in the task subset from a preset database; calculating the sum of multiple preset execution times corresponding to a single task subset to obtain the estimated execution time of the corresponding task subset. In this embodiment, the preset execution duration for each scheduled task can be read from the preset database. Then, all scheduled tasks that need to be executed and their corresponding preset execution durations can be displayed on the resource planning page. Other information, such as the dependencies between different scheduled tasks, can also be displayed on the resource planning page. Next, the sum of the preset execution durations of all scheduled tasks in the task subset is calculated. It can be understood that when there is only one scheduled task in the task subset (Jobi), the preset execution duration of that scheduled task is the estimated execution duration Ti of the task subset (Jobi). When there are multiple scheduled tasks in the task subset (Jobi), the sum of the preset execution durations of all scheduled tasks is the estimated execution duration Ti of the task subset (Jobi). The relationship between the task subset and the estimated execution duration can be expressed as (Jobi, Ti).
[0019] Step S13: According to the preset window selection rules, determine the optimal execution time window when using a preset maximum number of task execution devices to execute multiple task subsets; the preset window selection rules are to calculate the sum of a single estimated execution time and a single cumulative execution time to obtain the sum of multiple execution times, and take the maximum value among the sums of multiple execution times as the current optimal window.
[0020] In this embodiment, after obtaining the estimated execution time Ti of each task subset (Jobi) and the cumulative execution time W(t) of each task execution device (such as a service resource pool), the cumulative execution time W(t) of a single task execution device and the estimated execution time Ti of a single task subset are calculated to obtain multiple execution time sums. Then, the maximum value among the multiple execution time sums is used as the optimal execution time window (W(best)) when using a preset upper limit number P(max) of task execution devices to execute all task subsets (Jobi), i.e. (W(best), P(max)).
[0021] In this embodiment, the optimal execution time window for executing multiple task subsets using a preset maximum number of task execution devices is determined according to a preset window selection rule. Specifically, this may include: sorting multiple task subsets in descending order of estimated execution time to obtain sorted subsets; sorting the preset maximum number of task execution devices in ascending order of cumulative execution time to obtain first sorted execution devices; determining the sorting element groups corresponding to each sorting position in the sorted subsets and the first sorted execution devices, and calculating the sum of the execution times corresponding to each sorting element group to obtain multiple first execution time sums; each sorting element group includes a task subset and a task execution device at the corresponding sorting position; and using the maximum value among the multiple first execution time sums as the optimal execution time window for executing each task subset using a preset maximum number of task execution devices. In this embodiment, all task subsets (Jobi) can first be sorted in descending order of estimated execution time Ti to obtain sorted subsets. Then, the cumulative execution time of the current preset maximum number (P(max)) task execution devices (such as service resource pools) is obtained to obtain the cumulative execution time W(t). The preset maximum number (P(max)) service resource pools are then sorted in ascending order of cumulative execution time W(t) to obtain the first sorted execution devices. Next, the sorted subsets (such as Job1, Job6, Job7, Job8, Job9 ... The sorting element groups corresponding to each sorting position in the first sorted execution devices (such as service resource pool 4, service resource pool 7, service resource pool 9, ..., service resource pool 2) are as follows: the two nodes at the top, i.e. (Job1, service resource pool 4), indicate that the resource pool with the shortest cumulative execution time is selected from multiple service resource pools to place the task subset with the longest execution time; the two nodes at the second position, i.e. (Job6, service resource pool 7), etc. Then, the sum of the execution time corresponding to each sorting element group (i.e., Ti + W(t)) is calculated to obtain multiple first execution time sums W1'(t). The maximum value among the multiple first execution time sums W1'(t) is taken as the optimal execution time window (W(best)) when all task subsets are executed using a preset upper limit number (P(max)) of service resource pools, i.e., W(best) = Max(W1'(t)), W1'(t) = Ti + W(t).
[0022] In this embodiment, the method may further include: sequentially allocating each task subset in the sorted subset to the corresponding task execution device in the first sorted execution device based on the sorted element group, thereby obtaining a first allocation relationship; obtaining the name of the task execution device corresponding to the first allocation relationship, thereby obtaining the first execution device name; and recording the first allocation relationship and the corresponding first execution device name, cumulative execution time, and estimated execution time through a preset array to obtain task scheduling information. In this embodiment, a pre-set JobMap array can be used to record task scheduling information generated in the current scheduling process, such as device information (e.g., service resource pool information) and task placement results. Specifically, based on the sorted element groups, such as (Job1, Service Resource Pool 4) and (Job6, Service Resource Pool 7), each task subset in the sorted subset is sequentially assigned to the corresponding task execution device in the first sorted execution device. For example, task subset Job1 is assigned to Service Resource Pool 4, obtaining the first allocation relationship. Then, the name of the service resource pool corresponding to this first allocation relationship is obtained, thus obtaining the name of the first execution device (i.e., Service Resource Pool 4). Finally, the first allocation relationship, the corresponding first execution device name (i.e., Service Resource Pool 4), the cumulative execution time W(t), the estimated execution time Ti, the timestamp, and other information are saved to the JobMap array. For example, the task scheduling information maintained during the scheduling process is recorded through the following JobMap array: JobMap=[ { Process: Pi; / / Name of the service resource pool WinTime: Wi; / / Cumulative execution time of the service resource pool Jobs: [ {name: Jobi;time: Ti}, {…}] / / List of task subsets to be executed },……].
[0023] By recording real-time task scheduling information generated during the current scheduling process using an array, users can easily understand the current scheduling information and progress. Furthermore, in the event of scheduling anomalies, the cause of the anomaly can be quickly located based on the task scheduling information recorded in the array. This JobMap array can also be displayed through the resource planning page.
[0024] Step S14: Based on the estimated execution time and cumulative execution time, and using a binary search algorithm, find the optimal number of task execution devices required to execute each subset of tasks within a preset upper limit execution time window.
[0025] In this embodiment, after determining (W(best), P(max)), based on the estimated execution time and cumulative execution time, and using a binary search algorithm (a search algorithm for finding a specific element in an ordered array, which continuously narrows the search area to reduce the difficulty of finding the target element, and can be implemented recursively or non-recursively), the optimal number of task execution devices (P(best)) required to execute each task subset (Jobi) within a preset upper limit execution time window (W(max)) can be found. Initially, the cumulative execution time of all task execution devices (such as the service resource pool) can be set to W(t) = 0.
[0026] It should be noted that the preset upper limit quantity (P(max)) and the preset execution time window for the upper limit (W(max)) can be set in advance through the resource planning page of the cloud management platform. For example, the administrator enters the resource planning page, clicks the planning button, and then enters the relevant information in the pop-up window, such as the service resource pool upper limit (i.e., P(max)) and the time window upper limit (i.e., W(max)). If the administrator does not set them, P(max) and W(max) can also be set to default values, for example, P(max) = 30, W(max) = 6 hours.
[0027] Furthermore, the resource planning page can display data generated throughout the scheduling process, such as the first execution time window (W(best)), the first number of devices (P(best)), and the JobMap array. Additionally, when task information needs adjustment, administrators can access the resource planning page to adjust the execution time of individual scheduled tasks, dependencies between tasks, add scheduled tasks, and delete scheduled tasks. Then, based on the final input task information, a new task scheduling process is re-executed. For example, when a new scheduled task is added, the process returns to step S11 to partition the task subset. Therefore, this application can meet the administrator's need to adjust the task information to be executed at any time according to actual business needs, and will regenerate a new scheduling strategy based on the latest task information. Thus, this application has excellent applicability.
[0028] In this embodiment, based on the estimated execution time and cumulative execution time, and using a binary search algorithm, the optimal number of task execution devices required to execute each task subset within a preset upper limit execution time window is found. Specifically, this may include: summing multiple estimated execution times to obtain a total execution time, and calculating the ratio of the total execution time to the preset upper limit execution time window to obtain a first lower bound for the number of devices; calculating the average of the first lower bound and the preset upper limit number; sorting the target number of task execution devices in ascending order of cumulative execution time to obtain a second sorted number of execution devices; the target number is a number determined based on the current average value; and determining the sorting element corresponding to each sorting position in the sorted subset and the second sorted number of execution devices. The system groups the target number of tasks and calculates the sum of execution times for each sorted element group to obtain multiple second execution time sums. The maximum value among the multiple second execution time sums is taken as the ideal window. If the ideal window is less than or equal to the preset upper limit of the execution time window, the target number is decremented to generate a first upper limit of the number of devices. If the first upper limit of the number of devices is not greater than the first lower limit of the number of devices, the target number is taken as the optimal number of devices required to execute each subset of tasks within the preset upper limit of the execution time window. If the first upper limit of the number of devices is greater than the first lower limit of the number of devices, the average of the first upper limit of the number of devices and the first lower limit of the number of devices is calculated, and the system jumps to the step of sorting the target number of task execution devices in ascending order of cumulative execution time. In this embodiment, under the condition of the preset upper limit of the execution time window (W(max)), the optimal number of devices (P(best)) can be found from [1,P(max)] using a binary search algorithm.The specific steps are as follows: First, sum the estimated execution times Ti of all task subsets (Jobi) to obtain the total execution time T'. Then, calculate the ratio of the total execution time T' to the preset upper limit execution time window (W(max)) to obtain the lower bound of the first number of devices (P1 lower bound). Next, calculate the average of the lower bound of the first number of devices (P1 lower bound) and the preset upper limit number (P(max)), and determine a quantity value based on the current average to obtain the target quantity. Then, obtain the cumulative execution time W(t) of the target quantity (e.g., 10) task execution devices (which can be randomly selected or selected according to the order of device numbers), and sort the 10 service resource pools in ascending order of cumulative execution time W(t) to obtain the second sorted execution devices. Further, determine the sorting element groups (e.g., (Job6, service resource pool 3), (Job4, service resource pool 6), etc.) corresponding to each sorting position in the sorted subsets and the second sorted execution devices, and calculate the sum of the execution times corresponding to each sorting element group to obtain multiple The sum of the second execution durations W2'(t) is used. Then, the maximum value among the sums of multiple second execution durations W2'(t) is used as the ideal window (W(current)). It is then determined whether the ideal window (W(current)) is less than or equal to the preset upper limit of the execution time window (W(max)). If the ideal window (W(current)) is less than or equal to the preset upper limit of the execution time window (W(max)), the current number of service resource pools (i.e., the target number) is recorded through P(temp), and the target number is decremented (e.g., target number - 1) to generate the first upper limit of the number of devices (P1 upper limit). Then, it is determined whether the first upper limit of the number of devices (P1 upper limit) is greater than the first lower limit of the number of devices (P1 lower limit). If the first upper limit of the number of devices (P1 upper limit) is not greater than the first lower limit of the number of devices (P1 lower limit), the target number recorded in P(temp) is used as the optimal number of devices (P(best)) required to execute each task subset within the preset upper limit of the execution time window (W(max)). If the upper bound of the first number of devices (P1 upper bound) is greater than the lower bound of the first number of devices (P1 lower bound), the search continues. At this point, the average of the upper bound of the first number of devices (P1 upper bound) and the lower bound of the first number of devices (P1 lower bound) can be calculated, and a new target number is determined based on the current average. Then, the process jumps to the step of sorting the target number of task execution devices in ascending order of cumulative execution time. By using a binary search algorithm to perform a P(best) search under the W(max) condition, the difficulty of finding P(best) is reduced, and the search efficiency is improved. This improves the efficiency of generating scheduling strategies in scenarios with a large number of complex timed tasks, meeting real-time scheduling requirements.
[0029] In this embodiment, it may further include: if the ideal window is greater than the execution time window of the preset upper limit, then the target number is incremented to generate a second lower bound for the number of devices; if the preset upper limit number is greater than the second lower bound for the number of devices, then the average of the preset upper limit number and the second lower bound for the number of devices is calculated, and the process jumps to the step of sorting the target number of task execution devices in order of cumulative execution time from shortest to longest; if the preset upper limit number is not greater than the second lower bound for the number of devices, then the target number is taken as the optimal number of task execution devices required to execute each subset of tasks within the execution time window of the preset upper limit. In this embodiment, if the ideal window (W(current)) is greater than the preset upper limit execution time window (W(max)), the target number is incremented (e.g., target number + 1) to generate a second lower bound for the number of devices (P2 lower bound). It is then determined whether the preset upper limit number (P(max)) is greater than the second lower bound for the number of devices (P2 lower bound). If it is, the average of the preset upper limit number (P(max)) and the second lower bound for the number of devices (P2 lower bound) is calculated, and a new target number is generated based on this average. The target number of task execution devices are then reordered according to the cumulative execution time W(t) from shortest to longest, i.e., P(best) is searched again. If the target number is not greater than the second lower bound for the number of devices (P2 lower bound), the target number recorded in P(temp) is used as the optimal number of task execution devices (P(best)) required to execute each task subset within the preset upper limit execution time window (W(max)), i.e., (W(max), P(best)).
[0030] In this embodiment, the ratio of the total execution time to a preset upper limit execution time window is calculated to obtain the lower bound of the number of first devices. Specifically, this may include: calculating the ratio of the total execution time to the preset upper limit execution time window and determining whether the ratio is an integer; if the ratio is not an integer, the value is rounded up using a rounding function to obtain the lower bound of the number of first devices. In this embodiment, the ratio of the total execution time T' to the preset upper limit execution time window (W(max)) is calculated, and then it is determined whether the ratio is an integer. If it is not an integer (e.g., 2.5), the value is rounded up using a rounding function to obtain the lower bound of the number of first devices (e.g., 3). By using a rounding function to obtain the lower bound of the number of first devices, it is ensured that resources can be allocated to all subsets of tasks, while avoiding resource waste.
[0031] In this embodiment, the target number of task execution devices are sorted in ascending order of cumulative execution time to obtain the second sorted execution devices. Specifically, this may include: if the current average value is not an integer, the current average value is rounded down using a floor function to obtain the target number, and the target number of task execution devices are then sorted in ascending order of cumulative execution time to obtain the second sorted execution devices. That is, if the current average value is not an integer (e.g., 2.4), the current average value is rounded down using a floor function to obtain the target number Mid (i.e., 2), and then the cumulative execution time W(t) of the target number Mid task execution devices is obtained, and the target number of task execution devices are sorted in ascending order of cumulative execution time W(t) to obtain the second sorted execution devices. It can be seen that in this application, when performing binary search for bounding, the upper bound is rounded up and the middle value is rounded down. This method can prevent resource waste or insufficiency.
[0032] In this embodiment, it may further include: allocating each task subset in the sorted subset to the corresponding task execution device in the second sorted execution device based on the sorted element group, to obtain a second allocation relationship; obtaining the name of the task execution device corresponding to the second allocation relationship, to obtain the name of the second execution device; and updating the task scheduling information recorded in the preset array based on the second allocation relationship and the corresponding name of the second execution device, the cumulative execution time and the estimated execution time. In this embodiment, when using the binary search algorithm to find (W(max), P(best)), based on the sorted element group (such as (Job6, service resource pool 3), (Job4, service resource pool 6) etc.), each task subset in the sorted subset is sequentially assigned to the corresponding task execution device in the second sorted execution device. For example, the task subset Job6 is assigned to service resource pool 3 to obtain the corresponding second allocation relationship. Then, the name of the task execution device corresponding to the second allocation relationship is obtained to obtain the name of the second execution device (i.e., service resource pool 3). Then, the task scheduling information recorded in the above JobMap array is updated using the current task scheduling information, such as the second allocation relationship, the corresponding name of the second execution device (i.e., service resource pool 3), the cumulative execution time W(t), the estimated execution time Ti, the current timestamp, etc., so as to grasp the latest scheduling information and progress.
[0033] Step S15: Balance the optimal execution time window and the optimal number of devices to obtain a new time window and a new number of devices.
[0034] In this embodiment, after obtaining (W(best), P(max)) and (W(max), P(best)), the optimal execution time window (W(best)) and the optimal number of devices (P(best)) can be further balanced to obtain a new time window (W(new)) and a new number of devices (P(new)). P(best) is then incremented to obtain P(new) = P(best) + 1.
[0035] Step S16: If the new time window or the window compression degree of the new time window relative to the old time window is less than or equal to the corresponding preset threshold, then the new time window is used as the target execution time window, and the number of new devices is used as the target number of devices.
[0036] In this embodiment, after obtaining (W(new), P(new)), it is determined whether W(new) is less than or equal to a first preset threshold, or whether the window compression degree of W(new) relative to the old time window (W(old)) is less than or equal to a second preset threshold. If the conditions are met, i.e., W(new) is less than or equal to the first preset threshold, or the window compression degree is less than or equal to the second preset threshold, then W(new) is used as the target execution time window (W(final)), and P(new) is used as the target number of devices (P(final)). The preset threshold can be set in advance through the resource planning page, or it can be a default value.
[0037] Step S17: Within the target execution time window, schedule each task subset to the target number of task execution devices to obtain the corresponding task execution results.
[0038] In this embodiment, after obtaining (W(final), P(final)), the administrator can plan a startup time based on W(final), and then when the startup time is reached, within W(final), schedule each task subset to P(final) task execution devices for execution, thereby obtaining the task execution results corresponding to each task subset.
[0039] In this embodiment, before executing the task subset according to (W(final), P(final)), considering the possibility that the same scheduled task may be a prerequisite task for multiple other scheduled tasks, a prerequisite dependency task array (arrayPre, such as a two-dimensional array) can be first calculated. This array is used to ensure that the same scheduled task existing in multiple task subsets will not be executed repeatedly, and the execution result can be recorded. Specifically, the array can fill the first row with the names of all prerequisite tasks, then record the execution count of the task in the second row, with an initial value of 0, and record the execution status of the task in the third row: 0 indicates not executed, 1 indicates in progress, 2 indicates completed, and 3 indicates failed. Finally, the specific execution information of the task is recorded in the fourth row, for example: arrayPre = [[a, b, c, d, ……] / / Task name [0, 1, 1, 1, ……] / / Number of times the task was executed [0, 1, 2, 3, ……] / / Task execution record [null,null,“vol1”,“CMM204930”……] / / Task execution information ] During the execution of task subsets according to the final task execution strategy (W(final), P(final)) and the corresponding allocation relationship between subsets and device resources, if a scheduled task is a prerequisite task, the prerequisite dependent task array will be checked first. If it has already been executed, it will not be executed again. If a task subset fails, it will be skipped. Finally, the execution results of all task subsets will be output uniformly. Through the above execution method, the execution process and results of tasks can be recorded, and repeated prerequisite tasks are executed only once, thus preventing resource waste.
[0040] Specifically, corresponding task subsets can be placed in the service resource pool queue. If a task subset fails to execute, an error log is recorded, the task subset is skipped, and the execution of the task subset is determined to have failed. Then, the execution of the subsequent task subset is started directly.
[0041] As can be seen, this embodiment first divides the set of scheduled tasks into multiple task subsets based on the dependencies between them (there are no dependencies between scheduled tasks in different task subsets). This ensures both the integrity of the tasks and their independence, preventing different task subsets from affecting each other. Next, based on the window selection rule that the maximum value between the estimated execution time of the subset and the sum of the cumulative execution time of the devices is the current optimal window, the optimal execution time window is determined when using a preset upper limit number of task execution devices to execute multiple task subsets. A binary search algorithm is then used to find the optimal number of task execution devices required to execute each task subset within the preset upper limit execution time window. The optimal execution time window and the optimal number of devices are then balanced. If the new time window obtained after the balance, or the window compression degree of the new time window relative to the old time window, is less than or equal to a corresponding preset threshold, then the new time window is used as the target execution time window. The execution time window is set, and the new number of devices obtained after balancing is used as the target number of devices. Finally, within the target execution time window, each subset of tasks is scheduled to be executed on the target number of task execution devices. It can be seen that the task execution method in this application is not generated based on a single dimension of optimality, such as the optimal number of devices required when the execution time window has a preset upper limit, or the optimal execution time window corresponding to the preset upper limit number of task execution devices. Instead, it further balances the scheduling results when two single dimensions are optimal, and considers both the number of devices and the time window. This allows for more reasonable planning of the execution time of scheduled tasks and the number of task execution devices required. It can rationally plan resources while ensuring efficient task execution, avoiding resource waste. At the same time, it improves the overall operation and maintenance efficiency and resource utilization efficiency of the cloud management platform. In addition, it realizes automated scheduling of scheduled tasks, saving manpower and time costs.
[0042] This application discloses a specific method for scheduling timed tasks. See [link to relevant documentation]. Figure 2 As shown, the method includes: Step S21: Divide the task subsets based on the dependencies between the timed tasks in the timed task set to obtain at least two task subsets; the timed tasks in any task subset have no dependencies on the timed tasks in other task subsets.
[0043] Step S22: Estimate the execution time of each task subset, obtain the estimated execution time, and obtain the cumulative execution time of each task execution device in the cloud management platform.
[0044] Step S23: According to the preset window selection rules, determine the optimal execution time window when using a preset maximum number of task execution devices to execute multiple task subsets; the preset window selection rules are to calculate the sum of a single estimated execution time and a single cumulative execution time to obtain the sum of multiple execution times, and take the maximum value among the sums of multiple execution times as the current optimal window.
[0045] Step S24: Based on the estimated execution time and cumulative execution time, and using a binary search algorithm, find the optimal number of task execution devices required to execute each subset of tasks within a preset upper limit execution time window.
[0046] Step S25: Increment the optimal number of devices to obtain the new number of devices, and sort the new number of devices and task execution devices in order of cumulative execution time from shortest to longest to obtain the third sorted execution devices.
[0047] In this embodiment, the optimal number of devices (P(best)) is first incremented (e.g., P(best)+1) to obtain the new number of devices (P(new)). Then, the cumulative execution time W(t) of the new number of devices (P(new)) is obtained, and the new number of devices (P(new)) are sorted in ascending order of cumulative execution time W(t) to obtain the third sorted execution devices.
[0048] Step S26: Determine the sorting element groups corresponding to each sorting position in the sorted subset and the third sorted execution device, and calculate the sum of the execution time corresponding to each sorting element group to obtain multiple third execution time sums. Take the maximum value among the multiple third execution time sums as the new time window.
[0049] In this embodiment, the sorting element groups (such as (Job8, service resource pool 2), (Job6, service resource pool 3), etc.) corresponding to each sorting position in the initial sorted subset and the third sorted execution device are determined. Then, the sum of the execution time corresponding to each sorting element group is calculated to obtain multiple third execution time sums W3'(t). The maximum value among all third execution time sums W3'(t) is used as the new time window (W(new)).
[0050] Step S27: If the new time window or the window compression degree of the new time window relative to the old time window is less than or equal to the corresponding preset threshold, then the new time window is used as the target execution time window, and the number of new devices is used as the target number of devices.
[0051] In a specific embodiment, if the window compression degree is less than or equal to the corresponding preset threshold, the new time window is taken as the target execution time window, which may specifically include: calculating the difference between the old time window and the new time window to obtain the first difference, and calculating the ratio of the first difference to the old time window to obtain the first calculation result; the initial value of the old time window is the execution time window of the preset upper limit; determining whether the first calculation result is less than or equal to the first preset threshold; the first preset threshold is between 0 and the first parameter, and the first parameter is the ratio of the second difference to the execution time window of the preset upper limit, and the second difference is the difference between the execution time window of the preset upper limit and the optimal execution time window; if the first calculation result is less than or equal to the first preset threshold, the new time window is taken as the target execution time window. That is, calculate the difference between the old time window (W(old)) and the new time window (W(new)) to obtain the first difference (i.e., W(old) - W(new)), and then calculate the ratio of the first difference to the old time window (W(old)) to obtain the first calculation result (i.e., (W(old) - W(new)) / W(old)); where, in the initial state, W(old) = W(max). Further, determine whether the first calculation result is less than or equal to the first preset threshold m; where, m can be used to evaluate the degree of time shortening, and the value range of m is: 0 < m < (W(max) - W(best)) / W(max). It should be noted that the value of m can be set by the administrator on the resource planning page, or can be set to a default value, such as 0.15, or can also be randomly generated within the value range. m cannot be less than 0, and less than 0 means there is no improvement, and (W(max) - W(best)) / W(max) is already the compression limit, so m cannot exceed this value. If (W(old) - W(new)) / W(old) <= m, then the new time window (W(new)) is taken as W(final).
[0052] In another specific embodiment, if the new time window is less than or equal to the corresponding preset threshold, the new time window is taken as the target execution time window, which may specifically include: determining whether the new time window is less than or equal to the second preset threshold; where, the second preset threshold is the product of the optimal device number and the second parameter, and the second parameter is between 1 and the third parameter, and the third parameter is the ratio of the execution time window of the preset upper limit to the optimal execution time window; if the new time window is less than or equal to the second preset threshold, the new time window is taken as the target execution time window. That is, determine whether the new time window (W(new)) is less than or equal to the second preset threshold n'; where, n' = W(best) n, where n can be configured by the administrator himself or herself, or can be a default value, such as 1.2, or can be randomly generated, but it needs to be within the following value range: 1 < n < W(max) / W(best). It should be noted that n cannot be less than 1, and W(best) The result of n cannot be greater than W(max). If W(new) <= W(best) n, then the new time window (W(new)) is taken as W(final).
[0053] In this embodiment, it may further include: if the new time window or the window compression degree is greater than the corresponding preset threshold, then increment the number of new devices to obtain the updated number of devices; take the updated number of devices as the number of new devices, and jump to the step of sorting the task execution devices with the number of new devices in ascending order of the cumulative execution duration to obtain the third sorted execution devices. In this embodiment, if (W(old) - W(new)) / W(old) > m or W(new) > W(best) n, it indicates that the balance condition has not been reached and it is necessary to continue to find the optimal number of devices and the optimal time window. At this time, the number of new devices can be incremented (such as P(new) + 1) to obtain the updated number of devices, and then take the updated number of devices (i.e., P(new) + 1) as the number of new devices, and re-jump to the step of sorting the task execution devices with the number of new devices in ascending order of the cumulative execution duration W(t).
[0054] In this embodiment, it may further include: sequentially allocate each task subset in the sorted subset to the corresponding task execution device in the third sorted execution devices based on the sorting element group to obtain the third allocation relationship; obtain the name of the task execution device corresponding to the third allocation relationship to obtain the third execution device name; update the task scheduling information recorded in the preset array based on the third allocation relationship, the corresponding third execution device name, the cumulative execution duration, and the estimated execution duration. In this embodiment, each task subset in the sorted subset can be allocated to the corresponding task execution device in the third sorted execution devices based on the sorting element group (such as (Job8, service resource pool 2), (Job6, service resource pool 3), etc.). For example, allocate the task subset Job8 in the sorted subset to the service resource pool 2 in the third sorted execution devices to obtain the third allocation relationship, then obtain the name of the task execution device corresponding to the third allocation relationship to obtain the third execution device name (i.e., service resource pool 2), and then update the task scheduling information already recorded in the preset array based on the third allocation relationship, the corresponding third execution device name (i.e., service resource pool 2), the cumulative execution duration W(t), and the estimated execution duration Ti. At this time, the task scheduling information can be used as the final scheduling strategy.
[0055] Step S28: Within the target execution time window, schedule each task subset to the target number of task execution devices to obtain the corresponding task execution results.
[0056] For more detailed processing procedures regarding steps S21 to S24 and S28, please refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
[0057] As can be seen, this embodiment of the application, based on the optimal execution time window (W(best)) and the optimal number of devices (P(best)), further optimizes (W(best)) and (P(best)) from two dimensions: time window and device resources, based on two different balance conditions (the window compression degree of the new time window or the new time window relative to the old time window is less than or equal to the corresponding preset threshold). This makes the final task execution strategy (including W(final) and P(final)) minimize the occupation of device resources and minimize the execution time, thus saving resources and ensuring the smooth execution of the scheduled task.
[0058] Accordingly, this application also discloses a timed task scheduling device applied to a cloud management platform, the device comprising: The partitioning module is used to partition the task subsets based on the dependencies between the timed tasks in the timed task set, so as to obtain at least two task subsets; the timed tasks in any task subset have no dependency relationship with the timed tasks in other task subsets. The estimation module is used to estimate the execution time of each task subset and obtain the estimated execution time. The acquisition module is used to obtain the cumulative execution time of each task execution device in the cloud management platform; The first determining module is used to determine the optimal execution time window when using a preset maximum number of task execution devices to execute multiple task subsets according to a preset window selection rule. The preset window selection rule is to calculate the sum of a single estimated execution time and a single cumulative execution time to obtain the sum of multiple execution times, and take the maximum value among the sums of multiple execution times as the current optimal window. The search module is used to find the optimal number of task execution devices required to execute each subset of tasks within a preset upper limit execution time window, based on the estimated execution time and the cumulative execution time and using a binary search algorithm. The balancing module is used to balance the optimal execution time window and the optimal number of devices to obtain a new time window and a new number of devices. The second determining module is used to determine the new time window as the target execution time window and the number of new devices as the target number of devices if the new time window or the window compression degree of the new time window relative to the old time window is less than or equal to the corresponding preset threshold. The scheduling module is used to schedule each subset of tasks to the target number of task execution devices within the target execution time window, so as to obtain the corresponding task execution results.
[0059] The specific workflow of each of the above modules can be found in the relevant content disclosed in the foregoing embodiments, and will not be repeated here.
[0060] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above-described timed task scheduling method embodiments.
[0061] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described timed task scheduling method embodiments when it runs.
[0062] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0063] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described timed task scheduling method embodiments.
[0064] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described timed task scheduling method embodiments.
[0065] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be executed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-a-chip (SoC), a complex programmable logic device (CPLD), a microprocessor (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or one or more combinations thereof. The aforementioned computer program (also known as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.
[0066] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0067] The above provides a detailed description of a timed task scheduling method and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A method for scheduling timed tasks, characterized in that, Applications in cloud management platforms, including: The task subsets are divided based on the dependencies between the scheduled tasks in the scheduled task set to obtain at least two task subsets; the scheduled tasks in any task subset have no dependencies on the scheduled tasks in other task subsets. Estimate the execution time of each of the aforementioned task subsets to obtain the estimated execution time, and obtain the cumulative execution time of each task execution device in the cloud management platform; According to the preset window selection rules, the optimal execution time window is determined when a preset upper limit number of task execution devices are used to execute multiple task subsets; the preset window selection rules are to calculate the sum of a single estimated execution time and a single cumulative execution time to obtain the sum of multiple execution times, and take the maximum value among the sums of multiple execution times as the current optimal window; Based on the estimated execution time and the cumulative execution time, and using a binary search algorithm, find the optimal number of task execution devices required to execute each subset of tasks within a preset upper limit execution time window; The optimal execution time window and the optimal number of devices are balanced to obtain a new time window and a new number of devices. If the new time window or the window compression degree of the new time window relative to the old time window is less than or equal to the corresponding preset threshold, then the new time window is taken as the target execution time window, and the number of new devices is taken as the target number of devices. Within the target execution time window, each of the task subsets is scheduled to the target number of task execution devices to obtain the corresponding task execution results.
2. The timed task scheduling method according to claim 1, characterized in that, The estimated execution time for each of the task subsets is obtained by estimating the estimated execution time, including: Read the preset execution duration corresponding to each timed task in the task subset from the preset database; Calculate the sum of the preset execution times corresponding to a single task subset to obtain the estimated execution time of the corresponding task subset.
3. The timed task scheduling method according to claim 1, characterized in that, The step of determining the optimal execution time window when using a preset maximum number of task execution devices to execute multiple subsets of tasks according to preset window selection rules includes: The multiple task subsets are sorted in descending order of estimated execution time to obtain the sorted subsets; The task execution devices are sorted according to the cumulative execution time from shortest to longest, according to a preset upper limit number of devices, to obtain the first sorted execution devices; Determine the sorting element groups corresponding to each sorting position in the sorted subset and the first sorted execution device, and calculate the sum of the execution times corresponding to each sorting element group to obtain a sum of multiple first execution times; the sorting element group includes a task subset and a task execution device at the corresponding sorting position; The maximum value among the sums of the multiple first execution durations is taken as the optimal execution time window when each of the task subsets is executed using a preset upper limit number of the task execution devices.
4. The timed task scheduling method according to claim 3, characterized in that, Also includes: Based on the sorted element group, each task subset in the sorted subset is sequentially assigned to the corresponding task execution device in the first sorted execution device to obtain the first allocation relationship; Obtain the name of the task execution device corresponding to the first allocation relationship to obtain the first execution device name; Task scheduling information is obtained by recording the first allocation relationship, the corresponding first execution device name, the cumulative execution time, and the estimated execution time using a preset array.
5. The timed task scheduling method according to claim 4, characterized in that, The step of finding the optimal number of task execution devices required to execute each subset of tasks within a preset upper limit execution time window, based on the estimated execution time and the cumulative execution time and using a binary search algorithm, includes: The sum of multiple estimated execution times is calculated to obtain the total execution time, and the ratio of the total execution time to a preset upper limit execution time window is calculated to obtain the lower bound of the number of devices. Calculate the average of the lower bound of the first number of devices and the preset upper bound of the number of devices; The target number of task execution devices are sorted in ascending order of cumulative execution time to obtain the second sorted execution devices; the target number is a number determined based on the current average value. Determine the sorted element groups corresponding to each sorting position in the sorted subset and the second sorted execution device, and calculate the sum of the execution times corresponding to each sorted element group to obtain a sum of multiple second execution times; The maximum value among the sums of multiple second execution times is used as the ideal window; If the ideal window is less than or equal to the preset upper limit of the execution time window, the target number is decremented to generate a first upper limit for the number of devices. If the upper bound of the number of the first devices is not greater than the lower bound of the number of the first devices, then the target number is taken as the optimal number of task execution devices required to execute each subset of tasks within the execution time window of the preset upper limit. If the upper bound of the number of the first devices is greater than the lower bound of the number of the first devices, then calculate the average of the upper bound of the number of the first devices and the lower bound of the number of the first devices, and jump to the step of sorting the target number of task execution devices in order of cumulative execution time from shortest to longest.
6. The timed task scheduling method according to claim 5, characterized in that, Also includes: If the ideal window is larger than the preset upper limit of the execution time window, then the target number is incremented to generate a second lower bound for the number of devices; If the preset upper limit is greater than the lower limit of the second number of devices, then the average of the preset upper limit and the lower limit of the second number of devices is calculated, and the process jumps to the step of sorting the target number of task execution devices in order of cumulative execution time from shortest to longest. If the preset upper limit number is not greater than the lower limit of the second number of devices, then the target number is taken as the optimal number of task execution devices required to execute each subset of tasks within the execution time window of the preset upper limit.
7. The timed task scheduling method according to claim 6, characterized in that, Also includes: Based on the sorted element group, each task subset in the sorted subset is sequentially assigned to the corresponding task execution device in the second sorted execution device to obtain the second allocation relationship; Obtain the name of the task execution device corresponding to the second allocation relationship to obtain the second execution device name; The task scheduling information recorded in the preset array is updated based on the second allocation relationship and the corresponding second execution device name, the cumulative execution time and the estimated execution time.
8. The timed task scheduling method according to claim 5, characterized in that, The calculation of the ratio of the total execution time to a preset upper limit execution time window to obtain the lower bound of the first number of devices includes: Calculate the ratio of the total execution time to the preset upper limit of the execution time window, and determine whether the ratio is an integer; If the ratio is not an integer, the ratio is rounded up using a rounding function to obtain the lower bound of the number of devices.
9. The timed task scheduling method according to claim 5, characterized in that, The process of sorting the target number of task execution devices according to their cumulative execution time from shortest to longest to obtain the second sorted execution devices includes: If the current average value is not an integer, the current average value is rounded down using a floor function to obtain the target number. The target number of task execution devices are then sorted in ascending order of cumulative execution time to obtain the second sorted execution devices.
10. The timed task scheduling method according to claim 7, characterized in that, The step of balancing the optimal execution time window and the optimal number of devices to obtain a new time window and a new number of devices includes: The optimal number of devices is incremented to obtain a new number of devices. The number of new task execution devices are sorted in ascending order of cumulative execution time to obtain the third sorted execution devices; Determine the sorting element groups corresponding to each sorting position in the sorted subset and the third sorted execution device, and calculate the sum of the execution times corresponding to each sorting element group to obtain a sum of multiple third execution times; The maximum value among the sums of the multiple third execution durations is used as the new time window.
11. The timed task scheduling method according to claim 10, characterized in that, If the window compression degree is less than or equal to the corresponding preset threshold, then the new time window is used as the target execution time window, including: Calculate the difference between the old time window and the new time window to obtain a first difference, and calculate the ratio of the first difference to the old time window to obtain a first calculation result; the initial value of the old time window is the execution time window of the preset upper limit; Determine whether the first calculation result is less than or equal to a first preset threshold; the first preset threshold is between 0 and a first parameter, the first parameter is the ratio of the second difference to the execution time window of the preset upper limit, and the second difference is the difference between the execution time window of the preset upper limit and the optimal execution time window; If the first calculation result is less than or equal to the first preset threshold, then the new time window is used as the target execution time window.
12. The timed task scheduling method according to claim 10, characterized in that, If the new time window is less than or equal to the corresponding preset threshold, then the new time window is used as the target execution time window, including: Determine whether the new time window is less than or equal to a second preset threshold; wherein, the second preset threshold is the product of the optimal number of devices and a second parameter, the second parameter is between 1 and a third parameter, and the third parameter is the ratio of the execution time window of the preset upper limit to the optimal execution time window; If the new time window is less than or equal to the second preset threshold, then the new time window will be used as the target execution time window.
13. The timed task scheduling method according to claim 10, characterized in that, Also includes: If the new time window or the window compression degree is greater than the corresponding preset threshold, the number of new devices is incremented to obtain the updated number of devices. The updated number of devices is used as the new number of devices, and the process jumps to the step of sorting the new number of task execution devices in ascending order of cumulative execution time to obtain the third sorted execution devices.
14. The timed task scheduling method according to claim 10, characterized in that, Also includes: Based on the sorted element group, each task subset in the sorted subset is sequentially assigned to the corresponding task execution device in the third sorted execution device to obtain the third allocation relationship; Obtain the name of the task execution device corresponding to the third allocation relationship, and obtain the name of the third execution device; The task scheduling information recorded in the preset array is updated based on the third allocation relationship and the corresponding third execution device name, the cumulative execution time, and the estimated execution time.
15. An electronic device, characterized in that, It includes a processor and a memory; wherein, when the processor executes a computer program stored in the memory, it implements the timed task scheduling method as described in any one of claims 1 to 14.