Task scheduling method and device, equipment, medium and product
By detecting the arrival of a new task in a heterogeneous parallel system, the task scheduling conditions are determined based on the number of tasks and the initial time, the candidate scheduling order and completion time are selected, and the target task scheduling order is finally determined to allocate tasks, which solves the problem of low task scheduling efficiency in a heterogeneous parallel system, and realizes resource saving and unified task allocation.
Patent Information
- Application Number
- CN202411830174.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-14
AI Technical Summary
When heterogeneous parallel systems handle batch tasks, the existing task scheduling algorithm is low in efficiency, resulting in waste of computer resources and it is difficult to achieve unified task allocation and scheduling.
By detecting that a new task arrives, it is determined whether the task scheduling conditions are met based on the number of reached tasks and the initial time when the first task arrives. If it is met, the candidate scheduling order and candidate completion time are determined, and the target task scheduling order is finally determined to allocate tasks to the target execution server.
It effectively improves the task scheduling efficiency of heterogeneous parallel systems, saves computer resources, and realizes unified allocation and scheduling of batch tasks.
Smart Images

Figure CN119621285A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology and computer technology, and in particular to a task scheduling method, device, equipment, medium and product. Background Art
[0002] Parallel tasks refer to the task processing method of executing multiple tasks or operations simultaneously in a computer system, thereby improving the processing efficiency and response speed of the system. Computer parallel systems are widely used in modern enterprises. For example, batch processing platforms, continuous integration platforms and big data processing platforms in banking systems all involve a large number of parallel task processing.
[0003] In order to meet the timeliness requirements and different types of task processing needs, parallel systems generally process a large number of different types of parallel tasks by continuously increasing the number and types of execution servers. A parallel computer system composed of different execution servers is called a heterogeneous parallel system. In a heterogeneous parallel system, due to the different types of execution servers, the processing time for the same task is also different, which involves the problem of execution server allocation, that is, how to allocate the parallel tasks in the parallel task group to the execution servers to shorten the overall execution time. The current task scheduling algorithm generally allocates tasks to the execution server with the fastest processing time according to the order in which the tasks arrive, which has certain limitations when there are a large number of tasks.
[0004] Therefore, how to uniformly allocate and schedule batch tasks in heterogeneous parallel systems, effectively improve the task scheduling efficiency of heterogeneous parallel systems, and save computer resources is a problem that needs to be solved urgently. Summary of the invention
[0005] The present invention provides a task scheduling method, device, equipment, medium and product to uniformly allocate and schedule batch tasks, effectively improve the task scheduling efficiency of heterogeneous parallel systems, and save computer resources.
[0006] According to one aspect of the present invention, there is provided a task scheduling method, comprising:
[0007] In the process of acquiring tasks in a heterogeneous parallel system, if the arrival of a new task is detected, it is determined whether the task scheduling conditions are met based on the number of tasks that have arrived and the initial time when the first task arrives;
[0008] If yes, determine the candidate scheduling order corresponding to the to-be-assigned tasks, and determine the candidate completion time required for all the to-be-assigned tasks to be executed under each candidate task scheduling order according to the preset task scheduling information table;
[0009] According to the candidate completion time corresponding to each candidate task scheduling order, the target task scheduling order is determined to allocate the tasks to be allocated to the corresponding target execution servers to complete the task scheduling.
[0010] According to another aspect of the present invention, there is provided a task scheduling device, comprising:
[0011] A judgment module is used to determine whether the task scheduling conditions are met according to the number of tasks that have arrived and the initial time when the first task arrives, if a new task arrives during the process of acquiring tasks in a heterogeneous parallel system;
[0012] A determination module is used to determine the candidate scheduling order corresponding to the to-be-assigned tasks, and determine the candidate completion time required for all the to-be-assigned tasks to be executed under each candidate task scheduling order according to a preset task scheduling information table;
[0013] The scheduling module is used to determine the target task scheduling order according to the candidate completion time corresponding to each candidate task scheduling order, so as to assign the tasks to be assigned to the corresponding target execution servers to complete the task scheduling.
[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0015] at least one processor; and
[0016] a memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the task scheduling method described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the task scheduling method described in any embodiment of the present invention when executed.
[0019] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the task scheduling method of any embodiment of the present invention is implemented.
[0020] The technical solution of the embodiment of the present invention is that in the process of acquiring tasks in a heterogeneous parallel system, if a new task is detected to have arrived, whether the task scheduling condition is met is determined based on the number of tasks that have arrived and the initial time when the first task arrives; if so, the candidate scheduling order corresponding to the tasks to be assigned is determined, and the candidate completion time required for all the tasks to be assigned to be completed under each candidate task scheduling order is determined based on a preset task scheduling information table; the target task scheduling order is determined based on the candidate completion time corresponding to each candidate task scheduling order, so as to assign the tasks to be assigned to the corresponding target execution server and complete the task scheduling. By uniformly allocating and scheduling batch tasks, the task scheduling efficiency of the heterogeneous parallel system can be effectively improved and computer resources can be saved.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 is a flowchart of a task scheduling method provided by Embodiment 1 of the present invention;
[0024] Figure 2 is a flowchart of a task scheduling method provided by Embodiment 2 of the present invention;
[0025] Figure 3 is a structural block diagram of a task scheduling device provided in Embodiment 3 of the present invention;
[0026] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", "target", "candidate", "alternative", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. The acquisition, storage, use, processing, etc. of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0029] It should be noted that in the related art, tasks are generally assigned to the execution server with the fastest processing time according to the order in which they arrive. As more and more tasks are assigned, more and more parallel tasks arrive in the same time period. Allocating tasks completely according to the order in which tasks arrive may not be the optimal scheduling order. The present invention can effectively improve the task scheduling efficiency of heterogeneous parallel systems and save computer resources by uniformly allocating tasks that arrive in sequence or within a period of time as a scheduling unit. The specific implementation method will be described in detail in the subsequent embodiments.
[0030] Embodiment 1
[0031] Figure 1 is a flowchart of a task scheduling method provided by the first embodiment of the present invention; this embodiment can be applied to the situation where a heterogeneous parallel system uniformly allocates batch tasks to achieve efficient task scheduling. The method can be executed by a task scheduling device, which can be implemented in the form of hardware and / or software. The task scheduling device can be configured in an electronic device, such as a heterogeneous parallel system, wherein the heterogeneous parallel system can be a bank's business system, such as Figure 1 As shown, the task scheduling method includes:
[0032] S101. In the process of acquiring tasks in a heterogeneous parallel system, if the arrival of a new task is detected, whether a task scheduling condition is met is determined according to the number of tasks that have arrived and the initial time when the first task arrives.
[0033] Among them, a heterogeneous parallel system refers to a parallel computer system composed of execution servers of different types or characteristics, which is used to process a large number of parallel tasks simultaneously. A heterogeneous parallel system can be, for example, a Jenkins task scheduling system (an enterprise lightweight job scheduling system). An execution server can be, for example, a slave server. Different execution servers form an execution server cluster. For example, a set of p heterogeneous execution servers can be represented as S = {S1, S2, ..., S k , ..., S p}(1≦k≦p).
[0034] The number of tasks that have arrived refers to the number of tasks that the heterogeneous parallel system has currently obtained from the task publishing system or other business systems but has not yet been assigned. The initial time refers to the arrival time of the first task that has arrived among the unassigned tasks currently stored in the heterogeneous parallel system. The task scheduling condition refers to the condition that can indicate whether to start batch task scheduling. The task scheduling condition can be to determine whether the number of tasks that have arrived has reached a preset number, or whether the time interval between the current time and the initial time has reached a preset time threshold.
[0035] Optionally, in the process of acquiring tasks in a heterogeneous parallel system, tasks that arrive sequentially or within a period of time can be used as a scheduling unit for unified task allocation. If the arrival of a new task is detected, it is determined whether the task scheduling conditions are met based on the number of tasks that have arrived in this scheduling unit and the initial time of arrival of the first task.
[0036] Optionally, the heterogeneous parallel system can obtain new tasks sent by the task publishing system or other business systems in real time and distribute them in batches to the execution server to execute the new tasks. In the process of the heterogeneous parallel system obtaining tasks, if the arrival of new tasks is detected, it can first determine whether the number of tasks that have arrived triggers the task scheduling conditions. If not, it can further determine whether the initial time triggers the task scheduling conditions.
[0037] Optionally, if the arrival of a new task is detected, it can be determined whether the number of arrived tasks has reached a preset number. If not, it can be determined whether the time from the arrival of the first task has reached a preset duration threshold. If the number of arrived tasks has reached a preset number or the time from the arrival of the first task has reached a preset duration threshold, it is determined that the task scheduling conditions are met.
[0038] Optionally, whether the task scheduling conditions are met is determined based on the number of tasks that have arrived and the initial time of arrival of the first task, including: determining whether the number of tasks that have arrived is greater than or equal to a preset number; if not, determining the time interval between the initial time of arrival of the first task and the current time, and determining that the task scheduling conditions are met when the time interval is greater than or equal to a preset duration threshold.
[0039] The preset number refers to the maximum number of tasks that need to be scheduled. The preset duration threshold refers to the maximum duration that the duration of a task reaches and needs to be scheduled. The time interval can be the time deviation between the initial time and the current time. The number of tasks that have been reached refers to the number of tasks that have arrived in this scheduling unit.
[0040] Optionally, if the number of tasks that have arrived is greater than or equal to a preset number, it can be directly determined that the task scheduling conditions are met; if the number of tasks that have arrived is less than a preset number, and the time interval is less than a preset duration threshold, it can be determined that the task scheduling conditions are not met temporarily, and subsequent task scheduling operations will not be performed.
[0041] It should be noted that the above embodiment of the present invention determines whether to trigger the task scheduling condition by first judging whether the number of tasks has been reached and then judging the time interval. This can more comprehensively consider the prerequisites for task scheduling, so as to schedule tasks at the appropriate time and improve the efficiency of task scheduling.
[0042] It should be noted that, considering that when n consecutively arriving tasks are set as one allocation unit to determine and allocate the task scheduling order, it is easy for the first arriving task to wait too long, the present invention specifically sets that if the number of tasks arriving within a certain time range T is less than n, the tasks within this time range are also used as one allocation unit to determine and allocate the task scheduling order, and no further waiting is required. The values of T and n can be adjusted according to actual conditions, which is flexible and maneuverable, thereby effectively improving the efficiency of task scheduling.
[0043] S102: If yes, determine the candidate scheduling order corresponding to the to-be-assigned tasks, and determine the candidate completion time required for all the to-be-assigned tasks to be executed under each candidate task scheduling order according to a preset task scheduling information table.
[0044] The number of tasks to be assigned refers to the unassigned tasks stored in the heterogeneous parallel system when the task scheduling conditions are met. The candidate scheduling order refers to the execution order that the tasks to be assigned can follow. The candidate task order can be obtained by fully arranging the tasks to be assigned. For example, if the number of tasks to be assigned is n, the number of candidate scheduling orders can be n*(n-1).
[0045] The task scheduling information table refers to a predefined information table for storing the relevant attribute information of the tasks to be assigned and the candidate execution servers. The task scheduling information table can be updated once after each task scheduling. The candidate scheduling order corresponds to the candidate completion time. The candidate completion time refers to the time required to complete all the tasks to be assigned under the corresponding candidate scheduling order.
[0046] Exemplarily, the task scheduling information table may include the following: (1) the average execution time ET of each task to be assigned on each candidate execution server, which is used to predict the expected execution time of the task assigned to each execution server. i,k Represents the task to be assigned V i On the candidate execution server S k It should be noted that when adding a task, the average execution time of the new task on each execution server can be initialized to 0, that is, ET i,k = 0. (2) The estimated completion time ST of the assigned tasks on each candidate execution server can be obtained through ST k Represents the candidate execution server S k The estimated completion time of the assigned tasks.
[0047] For example, if the number of tasks to be assigned is n, the set of candidate task scheduling orders can be expressed as VL = {VL1, VL2, ..., VL j , ..., VL n*(n-1)}(1≦j≦n*(n-1)). For example, if n=3, then VL={VL1, VL2, ..., VL6}, VL1=V1V2V3 means the task scheduling order is V1, V2, V3; VL2=V1V3V2 means the task scheduling order is V1, V3, V2.
[0048] Optionally, according to a preset task scheduling information table, the candidate completion time required for the execution of all the assigned tasks under each candidate task scheduling order is determined, including: for each candidate task scheduling order, according to the preset task scheduling information table, the average execution time of each candidate task on each candidate execution server is determined, and the first estimated completion time of the assigned tasks to each candidate execution server is determined; according to the operating status of each candidate execution server, the second estimated completion time of each candidate task on each candidate execution server is determined in combination with the average execution time and the first estimated completion time; according to the second estimated completion time, the candidate execution server corresponding to each candidate task and the third estimated completion time of each candidate task on its corresponding candidate execution server are determined, and according to the third estimated completion time, the candidate completion time required for the execution of all the assigned tasks is determined.
[0049] Among them, the candidate task can be any task among the tasks to be assigned, and for each candidate task scheduling order, the tasks to be assigned can be determined as candidate tasks in turn. The first estimated completion time refers to the estimated completion time point ST of the assigned task after the historical task scheduling on each candidate execution server. The operating status refers to the situation that characterizes whether the candidate execution server can currently execute the task to be assigned immediately. The second estimated completion time refers to the time required for the candidate execution server to complete the assigned task and complete the corresponding candidate task. The third estimated completion time refers to the task completion time of the candidate task on the corresponding candidate execution server after the assignment is completed. The third estimated completion time can specifically be the minimum completion time of the candidate task among different candidate execution servers.
[0050] Optionally, a match may be directly performed in a preset task scheduling information table to determine the average execution time and the first estimated completion time.
[0051] Optionally, for each candidate task, the candidate execution server corresponding to the minimum completion time may be determined as the candidate execution server corresponding to the candidate task, and the completion time required for the candidate task on the candidate execution server may be determined as the third estimated completion time.
[0052] It should be noted that the above-mentioned embodiment of the present invention determines the time required to complete each candidate task under different candidate scheduling orders by analyzing the server operation status and the average execution time of tasks on different servers. It can accurately and comprehensively analyze the time required to complete all tasks under different scheduling orders, which is helpful for subsequent efficient task allocation.
[0053] Optionally, each candidate task is assigned to a corresponding candidate execution server based on the second estimated completion time to determine a third estimated completion time of each candidate task on its corresponding candidate execution server, including: under each candidate task scheduling order, for each candidate task, determining the candidate execution server corresponding to the minimum value of the second estimated completion time as the candidate execution server corresponding to the candidate task; and determining the minimum value of the second estimated completion time as the third estimated completion time of the candidate task on its corresponding candidate execution server.
[0054] Optionally, the candidate task V i Assign the second estimated completion time PT value (ie PT j,i,k ) The smallest candidate execution server S k .
[0055] For example, if the second estimated completion time of candidate task 1 on candidate execution server 1 is t1, and the second estimated completion time on candidate execution server 2 is t2, the minimum value of t1 and t2 can be determined. If t2 is the smallest, the corresponding candidate execution server 2 can be determined as the server corresponding to candidate task 1, and t2 is used as the third estimated completion time.
[0056] Optionally, in each candidate task scheduling sequence, for each candidate task, its corresponding candidate execution server can be determined based on the above steps until each candidate task in each candidate task scheduling sequence is assigned a corresponding candidate execution server.
[0057] It should be noted that the above embodiment of the present invention determines the execution server corresponding to the candidate task according to the minimum value of the second estimated completion time, and can select the most suitable execution server for each candidate task based on the completion time, which helps to complete the task efficiently and quickly.
[0058] Optionally, based on the third estimated completion time, determine the candidate completion time required for all the assigned tasks to be executed, including: for each candidate task scheduling order, determine the third estimated completion time of each candidate task on each candidate execution server; and determine the maximum value of the third estimated completion times as the candidate completion time required for all the assigned tasks to be executed under the candidate task scheduling order.
[0059] Optionally, based on the method described in the above embodiment, the second estimated completion time of each candidate task on each candidate execution server in each candidate task scheduling order may be determined, and the minimum value of the second estimated completion times may be determined as the third estimated completion time.
[0060] For example, the task scheduling order VL can be found j The PT with the largest value in the case j,i,k , set LT j The value is PT j,i,k , that is, the maximum value is determined as the candidate completion time required for all the tasks to be assigned to be completed.
[0061] It should be noted that the above embodiment of the present invention determines the maximum value of the third estimated time as the time required to complete all tasks under the candidate scheduling order, that is, uses the maximum value of the completion time of each task to represent the time required to complete the entire batch task, so that the time for completing all batch tasks can be determined concisely and accurately.
[0062] Optionally, in the process of determining the candidate completion time corresponding to each candidate task scheduling order, the present invention can record various temporary data generated under different task scheduling orders by setting a temporary data information table. When the task is finally assigned, the data in the table is cleared.
[0063] Exemplarily, the temporary data information table may include the following contents:
[0064] (1) Under each candidate scheduling order, the estimated completion time PT of each candidate task on each candidate execution server, that is, the second estimated completion time, PT j,i,k Represents the candidate scheduling order VL j Candidate tasks V i Assigned to the candidate execution server S k The estimated completion time corresponding to the above execution.
[0065] (2) Under each candidate scheduling order, the estimated completion time point ST' of the assigned tasks on each candidate execution server, that is, the first estimated completion time, ST' j,k Represents the candidate scheduling order VL j In the case of candidate execution server S k The estimated completion time of the assigned tasks.
[0066] (3) The candidate execution server S' assigned to each candidate task under each candidate scheduling order, that is, the candidate execution server corresponding to each candidate task, S' j,i Represents the scheduling order VL j Case V i Assigned execution server.
[0067] (4) The estimated completion time LT at which all the tasks to be assigned are completed under each candidate scheduling order, i.e., the candidate completion time, LT j Represents the candidate scheduling order VL j The estimated completion time when all the assigned tasks are completed.
[0068] S103 , determining a target task scheduling sequence according to the candidate completion time corresponding to each candidate task scheduling sequence, so as to allocate the tasks to be allocated to the corresponding target execution servers, and completing task scheduling.
[0069] The target task scheduling order may be the candidate task scheduling order with the earliest candidate completion time. The target execution server refers to the candidate execution server corresponding to the task to be assigned under the target task scheduling order.
[0070] Optionally, tasks may be assigned according to the target task scheduling order with the earliest estimated completion time of all tasks and the corresponding target execution servers, so that the tasks to be assigned are distributed to the corresponding target execution servers for processing.
[0071] Optionally, a target task scheduling order is determined based on the candidate completion times corresponding to each candidate task scheduling order, so as to assign the tasks to be assigned to the corresponding target execution servers to complete task scheduling, including: based on the candidate task completion times corresponding to each candidate task scheduling order, determining the candidate task scheduling order corresponding to the minimum value of the candidate task completion times as the target task scheduling order; determining the candidate tasks under the target task scheduling order as the tasks to be assigned, and determining the candidate execution servers corresponding to each candidate task under the target task scheduling order as the target execution servers corresponding to the tasks to be assigned, so as to assign the tasks to be assigned to the corresponding target execution servers to complete task scheduling.
[0072] For example, the candidate completion time LT with the smallest value can be found. j , then the corresponding candidate scheduling order VL j Scheduling order for target tasks, according to VL j The task scheduling order and execution server S' j,i The value of is used to make the final execution server allocation for the n tasks to be assigned.
[0073] It should be noted that the above embodiment of the present invention can determine the optimal task scheduling order by determining the target task scheduling order from the candidate task scheduling order according to the task completion time, which helps to achieve optimal allocation of tasks to be assigned and improve task completion efficiency.
[0074] The technical solution of the embodiment of the present invention is that in the process of acquiring tasks in a heterogeneous parallel system, if a new task is detected to have arrived, whether the task scheduling condition is met is determined based on the number of tasks that have arrived and the initial time when the first task arrives; if so, the candidate scheduling order corresponding to the tasks to be assigned is determined, and the candidate completion time required for all the tasks to be assigned to be completed under each candidate task scheduling order is determined based on a preset task scheduling information table; the target task scheduling order is determined based on the candidate completion time corresponding to each candidate task scheduling order, so as to assign the tasks to be assigned to the corresponding target execution server and complete the task scheduling. By uniformly allocating and scheduling batch tasks, the task scheduling efficiency of the heterogeneous parallel system can be effectively improved and computer resources can be saved.
[0075] Embodiment 2
[0076] Figure 2is a flowchart of a task scheduling method provided by the second embodiment of the present invention; based on the above embodiment, this embodiment provides a method for scheduling each task in a sequence VL when a heterogeneous parallel system assigns execution servers to n consecutive tasks. j , calculate the estimated execution completion time point when all the n tasks are executed, and then select the task sequence with the earliest estimated completion time point and the preferred instance for allocation of the execution server, specifically, Figure 2 As shown, the method includes:
[0077] S201, for the task scheduling sequence VL j , take out each task V in order i .
[0078] S202: Obtain the average execution time and the estimated completion time of the tasks assigned to each execution server from the task scheduling information table.
[0079] (1) Mission V i The average execution time ET on each execution server i,k ; (2) The estimated completion time of the assigned tasks on each execution server ST k At the same time, initialize the temporary data information table ST' j,k =ST k .
[0080] S203, calculation task V i On the execution server S k The estimated completion time PT of the execution j,i,k .
[0081] Specifically, (1) when executing server S k Once the allocation is available for immediate execution, PT j,i,k TC+ET is the current time point i,k ; (2) When the execution server needs to wait for other tasks to be completed before it can execute, PT j,i,k =ST' j,k +ET i,k ;
[0082] S204, set the task V i The PT value assigned to the estimated completion time (i.e. PT j,i,k ) The smallest execution server S k , set the execution server S' assigned to each task in the temporary data information table j,i = k, and update the estimated completion time ST' of the assigned tasks on each execution server j,k The value is PT j,i,k .
[0083] S205, loop steps S201 to S204 until VL j The n tasks under the scheduling order are assigned. Find the task scheduling order VL j The PT with the largest value in the case j,i,k , set LT j The value is PT j,i,k .
[0084] S206, loop S201 to S205 until all the scheduled task sequences of the task scheduling sequence set VL are calculated. Find the LT with the smallest value j , then the scheduling order VL j To schedule the best tasks.
[0085] S207, according to VL j The task scheduling order and S' j,i The value of is used to perform the final execution server allocation for these n tasks, and ST is updated at the same time k =ST' j,k .
[0086] S208, each task V i On its assigned execution server S k After the above execution is completed, V in the task scheduling information table is calculated and updated according to the actual execution time TR. i In S k The average execution time ET i,k .
[0087] The present invention allocates execution servers for n consecutive tasks by scheduling the order VL for each task. j In this case, the estimated execution completion time of all n tasks is calculated, and then the task sequence and execution server with the earliest estimated completion time are selected for allocation, which can effectively improve the task scheduling efficiency of heterogeneous parallel systems and save computer resources.
[0088] Embodiment 3
[0089] Figure 3 : is a structural block diagram of a task scheduling device provided in the third embodiment of the present invention; this embodiment can be applied to the situation where a heterogeneous parallel system uniformly allocates batch tasks to achieve efficient task scheduling. The task scheduling device provided in the embodiment of the present invention can execute the task scheduling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method; the task scheduling device can be implemented in the form of hardware and / or software, and configured in an electronic device with task scheduling function, such as a heterogeneous parallel system, wherein the heterogeneous parallel system can be a bank's business system, such as Figure 3 As shown, the task scheduling device specifically includes:
[0090] The judgment module 301 is used to determine whether the task scheduling condition is met according to the number of tasks that have arrived and the initial time when the first task arrives, if a new task arrives during the process of acquiring tasks in the heterogeneous parallel system;
[0091] The determination module 302 is used to determine the candidate scheduling order corresponding to the to-be-assigned tasks, and determine the candidate completion time required for all the to-be-assigned tasks to be executed under each candidate task scheduling order according to a preset task scheduling information table;
[0092] The scheduling module 303 is used to determine the target task scheduling order according to the candidate completion time corresponding to each candidate task scheduling order, so as to allocate the to-be-allocated tasks to the corresponding target execution servers to complete the task scheduling.
[0093] The technical solution of the embodiment of the present invention is that in the process of acquiring tasks in a heterogeneous parallel system, if a new task is detected to have arrived, whether the task scheduling condition is met is determined based on the number of tasks that have arrived and the initial time when the first task arrives; if so, the candidate scheduling order corresponding to the tasks to be assigned is determined, and the candidate completion time required for all the tasks to be assigned to be completed under each candidate task scheduling order is determined based on a preset task scheduling information table; the target task scheduling order is determined based on the candidate completion time corresponding to each candidate task scheduling order, so as to assign the tasks to be assigned to the corresponding target execution server and complete the task scheduling. By uniformly allocating and scheduling batch tasks, the task scheduling efficiency of the heterogeneous parallel system can be effectively improved and computer resources can be saved.
[0094] Furthermore, the determination module 301 is specifically used for:
[0095] Determine whether the number of tasks that have arrived is greater than or equal to the preset number;
[0096] If not, the time interval between the initial time when the first task arrives and the current time is determined, and when the time interval is greater than or equal to a preset time threshold, it is determined that the task scheduling condition is met.
[0097] Further, the determination module 302 may include:
[0098] A first determining unit is used to determine, for each candidate task scheduling sequence, an average execution time of each candidate task on each candidate execution server according to a preset task scheduling information table, and determine a first estimated completion time of the task assigned to each candidate execution server;
[0099] A second determining unit is used to determine a second estimated completion time of each candidate task on each candidate execution server according to the operation status of each candidate execution server and in combination with the average execution time and the first estimated completion time;
[0100] The third determination unit is used to determine the candidate execution server corresponding to each candidate task and the third estimated completion time of each candidate task on its corresponding candidate execution server according to the second estimated completion time, and determine the candidate completion time required for all the assigned tasks to be executed according to the third estimated completion time.
[0101] Further, the third determining unit is specifically used for:
[0102] Under each candidate task scheduling order, for each candidate task, determine the candidate execution server corresponding to the minimum value of the second estimated completion time as the candidate execution server corresponding to the candidate task;
[0103] The minimum value of the second estimated completion times is determined as the third estimated completion time of the candidate task on its corresponding candidate execution server.
[0104] Further, the third determining unit is further configured to:
[0105] For each candidate task scheduling order, determine a third estimated completion time of each candidate task on each candidate execution server;
[0106] The maximum value among the third estimated completion times is determined as the candidate completion time required for all the tasks to be assigned to be completed under the candidate task scheduling sequence.
[0107] Furthermore, the scheduling module 303 is specifically used for:
[0108] According to the candidate task completion times corresponding to the candidate task scheduling sequences, the candidate task scheduling sequence corresponding to the minimum value of the candidate task completion times is determined as the target task scheduling sequence;
[0109] Determine the candidate tasks under the target task scheduling order as the tasks to be assigned, and determine the candidate execution servers corresponding to each candidate task under the target task scheduling order as the target execution servers corresponding to the tasks to be assigned, so as to assign the tasks to be assigned to the corresponding target execution servers and complete task scheduling.
[0110] Embodiment 4
[0111] Figure 4 It is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Figure 4A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0112] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0113] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0114] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a task scheduling method.
[0115] In some embodiments, the task scheduling method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the task scheduling method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the task scheduling method in any other appropriate manner (e.g., by means of firmware).
[0116] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0117] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0118] In the context of the present invention, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0119] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0120] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0121] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0122] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and the computer program implements the task scheduling method of any embodiment of the present invention when executed by a processor.
[0123] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0124] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0125] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A task scheduling method, characterized in that: include: In the process of acquiring tasks in a heterogeneous parallel system, if the arrival of a new task is detected, it is determined whether the task scheduling conditions are met based on the number of tasks that have arrived and the initial time when the first task arrives; If yes, determine the candidate scheduling order corresponding to the to-be-assigned tasks, and determine the candidate completion time required for all the to-be-assigned tasks to be executed under each candidate task scheduling order according to the preset task scheduling information table; According to the candidate completion time corresponding to each candidate task scheduling order, the target task scheduling order is determined to allocate the tasks to be allocated to the corresponding target execution servers to complete the task scheduling.
2. The method according to claim 1, characterized in that Based on the number of tasks that have arrived and the initial time when the first task arrives, determine whether the task scheduling conditions are met, including: Determine whether the number of tasks that have arrived is greater than or equal to the preset number; If not, the time interval between the initial time when the first task arrives and the current time is determined, and when the time interval is greater than or equal to a preset time threshold, it is determined that the task scheduling condition is met.
3. The method according to claim 1, characterized in that According to the preset task scheduling information table, determine the candidate completion time required for all the tasks to be assigned to be completed under each candidate task scheduling sequence, including: For each candidate task scheduling order, determine the average execution time of each candidate task on each candidate execution server according to a preset task scheduling information table, and determine the first estimated completion time of the task assigned to each candidate execution server; Determine a second estimated completion time of each candidate task on each candidate execution server according to the operation status of each candidate execution server and in combination with the average execution time and the first estimated completion time; According to the second estimated completion time, the candidate execution server corresponding to each candidate task and the third estimated completion time of each candidate task on its corresponding candidate execution server are determined, and according to the third estimated completion time, the candidate completion time required for all the tasks to be assigned to be completed is determined.
4. The method according to claim 3, characterized in that Determining, according to the second estimated completion time, a candidate execution server corresponding to each candidate task and a third estimated completion time of each candidate task on its corresponding candidate execution server, including: Under each candidate task scheduling order, for each candidate task, determine the candidate execution server corresponding to the minimum value of the second estimated completion time as the candidate execution server corresponding to the candidate task; The minimum value of the second estimated completion times is determined as the third estimated completion time of the candidate task on its corresponding candidate execution server.
5. The method according to claim 3, characterized in that: Based on the third estimated completion time, determine the candidate completion time required for all the tasks to be assigned to be completed, including: For each candidate task scheduling order, determine a third estimated completion time of each candidate task on each candidate execution server; The maximum value among the third estimated completion times is determined as the candidate completion time required for all the tasks to be assigned to be completed under the candidate task scheduling sequence.
6. The method according to claim 1, characterized in that According to the candidate completion time corresponding to each candidate task scheduling order, the target task scheduling order is determined to assign the to-be-assigned tasks to the corresponding target execution servers to complete the task scheduling, including: According to the candidate task completion times corresponding to the candidate task scheduling sequences, the candidate task scheduling sequence corresponding to the minimum value of the candidate task completion times is determined as the target task scheduling sequence; Determine the candidate tasks under the target task scheduling order as the tasks to be assigned, and determine the candidate execution servers corresponding to each candidate task under the target task scheduling order as the target execution servers corresponding to the tasks to be assigned, so as to assign the tasks to be assigned to the corresponding target execution servers and complete task scheduling.
7. A task scheduling device, characterized in that: include: A judgment module is used to determine whether the task scheduling conditions are met according to the number of tasks that have arrived and the initial time when the first task arrives, if a new task arrives during the process of acquiring tasks in a heterogeneous parallel system; A determination module is used to determine the candidate scheduling order corresponding to the to-be-assigned tasks, and determine the candidate completion time required for all the to-be-assigned tasks to be executed under each candidate task scheduling order according to a preset task scheduling information table; The scheduling module is used to determine the target task scheduling order according to the candidate completion time corresponding to each candidate task scheduling order, so as to assign the tasks to be assigned to the corresponding target execution servers to complete the task scheduling.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the task scheduling method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the task scheduling method according to any one of claims 1 to 6 when executed.
10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the task scheduling method according to any one of claims 1 to 6.
Citation Information
Cited By
Method and device for processing perception task
CN121864274A
Processing method and apparatus for perception task
CN121864274B