CN117453358A - Optimization method and device for offline scheduling task, electronic equipment and storage medium - Google Patents

Optimization method and device for offline scheduling task, electronic equipment and storage medium Download PDF

Info

Publication number
CN117453358A
CN117453358A CN202311354681.7A CN202311354681A CN117453358A CN 117453358 A CN117453358 A CN 117453358A CN 202311354681 A CN202311354681 A CN 202311354681A CN 117453358 A CN117453358 A CN 117453358A
Authority
CN
China
Prior art keywords
task
node task
time length
node
optimization
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311354681.7A
Other languages
Chinese (zh)
Inventor
胡育林
周斌
孙鑫炎
俞临曲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Shizhuang Information Technology Co ltd
Original Assignee
Shanghai Shizhuang Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Shizhuang Information Technology Co ltd filed Critical Shanghai Shizhuang Information Technology Co ltd
Priority to CN202311354681.7A priority Critical patent/CN117453358A/en
Publication of CN117453358A publication Critical patent/CN117453358A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The application discloses an optimization method and device for offline scheduling tasks, electronic equipment and a storage medium, and relates to the technical field of computer data processing. Wherein the method comprises the following steps: determining the operation time and the waiting time of each node task in the offline scheduling task; determining the total operation time length of the longest path task in the offline scheduling task based on the operation time length of each node task; calculating the optimization time length for adjusting the execution time of each node task based on the total operation time length and the waiting time length of each node task; and adjusting the execution time of each node task based on the optimized time length. According to the technical scheme, the offline scheduling task can be efficiently and accurately optimized, and the utilization rate of the resource space can be improved.

Description

