CN113268324A - Task scheduling method and device, storage medium and computer equipment - Google Patents
Task scheduling method and device, storage medium and computer equipment Download PDFInfo
- Publication number
- CN113268324A CN113268324A CN202110544307.8A CN202110544307A CN113268324A CN 113268324 A CN113268324 A CN 113268324A CN 202110544307 A CN202110544307 A CN 202110544307A CN 113268324 A CN113268324 A CN 113268324A
- Authority
- CN
- China
- Prior art keywords
- task
- tasks
- data
- executed
- trigger signal
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 57
- 238000004590 computer program Methods 0.000 claims description 10
- 239000002699 waste material Substances 0.000 abstract description 6
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 238000004891 communication Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The application discloses a task scheduling method and device, a storage medium and computer equipment, wherein the method comprises the following steps: receiving a first task trigger signal; acquiring a first task corresponding to the first task trigger signal from a plurality of data processing tasks, and acquiring first data to be processed; executing the first task to process the first data to be processed to generate second data to be processed, and broadcasting a second task trigger signal, wherein the second task trigger signal is used for triggering execution of a second task, and the execution of the second task depends on an execution result of the first task. The method and the device are beneficial to improving the timeliness of data processing and the management efficiency of the data development task, and waste of system resources is avoided.
Description
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a task scheduling method and apparatus, a storage medium, and a computer device.
Background
A series of data development tasks need to be called to process a large amount of data in the data development process. The timeliness and rationality of the data development task invocation have a direct impact on the execution effect of the data development task.
In the existing data development task scheduling method and system, data development tasks are scheduled according to time periods, and are executed after each time period elapses. When the time period is set to be longer, the data processing has larger time delay; when the time period is set to be short, data processing is too frequent, and a large amount of system resources are wasted.
Therefore, how to avoid the problem caused by the time period scheduling manner in the data development process, improve the timeliness of data processing and the management efficiency of the data development task, and avoid the waste of system resources, becomes a problem to be solved in the field.
Disclosure of Invention
In view of this, the present application provides a task scheduling method and apparatus, a storage medium, and a computer device, which are beneficial to improving timeliness of data processing and management efficiency of data development tasks, and avoiding waste of system resources.
According to an aspect of the present application, there is provided a task scheduling method, including:
receiving a first task trigger signal;
acquiring a first task corresponding to the first task trigger signal from a plurality of data processing tasks, and acquiring first data to be processed;
executing the first task to process the first data to be processed to generate second data to be processed, and broadcasting a second task trigger signal, wherein the second task trigger signal is used for triggering execution of a second task, and the execution of the second task depends on an execution result of the first task.
Optionally, after the acquiring the first to-be-processed data, the method further includes:
counting the number of the current running tasks;
when the number of the currently running tasks is larger than or equal to the preset number, adding the first tasks into a task queue to be executed, and executing the tasks in the task queue to be executed when the number of the currently running tasks is monitored to be smaller than the preset number;
and when the number of the current running tasks is less than the preset number, executing the first task.
Optionally, the executing the tasks in the to-be-executed task queue when it is monitored that the number of the currently-running tasks is smaller than the preset number specifically includes:
and when the number of the current running tasks is monitored to be smaller than the preset number, acquiring a tail end task in the to-be-executed task queue, and executing the tail end task, wherein execution of a first other task in the to-be-executed task queue does not depend on an execution result of the tail end task, and the first other task is a task except the tail end task in the to-be-executed task queue.
Optionally, the executing the tasks in the to-be-executed task queue when it is monitored that the number of the currently-running tasks is smaller than the preset number specifically includes:
and when the number of the current running tasks is monitored to be smaller than the preset number, acquiring front-end tasks in the to-be-executed task queue, and executing the front-end tasks, wherein the execution of the front-end tasks does not depend on the execution result of second other tasks in the to-be-executed task queue, and the second other tasks are tasks in the to-be-executed task queue except the front-end tasks.
Optionally, the method further comprises:
creating a data processing task, wherein the data processing task comprises a data processing rule, a trigger signal and an execution end signal.
Optionally, the first task trigger signal includes a data identifier corresponding to the initial data, and after receiving the first task trigger signal, the method further includes:
and updating the processing progress of the initial data according to the first task trigger signal, wherein the processing progress of the initial data comprises a data identifier corresponding to the initial data, an executed task and an execution result corresponding to the executed task.
According to another aspect of the present application, there is provided a task scheduling apparatus including:
the signal receiving module is used for receiving a first task triggering signal;
the task acquisition module is used for acquiring a first task corresponding to the first task trigger signal from a plurality of data processing tasks and acquiring first data to be processed;
and the task execution module is used for executing the first task to process the first data to be processed to generate second data to be processed and broadcasting a second task trigger signal, wherein the second task trigger signal is used for triggering the execution of a second task, and the execution of the second task depends on the execution result of the first task.
Optionally, the task scheduling apparatus further includes:
the running task counting module is used for counting the number of the current running tasks after the first data to be processed is obtained;
the to-be-executed task processing module is used for adding the first task into a to-be-executed task queue when the number of the currently-operated tasks is larger than or equal to a preset number, and executing the tasks in the to-be-executed task queue when the number of the currently-operated tasks is monitored to be smaller than the preset number;
the task execution module is further configured to execute the first task when the number of the currently running tasks is smaller than the preset number.
Optionally, the to-be-executed task processing module includes an end task execution unit,
and the end task execution unit is configured to, when it is monitored that the number of the currently running tasks is smaller than the preset number, acquire an end task in the to-be-executed task queue, and execute the end task, where execution of a first other task in the to-be-executed task queue is independent of an execution result of the end task, and the first other task is a task other than the end task in the to-be-executed task queue.
Optionally, the to-be-executed task processing module includes a front-end task execution unit,
the front-end task execution unit is configured to, when it is monitored that the number of the currently running tasks is smaller than the preset number, acquire a front-end task in the to-be-executed task queue, and execute the front-end task, where execution of the front-end task does not depend on an execution result of a second other task in the to-be-executed task queue, and the second other task is a task in the to-be-executed task queue other than the front-end task.
Optionally, the task scheduling apparatus further includes:
the task creating module is used for creating a data processing task, wherein the data processing task comprises a data processing rule, a trigger signal and an execution ending signal.
Optionally, the first task trigger signal includes a data identifier corresponding to the initial data, and the task scheduling apparatus further includes:
and the task execution result processing module is used for updating the processing progress of the initial data according to the first task trigger signal after receiving the first task trigger signal, wherein the processing progress of the initial data comprises a data identifier corresponding to the initial data, an executed task and an execution result corresponding to the executed task.
According to yet another aspect of the present application, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the above task scheduling method.
According to yet another aspect of the present application, there is provided a computer device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, the processor implementing the task scheduling method when executing the program.
By means of the technical scheme, the task scheduling method and device, the storage medium and the computer device, after receiving the first task trigger signal, obtain a first task corresponding to the signal from a plurality of data processing tasks and obtain first data to be processed, and after processing the first data to be processed, the first task generates second data to be processed and generates a second task trigger signal to be broadcast. The data processing tasks in the embodiment of the application are scheduled and executed under the trigger of the specific task trigger signal, the lower task trigger signal is generated after each task is finished, and each data processing task in the system is scheduled in real time in a signal flow mode, so that the problem that in the prior art, the data processing tasks are not timely processed when being scheduled by using a time period, or the data processing tasks occupy too much system resources frequently is solved, the timeliness of data processing and the management efficiency of data development tasks are favorably improved, and the waste of system resources is avoided.
The foregoing description is only an overview of the technical solutions of the present application, and the present application can be implemented according to the content of the description in order to make the technical means of the present application more clearly understood, and the following detailed description of the present application is given in order to make the above and other objects, features, and advantages of the present application more clearly understandable.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a flowchart illustrating a task scheduling method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating another task scheduling method provided in an embodiment of the present application;
fig. 3 is a flowchart illustrating a task scheduling apparatus according to an embodiment of the present application.
Detailed Description
The present application will be described in detail below with reference to the accompanying drawings in conjunction with embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
In this embodiment, a task scheduling method is provided, as shown in fig. 1, the method includes:
102, acquiring a first task corresponding to the first task trigger signal from a plurality of data processing tasks, and acquiring first data to be processed;
The task scheduling method provided by the embodiment of the application can be applied to a task scheduling system, and the first task trigger signal can be generated by an external environment or by artificial active input. The task scheduling system stores a plurality of data processing tasks in advance, finds out a first task corresponding to a first task trigger signal from the data processing tasks after receiving the first task trigger signal, and acquires first to-be-processed data required to be processed by the first task. Here, the first to-be-processed data may be carried in the first task trigger signal. And in addition, after the first task is executed, generating a second task trigger signal and broadcasting the second task trigger signal so that the second task is called and executed under the trigger of the second task trigger signal to process the second data to be processed. The execution of the second task depends on the execution result of the first task, that is, depends on the second data to be processed generated after the first task is executed.
By applying the technical scheme of the embodiment, after receiving the first task trigger signal, the first task corresponding to the first task is acquired from the plurality of data processing tasks, the first to-be-processed data is acquired, the first task processes the first to-be-processed data, generates the second to-be-processed data, and generates the second task trigger signal for broadcasting. The data processing tasks in the embodiment of the application are scheduled and executed under the trigger of the specific task trigger signal, the lower task trigger signal is generated after each task is finished, and each data processing task in the system is scheduled in real time in a signal flow mode, so that the problem that in the prior art, the data processing tasks are not timely processed when being scheduled by using a time period, or the data processing tasks occupy too much system resources frequently is solved, the timeliness of data processing and the management efficiency of data development tasks are favorably improved, and the waste of system resources is avoided.
Further, as a refinement and an extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of the embodiment, another task scheduling method is provided, as shown in fig. 2, and the method includes:
in this embodiment, the first task trigger signal includes a data identifier corresponding to the initial data. Here, the initial data may be obtained from the first task trigger signal, each of the initial data carries a data identifier different from other data, and the data identifier may be a sequential number of the data, or the like, which is not required herein. And after receiving the first task triggering signal, the task scheduling system updates the processing progress of the initial data on the basis of the first task triggering signal. The process of updating the data processing progress by the task scheduling system is accompanied with the whole process of data processing. Here, the processing progress of the initial data may include a data identifier of the initial data, and may also include already executed tasks and execution results corresponding to the already executed tasks. The processing progress can be directly output and displayed on the task scheduling system or acquired in a manually-derived mode when a user wants to know the task running condition. By applying the technical scheme of the embodiment, the user can conveniently know the running condition of the current data processing task, and the result query experience of the user is favorably improved.
and step 206, when the number of the currently running tasks is smaller than the preset number, executing the first task.
In this embodiment, after the first task is determined according to the first task trigger signal and the first to-be-processed data is acquired, the number of tasks currently running is counted. And when the number of the running tasks is less than the preset number, directly executing the first task. And when the number of running tasks is greater than or equal to the preset number, adding the first task receiving the first task trigger signal into the task queue to be executed. For example, the number of data processing tasks pre-established in the system is five, which are respectively a first task to a fifth task, when receiving the first task trigger signal K, the running data processing tasks include four first tasks corresponding to the first task trigger signals a to D, three second tasks corresponding to the second task trigger signals E to G, and three fourth tasks corresponding to the fourth task trigger signals H to J, and the preset number is 10, then the first task corresponding to the first task trigger signal K cannot be executed at this time, and needs to be added into the to-be-executed task queue, and after the first task is added into the to-be-executed queue, the task scheduling system still monitors the number of running tasks in real time, and executes the tasks in the to-be-executed task queue under the condition that the number of running tasks is monitored to be less than the preset number. According to the embodiment of the application, the number of the running tasks is judged before the first tasks are executed, and the first tasks are executed when the number of the running tasks is smaller than the preset number, so that the problem that the number of the tasks running simultaneously is overlarge can be effectively avoided, the data processing capacity of a system is limited, and the effect of reasonably occupying system resources is realized.
In this embodiment of the present application, optionally, in step 205, "executing the tasks in the to-be-executed task queue when it is monitored that the number of the currently-running tasks is smaller than the preset number" specifically includes:
step 205-1, when it is monitored that the number of the currently running tasks is smaller than the preset number, acquiring a tail end task in the to-be-executed task queue, and executing the tail end task, wherein execution of a first other task in the to-be-executed task queue does not depend on an execution result of the tail end task, and the first other task is a task in the to-be-executed task queue except the tail end task.
In this embodiment, the task scheduling system monitors the number of tasks currently running, and when the number of tasks currently running is smaller than a preset number, finds the end task from all the tasks in the to-be-executed task queue, and executes the end task. Here, the end task is a relative concept, and the end task is located at the lowest level position relative to the first other task in the task chain formed by the data processing tasks relative to the first other task remaining in the queue, and the execution of the first other task does not need to depend on the direct or indirect execution result of the end task. For example, five data processing tasks are pre-established in the task scheduling system, the five data processing tasks are respectively a first task to a fifth task, three to-be-processed tasks are present in the to-be-executed task queue, and the three to-be-processed tasks are respectively a second task corresponding to the second task trigger signal a, a third task corresponding to the third task trigger signal B, and a fifth task corresponding to the fifth task trigger signal C, so that in the to-be-executed task queue, the fifth task corresponding to the fifth task trigger signal C is the end task. According to the embodiment of the application, the terminal task in the task queue to be executed is preferentially processed, so that the full link output of one data can be guaranteed, namely after one data is preferentially guaranteed to be processed, other data are processed, the completeness of data processing is favorably improved, and a user can conveniently look up the processed data in the first time.
In this embodiment of the present application, optionally, in step 205, "executing the tasks in the to-be-executed task queue when it is monitored that the number of the currently-running tasks is smaller than the preset number" specifically includes:
step 205-2, when it is monitored that the number of the currently running tasks is smaller than the preset number, obtaining a front-end task in the to-be-executed task queue, and executing the front-end task, where the execution of the front-end task does not depend on an execution result of a second other task in the to-be-executed task queue, and the second other task is a task in the to-be-executed task queue other than the front-end task.
In this embodiment, the task scheduling system monitors the number of tasks currently running, and finds the front-end task from all the tasks in the to-be-executed task queue and executes the front-end task when the number of the tasks currently running is smaller than a preset number. Here, the front-end task is also a relative concept, and the front-end task is located at the uppermost position relative to the second other task in the task chain formed by the data processing tasks, and the execution of the second other task needs to depend on the direct or indirect execution result of the front-end task. For example, five data processing tasks are pre-established in the task scheduling system, the five data processing tasks are respectively a first task to a fifth task, three to-be-processed tasks are present in the to-be-executed task queue, and the three to-be-processed tasks are respectively a second task corresponding to the second task trigger signal a, a fourth task corresponding to the fourth task trigger signal B, and a fifth task corresponding to the fifth task trigger signal C, so that in the to-be-executed task queue, the second task corresponding to the second task trigger signal a is a front-end task. According to the embodiment of the application, the front-end task in the task queue to be executed is processed preferentially, so that the next stage can be processed after the front-end stage of all data is processed, namely the data is processed in the next stage after the first stage of all data is processed preferentially, and the completeness of the data processing stage is favorably improved.
In addition, when the task scheduling system monitors that the number of the currently running tasks is smaller than the preset number, the tasks in the task queue to be executed can be executed according to other preset sequences. The other preset sequence may be a sequence in which the tasks that enter the to-be-executed task queue first are executed first, or a sequence in which the tasks that enter the to-be-executed task queue later are executed first.
In this embodiment of the present application, optionally, the method further includes: creating a data processing task, wherein the data processing task comprises a data processing rule, a trigger signal and an execution end signal.
In this embodiment, the task scheduling system may create the data processing task under the operation of the staff member prior to receiving the first task trigger signal. For example, processing a certain signal requires processing through five data processing tasks, which then need to be created in advance and stored in the task scheduling system. Here, the data processing task includes a data processing rule, a trigger signal, and an execution end signal broadcasted after the data processing task is ended, where the trigger signal is a signal that is preset to be able to trigger the corresponding data processing task.
In addition, when the data processing tasks pre-stored in the task scheduling system are in the execution process, the working personnel can also create a brand-new data development task to be added into the existing data processing tasks, and the dependency relationship between the newly added task and the existing tasks can be determined according to actual requirements. For example, five data processing tasks, namely a first task to a fifth task, have been stored in the task scheduling system, wherein a second task trigger signal generated after the execution of the first task is finished may trigger the execution of the second task, and so on. When the staff wants to directly depend on the third task for triggering the newly created sixth task, then when creating the sixth task, in addition to including the data processing rule, it is necessary to set the trigger signal triggering the sixth task as the original fourth task trigger signal, determine the execution end signal of the sixth task, and change the original fourth task trigger signal to the execution end signal of the sixth task.
Further, as a specific implementation of the method in fig. 1, an embodiment of the present application provides a task scheduling apparatus, as shown in fig. 3, the apparatus includes:
the signal receiving module is used for receiving a first task triggering signal;
the task acquisition module is used for acquiring a first task corresponding to the first task trigger signal from a plurality of data processing tasks and acquiring first data to be processed;
and the task execution module is used for executing the first task to process the first data to be processed to generate second data to be processed and broadcasting a second task trigger signal, wherein the second task trigger signal is used for triggering the execution of a second task, and the execution of the second task depends on the execution result of the first task.
In this embodiment of the present application, optionally, the task scheduling apparatus further includes:
the running task counting module is used for counting the number of the current running tasks after the first data to be processed is obtained;
the to-be-executed task processing module is used for adding the first task into a to-be-executed task queue when the number of the currently-operated tasks is larger than or equal to a preset number, and executing the tasks in the to-be-executed task queue when the number of the currently-operated tasks is monitored to be smaller than the preset number;
the task execution module is further configured to execute the first task when the number of the currently running tasks is smaller than the preset number.
In this embodiment of the present application, optionally, the to-be-executed task processing module includes an end task execution unit,
and the end task execution unit is configured to, when it is monitored that the number of the currently running tasks is smaller than the preset number, acquire an end task in the to-be-executed task queue, and execute the end task, where execution of a first other task in the to-be-executed task queue is independent of an execution result of the end task, and the first other task is a task other than the end task in the to-be-executed task queue.
In this embodiment of the present application, optionally, the to-be-executed task processing module includes a front-end task execution unit,
the front-end task execution unit is configured to, when it is monitored that the number of the currently running tasks is smaller than the preset number, acquire a front-end task in the to-be-executed task queue, and execute the front-end task, where execution of the front-end task does not depend on an execution result of a second other task in the to-be-executed task queue, and the second other task is a task in the to-be-executed task queue other than the front-end task.
In this embodiment of the present application, optionally, the task scheduling apparatus further includes:
the task creating module is used for creating a data processing task, wherein the data processing task comprises a data processing rule, a trigger signal and an execution ending signal.
In this embodiment of the present application, optionally, the first task trigger signal includes a data identifier corresponding to initial data, and the task scheduling apparatus further includes:
and the task execution result processing module is used for updating the processing progress of the initial data according to the first task trigger signal after receiving the first task trigger signal, wherein the processing progress of the initial data comprises a data identifier corresponding to the initial data, an executed task and an execution result corresponding to the executed task.
It should be noted that other corresponding descriptions of the functional units related to the task scheduling device provided in the embodiment of the present application may refer to corresponding descriptions in the methods in fig. 1 and fig. 2, and are not described herein again.
Based on the methods shown in fig. 1 and fig. 2, correspondingly, an embodiment of the present application further provides a storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the task scheduling method shown in fig. 1 and fig. 2.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.), and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the implementation scenarios of the present application.
Based on the above methods shown in fig. 1 and fig. 2 and the virtual device embodiment shown in fig. 3, in order to achieve the above object, an embodiment of the present application further provides a computer device, which may specifically be a personal computer, a server, a network device, and the like, where the computer device includes a storage medium and a processor; a storage medium for storing a computer program; and a processor for executing a computer program to implement the task scheduling method shown in fig. 1 and 2.
Optionally, the computer device may also include a user interface, a network interface, a camera, Radio Frequency (RF) circuitry, sensors, audio circuitry, a WI-FI module, and so forth. The user interface may include a Display screen (Display), an input unit such as a keypad (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., a bluetooth interface, WI-FI interface), etc.
It will be appreciated by those skilled in the art that the present embodiment provides a computer device architecture that is not limiting of the computer device, and that may include more or fewer components, or some components in combination, or a different arrangement of components.
The storage medium may further include an operating system and a network communication module. An operating system is a program that manages and maintains the hardware and software resources of a computer device, supporting the operation of information handling programs, as well as other software and/or programs. The network communication module is used for realizing communication among components in the storage medium and other hardware and software in the entity device.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by software plus a necessary general hardware platform, and can also be implemented by hardware. After receiving the first task trigger signal, acquiring a first task corresponding to the first task from a plurality of data processing tasks according to the first task trigger signal, and acquiring first data to be processed, wherein the first task processes the first data to be processed, generates second data to be processed, and generates a second task trigger signal for broadcasting. The data processing tasks in the embodiment of the application are scheduled and executed under the trigger of the specific task trigger signal, the lower task trigger signal is generated after each task is finished, and each data processing task in the system is scheduled in real time in a signal flow mode, so that the problem that in the prior art, the data processing tasks are not timely processed when being scheduled by using a time period, or the data processing tasks occupy too much system resources frequently is solved, the timeliness of data processing and the management efficiency of data development tasks are favorably improved, and the waste of system resources is avoided.
Those skilled in the art will appreciate that the figures are merely schematic representations of one preferred implementation scenario and that the blocks or flow diagrams in the figures are not necessarily required to practice the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario may be distributed in the devices in the implementation scenario according to the description of the implementation scenario, or may be located in one or more devices different from the present implementation scenario with corresponding changes. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The above application serial numbers are for description purposes only and do not represent the superiority or inferiority of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any variations that can be made by those skilled in the art are intended to fall within the scope of the present application.
Claims (10)
1. A method for task scheduling, comprising:
receiving a first task trigger signal;
acquiring a first task corresponding to the first task trigger signal from a plurality of data processing tasks, and acquiring first data to be processed;
executing the first task to process the first data to be processed to generate second data to be processed, and broadcasting a second task trigger signal, wherein the second task trigger signal is used for triggering execution of a second task, and the execution of the second task depends on an execution result of the first task.
2. The method of claim 1, wherein after the obtaining the first data to be processed, the method further comprises:
counting the number of the current running tasks;
when the number of the currently running tasks is larger than or equal to the preset number, adding the first tasks into a task queue to be executed, and executing the tasks in the task queue to be executed when the number of the currently running tasks is monitored to be smaller than the preset number;
and when the number of the current running tasks is less than the preset number, executing the first task.
3. The method according to claim 2, wherein the executing the tasks in the to-be-executed task queue when it is monitored that the number of the currently-running tasks is smaller than the preset number specifically comprises:
and when the number of the current running tasks is monitored to be smaller than the preset number, acquiring a tail end task in the to-be-executed task queue, and executing the tail end task, wherein execution of a first other task in the to-be-executed task queue does not depend on an execution result of the tail end task, and the first other task is a task except the tail end task in the to-be-executed task queue.
4. The method according to claim 2, wherein the executing the tasks in the to-be-executed task queue when it is monitored that the number of the currently-running tasks is smaller than the preset number specifically comprises:
and when the number of the current running tasks is monitored to be smaller than the preset number, acquiring front-end tasks in the to-be-executed task queue, and executing the front-end tasks, wherein the execution of the front-end tasks does not depend on the execution result of second other tasks in the to-be-executed task queue, and the second other tasks are tasks in the to-be-executed task queue except the front-end tasks.
5. The method of claim 1, further comprising:
creating a data processing task, wherein the data processing task comprises a data processing rule, a trigger signal and an execution end signal.
6. The method of claim 1, wherein the first task trigger signal comprises a data identifier corresponding to initial data, and wherein after receiving the first task trigger signal, the method further comprises:
and updating the processing progress of the initial data according to the first task trigger signal, wherein the processing progress of the initial data comprises a data identifier corresponding to the initial data, an executed task and an execution result corresponding to the executed task.
7. A task scheduling apparatus, comprising:
the signal receiving module is used for receiving a first task triggering signal;
the task acquisition module is used for acquiring a first task corresponding to the first task trigger signal from a plurality of data processing tasks and acquiring first data to be processed;
and the task execution module is used for executing the first task to process the first data to be processed to generate second data to be processed and broadcasting a second task trigger signal, wherein the second task trigger signal is used for triggering the execution of a second task, and the execution of the second task depends on the execution result of the first task.
8. The apparatus of claim 7, wherein the task scheduler further comprises:
the running task counting module is used for counting the number of the current running tasks after the first data to be processed is obtained;
the to-be-executed task processing module is used for adding the first task into a to-be-executed task queue when the number of the currently-operated tasks is larger than or equal to a preset number, and executing the tasks in the to-be-executed task queue when the number of the currently-operated tasks is monitored to be smaller than the preset number;
the task execution module is further configured to execute the first task when the number of the currently running tasks is smaller than the preset number.
9. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method of any of claims 1 to 6.
10. A computer device comprising a storage medium, a processor and a computer program stored on the storage medium and executable on the processor, characterized in that the processor implements the method of any one of claims 1 to 6 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110544307.8A CN113268324A (en) | 2021-05-19 | 2021-05-19 | Task scheduling method and device, storage medium and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110544307.8A CN113268324A (en) | 2021-05-19 | 2021-05-19 | Task scheduling method and device, storage medium and computer equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113268324A true CN113268324A (en) | 2021-08-17 |
Family
ID=77231699
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110544307.8A Pending CN113268324A (en) | 2021-05-19 | 2021-05-19 | Task scheduling method and device, storage medium and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113268324A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113687932A (en) * | 2021-08-30 | 2021-11-23 | 上海商汤科技开发有限公司 | Task scheduling method, device and system, electronic equipment and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130326537A1 (en) * | 2012-06-05 | 2013-12-05 | International Business Machines Corporation | Dependency management in task scheduling |
US20150277993A1 (en) * | 2012-12-14 | 2015-10-01 | Huawei Technologies Co., Ltd. | Task Processing Method and Virtual Machine |
CN106557369A (en) * | 2016-11-25 | 2017-04-05 | 武汉斗鱼网络科技有限公司 | A kind of management method and system of multithreading |
CN109743390A (en) * | 2019-01-04 | 2019-05-10 | 深圳壹账通智能科技有限公司 | Method for scheduling task, device, computer equipment and storage medium |
US20200073709A1 (en) * | 2018-08-30 | 2020-03-05 | Baidu Online Network Technology (Beijing) Co., Ltd. | Method and apparatus for scheduling task, device and medium |
-
2021
- 2021-05-19 CN CN202110544307.8A patent/CN113268324A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130326537A1 (en) * | 2012-06-05 | 2013-12-05 | International Business Machines Corporation | Dependency management in task scheduling |
US20150277993A1 (en) * | 2012-12-14 | 2015-10-01 | Huawei Technologies Co., Ltd. | Task Processing Method and Virtual Machine |
CN106557369A (en) * | 2016-11-25 | 2017-04-05 | 武汉斗鱼网络科技有限公司 | A kind of management method and system of multithreading |
US20200073709A1 (en) * | 2018-08-30 | 2020-03-05 | Baidu Online Network Technology (Beijing) Co., Ltd. | Method and apparatus for scheduling task, device and medium |
CN109743390A (en) * | 2019-01-04 | 2019-05-10 | 深圳壹账通智能科技有限公司 | Method for scheduling task, device, computer equipment and storage medium |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113687932A (en) * | 2021-08-30 | 2021-11-23 | 上海商汤科技开发有限公司 | Task scheduling method, device and system, electronic equipment and storage medium |
CN113687932B (en) * | 2021-08-30 | 2024-07-12 | 上海商汤科技开发有限公司 | Task scheduling method, device, system, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112988362B (en) | Task processing method and device, electronic equipment and storage medium | |
US10691496B2 (en) | Dynamic micro-services related job assignment | |
CN111159046B (en) | Test method, test device, electronic equipment, test system and storage medium | |
CN108319499B (en) | Task scheduling method and device | |
CN114610499A (en) | Task scheduling method and device, computer readable storage medium and electronic equipment | |
CN111143039A (en) | Virtual machine scheduling method and device and computer storage medium | |
CN112084044B (en) | Event processing method in system and related device | |
CN108829519A (en) | Method for scheduling task, cloud platform and computer readable storage medium based on cloud platform | |
CN111158800B (en) | Method and device for constructing task DAG based on mapping relation | |
CN110750453B (en) | HTML 5-based intelligent mobile terminal testing method, system, server and storage medium | |
CN113138801A (en) | Command distribution device, method, chip, computer equipment and storage medium | |
CN110362394B (en) | Task processing method and device, storage medium and electronic device | |
CN112199180A (en) | Multitask scheduling method and device, electronic equipment and readable storage medium | |
CN113268324A (en) | Task scheduling method and device, storage medium and computer equipment | |
CN109102200B (en) | Timed task processing method and device | |
CN117149665B (en) | Continuous integration method, control device, continuous integration system, and storage medium | |
EP4310677A1 (en) | Task scheduling method, game engine, device and storage medium | |
CN111158889A (en) | Batch task processing method and system | |
CN111190731A (en) | Cluster task scheduling system based on weight | |
CN115754413A (en) | Oscilloscope and data processing method | |
CN115981871A (en) | GPU resource scheduling method, device, equipment and storage medium | |
CN106708737B (en) | Test method and device | |
CN109901925B (en) | Task processing method and system | |
CN111339422A (en) | Recommendation system task management platform, recommendation method and system | |
CN113687870B (en) | Terminal operation optimization method and device, storage medium and terminal |
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 |