CN112395088A - Task scheduling method, device, equipment and storage medium - Google Patents

Task scheduling method, device, equipment and storage medium Download PDF

Info

Publication number
CN112395088A
CN112395088A CN202011284197.8A CN202011284197A CN112395088A CN 112395088 A CN112395088 A CN 112395088A CN 202011284197 A CN202011284197 A CN 202011284197A CN 112395088 A CN112395088 A CN 112395088A
Authority
CN
China
Prior art keywords
task
scheduling
scheduling unit
scheduled
running
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
CN202011284197.8A
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.)
Ping An Life Insurance Company of China Ltd
Original Assignee
Ping An Life Insurance Company of China 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 Ping An Life Insurance Company of China Ltd filed Critical Ping An Life Insurance Company of China Ltd
Priority to CN202011284197.8A priority Critical patent/CN112395088A/en
Publication of CN112395088A publication Critical patent/CN112395088A/en
Pending legal-status Critical Current

Links

Images

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/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

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 invention provides a task scheduling method, a device, equipment and a storage medium, wherein the task scheduling method comprises the steps of obtaining at least one scheduling unit, wherein each scheduling unit corresponds to one scheduling time length; acquiring a task operation table; acquiring a task to be scheduled and a target scheduling unit thereof; judging whether the target scheduling unit configured by the task to be scheduled meets a minimum scheduling unit configuration rule or not according to the running duration included by the running information in the task running table; if not, reallocating a target scheduling unit for the task to be scheduled from the scheduling unit according to the minimum scheduling unit configuration rule; and scheduling the redistributed target scheduling unit to execute the task to be scheduled. By the method, whether the allocation of the scheduling units is reasonable can be analyzed according to the running time of the tasks, the appropriate scheduling units are allocated for the tasks to be scheduled when the allocation is unreasonable, and the purposes of improving the task scheduling reasonability and reducing the maintenance cost can be achieved.

Description

Task scheduling method, device, equipment and storage medium
Technical Field
The present invention relates to the field of operation and maintenance/process optimization technologies, and in particular, to a method, an apparatus, a device, and a storage medium for task scheduling.
Background
Task scheduling is the management of on-line, down-sending, running and the like of tasks, and is the most core work of a data system. The traditional scheduler only performs operation management on tasks, the task allocation depends on an operator to allocate the scheduler for the tasks according to experience, the traditional scheduler only performs operation management, whether the allocation of the tasks and the scheduler is reasonable or not can only be judged manually by a maintainer by analyzing the execution condition of the tasks, under the condition of large task amount, the workload of the maintainer for analyzing the execution results of all the tasks one by one is very huge, the maintainer generally performs simple analysis processing on the tasks based on task operation error reporting, so the tasks which are unreasonable in the allocation of the scheduler are difficult to find, obviously, a large amount of manpower investment is needed for enabling all the tasks to be matched with the proper scheduler, the operation cost is high, and the construction of a data system is not facilitated.
Disclosure of Invention
The invention provides a task scheduling method, a device, equipment and a storage medium, which can achieve the purposes of analyzing whether the allocation of a scheduling unit is reasonable according to the running time of a task, allocating a proper scheduling unit for the task to be scheduled when the allocation is unreasonable, improving the task scheduling rationality and reducing the maintenance cost.
In order to solve the technical problems, the invention adopts a technical scheme that: a task scheduling method is provided, and comprises the following steps:
acquiring at least one scheduling unit, wherein each scheduling unit corresponds to a scheduling time length, and the scheduling unit schedules the task configured in the scheduling unit to execute in the corresponding scheduling time length;
acquiring a task operation table, wherein the task operation table is used for recording operation information of a scheduled task, and the operation information comprises operation duration of each execution completion of the task;
acquiring a task to be scheduled and a target scheduling unit configured by the task to be scheduled;
according to the running duration included in the running information in the task running table, judging whether the target scheduling unit configured by the task to be scheduled meets a minimum scheduling unit configuration rule, wherein the minimum scheduling unit configuration rule comprises: the scheduling time corresponding to the target scheduling unit configured for the task to be scheduled is greater than or equal to the running time of the task to be scheduled, and the scheduling time corresponding to the target scheduling unit is the minimum scheduling unit with the scheduling time greater than or equal to the running time;
if the target scheduling unit configured by the task to be scheduled does not meet the minimum scheduling unit configuration rule, reallocating the target scheduling unit for the task to be scheduled from the scheduling unit according to the minimum scheduling unit configuration rule;
and scheduling the redistributed target scheduling unit to execute the task to be scheduled.
In accordance with one embodiment of the present invention,
the reallocating the target scheduling unit from the scheduling unit to the task to be scheduled according to the minimum scheduling unit configuration rule includes:
acquiring the running time corresponding to the task to be scheduled from the task running table;
obtaining the running time range of the task to be scheduled;
sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large;
acquiring a first scheduling unit with a scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit;
and taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit.
According to an embodiment of the present invention, the obtaining the running time range of the task to be scheduled includes:
and clustering the running time of the task to be scheduled to obtain the running time range of the task to be scheduled.
According to an embodiment of the present invention, the task scheduling method further includes:
acquiring task information of the task to be scheduled, wherein the task information is a pre-task on which the task to be scheduled depends and a scheduling unit corresponding to the pre-task;
the reallocating the target scheduling unit from the scheduling unit to the task to be scheduled according to the minimum scheduling unit configuration rule includes:
acquiring the running time corresponding to the task to be scheduled from the task running table;
obtaining the running time range of the task to be scheduled;
sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large;
acquiring a first scheduling unit with a scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit;
comparing the scheduling unit with the minimum scheduling time length in the first scheduling unit with the scheduling time length of the scheduling unit corresponding to the preposed task;
if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is greater than or equal to the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit;
and if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is less than the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit corresponding to the preposed task as the target scheduling unit.
According to an embodiment of the present invention, after the scheduling the reallocated target scheduling unit to execute the task to be scheduled, the method further includes:
and acquiring an execution result of the task to be scheduled, wherein the execution result comprises the execution time length of the task to be scheduled executed at this time, and the execution result is recorded into the task operation table as the newly added operation information.
According to an embodiment of the present invention, the recording the execution result as new operation information in the task operation table further includes:
and reporting task execution overtime alarm when the running time of the task to be scheduled executed at this time exceeds the running time range.
According to an embodiment of the present invention, the task scheduling method further includes:
and displaying the running information of the task to be scheduled to external display equipment according to the task running table.
In addition, in order to solve the above technical problems, the present invention further adopts a technical solution in which: provided is a task scheduling device including:
the system comprises an acquisition module, a scheduling module and a scheduling module, wherein the acquisition module is used for acquiring at least one scheduling unit, each scheduling unit corresponds to one scheduling time length, and the scheduling units schedule and execute tasks configured in the scheduling units in the corresponding scheduling time lengths; acquiring a task operation table, wherein the task operation table is used for recording operation information of a scheduled task, and the operation information comprises operation duration of each execution completion of the task; acquiring a task to be scheduled and a target scheduling unit configured by the task to be scheduled;
an analysis module, configured to determine whether the target scheduling unit configured by the task to be scheduled meets a minimum scheduling unit configuration rule according to the running duration included in the running information in the task running table, where the minimum scheduling unit configuration rule includes: the scheduling time corresponding to the target scheduling unit configured for the task to be scheduled is greater than or equal to the running time of the task to be scheduled, and the scheduling time corresponding to the target scheduling unit is the minimum scheduling unit with the scheduling time greater than or equal to the running time;
the allocation module is used for reallocating the target scheduling unit for the task to be scheduled from the scheduling unit according to the minimum scheduling unit configuration rule if the target scheduling unit configured by the task to be scheduled does not meet the minimum scheduling unit configuration rule;
and the scheduling module is used for scheduling the redistributed target scheduling unit to execute the task to be scheduled.
In addition, in order to solve the above technical problems, the present invention further adopts a technical solution in which: there is provided a task scheduling device comprising a processor, a memory coupled to the processor, wherein the memory has stored therein computer readable instructions which, when executed by the processor, cause the processor to perform the steps of the task scheduling method as claimed in any one of the above.
In addition, in order to solve the above technical problems, the present invention further adopts a technical solution in which: there is provided a storage medium having stored thereon computer readable instructions which, when executed by one or more processors, cause the one or more processors to carry out the steps of the task scheduling method as claimed in any one of the preceding claims.
According to the task scheduling method, the device, the equipment and the storage medium, whether a target scheduling unit allocated by the task to be scheduled meets the minimum scheduling unit configuration rule or not is analyzed according to the running duration of the running information corresponding to the task to be scheduled in the task running table, and the target scheduling unit is reconfigured when the minimum scheduling unit configuration rule is not met, so that allocation of the target scheduling unit is more intelligent and reasonable, later maintenance investment is reduced, and construction of a data system is facilitated.
Furthermore, the first scheduling unit with the scheduling time length greater than or equal to the upper limit value of the operation time range is obtained from the scheduling units, and the scheduling unit with the minimum scheduling time length in the first scheduling unit is used as the target scheduling unit, so that the allocation efficiency of the scheduling units can be improved, and the system resources are saved.
Furthermore, the target scheduling unit is allocated by comparing the scheduling unit with the minimum scheduling time length in the first scheduling unit with the scheduling time length of the scheduling unit corresponding to the pre-task, so that the coupling of the pre-task and the pre-task can be considered, the task scheduling is more stable, and the task scheduling compatibility is improved.
Furthermore, the abnormal state of the task can be alarmed through running and analyzing the task to be scheduled, maintenance personnel can be prompted to check and locate problems in time, task scheduling efficiency is improved, and operation and maintenance cost is reduced.
Furthermore, the running information of the tasks to be scheduled is displayed to the external display equipment, so that the task scheduling state can be displayed to the outside in time, and the user experience is better.
Drawings
FIG. 1 is a flowchart illustrating a task scheduling method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a task scheduling apparatus according to an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a task scheduling apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a storage medium according to an embodiment of the present invention.
Detailed Description
The technical solutions in 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 obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first", "second" and "third" in this application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any indication of the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of the feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise. All directional indications (such as up, down, left, right, front, and rear … …) in the embodiments of the present application are only used to explain the relative positional relationship between the components, the movement, and the like in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indication is changed accordingly. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
Referring to fig. 1, fig. 1 is a flowchart illustrating a task scheduling method according to an embodiment of the present invention. According to an embodiment of the present invention, the task scheduling method includes the following steps:
step S101: and acquiring at least one scheduling unit, wherein each scheduling unit corresponds to a scheduling time length, and the scheduling unit schedules the task configured in the scheduling unit to execute in the corresponding scheduling time length.
According to an embodiment of the present invention, each scheduling unit may correspond to a scheduling duration, where the scheduling duration is a time for the scheduling unit to execute task scheduling, such as: and if the scheduling time is 2 hours, the scheduling unit can schedule the task to be executed within 2 hours, and if the scheduling time is 24 hours, the scheduling unit can schedule the task to be executed within 24 hours, and the scheduling unit can plan different scheduling times according to different requirements of the task.
Step S102: and acquiring a task operation table, wherein the task operation table is used for recording operation information of the tasks which are scheduled to be executed, and the operation information comprises the operation duration of each execution completion of the tasks.
The tasks can be executed only by obtaining system resources through scheduling of the scheduling unit, so that the tasks can be controlled to be executed only by configuring the tasks into the scheduling unit before the tasks are executed, generally, development and maintenance personnel can allocate the corresponding scheduling unit to the tasks according to experience, and execute the tasks through scheduling of the scheduling unit.
Step S103: acquiring a task to be scheduled and a target scheduling unit configured by the task to be scheduled, judging whether the target scheduling unit configured by the task to be scheduled meets a minimum scheduling unit configuration rule or not according to the running duration included by the running information in the task running table, and executing the step S104 if the target scheduling unit configured by the task to be scheduled does not meet the minimum scheduling unit configuration rule.
Depending on the scheduling unit configured empirically, problems may occur that the scheduling time of the scheduling unit does not meet the requirement for task execution, the scheduling time of the scheduling unit is too long, and system resources are wasted, and the like, and in order to enable the task to be executed and completed within the scheduling time of the scheduling unit and achieve efficient utilization of resources, in this embodiment, before the task needs to be scheduled and executed again, it may be determined whether the scheduling unit allocated to the task to be scheduled meets a minimum scheduling unit configuration rule, where the minimum scheduling unit configuration rule includes: the scheduling time corresponding to the target scheduling unit configured for the task to be scheduled is greater than or equal to the running time of the task to be scheduled, and the scheduling time corresponding to the target scheduling unit is the minimum scheduling unit with the scheduling time greater than or equal to the running time.
Step S104: and reallocating a target scheduling unit for the task to be scheduled from the scheduling unit according to the minimum scheduling unit configuration rule.
And when the target scheduling unit configured by the task to be scheduled does not meet the minimum scheduling unit configuration rule, automatically allocating the more appropriate target scheduling unit to the task to be scheduled.
Specifically, according to an embodiment of the present invention, the step S104 may include the following steps:
step S104 a: and acquiring the running time corresponding to the task to be scheduled from the task running table.
Specifically, corresponding running information may be searched for in the task running table through the task name, the task ID, and the like of the task to be scheduled, and the running time length executed before the task to be scheduled is obtained from the running information, which needs to be described.
Step S104 b: and obtaining the running time range of the task to be scheduled.
For the task to be scheduled having the operation information record, according to an embodiment of the present invention, the operation duration in all the operation information may be clustered, and an abnormal value is excluded, so as to obtain an operation duration range of the task to be scheduled, where if the operation duration of one of the tasks to be scheduled is 1h23m, 1h33m, 3h03m, 1h12m, and 1h45m, the clustering result is that the operation duration range of the task to be scheduled is 1 h-2 h, and where for the task to be scheduled without the operation record, the operation duration range is still the minimum default value, such as 0 h.
Step S104 c: and sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large.
Because the scheduling unit can plan different scheduling time lengths according to different requirements of tasks, the scheduling units are sequenced according to the sequence of the scheduling time lengths of the scheduling units from small to large.
Step S104 d: and acquiring a first scheduling unit with the scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit.
Specifically, a scheduling unit with a scheduling duration greater than or equal to the upper limit of the operating time range in the scheduling units is used as the first scheduling unit, if the scheduling unit is configured with a scheduling unit of 1 hour, a scheduling unit of 2 hours, and a scheduling unit of 12 hours according to task requirements, and for the task to be scheduled with the operating time range of 1 to 2 hours, the upper limit of the operating time range is 2 hours, the first scheduling unit is a scheduling unit of 2 hours, and a scheduling unit of 12 hours, it can be understood that, for the task to be scheduled without the operation information record, the upper limit of the operating time range is also a minimum default value, and therefore, the first scheduling unit of the task to be scheduled may be a scheduling unit with a scheduling duration greater than or equal to the minimum default value, and if the minimum default value is 0 hour, the first scheduling unit of the task to be scheduled without the running information record is a 1-hour scheduling unit, a 2-hour scheduling unit and a 12-hour scheduling unit.
Step S104 e: and taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit.
Selecting a scheduling unit with the minimum scheduling duration from the first scheduling units as the target scheduling unit of the task to be scheduled, and still taking the above example as a description, for the task to be scheduled with the operating time range of 1 to 2h, the first scheduling units are a 2-hour scheduling unit and a 12-hour scheduling unit, the target scheduling unit is a 2-hour scheduling unit, and for the task to be scheduled without the operation information record, the first scheduling units are a 1-hour scheduling unit, a 2-hour scheduling unit and a 12-hour scheduling unit, and the target scheduling unit is a 1-hour scheduling unit.
In the task scheduling method of this embodiment, the first scheduling unit with the scheduling time length greater than or equal to the upper limit value of the operating time range is obtained from the scheduling unit, and the scheduling unit with the minimum scheduling time length in the first scheduling unit is used as the target scheduling unit, so that the allocation efficiency of the scheduling unit can be improved, and system resources can be saved.
According to another embodiment of the present invention, step S104 further includes the following steps:
step S204: and acquiring task information of the task to be scheduled, wherein the task information is a front task on which the task to be scheduled depends and a scheduling unit corresponding to the front task.
Generally, there is a dependency relationship in scheduling between tasks, and a post task has an execution condition only after a pre task is executed, so that task information of the task to be scheduled needs to be obtained first before a scheduling unit is allocated to the task to be scheduled, where the task information is used to record a pre task on which the task to be scheduled depends and a scheduling unit corresponding to the pre task.
In this embodiment, step S104 may include the following steps:
step S204 a: and acquiring the running time corresponding to the task to be scheduled from the task running table.
Step S204 b: and obtaining the running time range of the task to be scheduled.
Step S204 c: and sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large.
Step S204 d: and acquiring a first scheduling unit with the scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit.
In the present embodiment, steps S204a, S204b, S204c, and S204d are similar to steps S104a, S104b, S104c, and S104d of the above embodiment, and for brevity, are not described again here.
Step S204 e: comparing the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit with the scheduling time length of the scheduling unit corresponding to the preposed task, if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is greater than or equal to the scheduling time length of the scheduling unit corresponding to the preposed task, executing step S204f, and if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is smaller than the scheduling time length of the scheduling unit corresponding to the preposed task, executing step S204 g.
Step S204 f: and taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit.
And when the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is greater than or equal to the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit.
Step S204 g: and taking the scheduling unit corresponding to the preposed task as the target scheduling unit.
And when the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is less than the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit corresponding to the preposed task as the target scheduling unit.
In this embodiment, the scheduling duration of the scheduling unit with the minimum scheduling duration in the first scheduling unit and the scheduling duration of the scheduling unit corresponding to the pre-task are compared, and the larger scheduling unit is used as the target scheduling unit to be allocated to the task to be scheduled, for example, the scheduling duration of the scheduling unit with the minimum scheduling duration in the first scheduling unit is 2 hours, the scheduling duration of the scheduling unit corresponding to the pre-task is 12 hours, and the scheduling unit with the scheduling duration of 12 hours is used as the target scheduling unit of the task to be scheduled.
In the task scheduling method of this embodiment, the target scheduling unit is allocated by comparing the scheduling unit with the minimum scheduling time in the first scheduling unit with the scheduling time of the scheduling unit corresponding to the pre-task, so that the coupling between the pre-task and the post-task can be considered, the task scheduling is more stable, and the task scheduling compatibility is improved.
Step S105: and scheduling the redistributed target scheduling unit to execute the task to be scheduled.
And after the target scheduling unit is reallocated to the task to be scheduled, scheduling and executing the task to be scheduled by scheduling the reallocated target scheduling unit.
In the task scheduling method of this embodiment, whether the target scheduling unit allocated to the task to be scheduled satisfies the minimum scheduling unit configuration rule is analyzed according to the running duration of the running information in the task running table, and when the target scheduling unit does not satisfy the minimum scheduling unit configuration rule, the target scheduling unit is reconfigured, so that allocation of the target scheduling unit is more intelligent and reasonable, maintenance investment in a later period is reduced, and construction of a data system is facilitated.
According to an embodiment of the present invention, after step S105, the following steps may be further included:
step S106: and acquiring an execution result of the task to be scheduled, wherein the execution result comprises the execution time length of the task to be scheduled executed at this time, and the execution result is recorded into the task operation table as the newly added operation information.
After the task to be scheduled is allocated to the target scheduling unit, the task to be scheduled is executed when the target scheduling unit is scheduled, after the execution is completed, the operation result of the task to be scheduled is recorded into the task operation table as a new operation record, the configuration of the task to be scheduled can be analyzed before each scheduling by combining the previous operation record and the newly added operation record again, and the target scheduling unit configured by the task to be scheduled can meet the configuration rule of the minimum scheduling unit when each task scheduling is performed.
According to another embodiment of the present invention, after step S106, the task to be scheduled may be further analyzed according to the task running table, and if the running time of the current execution of the task to be scheduled exceeds the running time range, a task execution timeout alarm is reported. The abnormal state of the task can be alarmed by running and analyzing the task to be scheduled, maintenance personnel are prompted to check and locate problems in time, task scheduling efficiency is improved, and operation and maintenance cost is reduced.
According to an embodiment of the present invention, the task scheduling method may further include the following steps:
step S107: and displaying the running information of the task to be scheduled to external display equipment according to the task running table.
According to the task scheduling method, the running information of the task to be scheduled is displayed to the external display equipment, so that the task scheduling state can be displayed to the outside in time, and the user experience is better.
Fig. 2 is a schematic structural diagram of the task scheduling device 1 according to an embodiment of the present invention. As shown in fig. 2, the task scheduling apparatus 1 includes an obtaining module 11, an analyzing module 12, an allocating module 13, and a scheduling module 14.
An obtaining module 11, configured to obtain at least one scheduling unit, where each scheduling unit corresponds to a scheduling duration, and the scheduling unit schedules a task configured in the scheduling unit to execute within the corresponding scheduling duration; acquiring a task operation table, wherein the task operation table is used for recording operation information of a scheduled task, and the operation information comprises operation duration of each execution completion of the task; acquiring a task to be scheduled and a target scheduling unit configured by the task to be scheduled;
an analysis module 12, configured to determine, according to the running duration included in the running information in the task running table, whether the target scheduling unit configured by the task to be scheduled meets a minimum scheduling unit configuration rule, where the minimum scheduling unit configuration rule is that the scheduling duration corresponding to the target scheduling unit of the task to be scheduled is the minimum of the scheduling units having scheduling durations greater than or equal to the running duration;
an allocating module 13, configured to, if the target scheduling unit configured by the task to be scheduled does not meet a minimum scheduling unit configuration rule, reallocate the target scheduling unit for the task to be scheduled from the scheduling unit according to the minimum scheduling unit configuration rule;
and the scheduling module 14 is configured to schedule the reallocated target scheduling unit to execute the task to be scheduled.
According to an embodiment of the present invention, the allocating module 13 may be further configured to obtain the running time length corresponding to the task to be scheduled from the task running table; obtaining the running time range of the task to be scheduled; sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large; and the first scheduling unit which acquires the scheduling time length which is greater than or equal to the upper limit value of the running time range from the scheduling units takes the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit.
According to an embodiment of the present invention, the allocating module 13 may be further configured to perform clustering calculation on the running duration of the task to be scheduled, so as to obtain a running time range of the task to be scheduled.
According to another embodiment of the present invention, the obtaining module 11 may be further configured to obtain task information of the task to be scheduled, where the task information is a pre-task on which the task to be scheduled depends and a scheduling unit corresponding to the pre-task.
According to an embodiment of the present invention, the allocating module 13 may be further configured to obtain the running time length corresponding to the task to be scheduled from the task running table; obtaining the running time range of the task to be scheduled; sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large; acquiring a first scheduling unit with a scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit; comparing the scheduling unit with the minimum scheduling time length in the first scheduling unit with the scheduling time length of the scheduling unit corresponding to the preposed task; if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is greater than or equal to the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit; and if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is less than the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit corresponding to the preposed task as the target scheduling unit.
According to an embodiment of the present invention, the scheduling module 14 may be further configured to obtain an execution result of the task to be scheduled, where the execution result includes a running time length of the task to be scheduled, and record the execution result as new running information in the task running table.
According to an embodiment of the present invention, the analysis module 12 may be further configured to report a task execution timeout alarm when the running time of the current execution of the task to be scheduled exceeds the running time range.
According to an embodiment of the present invention, the analysis module 14 may be further configured to display the running information of the task to be scheduled to an external display device according to the task running table.
It can be understood that specific ways for implementing the functions by the modules of the apparatus may refer to the specific steps corresponding to the above embodiments, and therefore, the detailed description thereof is omitted here.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a task scheduling apparatus 30 according to an embodiment of the present invention. As shown in fig. 3, the task scheduling apparatus 30 includes a memory 32, a processor 31, and a computer program stored on the memory 32 and executable on the processor 31, and the processor 31 implements the following steps when executing the computer program: acquiring at least one scheduling unit, wherein each scheduling unit corresponds to a scheduling time length, and the scheduling unit schedules the task configured in the scheduling unit to execute in the corresponding scheduling time length; acquiring a task operation table, wherein the task operation table is used for recording operation information of a scheduled task, and the operation information comprises operation duration of each execution completion of the task; acquiring a task to be scheduled and a target scheduling unit configured by the task to be scheduled; judging whether the target scheduling unit configured by the task to be scheduled meets a minimum scheduling unit configuration rule according to the running time included by the running information in the task running table, wherein the minimum scheduling unit configuration rule is that the scheduling time corresponding to the target scheduling unit of the task to be scheduled is the minimum scheduling time in the scheduling units with the scheduling time greater than or equal to the running time; if the target scheduling unit configured by the task to be scheduled does not meet the minimum scheduling unit configuration rule, reallocating the target scheduling unit for the task to be scheduled from the scheduling unit according to the minimum scheduling unit configuration rule; and scheduling the redistributed target scheduling unit to execute the task to be scheduled.
According to an embodiment of the present invention, the reallocating a target scheduling unit from the scheduling unit to the task to be scheduled according to the minimum scheduling unit configuration rule includes: acquiring the running time corresponding to the task to be scheduled from the task running table; obtaining the running time range of the task to be scheduled; sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large; acquiring a first scheduling unit with a scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit; and taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit.
According to an embodiment of the present invention, the obtaining the running time range of the task to be scheduled includes: and clustering the running time of the task to be scheduled to obtain the running time range of the task to be scheduled.
According to an embodiment of the present invention, the task scheduling method further includes: acquiring task information of the task to be scheduled, wherein the task information is a pre-task on which the task to be scheduled depends and a scheduling unit corresponding to the pre-task; the reallocating the target scheduling unit from the scheduling unit to the task to be scheduled according to the minimum scheduling unit configuration rule includes: acquiring the running time corresponding to the task to be scheduled from the task running table; obtaining the running time range of the task to be scheduled; sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large; acquiring a first scheduling unit with a scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit; comparing the scheduling unit with the minimum scheduling time length in the first scheduling unit with the scheduling time length of the scheduling unit corresponding to the preposed task; if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is greater than or equal to the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit; and if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is less than the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit corresponding to the preposed task as the target scheduling unit.
According to an embodiment of the present invention, after the scheduling the reallocated target scheduling unit to execute the task to be scheduled, the method further includes: and acquiring an execution result of the task to be scheduled, wherein the execution result comprises the execution time length of the task to be scheduled executed at this time, and the execution result is recorded into the task operation table as the newly added operation information.
According to an embodiment of the present invention, the recording the execution result as new operation information in the task operation table further includes: and reporting task execution overtime alarm when the running time of the task to be scheduled executed at this time exceeds the running time range.
According to an embodiment of the present invention, the task scheduling method further includes: and displaying the running information of the task to be scheduled to external display equipment according to the task running table.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a storage medium according to an embodiment of the invention. As shown in fig. 4, a storage medium storing computer readable instructions 41, the computer readable instructions 41, when executed by one or more processors, cause the one or more processors to perform the steps of: acquiring at least one scheduling unit, wherein each scheduling unit corresponds to a scheduling time length, and the scheduling unit schedules the task configured in the scheduling unit to execute in the corresponding scheduling time length; acquiring a task operation table, wherein the task operation table is used for recording operation information of a scheduled task, and the operation information comprises operation duration of each execution completion of the task; acquiring a task to be scheduled and a target scheduling unit configured by the task to be scheduled; judging whether the target scheduling unit configured by the task to be scheduled meets a minimum scheduling unit configuration rule according to the running time included by the running information in the task running table, wherein the minimum scheduling unit configuration rule is that the scheduling time corresponding to the target scheduling unit of the task to be scheduled is the minimum scheduling time in the scheduling units with the scheduling time greater than or equal to the running time; if the target scheduling unit configured by the task to be scheduled does not meet the minimum scheduling unit configuration rule, reallocating the target scheduling unit for the task to be scheduled from the scheduling unit according to the minimum scheduling unit configuration rule; and scheduling the redistributed target scheduling unit to execute the task to be scheduled.
According to an embodiment of the present invention, the reallocating a target scheduling unit from the scheduling unit to the task to be scheduled according to the minimum scheduling unit configuration rule includes: acquiring the running time corresponding to the task to be scheduled from the task running table; obtaining the running time range of the task to be scheduled; sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large; acquiring a first scheduling unit with a scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit; and taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit.
According to an embodiment of the present invention, the obtaining the running time range of the task to be scheduled includes: and clustering the running time of the task to be scheduled to obtain the running time range of the task to be scheduled.
According to an embodiment of the present invention, the task scheduling method further includes: acquiring task information of the task to be scheduled, wherein the task information is a pre-task on which the task to be scheduled depends and a scheduling unit corresponding to the pre-task; the reallocating the target scheduling unit from the scheduling unit to the task to be scheduled according to the minimum scheduling unit configuration rule includes: acquiring the running time corresponding to the task to be scheduled from the task running table; obtaining the running time range of the task to be scheduled; sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large; acquiring a first scheduling unit with a scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit; comparing the scheduling unit with the minimum scheduling time length in the first scheduling unit with the scheduling time length of the scheduling unit corresponding to the preposed task; if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is greater than or equal to the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit; and if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is less than the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit corresponding to the preposed task as the target scheduling unit.
According to an embodiment of the present invention, after the scheduling the reallocated target scheduling unit to execute the task to be scheduled, the method further includes: and acquiring an execution result of the task to be scheduled, wherein the execution result comprises the execution time length of the task to be scheduled executed at this time, and the execution result is recorded into the task operation table as the newly added operation information.
According to an embodiment of the present invention, the recording the execution result as new operation information in the task operation table further includes: and reporting task execution overtime alarm when the running time of the task to be scheduled executed at this time exceeds the running time range.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the computer program is executed. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A task scheduling method is characterized by comprising the following steps:
acquiring at least one scheduling unit, wherein each scheduling unit corresponds to a scheduling time length, and the scheduling unit schedules the task configured in the scheduling unit to execute in the corresponding scheduling time length;
acquiring a task operation table, wherein the task operation table is used for recording operation information of a scheduled task, and the operation information comprises operation duration of each execution completion of the task;
acquiring a task to be scheduled and a target scheduling unit configured by the task to be scheduled;
according to the running duration included in the running information in the task running table, judging whether the target scheduling unit configured by the task to be scheduled meets a minimum scheduling unit configuration rule, wherein the minimum scheduling unit configuration rule comprises: the scheduling time corresponding to the target scheduling unit configured for the task to be scheduled is greater than or equal to the running time of the task to be scheduled, and the scheduling time corresponding to the target scheduling unit is the minimum scheduling unit with the scheduling time greater than or equal to the running time;
if the target scheduling unit configured by the task to be scheduled does not meet the minimum scheduling unit configuration rule, reallocating the target scheduling unit for the task to be scheduled from the scheduling unit according to the minimum scheduling unit configuration rule;
and scheduling the redistributed target scheduling unit to execute the task to be scheduled.
2. The task scheduling method according to claim 1, wherein the re-allocating a target scheduling unit from the scheduling unit for the task to be scheduled according to the minimum scheduling unit configuration rule comprises:
acquiring the running time corresponding to the task to be scheduled from the task running table;
obtaining the running time range of the task to be scheduled;
sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large;
acquiring a first scheduling unit with a scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit;
and taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit.
3. The task scheduling method according to claim 2, wherein the obtaining the running time range of the task to be scheduled comprises:
and clustering the running time of the task to be scheduled to obtain the running time range of the task to be scheduled.
4. The task scheduling method according to claim 1, wherein the task scheduling method further comprises:
acquiring task information of the task to be scheduled, wherein the task information is a pre-task on which the task to be scheduled depends and a scheduling unit corresponding to the pre-task;
the reallocating the target scheduling unit from the scheduling unit to the task to be scheduled according to the minimum scheduling unit configuration rule includes:
acquiring the running time corresponding to the task to be scheduled from the task running table;
obtaining the running time range of the task to be scheduled;
sequencing the scheduling units according to the sequence of the scheduling duration of the scheduling units from small to large;
acquiring a first scheduling unit with a scheduling duration being greater than or equal to the upper limit value of the operating time range from the scheduling unit;
comparing the scheduling unit with the minimum scheduling time length in the first scheduling unit with the scheduling time length of the scheduling unit corresponding to the preposed task;
if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is greater than or equal to the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit with the minimum scheduling time length in the first scheduling unit as the target scheduling unit;
and if the scheduling time length of the scheduling unit with the minimum scheduling time length in the first scheduling unit is less than the scheduling time length of the scheduling unit corresponding to the preposed task, taking the scheduling unit corresponding to the preposed task as the target scheduling unit.
5. The task scheduling method according to claim 1, wherein after the scheduling the reallocated target scheduling unit to execute the task to be scheduled, the method further comprises:
and acquiring an execution result of the task to be scheduled, wherein the execution result comprises the execution time length of the task to be scheduled executed at this time, and the execution result is recorded into the task operation table as the newly added operation information.
6. The task scheduling method according to claim 5, wherein the recording the execution result as new operation information into the task operation table further comprises:
and reporting task execution overtime alarm when the running time of the task to be scheduled executed at this time exceeds the running time range.
7. The task scheduling method according to claim 1, further comprising:
and displaying the running information of the task to be scheduled to external display equipment according to the task running table.
8. A task scheduling apparatus, characterized in that the task scheduling apparatus comprises:
the system comprises an acquisition module, a scheduling module and a scheduling module, wherein the acquisition module is used for acquiring at least one scheduling unit, each scheduling unit corresponds to one scheduling time length, and the scheduling units schedule and execute tasks configured in the scheduling units in the corresponding scheduling time lengths; acquiring a task operation table, wherein the task operation table is used for recording operation information of a scheduled task, and the operation information comprises operation duration of each execution completion of the task; acquiring a task to be scheduled and a target scheduling unit configured by the task to be scheduled;
an analysis module, configured to determine whether the target scheduling unit configured by the task to be scheduled meets a minimum scheduling unit configuration rule according to the running duration included in the running information in the task running table, where the minimum scheduling unit configuration rule includes: the scheduling time corresponding to the target scheduling unit configured for the task to be scheduled is greater than or equal to the running time of the task to be scheduled, and the scheduling time corresponding to the target scheduling unit is the minimum scheduling unit with the scheduling time greater than or equal to the running time;
the allocation module is used for reallocating the target scheduling unit for the task to be scheduled from the scheduling unit according to the minimum scheduling unit configuration rule if the target scheduling unit configured by the task to be scheduled does not meet the minimum scheduling unit configuration rule;
and the scheduling module is used for scheduling the redistributed target scheduling unit to execute the task to be scheduled.
9. A task scheduling device comprising a processor, a memory coupled to the processor, wherein,
the memory has stored therein computer readable instructions which, when executed by the processor, cause the processor to carry out the steps of the task scheduling method according to any one of claims 1 to 7.
10. A storage medium having stored thereon computer-readable instructions which, when executed by one or more processors, cause the one or more processors to perform the steps of the task scheduling method according to any one of claims 1 to 7.
CN202011284197.8A 2020-11-17 2020-11-17 Task scheduling method, device, equipment and storage medium Pending CN112395088A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011284197.8A CN112395088A (en) 2020-11-17 2020-11-17 Task scheduling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011284197.8A CN112395088A (en) 2020-11-17 2020-11-17 Task scheduling method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112395088A true CN112395088A (en) 2021-02-23

Family

ID=74600555

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011284197.8A Pending CN112395088A (en) 2020-11-17 2020-11-17 Task scheduling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112395088A (en)

Similar Documents

Publication Publication Date Title
US20140364987A1 (en) Operating plan formulation support system and method
CN102414674B (en) Application efficiency engine
CN111338791A (en) Method, device and equipment for scheduling cluster queue resources and storage medium
CN112667376A (en) Task scheduling processing method and device, computer equipment and storage medium
CN112272203A (en) Cluster service node selection method, system, terminal and storage medium
CN110516936B (en) Intelligent production line allocation system
CN101821997A (en) Hierarchical reservation resource scheduling infrastructure
US20160269239A1 (en) Selecting resources for automatic modeling using forecast thresholds
CN109815007A (en) Thread control method, device, electronic equipment and storage medium based on cloud monitoring
CN111459754B (en) Abnormal task processing method, device, medium and electronic equipment
CN108268546B (en) Method and device for optimizing database
CN1835454B (en) Event notification management method and event notification management apparatus
CN106209412B (en) Resource monitoring system and method thereof
CN102708006A (en) Processing optimization load adjustment
CN114675956B (en) Method for configuration and scheduling of Pod between clusters based on Kubernetes
CN111767199A (en) Resource management method, device, equipment and system based on batch processing operation
CN115543624A (en) Heterogeneous computing power arrangement scheduling method, system, equipment and storage medium
CN111638953A (en) Method, device and storage medium for realizing GPU virtualization
CN112395088A (en) Task scheduling method, device, equipment and storage medium
CN112416596A (en) Node scheduling method, device and equipment
CN116151582A (en) Automatic version scheduling method and device based on resource identification and storage medium
CN104781788A (en) Resource management system, resource management method and program
CN110850955B (en) Terminal position information processing method and device, computing equipment and storage medium
CN116089040A (en) Service flow scheduling method and device, electronic equipment and storage medium
US20140165058A1 (en) System resource management method for virtual system

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