Optimization method and device for offline scheduling task, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer data processing technologies, and in particular, to a method and apparatus for optimizing an offline scheduling task, an electronic device, and a storage medium.
Background
Offline scheduling tasks typically include a number of node tasks that are interdependent to form a vast task link. In the scenario of the timing operation of the offline scheduling task, there may be a situation that the start time set by the downstream node task is far later than the end time of the upstream node task on which the downstream node task depends, which may result in slow task output; and the interval time between the tasks of each node is too long, which results in wasting resource space.
In the prior art, by manually adjusting the starting time of each node task, the problems of time consumption, labor consumption and high error rate exist in a huge task link. Therefore, how to efficiently and accurately optimize offline scheduling tasks is a need to be addressed.
Disclosure of Invention
The application provides an optimization method, an optimization device, electronic equipment and a storage medium for offline scheduling tasks, which can efficiently and accurately optimize the offline scheduling tasks and can improve the utilization rate of resource space.
In a first aspect, the present application provides a method for optimizing offline scheduling tasks, where the method includes:
determining the operation time and the waiting time of each node task in the offline scheduling task;
determining the total operation time length of the longest path task in the offline scheduling task based on the operation time length of each node task;
calculating an optimization time length for adjusting the execution time of each node task based on the total operation time length and the waiting time length of each node task;
and adjusting the execution time of each node task based on the optimized time length.
Further, the offline scheduling task comprises at least one path task, and each path task comprises a termination node task; the calculating, based on the total operation duration and the waiting duration of each node task, an optimized duration for adjusting the execution time of each node task includes: calculating the optimization time length for adjusting the execution time of the termination node task in each path task based on the total operation time length; and sequentially calculating the optimization time length of each node task in each path task based on the optimization time length of the termination node task in each path task and the waiting time length of each node task in each path task.
Further, the calculating the optimization time length of each node task in each path task based on the optimization time length of the termination node task in each path task and the waiting time length of each node task in each path task in turn includes: taking the termination node task as a downstream node task; determining at least one upstream node task corresponding to the downstream node task from the task link of the offline scheduling task; determining a waiting time length of the downstream node task relative to a target upstream node task in the at least one upstream node task; calculating the optimization time length of the target upstream node task based on the optimization time length of the downstream node task and the waiting time length of the downstream node task, so as to obtain the optimization time length of each upstream node task in the at least one upstream node task; and taking the at least one upstream node task as a new downstream node task, and repeatedly executing the operation of determining the at least one upstream node task corresponding to the downstream node task from the task links of the offline scheduling task until the optimized time length of each node task is obtained.
Further, the calculating the optimized time length of the target upstream node task based on the optimized time length of the downstream node task and the waiting time length of the downstream node task includes: calculating a numerical result obtained by subtracting the waiting time of the downstream node task from the optimizing time of the downstream node task; if the numerical result is a non-negative number, determining that the optimization duration of the target upstream node task is the numerical result; and if the numerical result is negative, determining that the optimization duration of the target upstream node task is zero.
Further, before the calculating the optimized time length of the target upstream node task based on the optimized time length of the downstream node task and the waiting time length of the downstream node task, the method further includes: determining whether the waiting time of the downstream node task is smaller than a preset value; if the optimization time length of the target upstream node task is smaller than the optimization time length of the target upstream node task, determining that the optimization time length of the target upstream node task is zero; and if not, executing the operation of calculating the optimized time length of the target upstream node task based on the optimized time length of the downstream node task and the waiting time length of the downstream node task.
Further, the determining the total operation duration of the longest path task in the offline scheduling task based on the operation duration of each node task includes: determining the dependency relationship among the node tasks in the offline scheduling task; generating a task link for the offline scheduling task based on the dependency relationship; determining a first path task with the maximum sum of the operation time durations from a starting node task to a terminating node task in the task link based on the operation time duration of each node task; and determining the first path task as the longest path task, and determining the total operation duration corresponding to the longest path task.
Further, the adjusting the execution time of each node task based on the optimized duration includes: determining the initial execution time of each node task; and carrying out numerical operation on the initial execution time and the optimization time to obtain the target execution time of each node task.
In a second aspect, the present application provides an apparatus for optimizing offline scheduling tasks, the apparatus comprising:
the first data determining module is used for determining the operation duration and the waiting duration of each node task in the offline scheduling task;
the second data determining module is used for determining the total operation time length of the longest path task in the offline scheduling task based on the operation time length of each node task;
the optimization time length determining module is used for calculating the optimization time length for adjusting the execution time of each node task based on the total operation time length and the waiting time length of each node task;
and the execution time optimization module is used for adjusting the execution time of each node task based on the optimization time length.
In a third aspect, the present application provides an electronic device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of optimizing offline scheduling tasks described in any embodiment of the present application.
In a fourth aspect, the present application provides a computer readable storage medium storing computer instructions for causing a processor to execute an optimization method for offline scheduling tasks according to any embodiment of the present application.
In order to solve the defects of the prior art in the background technology, the embodiment of the application provides an optimization method for offline scheduling tasks, and the execution of the method can bring the following beneficial effects: according to the method and the device, the concept of the longest link is introduced into the offline scheduling task, the total operation time of the longest path task in the task link of the offline scheduling task is determined, the optimization time of the termination node task is determined, and finally the optimization time of each node task is calculated according to the sequence from the downstream node task to the upstream node task by combining the waiting time of each node task, so that the problems of time consumption, labor consumption and high error rate existing in the prior art when the offline scheduling task is manually adjusted can be solved, the offline scheduling task can be efficiently and accurately optimized, and the resource space utilization rate can be improved.
It should be noted that the above-mentioned computer instructions may be stored in whole or in part on a computer-readable storage medium. The computer readable storage medium may be packaged together with the processor of the offline scheduling task optimizing device, or may be packaged separately from the processor of the offline scheduling task optimizing device, which is not limited in this application.
The description of the second, third and fourth aspects of the present application may refer to the detailed description of the first aspect; moreover, the advantages described in the second aspect, the third aspect and the fourth aspect may refer to the analysis of the advantages of the first aspect, and are not described herein.
It should be understood that the description of this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
It can be appreciated that before using the technical solutions disclosed in the embodiments of the present application, the user should be informed and authorized by appropriate means of the type, the usage range, the usage scenario, etc. of the personal information related to the present application according to the relevant laws and regulations.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a first flow chart of an optimization method for offline scheduling tasks according to an embodiment of the present application;
FIG. 2 is a second flow chart of an optimization method for offline scheduling tasks according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a task link corresponding to an offline scheduling task according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an optimization device for offline scheduling tasks according to an embodiment of the present application;
FIG. 5 is a block diagram of an electronic device for implementing an optimization method for offline scheduling tasks in accordance with an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," "target," and "original," etc. in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the present application described herein may be capable of executing sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a first flow chart of an optimization method for offline scheduling tasks according to an embodiment of the present application, where the embodiment may be applicable to a case of adjusting execution time of each node task in offline scheduling tasks. The method for optimizing the offline scheduling task provided by the embodiment of the invention can be executed by the device for optimizing the offline scheduling task provided by the embodiment of the invention, and the device can be realized in a software and/or hardware mode and is integrated in an electronic device for executing the method, and an execution main body of the method is a microcontroller in the electronic device.
Referring to fig. 1, the method of the present embodiment includes, but is not limited to, the following steps:
s110, determining the operation time length and the waiting time length of each node task in the offline scheduling task.
The offline scheduling task is a program form for automatically completing specific logic by using timing aiming at periodical batch operation. The offline scheduling task comprises a plurality of node tasks, the running time length refers to the time length corresponding to each node task, and the waiting time length of the downstream node task refers to the interval time length between the completion of the execution of the upstream node task and the start of the execution of the downstream node task.
In the embodiment of the application, the microcontroller acquires task metadata of the offline scheduling task, and calculates the running duration and the waiting duration of each node task based on the task metadata.
S120, determining the total operation time length of the longest path task in the offline scheduling task based on the operation time length of each node task.
The longest path task refers to a path task with the longest execution time in a task link corresponding to the offline scheduling task, and the task link of the offline scheduling task includes at least one path task.
Specifically, determining the total operation time length of the longest path task in the offline scheduling task based on the operation time length of each node task includes: determining the dependency relationship among the node tasks in the offline scheduling task based on the task metadata of the offline scheduling task, namely determining an upstream node task and a downstream node task corresponding to a certain node task; generating a task link for the offline scheduling task based on the dependency relationship; determining a first path task with the maximum sum of the operation time lengths from the initial node task to the termination node task in the task link based on the operation time length of each node task; determining the first path task as the longest path task, accumulating the operation time of each node task in the longest path task to obtain the total operation time corresponding to the longest path task, and taking the total operation time of the longest path task as the total operation time of the whole task link.
The specific process of determining the longest path task may be: and sequentially processing each node task according to the topological sequence of the task links by using a topological sorting algorithm, namely accumulating the running time of each node task, updating the path task from the node task to the starting node task until the termination node task of each path task is processed, and thus obtaining a plurality of path tasks. And selecting a first path task corresponding to the maximum accumulated value of the operation time from the plurality of path tasks, and determining the first path task as the longest path task of the whole task link.
And S130, calculating the optimization time length for adjusting the execution time of each node task based on the total operation time length and the waiting time length of each node task.
Wherein, each path task comprises a termination node task, and the optimization time length refers to the time length for adjusting the execution time of the node task, and can comprise delay and advance, or non-optimization (kept unchanged) and advance; when the optimization time length of a certain node task is a positive number, the execution time of the node task is indicated to be advanced; when the optimization time length of a certain node task is a negative number, the execution time of the node task is delayed or not optimized.
Specifically, calculating an optimized time length for adjusting the execution time of each node task based on the total operation time length and the waiting time length of each node task includes: calculating the optimization time length for adjusting the execution time of the termination node task in each path task based on the total operation time length; and sequentially calculating the optimization time length of each node task in each path task based on the optimization time length of the termination node task in each path task and the waiting time length of each node task in each path task.
In this embodiment of the present application, for a certain path task, the total running duration may be subtracted from the initial execution time of the termination node task in the path task to obtain the optimized duration of the termination node task in the path task. It can be understood that if the optimization duration is a negative number, the execution time of the termination node task is delayed by a value corresponding to the optimization duration, or the execution time of the termination node task is not optimized; and if the optimization time length is a positive number, advancing the execution time of the termination node task by a value corresponding to the optimization time length.
For example, if the execution time of the start node task is 00:00, the execution time of the end node task in a certain path task is 02:00, and the total operation time of the whole task link is 80 minutes, the execution time of the end node task may be calculated to be 40 minutes earlier, that is: 120 minutes minus 80 minutes equals 40 minutes.
After determining the optimization time length of the termination node task in the path task, starting from the termination node task according to the sequence from the downstream node task to the upstream node task, the optimization time length of each node task in the path task can be calculated in sequence, and the specific calculation method can be as follows: the optimization time length of a certain upstream node task is equal to the optimization time length of a downstream node task corresponding to the upstream node task minus the waiting time of the downstream node task.
And S140, adjusting the execution time of each node task based on the optimized time length.
Specifically, adjusting the execution time of each node task based on the optimized duration includes: determining the initial execution time of each node task; and carrying out numerical subtraction on the initial execution time and the optimization time to obtain the target execution time of each node task. Furthermore, the offline scheduling task, such as updating the node task and adjusting the execution time of the node task, can be adjusted through the application program interface of the Arian.
It can be understood that if the optimization duration is a negative number, the target execution time is equal to the initial execution time plus the optimization duration, which may be a value corresponding to the delay of the initial execution time for the optimization duration, or may be that the initial execution time is not optimized, so that the node task continues to run at the initial execution time; if the optimization time length is a positive number, the target execution time is equal to the initial execution time minus the optimization time length, and the initial execution time can be advanced by a value corresponding to the optimization time length.
According to the technical scheme provided by the embodiment, the operation duration and the waiting duration of each node task in the offline scheduling task are determined; determining the total operation time length of the longest path task in the offline scheduling task based on the operation time length of each node task; calculating the optimization time length for adjusting the execution time of each node task based on the total operation time length and the waiting time length of each node task; and adjusting the execution time of each node task based on the optimized time length. According to the method and the device, the concept of the longest link is introduced into the offline scheduling task, the total operation time of the longest path task in the task link of the offline scheduling task is determined, the optimization time of the termination node task is determined, and finally the optimization time of each node task is calculated according to the sequence from the downstream node task to the upstream node task by combining the waiting time of each node task, so that the problems of time consumption, labor consumption and high error rate existing in the prior art when the offline scheduling task is manually adjusted can be solved, the offline scheduling task can be efficiently and accurately optimized, and the resource space utilization rate can be improved.
The method for optimizing the offline scheduling task provided in the embodiment of the present application is further described below, and fig. 2 is a second flow chart of the method for optimizing the offline scheduling task provided in the embodiment of the present application. The embodiment of the application is optimized based on the embodiments, and is specifically: the present embodiment explains the process of adjusting the execution time of each node task in detail.
Referring to fig. 2, the method of the present embodiment includes, but is not limited to, the following steps:
s210, taking the termination node task as a downstream node task.
In the embodiment of the application, the total running time of the longest path task is used as the total running time of the task link, the termination node task is used as the downstream node task from the termination node task, so that the optimization time of the upstream node task is calculated based on the downstream node task, and the optimization time of each node task is calculated.
S220, determining at least one upstream node task corresponding to the downstream node task from the task links of the offline scheduling task.
In the embodiment of the application, the task link of the offline scheduling task comprises at least one path task, and for each path task, each downstream node task corresponds to an upstream node task except for the initial node task; each downstream node task corresponds to at least one upstream node task for the entire task link.
S230, determining the waiting time of the downstream node task relative to the target upstream node task in the at least one upstream node task.
In the embodiment of the application, if a certain downstream node task corresponds to an upstream node task, the upstream node task is taken as a target upstream node task; if a certain downstream node task corresponds to two or more upstream node tasks, the two or more upstream node tasks are sequentially taken as target upstream node tasks.
Illustratively, if downstream node task C corresponds to two upstream node tasks, upstream node task A and upstream node task B. When the upstream node task a is taken as a target upstream node task, determining a waiting time (for example, 20 minutes) of the downstream node task C relative to the upstream node task a, in other words, executing the downstream node task C after 20 minutes when the execution of the upstream node task a is finished; when the upstream node task B is taken as the target upstream node task, a waiting time period (for example, 10 minutes) of the downstream node task C is determined relative to the upstream node task B, in other words, the downstream node task C is executed after 10 minutes when the execution of the upstream node task B is finished.
S240, calculating the optimization time length of the target upstream node task based on the optimization time length of the downstream node task and the waiting time length of the downstream node task, so as to obtain the optimization time length of each upstream node task in at least one upstream node task.
Specifically, calculating the optimization time length of the target upstream node task based on the optimization time length of the downstream node task and the waiting time length of the downstream node task includes: calculating a numerical result obtained by subtracting the waiting time of the downstream node task from the optimizing time of the downstream node task; if the numerical result is a non-negative number (positive number and zero), determining the optimization time length of the target upstream node task as the numerical result; and if the numerical result is negative, determining that the optimization time of the target upstream node task is zero, namely not optimizing the execution time of the target upstream node task.
Optionally, before calculating the optimized duration of the target upstream node task based on the optimized duration of the downstream node task and the waiting duration of the downstream node task, the method further includes: determining whether the waiting time of the downstream node task is less than a preset value (such as one minute); if the optimization time length of the target upstream node task is less than the optimization time length of the target upstream node task, determining that the optimization time length of the target upstream node task is zero; and if the time length is not less than the preset time length, executing the operation of calculating the optimized time length of the target upstream node task based on the optimized time length of the downstream node task and the waiting time length of the downstream node task.
S250, taking at least one upstream node task as a new downstream node task, and repeatedly executing the operation of determining at least one upstream node task corresponding to the downstream node task from the task links of the offline scheduling task until the optimized time length of each node task is obtained.
In the embodiment of the present application, at least one upstream node task is taken as a new downstream node task, the above steps S220 to S240 are repeatedly executed, and the optimization time length of the new at least one upstream node task is calculated, so that the optimization time length of each node task is obtained according to the method.
According to the technical scheme provided by the embodiment, the termination node task is used as a downstream node task; determining at least one upstream node task corresponding to a downstream node task from a task link of an offline scheduling task; determining the waiting time of a downstream node task relative to a target upstream node task in at least one upstream node task; calculating the optimization time length of the target upstream node task based on the optimization time length of the downstream node task and the waiting time length of the downstream node task, so as to obtain the optimization time length of each upstream node task in at least one upstream node task; and taking at least one upstream node task as a new downstream node task, and repeatedly executing the operation of determining at least one upstream node task corresponding to the downstream node task from the task link of the offline scheduling task until the optimized time length of each node task is obtained. According to the method and the device, the optimization time length of each node task is calculated sequentially according to the sequence from the downstream node task to the upstream node task, so that the problems of time consumption, labor consumption and high error rate existing in the prior art of manually adjusting the offline scheduling task can be solved, the offline scheduling task can be optimized efficiently and accurately, and the utilization rate of the resource space can be improved.
In a specific embodiment, an optimization method of offline scheduling tasks of the present application is explained. FIG. 3 is a schematic diagram of a task link corresponding to an offline scheduling task. In fig. 3, 8 node tasks (a to H) are illustrated, wherein a value below each node task represents initial execution time of the node task when not optimized, a value above or to the left of an arrow between every two node tasks represents execution time of an upstream node task, and a value below or to the right of an arrow between every two node tasks represents waiting time of a downstream node task; only one termination node task is shown.
And determining that the longest path task from the starting node task to the ending node task in the task link is [ E, F, G, H ] based on the running time of each node task, wherein the total running time of the longest path task is 80 minutes, and carrying out numerical subtraction on the total running time and the initial execution time of the ending node task H by combining the initial execution time (02:00) of the ending node task H to obtain the optimized time of the ending node task H which is 40 minutes in advance. Starting from the termination node task H, taking the termination node task H as a downstream node task so as to calculate the optimization time length of an upstream node task based on the downstream node task, thereby calculating the optimization time length of each node task. Alternatively, when the waiting time of a certain node task is less than 1, it may be recorded as zero.
The optimization process is as follows: the method comprises the steps that firstly, an upstream node task of a node task H is determined to be a node task G, the optimization time length of the node task G is the optimization time length of the node task H minus the waiting time length of the node task H, namely 40-0=40.0 minutes, and the node task G advances for 40 minutes;
the second step, the upstream node task of the node task G is a node task B, a node task D and a node task F, the optimization time length of the node task B is the optimization time length of the node task G minus the waiting time length of the node task G relative to the node task B, namely 40-25=15.0 minutes, and the node task B advances for 15 minutes; the optimization time of the node task D is the optimization time of the node task G minus the waiting time of the node task G relative to the node task D, namely 40-35=5.0 minutes, and the node task D advances for 5 minutes; the optimization time length of the node task F is the optimization time length of the node task G minus the waiting time length of the node task G relative to the node task F, namely 40-40=0.0 minutes, and the node task F advances by 0 minutes;
thirdly, the upstream node task of the node task B is a node task A and a node task C, the optimization time length of the node task A is the optimization time length of the node task B minus the waiting time length of the node task B relative to the node task A, namely 15.0-10.0=5.0 minutes, and the node task A advances for 5 minutes; the optimization time of the node task C is the optimization time of the node task B minus the waiting time of the node task B relative to the node task C, namely 15.0-35.0= -20.0 minutes, and the node task C advances by 0 minutes. The upstream node task of the node task D is a node task C, the optimization time length of the node task C is the optimization time length of the node task D minus the waiting time length of the node task D, namely 5.0-45.0= -40.0 minutes, and the node task C advances by 0 minutes. The upstream node task of the node task F is a node task E, the optimization time length of the node task E is the optimization time length of the node task F minus the waiting time length of the node task F, namely 0-0=0 minutes, and the node task E advances by 0 minutes;
And fourthly, the upstream node task of the node task A is a node task C, the optimization time length of the node task C is the optimization time length of the node task A minus the waiting time length of the node task A, namely 5.0-10.0= -5 minutes, and the node task C advances by 0 minutes.
Fig. 4 is a schematic structural diagram of an offline scheduling task optimizing apparatus provided in an embodiment of the present application, and as shown in fig. 4, the apparatus 400 may include:
a first data determining module 410, configured to determine an operation duration and a waiting duration of each node task in the offline scheduling task;
a second data determining module 420, configured to determine a total operation duration of a longest path task in the offline scheduling task based on the operation duration of each node task;
an optimization time determining module 430, configured to calculate an optimization time for adjusting the execution time of each node task based on the total operation time and the waiting time of each node task;
and the execution time optimization module 440 is configured to adjust the execution time of each node task based on the optimization duration.
Optionally, the offline scheduling task includes at least one path task, and each path task includes a termination node task;
Further, the optimization duration determination module 430 may be specifically configured to: calculating the optimization time length for adjusting the execution time of the termination node task in each path task based on the total operation time length; and sequentially calculating the optimization time length of each node task in each path task based on the optimization time length of the termination node task in each path task and the waiting time length of each node task in each path task.
Further, the optimization duration determining module 430 may be further specifically configured to: taking the termination node task as a downstream node task; determining at least one upstream node task corresponding to the downstream node task from the task link of the offline scheduling task; determining a waiting time length of the downstream node task relative to a target upstream node task in the at least one upstream node task; calculating the optimization time length of the target upstream node task based on the optimization time length of the downstream node task and the waiting time length of the downstream node task, so as to obtain the optimization time length of each upstream node task in the at least one upstream node task; and taking the at least one upstream node task as a new downstream node task, and repeatedly executing the operation of determining the at least one upstream node task corresponding to the downstream node task from the task links of the offline scheduling task until the optimized time length of each node task is obtained.
Further, the optimization duration determining module 430 may be further specifically configured to: calculating a numerical result obtained by subtracting the waiting time of the downstream node task from the optimizing time of the downstream node task; if the numerical result is a non-negative number, determining that the optimization duration of the target upstream node task is the numerical result; and if the numerical result is negative, determining that the optimization duration of the target upstream node task is zero.
Further, the optimization duration determining module 430 may be further specifically configured to: before the optimization time length of the target upstream node task is calculated based on the optimization time length of the downstream node task and the waiting time length of the downstream node task, determining whether the waiting time length of the downstream node task is smaller than a preset value; if the optimization time length of the target upstream node task is smaller than the optimization time length of the target upstream node task, determining that the optimization time length of the target upstream node task is zero; and if not, executing the operation of calculating the optimized time length of the target upstream node task based on the optimized time length of the downstream node task and the waiting time length of the downstream node task.
Further, the second data determining module 420 may be specifically configured to: determining the dependency relationship among the node tasks in the offline scheduling task; generating a task link for the offline scheduling task based on the dependency relationship; determining a first path task with the maximum sum of the operation time durations from a starting node task to a terminating node task in the task link based on the operation time duration of each node task; and determining the first path task as the longest path task, and determining the total operation duration corresponding to the longest path task.
Further, the execution time optimization module 440 may be specifically configured to: determining the initial execution time of each node task; and carrying out numerical operation on the initial execution time and the optimization time to obtain the target execution time of each node task.
The offline scheduling task optimizing device provided by the embodiment can be applied to the offline scheduling task optimizing method provided by any embodiment, and has corresponding functions and beneficial effects.
FIG. 5 is a block diagram of an electronic device for implementing an optimization method for offline scheduling tasks in accordance with an embodiment of the present application. The electronic device 10 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may 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 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various 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, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the optimization method of offline scheduling tasks.
In some embodiments, the method of optimizing offline scheduling tasks may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the above-described optimization method of offline scheduling tasks may be performed. Alternatively, in other embodiments, the processor 11 may be configured in any other suitable way (e.g., by means of firmware) to perform the optimization method of the offline scheduling task.
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out the methods of the present application 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, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, 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, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server) or that includes a middleware component (e.g., an application server) or that includes a front-end component through which a user can interact with an implementation of the systems and techniques described here, or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
Note that the above is only a preferred embodiment of the present application and the technical principle applied. Those skilled in the art will appreciate that the present application is not limited to the particular embodiments described herein, but is capable of numerous obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the present application. For example, one skilled in the art may use the various forms of flow shown above to reorder, add, or delete steps; the steps recited in the present application may be performed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions of the present application are achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (10)

