CN105373428B - Task scheduling method and system - Google Patents

Task scheduling method and system Download PDF

Info

Publication number
CN105373428B
CN105373428B CN201510906198.4A CN201510906198A CN105373428B CN 105373428 B CN105373428 B CN 105373428B CN 201510906198 A CN201510906198 A CN 201510906198A CN 105373428 B CN105373428 B CN 105373428B
Authority
CN
China
Prior art keywords
task
running state
terminal
state information
instruction
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.)
Active
Application number
CN201510906198.4A
Other languages
Chinese (zh)
Other versions
CN105373428A (en
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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing 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 Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201510906198.4A priority Critical patent/CN105373428B/en
Publication of CN105373428A publication Critical patent/CN105373428A/en
Application granted granted Critical
Publication of CN105373428B publication Critical patent/CN105373428B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a task scheduling method and a task scheduling system. Wherein the method comprises: receiving a task configuration instruction, configuring a task on a corresponding terminal according to the task configuration instruction and saving the task starting time; sending a task starting instruction to the terminal according to the saved task starting time, so that the terminal distributes the corresponding task to the server cluster to operate; acquiring running state information of each task from each terminal and storing the running state information into a task running state database; and receiving a task state query instruction, querying corresponding task running state information from the task running state database according to the task state query instruction, and displaying the task running state information. The technical scheme solves the problem that the task running state information cannot be visually provided for the user in the prior art, is convenient for task management, and improves task scheduling efficiency.

Description

Task scheduling method and system
Technical Field
The invention relates to the technical field of computers, in particular to a task scheduling method and system.
Background
In a distributed system, different tasks are often required to be run on each terminal, and therefore, the tasks on each terminal need to be reasonably scheduled. In the Linux system, the system service cron controls the programmatic task, and the corresponding process is crond. The crond can periodically execute a certain task or wait to process certain events, similar to the planned task in windows, when the Linux operating system is installed, the service tool is installed by default, and a crond process is automatically started, wherein the crond process periodically checks whether a task is required to be executed every minute, and if the task is required to be executed, the task is automatically executed. There is a crontab file under the/etc directory of the system, which is the configuration file for system task scheduling. For the task scheduling of the user, the Linux system provides a crontab tool for the user to create a crontab file so as to customize the own planning task. The format of the crontab file is very simple, each line represents a task, each line is divided into six fields, and the first five fields are respectively minute, hour, day, month and week and are used for setting the execution time of the task; the last field is a command, which represents a command to be executed by the user, and may be a system command or a script file written by the user.
However, although the crontab file can well set the execution time and the specific operation command of the task, the current running state of the task cannot be shown to the user, the user cannot well know whether some tasks are successfully running, and the statistics are not convenient, and especially in the case of data migration, the user has almost no knowledge about the running state of each task.
Disclosure of Invention
In view of the above, the present invention has been made to provide a task scheduling method and system that overcomes or at least partially solves the above problems.
According to an aspect of the present invention, there is provided a task scheduling method, including:
receiving a task configuration instruction, configuring a task on a corresponding terminal according to the task configuration instruction and saving the task starting time;
sending a task starting instruction to the terminal according to the saved task starting time, so that the terminal distributes the corresponding task to the server cluster to operate;
acquiring running state information of each task from each terminal and storing the running state information into a task running state database;
and receiving a task state query instruction, querying corresponding task running state information from the task running state database according to the task state query instruction, and displaying the task running state information.
Optionally, the receiving the task configuration instruction includes:
providing a visual task configuration interface, wherein the task configuration interface comprises a task uploading interface and task configuration options;
receiving a task uploaded by a user through a task uploading interface on a task configuration interface;
task configuration information set by a user through a task configuration option interface on a task configuration interface; wherein the task configuration information includes: and the user configures the terminal identification of the task and the task starting time.
Optionally, the obtaining the running state information of each task from each terminal includes:
and obtaining the running state information of each task which is distributed to the server cluster by the terminal machine and runs back to each execution step of the terminal machine from each terminal machine.
Optionally, the displaying of the task running state information includes:
generating a task running state diagram according to the task running state information and displaying the task running state diagram;
and representing each step of the task by each node in the task running state diagram, associating each node according to the execution sequence of each step, and marking each node according to the running state information of each step.
Optionally, the method further comprises:
when acquiring information that a task on a terminal fails to be executed midway from the terminal, inquiring running state information of the task from a task running state database;
determining the position of an execution breakpoint of the task according to the running state information of the task;
and sending an instruction for executing the task from the execution breakpoint position to the terminal where the task is located.
Optionally, the method further comprises:
receiving a task execution remaining time query instruction, and querying corresponding task running state information from a task running state database according to the task execution remaining time query instruction;
determining the rest steps of the task according to the task running state information;
and estimating the time required by the execution of the residual steps according to the running state information of other executed tasks which are the same as or related to the task, and feeding the time to the inquiring party.
Optionally, the method further comprises:
each terminal is periodically scanned to confirm whether the communication with each terminal is normal.
Optionally, the method further comprises:
and carrying out statistical analysis according to the running state information of each task in the task running state database to obtain a time distribution map of the load of the server cluster.
Optionally, the method further comprises:
determining a time period when the load of the server cluster is smaller than a preset value according to the time distribution diagram of the load of the server cluster;
and in the time period, sending an instruction for starting the task of which the time is not forcibly started to the terminal.
Optionally, the method further comprises:
establishing backup relation among all terminals;
for a terminal, simultaneously allocating tasks configured on the terminal to a backup terminal of the terminal;
when the terminal machine is in failure, an instruction for starting the configured backup task is sent to the backup terminal machine of the terminal machine.
According to another aspect of the present invention, there is provided a task scheduling system, including:
the instruction receiving unit is suitable for receiving a task configuration instruction; and adapted to receive a task state query instruction;
the configuration processing unit is used for configuring tasks on corresponding terminals according to the task configuration instruction and saving the task starting time;
the scheduling processing unit is suitable for sending a task starting instruction to the terminal according to the saved task starting time so that the terminal distributes the corresponding task to the server cluster to run; acquiring running state information of each task from each terminal and storing the running state information into a task running state database;
the database unit is suitable for storing the task running state database;
and the state query processing unit is suitable for querying corresponding task running state information from the task running state database according to the task state query instruction and displaying the task running state information.
Optionally, the instruction receiving unit is adapted to provide a visualized task configuration interface, where the task configuration interface includes a task uploading interface and task configuration options; receiving a task uploaded by a user through a task uploading interface on a task configuration interface; task configuration information set by a user through a task configuration option interface on a task configuration interface;
wherein the task configuration information includes: and the user configures the terminal identification of the task and the task starting time.
Optionally, the scheduling processing unit is adapted to obtain, from each terminal, operation state information that each task that the terminal is allocated to run on the server cluster and feeds back to each execution step of the terminal.
Optionally, the state query processing unit is adapted to generate and display a task running state diagram according to the task running state information; and representing each step of the task by each node in the task running state diagram, associating each node according to the execution sequence of each step, and marking each node according to the running state information of each step.
Optionally, the scheduling processing unit is further adapted to query the running state information of a task from the task running state database when the information that the execution of the task in the terminal fails in the midway is acquired from the terminal; determining the position of an execution breakpoint of the task according to the running state information of the task; and sending an instruction for executing the task from the execution breakpoint position to the terminal where the task is located.
Optionally, the instruction receiving unit is adapted to receive a task execution remaining time query instruction;
the state query processing unit is also suitable for querying corresponding task running state information from the task running state database according to the task execution remaining time query instruction; determining the rest steps of the task according to the task running state information; and estimating the time required by the execution of the residual steps according to the running state information of other executed tasks which are the same as or related to the task, and feeding the time to the inquiring party.
Optionally, the scheduling processing unit is further adapted to periodically scan each terminal to determine whether the communication with each terminal is normal.
Optionally, the system further comprises:
and the statistical analysis unit is suitable for performing statistical analysis according to the running state information of each task in the task running state database to obtain a time distribution map of the load of the server cluster.
Optionally, the scheduling processing unit is adapted to determine, according to the time distribution map of the load of the server cluster, a time period in which the load of the server cluster is smaller than a preset value; and in the time period, sending an instruction for starting the task of which the time is not forcibly started to the terminal.
Optionally, the scheduling processing unit is further adapted to establish a backup relationship between the terminals; for a terminal, simultaneously allocating tasks configured on the terminal to a backup terminal of the terminal;
when the terminal machine is in failure, an instruction for starting the configured backup task is sent to the backup terminal machine of the terminal machine.
According to the technical scheme, the tasks are configured on the terminal machines according to the received task configuration instructions, the starting time of each task is saved, the task starting instructions are sent to the terminal machines when the starting time is up, the corresponding tasks are distributed to the corresponding server clusters to run, the running state information of each task is obtained through each terminal machine and is saved in the task running state database, and the corresponding task running state information is inquired from the task running state database according to the instructions and is displayed when the task state inquiry instructions are received according to the user requirements. The technical scheme can not only realize the basic configuration of the tasks on each terminal, but also obtain the running state information of each task in real time and store the running state information in the corresponding database, thereby providing the corresponding query result for the user when the user wants to query the task state, solving the problem that the running state information of the tasks cannot be intuitively provided for the user in the prior art, facilitating the task management and improving the task scheduling efficiency.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 shows a flow diagram of a method of task scheduling according to one embodiment of the invention;
FIG. 2 is a schematic diagram of a task scheduling system according to an embodiment of the present invention; and
fig. 3 is a schematic structural diagram of another task scheduling system according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 shows a flowchart of a task scheduling method according to an embodiment of the present invention, and as shown in fig. 1, the method includes:
step S110, receiving task configuration instruction, configuring task on corresponding terminal machine according to task configuration instruction and saving task starting time. Specifically, the task start time setting format of crontab in the prior art may be referred to, or the start time setting format of the task may be determined according to the user requirement.
And step S120, sending a task starting instruction to the terminal according to the saved task starting time, so that the terminal distributes the corresponding task to the server cluster to operate. In the prior art, a system periodically checks whether a task to be executed exists through a crond process, and if the task to be executed exists, the task is automatically executed. In this embodiment, since a plurality of crontab files are not configured on each terminal, the corresponding task can be "woken up" by sending a task start instruction to the terminal when the task start time arrives, so that the terminal performs task allocation on the server cluster.
Step S130, obtaining the running state information of each task from each terminal and storing the running state information in the task running state database.
Step S140, receiving the task state query instruction, querying corresponding task running state information from the task running state database according to the task state query instruction, and displaying the task running state information. In the prior art, if the task running state information needs to be checked, the task running machine needs to be checked, and the operation is very complicated, for example, relevant commands are manually input. In this embodiment, the task running state information can be checked through the control terminal for task scheduling, which is very convenient.
It can be seen that, in the method shown in fig. 1, firstly, according to a received task configuration instruction, a task is configured on each terminal, and the start time of each task is saved, when the start time is reached, a task start instruction is sent to the terminal to enable the terminal to allocate the corresponding task to the corresponding server cluster for operation, the operation state information of each task is obtained through each terminal and saved in the task operation state database, and according to the user requirement, when a task state query instruction is received, the corresponding task operation state information is queried from the task operation state database according to the instruction and is displayed. The technical scheme can not only realize the basic configuration of the tasks on each terminal, but also obtain the running state information of each task in real time and store the running state information in the corresponding database, thereby providing the corresponding query result for the user when the user wants to query the task state, solving the problem that the running state information of the tasks cannot be intuitively provided for the user in the prior art, facilitating the task management and improving the task scheduling efficiency.
In an embodiment of the present invention, in the method shown in fig. 1, receiving a task configuration instruction includes: providing a visual task configuration interface, wherein the task configuration interface comprises a task uploading interface and task configuration options; receiving a task uploaded by a user through a task uploading interface on a task configuration interface; task configuration information set by a user through a task configuration option interface on a task configuration interface; wherein the task configuration information includes: and the user configures the terminal identification of the task and the task starting time.
In the prior art, a task is often configured by inputting a command of a code pattern, for example, a crontab file mentioned above for many times needs to be written by a user according to a specified format to configure the task. In this embodiment, a visual task configuration interface is provided, and a user can drag a task to be configured from a task list on the interface to a task upload interface for uploading through simple operations, such as dragging, and then input task start time and a terminal identifier for configuring the task in a task configuration option interface, so that sending of a task configuration instruction can be very simply realized, operations of related personnel are reduced, and user experience is improved.
In an embodiment of the present invention, in the method shown in fig. 1, the obtaining the running state information of each task from each terminal includes: and obtaining the running state information of each task which is distributed to the server cluster by the terminal machine and runs back to each execution step of the terminal machine from each terminal machine.
In this embodiment, the terminal receives the running state information fed back to each execution step of the terminal by each task running on the server cluster, that is, the execution result of each execution step in the task is well perceived. Because the terminal needs to configure tasks and the collected running state information is more, the terminal does not store the obtained running state information for a long time but forwards and stores the running state information into the task running state database, so that the resource consumption of the terminal is saved, and the pressure of the terminal is reduced.
In an embodiment of the present invention, in the method shown in fig. 1, the displaying of the task running state information includes: generating a task running state diagram according to the task running state information and displaying the task running state diagram; and representing each step of the task by each node in the task running state diagram, associating each node according to the execution sequence of each step, and marking each node according to the running state information of each step.
In the embodiment, the task running state information is displayed in a mode of the task running state diagram, so that the task running state information is convenient and visual. Since each step of the task has an execution sequence, each step is presented in a node manner, and a tree graph or a mesh graph can be formed, wherein, for a step that is successfully executed, a corresponding node can be marked green, similarly, a node corresponding to an unfinished step is marked white, a node corresponding to an ongoing step is marked yellow, a node corresponding to a step that has a problem is marked red, and the like. Specifically, the task running state diagram may be dynamically updated in real time, for example, if step a1 in task a has been successfully executed and step a2 is being executed, then nodes a1 to a2 may be labeled with dynamic arrows on the task running state diagram.
In one embodiment of the present invention, the method shown in fig. 1 further comprises: when acquiring information that a task on a terminal fails to be executed midway from the terminal, inquiring running state information of the task from a task running state database; determining the position of an execution breakpoint of the task according to the running state information of the task; and sending an instruction for executing the task from the execution breakpoint position to the terminal where the task is located.
Since a server cluster in a distributed system is deployed in multiple computer rooms, occasionally, a certain computer room or some machines in a certain computer room may fail. Repairing a fault is typically around 20 to 40 minutes, during which time the tasks performed by the machines in the machine room are necessarily interrupted. Therefore, when the task needs to be restarted after the fault is repaired, the task running state is only saved on the machine executing the task and is likely to be lost, so that manual intervention is often required in the prior art. The tasks to be executed are executed from the beginning, which not only wastes machine resources, but also affects the execution efficiency of the tasks and consumes labor cost. In this embodiment, if it is obtained that the execution of the last task of the terminal fails in the midway, the task can be automatically continuously executed from the execution breakpoint position without manual intervention, thereby reducing the background data pressure, reducing the execution time of the task and improving the efficiency.
In one embodiment of the present invention, the method shown in fig. 1 further comprises: receiving a task execution remaining time query instruction, and querying corresponding task running state information from a task running state database according to the task execution remaining time query instruction; determining the rest steps of the task according to the task running state information; and estimating the time required by the execution of the rest steps according to the running state information of other executed tasks which are the same as or related to the task, and feeding the time to the inquiring party.
In many cases, a user needs to determine how long the task being executed can be executed, so as to perform overall planning such as statistics reporting or summarization, and the task running state database stores a large amount of task running state information.
In one embodiment of the present invention, the method shown in fig. 1 further comprises: each terminal is periodically scanned to confirm whether the communication with each terminal is normal.
Since the task operation state information needs to be obtained by communicating with each terminal, each terminal needs to be periodically scanned for confirmation in order to ensure normal communication, and since normal communication does not fail, in a specific implementation, the interval of the periodic scanning may be slightly longer than that set in a normal heartbeat manner, for example, the interval of the scanning is set to 10 minutes.
In one embodiment of the present invention, the method shown in fig. 1 further comprises: and carrying out statistical analysis according to the running state information of each task in the task running state database to obtain a time distribution map of the load of the server cluster.
By checking the time distribution diagram of the load of the server cluster, a user can further plan the distribution of future tasks, so that the execution of the tasks is more efficient, the centralized management of the tasks is realized, the task quantity of the server cluster is conveniently and properly adjusted, and the equipment breakdown caused by overlarge pressure is avoided.
In an embodiment of the present invention, the method further includes: determining a time period when the load of the server cluster is smaller than a preset value according to the time distribution diagram of the load of the server cluster; and sending an instruction for starting a task of which the starting time is not forced to be within the time period to the terminal.
For example, a user finds that the load of the server cluster is small in a time period of 2: 00-4: 00, which indicates that the task configuration at that time is not reasonable enough and causes waste of resources, so that an instruction for starting a task with the starting time not forced within the time period can be sent to a terminal, and the task with the starting time not forced within the time period is partially started, thereby effectively balancing the load distribution of the server cluster.
In an embodiment of the present invention, the method further includes: establishing backup relation among all terminals; for a terminal, simultaneously allocating tasks configured on the terminal to a backup terminal of the terminal; when the terminal machine is in failure, an instruction for starting the configured backup task is sent to the backup terminal machine of the terminal machine.
In this embodiment, a configuration of scheduling disaster recovery is performed. The terminal machines are responsible for task configuration and acquisition and sending of task state information, pressure is usually high, and faults are easy to occur, so that in the embodiment, each terminal machine is configured with a backup terminal machine, and when a certain terminal machine has a fault, the backup terminal machine can be automatically switched to and the configured backup task is started.
Fig. 2 is a schematic structural diagram of a task scheduling system according to an embodiment of the present invention, and as shown in fig. 2, the task scheduling system 200 includes:
an instruction receiving unit 210 adapted to receive a task configuration instruction; and adapted to receive a task state query instruction. Specifically, the task start time setting format of crontab in the prior art may be referred to, or the start time setting format of the task may be determined according to the user requirement.
And the configuration processing unit 220 configures the tasks on the corresponding terminal machines according to the task configuration instructions and saves the task starting time. In the prior art, a system periodically checks whether a task to be executed exists through a crond process, and if the task to be executed exists, the task is automatically executed. In this embodiment, since a plurality of crontab files are not configured on each terminal, the corresponding task can be "woken up" by sending a task start instruction to the terminal when the task start time arrives, so that the terminal performs task allocation on the server cluster.
The scheduling processing unit 230 is adapted to send a task starting instruction to the terminal according to the saved task starting time, so that the terminal allocates the corresponding task to the server cluster for operation; and acquiring the running state information of each task from each terminal and storing the running state information into a task running state database.
A database unit 240 adapted to store a task running state database.
And the state query processing unit 250 is adapted to query corresponding task running state information from the task running state database according to the task state query instruction, and display the task running state information. In the prior art, if the task running state information needs to be checked, the task running machine needs to be checked, and the operation is very complicated, for example, relevant commands are manually input. In this embodiment, the task running state information can be checked through the control terminal for task scheduling, which is very convenient.
It can be seen that, in the system shown in fig. 2, through the mutual cooperation of the units, firstly, according to the received task configuration instruction, the task is configured on each terminal, and the start time of each task is saved, when the start time is reached, the task start instruction is sent to the terminal to enable the terminal to allocate the corresponding task to the corresponding server cluster for operation, the operation state information of each task is obtained through each terminal and saved in the task operation state database, and according to the user requirement, when the task state query instruction is received, the corresponding task operation state information is queried from the task operation state database according to the instruction and displayed. The technical scheme can not only realize the basic configuration of the tasks on each terminal, but also obtain the running state information of each task in real time and store the running state information in the corresponding database, thereby providing the corresponding query result for the user when the user wants to query the task state, solving the problem that the running state information of the tasks cannot be intuitively provided for the user in the prior art, facilitating the task management and improving the task scheduling efficiency.
In an embodiment of the present invention, in the system shown in fig. 2, the instruction receiving unit 210 is adapted to provide a visualized task configuration interface, where the task configuration interface includes a task uploading interface and task configuration options; receiving a task uploaded by a user through a task uploading interface on a task configuration interface; task configuration information set by a user through a task configuration option interface on a task configuration interface; wherein the task configuration information includes: and the user configures the terminal identification of the task and the task starting time.
In an embodiment of the present invention, in the system shown in fig. 2, the scheduling processing unit 230 is adapted to obtain, from each terminal machine, running state information that each task that the terminal machine allocates to run on the server cluster is fed back to each execution step of the terminal machine.
In an embodiment of the present invention, in the system shown in fig. 2, the state query processing unit 250 is adapted to generate and display a task running state diagram according to the task running state information; and representing each step of the task by each node in the task running state diagram, associating each node according to the execution sequence of each step, and marking each node according to the running state information of each step.
In an embodiment of the present invention, in the system shown in fig. 2, the scheduling processing unit 230 is further adapted to, when acquiring information that a task on the terminal fails to be executed halfway from the terminal, query the running state information of the task from the task running state database; determining the position of an execution breakpoint of the task according to the running state information of the task; and sending an instruction for executing the task from the execution breakpoint position to the terminal where the task is located.
In an embodiment of the present invention, in the system shown in fig. 2, the instruction receiving unit 210 is adapted to receive a task execution remaining time query instruction; the state query processing unit 250 is further adapted to query corresponding task running state information from the task running state database according to the task execution remaining time query instruction; determining the rest steps of the task according to the task running state information; and estimating the time required by the execution of the rest steps according to the running state information of other executed tasks which are the same as or related to the task, and feeding the time to the inquiring party.
In one embodiment of the present invention, in the system shown in fig. 2, the scheduling processing unit 230 is further adapted to periodically scan each terminal set to determine whether the communication with each terminal set is normal.
Fig. 3 is a schematic structural diagram of another task scheduling system according to an embodiment of the present invention, and as shown in fig. 3, the task scheduling system 300 includes: the functions and connection manners of the instruction receiving unit 210, the configuration processing unit 220, the scheduling processing unit 230, the database unit 240, and the status query processing unit 250 are the same as those in fig. 2, and are not described herein again. The system further comprises: the statistical analysis unit 360 is adapted to perform statistical analysis according to the running state information of each task in the task running state database to obtain a time distribution map of the load of the server cluster.
By checking the time distribution diagram of the load of the server cluster, a user can further plan the distribution of future tasks, so that the execution of the tasks is more efficient, the centralized management of the tasks is realized, the task quantity of the server cluster is conveniently and properly adjusted, and the equipment breakdown caused by overlarge pressure is avoided.
In an embodiment of the present invention, in the system shown in fig. 3, the scheduling processing unit 230 is adapted to determine, according to the time distribution diagram of the load of the server cluster, a time period when the load of the server cluster is smaller than a preset value; and sending an instruction for starting a task of which the starting time is not forced to be within the time period to the terminal.
In an embodiment of the present invention, in the system, the scheduling processing unit 230 is further adapted to establish a backup relationship between the terminals; for a terminal, simultaneously allocating tasks configured on the terminal to a backup terminal of the terminal; when the terminal machine is in failure, an instruction for starting the configured backup task is sent to the backup terminal machine of the terminal machine.
It should be noted that the specific implementation of each system embodiment is the same as the specific implementation of the corresponding method embodiment, and is not described herein again.
In summary, according to the technical solution of the present invention, firstly, a task is configured on each terminal according to a received task configuration instruction, and the start time of each task is saved, and when the start time is reached, a task start instruction is sent to the terminal to allocate the corresponding task to the corresponding server cluster for operation, the operation state information of each task is obtained through each terminal and saved in the task operation state database, and according to the user requirement, when a task state query instruction is received, the corresponding task operation state information is queried from the task operation state database according to the instruction and displayed. The technical scheme can not only realize the basic configuration of the tasks on each terminal, but also obtain the running state information of each task in real time and store the running state information in the corresponding database, thereby providing the corresponding query result for the user when the user wants to query the task state, solving the problem that the running state information of the tasks cannot be intuitively provided for the user in the prior art, facilitating the task management and improving the task scheduling efficiency.
It should be noted that:
the algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose devices may be used with the teachings herein. The required structure for constructing such a device will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in a task scheduling system according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses A1 and a task scheduling method, wherein the method comprises the following steps:
receiving a task configuration instruction, configuring a task on a corresponding terminal according to the task configuration instruction and saving the task starting time;
sending a task starting instruction to the terminal according to the saved task starting time, so that the terminal distributes the corresponding task to the server cluster to operate;
acquiring running state information of each task from each terminal and storing the running state information into a task running state database;
and receiving a task state query instruction, querying corresponding task running state information from the task running state database according to the task state query instruction, and displaying the task running state information.
A2, the method of claim A1, wherein the receiving task configuration instructions includes:
providing a visual task configuration interface, wherein the task configuration interface comprises a task uploading interface and task configuration options;
receiving a task uploaded by a user through a task uploading interface on a task configuration interface;
task configuration information set by a user through a task configuration option interface on a task configuration interface; wherein the task configuration information includes: and the user configures the terminal identification of the task and the task starting time.
A3, the method as in a1, wherein the acquiring the running state information of each task from each terminal includes:
and obtaining the running state information of each task which is distributed to the server cluster by the terminal machine and runs back to each execution step of the terminal machine from each terminal machine.
A4, the method as in A1, wherein the showing task running state information comprises:
generating a task running state diagram according to the task running state information and displaying the task running state diagram;
and representing each step of the task by each node in the task running state diagram, associating each node according to the execution sequence of each step, and marking each node according to the running state information of each step.
A5, the method of a1, wherein the method further comprises:
when acquiring information that a task on a terminal fails to be executed midway from the terminal, inquiring running state information of the task from a task running state database;
determining the position of an execution breakpoint of the task according to the running state information of the task;
and sending an instruction for executing the task from the execution breakpoint position to the terminal where the task is located.
A6, the method of a1, wherein the method further comprises:
receiving a task execution remaining time query instruction, and querying corresponding task running state information from a task running state database according to the task execution remaining time query instruction;
determining the rest steps of the task according to the task running state information;
and estimating the time required by the execution of the residual steps according to the running state information of other executed tasks which are the same as or related to the task, and feeding the time to the inquiring party.
A7, the method of a1, wherein the method further comprises:
each terminal is periodically scanned to confirm whether the communication with each terminal is normal.
A8, the method of a1, wherein the method further comprises:
and carrying out statistical analysis according to the running state information of each task in the task running state database to obtain a time distribution map of the load of the server cluster.
A9, the method of A8, wherein the method further comprises:
determining a time period when the load of the server cluster is smaller than a preset value according to the time distribution diagram of the load of the server cluster;
and in the time period, sending an instruction for starting the task of which the time is not forcibly started to the terminal.
A10, the method of any one of A1-A9, wherein the method further comprises:
establishing backup relation among all terminals;
for a terminal, simultaneously allocating tasks configured on the terminal to a backup terminal of the terminal;
when the terminal machine is in failure, an instruction for starting the configured backup task is sent to the backup terminal machine of the terminal machine.
The invention also discloses B11 and a task scheduling system, wherein the system comprises:
the instruction receiving unit is suitable for receiving a task configuration instruction; and adapted to receive a task state query instruction;
the configuration processing unit is used for configuring tasks on corresponding terminals according to the task configuration instruction and saving the task starting time;
the scheduling processing unit is suitable for sending a task starting instruction to the terminal according to the saved task starting time so that the terminal distributes the corresponding task to the server cluster to run; acquiring running state information of each task from each terminal and storing the running state information into a task running state database;
the database unit is suitable for storing the task running state database;
and the state query processing unit is suitable for querying corresponding task running state information from the task running state database according to the task state query instruction and displaying the task running state information.
B12, the system according to B11, wherein,
the instruction receiving unit is suitable for providing a visual task configuration interface, and the task configuration interface comprises a task uploading interface and task configuration options; receiving a task uploaded by a user through a task uploading interface on a task configuration interface; task configuration information set by a user through a task configuration option interface on a task configuration interface;
wherein the task configuration information includes: and the user configures the terminal identification of the task and the task starting time.
B13, the system according to B11, wherein,
the scheduling processing unit is suitable for obtaining the running state information of each task which is distributed to the server cluster by the terminal machine and is run by the server cluster and fed back to each execution step of the terminal machine.
B14, the system according to B11, wherein,
the state query processing unit is suitable for generating and displaying a task running state diagram according to the task running state information; and representing each step of the task by each node in the task running state diagram, associating each node according to the execution sequence of each step, and marking each node according to the running state information of each step.
B15, the system according to B11, wherein,
the scheduling processing unit is further suitable for inquiring the running state information of a task from the task running state database when the information that the execution of the task on the terminal machine fails in midway is acquired from the terminal machine; determining the position of an execution breakpoint of the task according to the running state information of the task; and sending an instruction for executing the task from the execution breakpoint position to the terminal where the task is located.
B16, the system according to B11, wherein,
the instruction receiving unit is suitable for receiving a task execution remaining time query instruction;
the state query processing unit is also suitable for querying corresponding task running state information from the task running state database according to the task execution remaining time query instruction; determining the rest steps of the task according to the task running state information; and estimating the time required by the execution of the residual steps according to the running state information of other executed tasks which are the same as or related to the task, and feeding the time to the inquiring party.
B17, the system according to B11, wherein,
the scheduling processing unit is further adapted to periodically scan each terminal to determine whether the communication with each terminal is normal.
B18, the system of B11, wherein the system further comprises:
and the statistical analysis unit is suitable for performing statistical analysis according to the running state information of each task in the task running state database to obtain a time distribution map of the load of the server cluster.
B19, the system according to B18, wherein,
the scheduling processing unit is suitable for determining a time period when the load of the server cluster is smaller than a preset value according to the time distribution diagram of the load of the server cluster; and in the time period, sending an instruction for starting the task of which the time is not forcibly started to the terminal.
B20, the system of any one of B11-B19, wherein,
the scheduling processing unit is further suitable for establishing backup relation among the terminal machines; for a terminal, simultaneously allocating tasks configured on the terminal to a backup terminal of the terminal;
when the terminal machine is in failure, an instruction for starting the configured backup task is sent to the backup terminal machine of the terminal machine.

Claims (20)

1. A task scheduling method applied to a control terminal is disclosed, wherein the method comprises the following steps:
receiving a task configuration instruction, configuring a task on a corresponding terminal according to the task configuration instruction and saving the task starting time;
sending a task starting instruction to the terminal according to the saved task starting time, so that the terminal distributes the corresponding task to the server cluster to operate;
acquiring running state information of each task from each terminal and storing the running state information into a task running state database;
receiving a task state query instruction, querying corresponding task running state information from a task running state database according to the task state query instruction, and displaying the task running state information;
the displaying of the task running state information comprises:
generating a task running state diagram according to the task running state information and displaying the task running state diagram;
and representing each step of the task by each node in the task running state diagram, associating each node according to the execution sequence of each step, and marking each node according to the running state information of each step, wherein the task running state diagram is dynamically updated in real time.
2. The method of claim 1, wherein the receiving task configuration instructions comprises:
providing a visual task configuration interface, wherein the task configuration interface comprises a task uploading interface and task configuration options;
receiving a task uploaded by a user through a task uploading interface on a task configuration interface;
task configuration information set by a user through a task configuration option interface on a task configuration interface; wherein the task configuration information includes: and the user configures the terminal identification of the task and the task starting time.
3. The method of claim 1, wherein the obtaining the running state information of each task from each terminal comprises:
and obtaining the running state information of each task which is distributed to the server cluster by the terminal machine and runs back to each execution step of the terminal machine from each terminal machine.
4. The method of claim 1, wherein the method further comprises:
when acquiring information that a task on a terminal fails to be executed midway from the terminal, inquiring running state information of the task from a task running state database;
determining the position of an execution breakpoint of the task according to the running state information of the task;
and sending an instruction for executing the task from the execution breakpoint position to the terminal where the task is located.
5. The method of claim 1, wherein the method further comprises:
receiving a task execution remaining time query instruction, and querying corresponding task running state information from a task running state database according to the task execution remaining time query instruction;
determining the rest steps of the task according to the task running state information;
and estimating the time required by the execution of the residual steps according to the running state information of other executed tasks which are the same as or related to the task, and feeding the time to the inquiring party.
6. The method of claim 1, wherein the method further comprises:
each terminal is periodically scanned to confirm whether the communication with each terminal is normal.
7. The method of claim 1, wherein the method further comprises:
and carrying out statistical analysis according to the running state information of each task in the task running state database to obtain a time distribution map of the load of the server cluster.
8. The method of claim 7, wherein the method further comprises:
determining a time period when the load of the server cluster is smaller than a preset value according to the time distribution diagram of the load of the server cluster;
and in the time period, sending an instruction for starting the task of which the time is not forcibly started to the terminal.
9. The method of any one of claims 1-8, wherein the method further comprises:
establishing backup relation among all terminals;
for a terminal, simultaneously allocating tasks configured on the terminal to a backup terminal of the terminal;
when the terminal machine is in failure, an instruction for starting the configured backup task is sent to the backup terminal machine of the terminal machine.
10. A task scheduling system, wherein the system comprises:
the instruction receiving unit is suitable for receiving a task configuration instruction; and adapted to receive a task state query instruction;
the configuration processing unit is used for configuring tasks on corresponding terminals according to the task configuration instruction and saving the task starting time;
the scheduling processing unit is suitable for sending a task starting instruction to the terminal according to the saved task starting time so that the terminal distributes the corresponding task to the server cluster to run; acquiring running state information of each task from each terminal and storing the running state information into a task running state database;
the database unit is suitable for storing the task running state database;
the state query processing unit is suitable for querying corresponding task running state information from the task running state database according to the task state query instruction and displaying the task running state information;
the state query processing unit is suitable for generating and displaying a task running state diagram according to the task running state information; and representing each step of the task by each node in the task running state diagram, associating each node according to the execution sequence of each step, and marking each node according to the running state information of each step, wherein the task running state diagram is dynamically updated in real time.
11. The system of claim 10, wherein,
the instruction receiving unit is suitable for providing a visual task configuration interface, and the task configuration interface comprises a task uploading interface and task configuration options; receiving a task uploaded by a user through a task uploading interface on a task configuration interface; task configuration information set by a user through a task configuration option interface on a task configuration interface;
wherein the task configuration information includes: and the user configures the terminal identification of the task and the task starting time.
12. The system of claim 10, wherein,
the scheduling processing unit is suitable for obtaining the running state information of each task which is distributed to the server cluster by the terminal machine and is run by the server cluster and fed back to each execution step of the terminal machine.
13. The system of claim 10, wherein,
the scheduling processing unit is further suitable for inquiring the running state information of a task from the task running state database when the information that the execution of the task on the terminal machine fails in midway is acquired from the terminal machine; determining the position of an execution breakpoint of the task according to the running state information of the task; and sending an instruction for executing the task from the execution breakpoint position to the terminal where the task is located.
14. The system of claim 10, wherein,
the instruction receiving unit is suitable for receiving a task execution remaining time query instruction;
the state query processing unit is also suitable for querying corresponding task running state information from the task running state database according to the task execution remaining time query instruction; determining the rest steps of the task according to the task running state information; and estimating the time required by the execution of the residual steps according to the running state information of other executed tasks which are the same as or related to the task, and feeding the time to the inquiring party.
15. The system of claim 10, wherein,
the scheduling processing unit is further adapted to periodically scan each terminal to determine whether the communication with each terminal is normal.
16. The system of claim 10, wherein the system further comprises:
and the statistical analysis unit is suitable for performing statistical analysis according to the running state information of each task in the task running state database to obtain a time distribution map of the load of the server cluster.
17. The system of claim 16, wherein,
the scheduling processing unit is suitable for determining a time period when the load of the server cluster is smaller than a preset value according to the time distribution diagram of the load of the server cluster; and in the time period, sending an instruction for starting the task of which the time is not forcibly started to the terminal.
18. The system of any one of claims 10-17,
the scheduling processing unit is further suitable for establishing backup relation among the terminal machines; for a terminal, simultaneously allocating tasks configured on the terminal to a backup terminal of the terminal;
when the terminal machine is in failure, an instruction for starting the configured backup task is sent to the backup terminal machine of the terminal machine.
19. An electronic device, wherein the electronic device comprises:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the method of any one of claims 1-9.
20. A computer readable storage medium, wherein the computer readable storage medium stores one or more programs which, when executed by a processor, implement the method of any of claims 1-9.
CN201510906198.4A 2015-12-09 2015-12-09 Task scheduling method and system Active CN105373428B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510906198.4A CN105373428B (en) 2015-12-09 2015-12-09 Task scheduling method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510906198.4A CN105373428B (en) 2015-12-09 2015-12-09 Task scheduling method and system

Publications (2)

Publication Number Publication Date
CN105373428A CN105373428A (en) 2016-03-02
CN105373428B true CN105373428B (en) 2020-02-11

Family

ID=55375653

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510906198.4A Active CN105373428B (en) 2015-12-09 2015-12-09 Task scheduling method and system

Country Status (1)

Country Link
CN (1) CN105373428B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107370612B (en) * 2016-05-12 2022-04-19 中兴通讯股份有限公司 Network quality management system detection task scheduling method and device
CN107544886A (en) * 2016-06-27 2018-01-05 上海中兴软件有限责任公司 A kind of block process dispatching method and device
CN105939393A (en) * 2016-06-30 2016-09-14 北京奇虎科技有限公司 Task operating state monitoring method and system
CN106294081B (en) * 2016-08-12 2019-01-04 北京百迈客云科技有限公司 Analysis of biological information task run monitoring system
CN106371893A (en) * 2016-08-31 2017-02-01 开封大学 Cloud computing scheduling system and method
CN106681808A (en) * 2016-12-01 2017-05-17 北京奇虎科技有限公司 Task scheduling method and device
CN106649053A (en) * 2016-12-28 2017-05-10 北京奇艺世纪科技有限公司 Task running status information acquisition method and device
CN107621978A (en) * 2017-09-29 2018-01-23 郑州云海信息技术有限公司 A kind of High Availabitity task processing Controlling model under parallel computation environment
CN108052614B (en) * 2017-12-14 2021-12-03 太原理工大学 Scheduling method for database system load
CN110489224A (en) * 2018-05-15 2019-11-22 北京京东尚科信息技术有限公司 A kind of method and apparatus of task schedule
CN109408210B (en) * 2018-09-27 2021-01-05 北京车和家信息技术有限公司 Distributed timed task management method and system
CN109471709B (en) * 2018-10-16 2022-02-18 深圳中顺易金融服务有限公司 Scheduling method for flow task processing big data based on Apache Oozie framework
CN110134512B (en) * 2019-04-15 2024-02-13 平安科技(深圳)有限公司 Method, device, equipment and storage medium for cluster server to execute tasks
CN111026530A (en) * 2019-11-29 2020-04-17 珠海随变科技有限公司 Task scheduling method and device, computer equipment and storage medium
CN111447258B (en) * 2020-03-10 2023-04-07 广州方硅信息技术有限公司 Method, device and equipment for scheduling offline tasks and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101800974A (en) * 2009-02-11 2010-08-11 朗讯科技公司 Method for processing task request of mobile equipment and user agent application server
WO2012139331A1 (en) * 2011-04-14 2012-10-18 中兴通讯股份有限公司 Distributed bill query management system and method
CN103257972A (en) * 2012-02-20 2013-08-21 腾讯科技(深圳)有限公司 Method and device for processing download task
CN103780635A (en) * 2012-10-17 2014-05-07 百度在线网络技术(北京)有限公司 System and method for distributed asynchronous task queue execution in cloud environment
CN104615107A (en) * 2014-12-30 2015-05-13 北京奇虎科技有限公司 Intelligent control system and method for controlling intelligent home equipment by using bus card

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103197969B (en) * 2013-03-27 2017-02-08 百度在线网络技术(北京)有限公司 Distributed timed task control device and method
CN103677973A (en) * 2013-09-01 2014-03-26 西安重装渭南光电科技有限公司 Distributed multi-task scheduling management system
CN103942034A (en) * 2014-03-21 2014-07-23 深圳华大基因科技服务有限公司 Task scheduling method and electronic device implementing method
CN104915259A (en) * 2015-06-15 2015-09-16 浪潮软件集团有限公司 Task scheduling method applied to distributed acquisition system
CN105100259B (en) * 2015-08-18 2018-02-16 北京京东尚科信息技术有限公司 A kind of distributed timing task executing method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101800974A (en) * 2009-02-11 2010-08-11 朗讯科技公司 Method for processing task request of mobile equipment and user agent application server
WO2012139331A1 (en) * 2011-04-14 2012-10-18 中兴通讯股份有限公司 Distributed bill query management system and method
CN103257972A (en) * 2012-02-20 2013-08-21 腾讯科技(深圳)有限公司 Method and device for processing download task
CN103780635A (en) * 2012-10-17 2014-05-07 百度在线网络技术(北京)有限公司 System and method for distributed asynchronous task queue execution in cloud environment
CN104615107A (en) * 2014-12-30 2015-05-13 北京奇虎科技有限公司 Intelligent control system and method for controlling intelligent home equipment by using bus card

Also Published As

Publication number Publication date
CN105373428A (en) 2016-03-02

Similar Documents

Publication Publication Date Title
CN105373428B (en) Task scheduling method and system
US20180329376A1 (en) Multisite version and upgrade management system
CN111352717B (en) Method for realizing kubernets self-defined scheduler
US20140364987A1 (en) Operating plan formulation support system and method
CN111381972B (en) Distributed task scheduling method, device and system
CN106406993A (en) Timed task management method and system
CN113569987A (en) Model training method and device
CN110086664B (en) Access equipment fault processing method and device
CN113032125B (en) Job scheduling method, job scheduling device, computer system and computer readable storage medium
CN106569920B (en) Database backup method and device
CN107919987B (en) Method for realizing micro-service cloud deployment
CN111459631A (en) Automatic batch processing method and system for server
CN110619014A (en) ETL-based data extraction method
CN106155599A (en) Equipment management system, relay and trunking method
CN108023905B (en) Internet of things application system and method
CN111459629A (en) Azkaban-based project operation method and device and terminal equipment
CN111311078A (en) Rent work order distribution method, system, electronic equipment and readable storage medium
CN111756778A (en) Server disk cleaning script pushing method and device and storage medium
CN107025126B (en) Resource scheduling method, NFVO and system
CN112905306A (en) Multi-cluster container management method and device, electronic equipment and storage medium
US11636446B2 (en) Systems and methods for providing status-based maintenance schedules
US20140181176A1 (en) Graphical user interface for hadoop system administration
CN108228254A (en) Intelligent Problems processing method, server and terminal device applied to parking lot
CN105207799A (en) Batch command executing method and device
CN108521524B (en) Agent collaborative task management method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20240113

Address after: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.

TR01 Transfer of patent right