1. An optimization method for offline scheduling tasks, the method comprising:
determining the operation time and the waiting time of each node task in the offline scheduling task;
Determining the total operation time length of the longest path task in the offline scheduling task based on the operation time length of each node task;
calculating an optimization time length for adjusting the execution time of each node task based on the total operation time length and the waiting time length of each node task;
and adjusting the execution time of each node task based on the optimized time length.
2. The method for optimizing offline scheduling tasks according to claim 1, wherein the offline scheduling tasks include at least one path task, each path task including a termination node task; the calculating, based on the total operation duration and the waiting duration of each node task, an optimized duration for adjusting the execution time of each node task includes:
calculating the optimization time length for adjusting the execution time of the termination node task in each path task based on the total operation time length;
and sequentially calculating the optimization time length of each node task in each path task based on the optimization time length of the termination node task in each path task and the waiting time length of each node task in each path task.
3. The method for optimizing offline scheduling tasks according to claim 2, wherein the sequentially calculating the optimized duration of each node task in each path task based on the optimized duration of the termination node task in each path task and the waiting duration of each node task in each path task includes:
taking the termination node task as a downstream node task;
determining at least one upstream node task corresponding to the downstream node task from the task link of the offline scheduling task;
determining a waiting time length of the downstream node task relative to a target upstream node task in the at least one upstream node task;
calculating the optimization time length of the target upstream node task based on the optimization time length of the downstream node task and the waiting time length of the downstream node task, so as to obtain the optimization time length of each upstream node task in the at least one upstream node task;
and taking the at least one upstream node task as a new downstream node task, and repeatedly executing the operation of determining the at least one upstream node task corresponding to the downstream node task from the task links of the offline scheduling task until the optimized time length of each node task is obtained.
4. The optimization method of offline scheduling tasks according to claim 3, wherein the calculating the optimization time length of the target upstream node task based on the optimization time length of the downstream node task and the waiting time length of the downstream node task includes:
calculating a numerical result obtained by subtracting the waiting time of the downstream node task from the optimizing time of the downstream node task;
if the numerical result is a non-negative number, determining that the optimization duration of the target upstream node task is the numerical result;
and if the numerical result is negative, determining that the optimization duration of the target upstream node task is zero.
5. The optimization method of offline scheduling tasks according to claim 3, further comprising, before said calculating the optimization time of the target upstream node task based on the optimization time of the downstream node task and the waiting time of the downstream node task:
determining whether the waiting time of the downstream node task is smaller than a preset value;
if the optimization time length of the target upstream node task is smaller than the optimization time length of the target upstream node task, determining that the optimization time length of the target upstream node task is zero;
and if not, executing the operation of calculating the optimized time length of the target upstream node task based on the optimized time length of the downstream node task and the waiting time length of the downstream node task.
6. The method for optimizing offline scheduled tasks according to claim 1, wherein determining the total operation time length of the longest path task in the offline scheduled tasks based on the operation time length of each node task comprises:
determining the dependency relationship among the node tasks in the offline scheduling task;
generating a task link for the offline scheduling task based on the dependency relationship;
determining a first path task with the maximum sum of the operation time durations from a starting node task to a terminating node task in the task link based on the operation time duration of each node task;
and determining the first path task as the longest path task, and determining the total operation duration corresponding to the longest path task.
7. The method for optimizing offline scheduling tasks according to claim 1, wherein said adjusting the execution time of each node task based on the optimization time length comprises:
determining the initial execution time of each node task;
and carrying out numerical operation on the initial execution time and the optimization time to obtain the target execution time of each node task.
8. An apparatus for optimizing offline scheduling tasks, the apparatus comprising:
The first data determining module is used for determining the operation duration and the waiting duration of each node task in the offline scheduling task;
the second data determining module is used for determining the total operation time length of the longest path task in the offline scheduling task based on the operation time length of each node task;
the optimization time length determining module is used for calculating the optimization time length for adjusting the execution time of each node task based on the total operation time length and the waiting time length of each node task;
and the execution time optimization module is used for adjusting the execution time of each node task based on the optimization time length.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of optimizing offline scheduling tasks according to any of claims 1 to 7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the method of optimizing off-line scheduling tasks of any one of claims 1 to 7.
CN202311354681.7A 2023-10-18 2023-10-18 Optimization method and device for offline scheduling task, electronic equipment and storage medium Pending CN117453358A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311354681.7A CN117453358A (en) 2023-10-18 2023-10-18 Optimization method and device for offline scheduling task, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311354681.7A CN117453358A (en) 2023-10-18 2023-10-18 Optimization method and device for offline scheduling task, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117453358A true CN117453358A (en) 2024-01-26

Family

ID=89580917

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311354681.7A Pending CN117453358A (en) 2023-10-18 2023-10-18 Optimization method and device for offline scheduling task, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117453358A (en)

Similar Documents

Publication Publication Date Title
CN115150471B (en) Data processing method, apparatus, device, storage medium, and program product
CN115202847A (en) Task scheduling method and device
CN112925811B (en) Method, apparatus, device, storage medium and program product for data processing
CN112948081B (en) Method, device, equipment and storage medium for processing tasks in delayed mode
CN114518974A (en) Checkpoint recovery method, device, equipment and medium for data processing task
CN115640359A (en) Message synchronization control method and device, electronic equipment and storage medium
CN115629903A (en) Task delay monitoring method, device, equipment and storage medium
CN117453358A (en) Optimization method and device for offline scheduling task, electronic equipment and storage medium
CN115774602A (en) Container resource allocation method, device, equipment and storage medium
CN115391158A (en) Time delay determination method, system and device and electronic equipment
CN115438007A (en) File merging method and device, electronic equipment and medium
CN115890684A (en) Robot scheduling method, device, equipment and medium
CN114564149A (en) Data storage method, device, equipment and storage medium
CN114139605A (en) Distributed model training method, system, device and storage medium
CN117290113B (en) Task processing method, device, system and storage medium
CN115563015B (en) Code heat statistics method, device, equipment and storage medium
CN116244324B (en) Task data relation mining method and device, electronic equipment and storage medium
CN117251295B (en) Training method, device, equipment and medium of resource prediction model
CN117032712A (en) Pipeline compiling and constructing method and device, electronic equipment and storage medium
CN115730000A (en) Medical data integration method, device, equipment and medium based on data lake
CN115543578A (en) Method, device and equipment for dynamically adjusting scheduling time and storage medium
CN114637584A (en) Method, device, equipment and medium for adjusting parallelism of data processing task
CN117609319A (en) Data processing method and device, electronic equipment and storage medium
CN115599634A (en) Data processing method, device, equipment and storage medium
CN115408115A (en) Transaction starting time processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination