CN108415765B - Task scheduling method and device and intelligent terminal - Google Patents
Task scheduling method and device and intelligent terminal Download PDFInfo
- Publication number
- CN108415765B CN108415765B CN201810168280.5A CN201810168280A CN108415765B CN 108415765 B CN108415765 B CN 108415765B CN 201810168280 A CN201810168280 A CN 201810168280A CN 108415765 B CN108415765 B CN 108415765B
- Authority
- CN
- China
- Prior art keywords
- asynchronous task
- task
- asynchronous
- execution time
- processor
- 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
Links
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
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application provides a task scheduling method, a task scheduling device and an intelligent terminal, wherein the method comprises the following steps: the method comprises the following steps: acquiring a first asynchronous task adding request, wherein the adding request comprises the initial execution time of the first asynchronous task; determining the optimal execution time of the first asynchronous task according to the execution times of the second asynchronous tasks currently contained in the system; sending the optimal execution time to an initiator of the first asynchronous task; and if a confirmation request returned by the initiator of the first asynchronous task is acquired, adding the first asynchronous task into the execution queue according to the optimal execution time. The technical problem that the task scheduling mode in the asynchronous task is low in reliability in the prior art is solved, the reliability and the coordination of task scheduling are improved on the premise of fully utilizing resources, and the running efficiency and the success rate of the asynchronous task are improved.
Description
Technical Field
The application relates to the technical field of computer information processing, in particular to a task scheduling method and device and an intelligent terminal.
Background
With the development of computer technology, the processing amount of computer data is also increasing, wherein, during data processing, asynchronous tasks are widely used, and generally, asynchronous tasks are used for task processing processes that are not suitable for being completed in a synchronous manner, such as processing processes of a large amount of off-line data, for example, tasks that need to run regularly or tasks that do not need to occupy real-time resources.
In the related art, the asynchronous task processing mode is as follows: and directly calling the asynchronous task from the database to the execution node. However, this method cannot implement efficient execution and allocation of asynchronous tasks, often resulting in idle resources and waste of some resources, which results in low accuracy of asynchronous task scheduling and slow execution of asynchronous tasks.
Content of application
The present application is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first objective of the present application is to provide a task scheduling method, which solves the technical problem in the prior art that the reliability of a task scheduling method in an asynchronous task is not high, improves the reliability and coordination of task scheduling on the premise of fully utilizing resources, and improves the operating efficiency and success rate of the asynchronous task.
A second object of the present application is to provide a task scheduling apparatus.
A third objective of the present application is to provide an intelligent terminal.
A fourth object of the present application is to propose a non-transitory computer-readable storage medium.
A fifth object of the present application is to propose a computer program product.
To achieve the above object, an embodiment of a first aspect of the present application provides a task scheduling method, including: acquiring a first asynchronous task adding request; determining the optimal execution time of the first asynchronous task according to the execution times of the second asynchronous tasks currently contained in the system; sending the optimal execution time to an initiator of the first asynchronous task; and if a confirmation request returned by the initiator of the first asynchronous task is acquired, adding the first asynchronous task into an execution queue according to the optimal execution time.
According to the task scheduling method, a first asynchronous task adding request is obtained, the best execution time of the first asynchronous task is determined according to the execution times of second asynchronous tasks currently contained in the system, the best execution time is further sent to an initiator of the first asynchronous task, and if a confirmation request returned by the initiator of the first asynchronous task is obtained, the first asynchronous task is added into an execution queue according to the best execution time. Therefore, the technical problem that the task scheduling mode in the asynchronous task is low in reliability in the prior art is solved, the reliability and the coordination of task scheduling are improved on the premise of fully utilizing resources, and the running efficiency and the success rate of the asynchronous task are improved.
In order to achieve the above object, a second aspect of the present application provides a task scheduling apparatus, including: the acquisition module is used for acquiring a first asynchronous task adding request; the determining module is used for determining the optimal execution time of the first asynchronous task according to the execution times of the second asynchronous tasks currently contained in the system; a sending module, configured to send the optimal execution time to an initiator of the first asynchronous task; and the processing module is used for adding the first asynchronous task into an execution queue according to the optimal execution time when a confirmation request returned by the initiator of the first asynchronous task is acquired.
The task scheduling device of the embodiment of the application obtains a first asynchronous task adding request, determines the optimal execution time of a first asynchronous task according to each execution time of each second asynchronous task currently included in a system, further sends the optimal execution time to an initiator of the first asynchronous task, and adds the first asynchronous task into an execution queue according to the optimal execution time if a confirmation request returned by the initiator of the first asynchronous task is obtained. Therefore, the technical problem that the task scheduling mode in the asynchronous task is low in reliability in the prior art is solved, the reliability and the coordination of task scheduling are improved on the premise of fully utilizing resources, and the running efficiency and the success rate of the asynchronous task are improved.
In order to achieve the above object, an embodiment of a third aspect of the present application provides an intelligent terminal, including: a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the task scheduling method described in the above embodiments.
In order to achieve the above object, a fourth aspect of the present application provides a non-transitory computer readable storage medium, where the program is executed by a processor to implement the task scheduling method as described in the above embodiments.
In order to achieve the above object, an embodiment of a fifth aspect of the present application proposes a computer program product, where when being executed by an instruction processor, a task scheduling method as described in the foregoing embodiment is performed.
Additional aspects and advantages of the present application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the present application.
Drawings
The foregoing and/or additional aspects and advantages of the present application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a task scheduling method according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another task scheduling method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another task scheduling method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a task scheduling method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a task scheduling apparatus according to an embodiment of the present application;
fig. 6 is a schematic diagram of a product implementation of a task scheduling method according to an embodiment of the present application; and
FIG. 7 is a block diagram of an exemplary computer device implementing embodiments of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary and intended to be used for explaining the present application and should not be construed as limiting the present application.
The following describes a task scheduling method, a task scheduling device and an intelligent terminal according to an embodiment of the present application with reference to the drawings.
Fig. 1 is a flowchart illustrating a task scheduling method according to an embodiment of the present application.
As analyzed by the background art, in the prior art, the asynchronous task scheduling mode directly calls the tasks in the database to the execution nodes for execution, and the mode of performing task scheduling depending on the system performance does not consider the real-time state of the resources, which results in low reliability of operation, and may even result in failure of task operation.
In order to solve the technical problems, the task scheduling method provided by the application is based on the resource occupancy rate to perform task scheduling, so that the reliability and the coordination of task scheduling are improved, the running efficiency and the success rate of asynchronous tasks are improved, the execution time is confirmed with the initiator of the asynchronous tasks, the requirement of the execution sequence is met, and resources are fully utilized.
Specifically, as shown in fig. 1, the task scheduling method includes the following steps:
The adding mode of the first asynchronous task is different according to different application requirements, as a possible implementation mode, the SDK API can be provided at the front end of the web for a user to use, and after the calling operation of the user to the SDK API interface is detected, the adding request of the first asynchronous task is obtained.
As another possible implementation manner, when the main thread determines that there is a task that can be asynchronously executed according to the task to be currently executed, the first asynchronous task addition request sent by the main thread is acquired.
And 102, determining the optimal execution time of the first asynchronous task according to the execution times of the second asynchronous tasks currently contained in the system.
It can be understood that after the adding request of the first asynchronous task is obtained, the executing node is not directly added in sequence, but the optimal executing time of the first task is determined according to the executing times of the second asynchronous tasks currently contained in the system, so that the optimal executing time of the first asynchronous task is determined according to the executing times of the second asynchronous tasks, the executing time of the first asynchronous task is coordinated with the executing time of the second asynchronous tasks, the resource utilization rate is improved, the first asynchronous task and the second asynchronous tasks are guaranteed not to be preempted in the executing process, and the running is reliable.
It should be noted that, according to different application scenarios, the method for determining the optimal execution time of the first asynchronous task according to the execution times of the second asynchronous tasks currently included in the system includes, but is not limited to, the following:
the first example:
in this example, the execution time of each second asynchronous task is obtained, the idle time during execution of the second asynchronous task is determined, and the idle time is used as the optimal execution time of the first asynchronous task.
For example, when two second asynchronous tasks a and B to be executed or being executed are included, the execution time of the asynchronous task a is a, and the execution time of the asynchronous task B is B, the idle time between a and B may be used as the optimal execution time of the first asynchronous task, or the idle time after the execution time B may be used as the optimal execution time of the first asynchronous task.
Of course, in this example, in order to better allocate resources, the task amount of the first asynchronous task to be added may also be obtained, the execution time length requirement of the first asynchronous task is estimated according to the task amount of the first asynchronous task, and the idle time between the second asynchronous tasks that is closest to the execution time length requirement is taken as the optimal execution time required by the execution time length.
The second example is:
in this example, the attribute information of the first asynchronous task is further included in the first asynchronous task addition request, where the attribute information of the asynchronous task includes command content, execution times, execution failure retriable times, execution task data amount, and the like.
Specifically, in the present example, as shown in fig. 2, this step 102 includes:
The processor refers to a machine capable of running the script unit, for example, according to the function of the running script unit, the processor may include a CPU, a memory, a network card, and the like, and the usage state of the processor may include resource occupancy rate, running task occupancy time, and the like.
It is understood that even if the second asynchronous task is executed within a certain time, the second asynchronous task may be executed with a small amount of data, and the processor may be under a low stress, or the processor may be loaded with other tasks at the same time due to a high load capacity of the processor.
For example, when the processor 1 is used for executing the second asynchronous task a, and the processor 2 is used for executing the second asynchronous task B, the execution time of the asynchronous task a is a, the execution time of the asynchronous task B is B, the attribute information of the second asynchronous task a is executed 3 times, the second asynchronous task a fails to be executed repeatedly, the execution task data size is m, the attribute information of the second asynchronous task B is executed 2 times, the second asynchronous task B fails to be executed repeatedly 1 time, and the execution task data size is n, then the usage status of the processor 1 at time a is predicted to be occupancy 80%, the remaining resource is p, the usage status of the processor 2 at time B is predicted to be occupancy 30%, and the remaining resource is q.
It should be emphasized that, in the above example, the processors 1 and 2 respectively execute different asynchronous tasks, during the actual execution process, multiple processors may jointly execute the same asynchronous task, and the execution mode may be implemented by the prior art, which is not described herein again.
It can be understood that the initial execution time of the first asynchronous task is obtained, and the initial execution time is the execution time expected by the initiator of the first asynchronous task, and whether the use state corresponding to the initial execution time of the first asynchronous task by each processor meets the attribute information of the first asynchronous task is judged.
And step 203, if yes, determining the initial execution time of the first asynchronous task as the optimal execution time.
Specifically, if the use state corresponding to the initial execution time of the first asynchronous task by each processor meets the attribute information of the first asynchronous task, the execution time of the first asynchronous task is determined as the optimal execution time.
Continuing with the above example as an example, the initial execution time of the first asynchronous task is the time within the time period included in b, when the attribute information of the first asynchronous task is executed for 2 times, the first asynchronous task fails to be repeatedly executed for 1 time, the data volume of the executed task is t, and t is greater than pisogen and less than q, the execution time of the first asynchronous task may be taken as the optimal execution time.
And step 204, if not, selecting the optimal execution time of the first asynchronous task from the time periods when the use states of the processors meet the attribute information of the first asynchronous task.
Specifically, if the usage state corresponding to the initial execution time of the first asynchronous task by each processor does not satisfy the attribute information of the first asynchronous task, the optimal execution time of the first asynchronous task is selected from the time periods in which the usage state of each processor satisfies the attribute information of the first asynchronous task, wherein when the optimal execution time is selected, the time closest to the initial execution time may be selected preferentially, and the time period with the lowest processor utilization rate may also be selected as the optimal execution time, so that resources are fully utilized, and the operating pressure of the processors is reduced.
The method comprises the steps of determining the optimal execution time of a first asynchronous task aiming at a certain single processor according to whether the use state corresponding to the initial execution time of the first asynchronous task in each processor meets the attribute information of the first asynchronous task or not, or determining the optimal execution time of the first asynchronous task aiming at the common operation of the processors according to whether the comprehensive use state corresponding to the initial execution time of the first asynchronous task in each processor meets the attribute information of the first asynchronous task or not.
In the actual execution process, the use state of the processor may change due to a network or the like during the execution of each task, and therefore, the optimal execution time for the first asynchronous task may be inaccurate along with the execution of each task, and therefore, in order to further improve the reliability of task scheduling in this embodiment, the optimal execution time for the first asynchronous task may also be adjusted.
Therefore, the determination of the optimal execution time in this embodiment, on one hand, ensures that the resources of the processor are sufficient when the first asynchronous task is executed, and ensures the reliability of the execution of the asynchronous task, and on the other hand, the determination of the execution time is performed according to the requirement of the first asynchronous task initiator, which meets the requirement of the task initiator between the executions, and has higher flexibility.
Specifically, fig. 3 is a schematic flowchart of another task scheduling method provided in the embodiment of the present application. As shown in fig. 3, after the step 104, the method further includes:
Specifically, the resource occupancy rates of the processors in the respective time periods and the like can be acquired.
Specifically, the actual usage state of each processor corresponding to the optimal execution time of the first asynchronous task may be caused by some sudden reasons or execution delays, and the attribute information of the first asynchronous task is not satisfied, for example, the optimal execution time of the first asynchronous task is suddenly added by other urgent tasks, and the optimal execution time of the first asynchronous task is adjusted according to the actual usage state of each processor in each time period, where a determination manner of the adjusted optimal execution time is the same as the determination manner of the optimal execution time, and is not described herein again.
And 103, sending the optimal execution time to an initiator of the first asynchronous task.
And 104, if a confirmation request returned by the initiator of the first asynchronous task is obtained, adding the first asynchronous task into the execution queue according to the optimal execution time.
In some scenarios, the priority of the initiator of the first asynchronous task on the execution time requirement is higher, so that, in order to enable the initiator to intuitively know the execution time, the optimal execution time may be sent to the corresponding initiator, and if a confirmation request returned by the initiator of the first asynchronous task is obtained, such as the initiator determining control, or voice input confirming voice information, etc., the first asynchronous task is added to the execution queue according to the optimal execution time, so as to execute the corresponding first asynchronous task at the optimal execution time.
In an embodiment of the present application, if a confirmation request returned by the initiator of the first asynchronous task is not obtained, the initiator may be prompted to reset the execution time, and the like.
To sum up, the task scheduling method according to the embodiment of the present application obtains the first asynchronous task addition request, determines the optimal execution time of the first asynchronous task according to each execution time of each second asynchronous task currently included in the system, further sends the optimal execution time to the initiator of the first asynchronous task, and adds the first asynchronous task into the execution queue according to the optimal execution time if the confirmation request returned by the initiator of the first asynchronous task is obtained. Therefore, the technical problem that the task scheduling mode in the asynchronous task is low in reliability in the prior art is solved, the reliability and the coordination of task scheduling are improved on the premise of fully utilizing resources, and the running efficiency and the success rate of the asynchronous task are improved.
Based on the above embodiment, the determination of the optimal time of the first asynchronous program may be determined according to the usage state of a single processor, or may also be determined according to the comprehensive usage state of each processor, and similarly, when the first asynchronous task is executed, it may also be determined whether to be executed by a single processor, or to be executed by each processor together, according to the usage state of a single processor, or according to the comprehensive usage state of each processor.
In an embodiment of the present application, in order to reduce the system computation pressure, a single processor executing a first asynchronous task is determined according to a usage state of the single processor, and fig. 4 is a flowchart illustrating a task scheduling method provided in an embodiment of the present application. As shown in fig. 4, after the step 104, the method further includes:
And 402, distributing the first asynchronous task to any processor with the current utilization rate smaller than a preset threshold value for processing.
The preset threshold is calibrated according to a large amount of experimental data, and when the utilization rate of the processor is smaller than the preset threshold, the utilization rate of the corresponding processor is low, and the running of other tasks can be better borne.
Specifically, when the system is determined to reach the optimal execution time of the first asynchronous task, the current utilization rate of each processor in the system is obtained, so that the first asynchronous task is distributed to a target processor with the current utilization rate smaller than a preset threshold value for processing, the operation reliability is fully improved, processor resources are effectively utilized, and the operation efficiency of the first asynchronous task is higher due to the target processor with the lower utilization rate before use.
Of course, in some possible embodiments, the processor with the lowest current usage rate may also be directly selected to run the first asynchronous task, so as to further reduce the probability of the failure of running the first asynchronous task due to insufficient remaining space of the processor.
Further, in order to further ensure the reliability of the operation of the first asynchronous task and monitor the operation condition of the first asynchronous task, in an embodiment of the present application, the addition request of the first asynchronous task further includes an ideal execution state, where the ideal execution state includes an execution duration, an output result, an execution failure frequency, and the like, the actual execution state of the first asynchronous task is monitored, whether the actual execution state matches the ideal execution state is determined, for example, whether the failure frequency is within the failure frequency corresponding to the ideal execution state, whether the execution duration is within the execution duration corresponding to the ideal execution state, and the like, and if not, the early warning information is output, for example, "execution limited" is output by popup window information, or early warning voice information is sent out, and the like, so that relevant people can timely troubleshoot the reason causing the execution is not ideal, and repair is performed in time, the stability of the system is improved.
In another embodiment of the present application, when it is determined that the system reaches the optimal execution time of the first asynchronous task, the current utilization rate of each processor in the system may be further obtained, so that the first asynchronous task is split into multiple corresponding target processors for processing, and the execution efficiency is substantially improved.
In summary, the task scheduling method according to the embodiment of the present application selects the processor with the lowest utilization rate to execute the first asynchronous task, thereby improving the resource utilization rate and the efficiency and reliability of executing the asynchronous task.
In order to implement the above embodiments, the present application further provides a task scheduling device. Fig. 5 is a schematic structural diagram of a task scheduling device according to an embodiment of the present application. As shown in fig. 5, the task scheduler includes: an acquisition module 100, a determination module 200, a sending module 300 and a processing module 400.
The obtaining module 100 is configured to obtain a first asynchronous task adding request.
The determining module 200 is configured to determine an optimal execution time of the first asynchronous task according to each execution time of each second asynchronous task currently included in the system.
A sending module 300, configured to send the optimal execution time to an initiator of the first asynchronous task.
The processing module 400 is configured to add the first asynchronous task to the execution queue according to the optimal execution time when the confirmation request returned by the initiator of the first asynchronous task is obtained.
In other embodiments, the task scheduling device may be divided into different modules as needed to complete all or part of the functions of the task scheduling device.
In some possible examples, the task scheduling apparatus in this embodiment may be implemented as a product as shown in fig. 6, where as shown in fig. 6, an initiator of the first asynchronous task addition may initiate a first asynchronous task addition request through a call of an SDK API interface at a web front end, where a business layer and a service layer provide back-end services, convert a requirement of the initiator into data for storage, and determine an optimal execution time for the first asynchronous task addition request.
The scheduling module checks all the included second asynchronous tasks, schedules the asynchronous tasks to be executed at the next moment and adds the asynchronous tasks to the queue to be executed, the task module checks the queue to be executed, detects all processor resources at the rear end, selects the processor with lower processor utilization rate to distribute the tasks, and records the use condition of the processor.
The inspection module inspects the asynchronous tasks in the execution state, if the scheduling time or the execution time is too long, an alarm is triggered to remind relevant personnel to conduct inspection, the script module receives a task execution request, executes the tasks, records output logs or abnormity in the task execution, and if the output logs or abnormity are abnormal, the alarm is triggered.
In addition, the strategy module analyzes the task scheduling effect, and introduces a machine learning mechanism to optimize the task scheduling scheme, so that the reliability of determining the next best execution time is improved. And the back-end database records the attribute information and the execution record of the asynchronous task.
It should be noted that the foregoing explanation on the embodiment of the task scheduling method is also applicable to the task scheduling apparatus of this embodiment, and is not repeated here.
To sum up, the task scheduling apparatus according to the embodiment of the present application obtains the first asynchronous task addition request, determines the optimal execution time of the first asynchronous task according to each execution time of each second asynchronous task currently included in the system, further sends the optimal execution time to the initiator of the first asynchronous task, and adds the first asynchronous task into the execution queue according to the optimal execution time if a confirmation request returned by the initiator of the first asynchronous task is obtained. Therefore, the technical problem that the task scheduling mode in the asynchronous task is low in reliability in the prior art is solved, the reliability and the coordination of task scheduling are improved on the premise of fully utilizing resources, and the running efficiency and the success rate of the asynchronous task are improved.
In order to implement the above embodiment, the present application further provides an intelligent terminal, including: and a processor, wherein the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for implementing the task scheduling method described in the above embodiments. The intelligent terminal can be a hardware device with various operating systems, such as a mobile phone, a tablet computer, a personal digital assistant and wearable equipment, and the wearable equipment can be an intelligent bracelet, an intelligent watch, intelligent glasses and the like.
To achieve the above embodiments, the present application also proposes a non-transitory computer-readable storage medium, in which instructions are enabled to execute the task scheduling method shown in the above embodiments when executed by a processor.
In order to implement the foregoing embodiments, the present application also proposes a computer program product, which when executed by an instruction processor in the computer program product, executes the screen capture search method shown in the foregoing embodiments.
FIG. 7 illustrates a block diagram of an exemplary computer device suitable for use to implement embodiments of the present application. The computer device 12 shown in fig. 7 is only an example, and should not bring any limitation to the function and the scope of use of the embodiments of the present application.
As shown in FIG. 7, computer device 12 is in the form of a general purpose computing device. The components of computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Computer device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by computer device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally perform the functions and/or methodologies of the embodiments described herein.
The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with the computer system/server 12, and/or with any devices (e.g., network card, modem, etc.) that enable the computer system/server 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Moreover, computer device 12 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public Network such as the Internet via Network adapter 20. As shown, the network adapter 20 communicates with the other modules of the computer device 12 over the bus 18. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing, for example, implementing the methods mentioned in the foregoing embodiments, by executing programs stored in the system memory 28.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Further, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present application may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.
Claims (9)
1. A method for task scheduling, comprising:
acquiring a first asynchronous task adding request, wherein the adding mode of the first asynchronous task is different according to different application requirements;
determining the optimal execution time of the first asynchronous task according to the execution times of the second asynchronous tasks currently contained in the system;
sending the optimal execution time to an initiator of the first asynchronous task;
if a confirmation request returned by the initiator of the first asynchronous task is acquired, adding the first asynchronous task into an execution queue according to the optimal execution time;
the adding request also comprises attribute information of the first asynchronous task;
the determining an optimal execution time of the first asynchronous task comprises:
predicting the use state of each processor in the system at each time interval according to each execution time of each second asynchronous task and the attribute information of each second asynchronous task;
judging whether the use states of the processors corresponding to the initial execution time of the first asynchronous task meet the attribute information of the first asynchronous task or not;
and if so, determining the initial execution time of the first asynchronous task as the optimal execution time.
2. The method as claimed in claim 1, wherein said determining whether the usage status of each processor corresponding to the initial execution time of the first asynchronous task satisfies the attribute information of the first asynchronous task further comprises:
and if not, selecting the optimal execution time of the first asynchronous task from the time periods when the use states of the processors meet the attribute information of the first asynchronous task.
3. The method of claim 1, wherein after the adding the first asynchronous task to the execution queue, further comprising:
monitoring the actual use state of each processor in each time period in the execution process of each task in the system;
and if the actual use state of each processor corresponding to the optimal execution time of the first asynchronous task does not meet the attribute information of the first asynchronous task, adjusting the optimal execution time of the first asynchronous task according to the actual use state of each processor in each time interval.
4. A method according to any of claims 1-3, wherein after the adding the first asynchronous task to an execution queue, further comprising:
when the system is determined to reach the optimal execution time of the first asynchronous task, the current utilization rate of each processor in the system is obtained;
and allocating the first asynchronous task to any processor with the current utilization rate smaller than a threshold value for processing.
5. The method of claim 4, wherein the add request further includes an ideal execution state of the first asynchronous task;
after the allocating the first asynchronous task to any processor whose current utilization rate is less than the threshold value for processing, the method further includes:
monitoring an actual execution state of the first asynchronous task;
judging whether the actual execution state is matched with the ideal execution state;
if not, outputting early warning information.
6. A task scheduling apparatus, comprising:
the device comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring a first asynchronous task adding request, and the adding mode of the first asynchronous task is different according to different application requirements;
the determining module is used for determining the optimal execution time of the first asynchronous task according to the execution times of the second asynchronous tasks currently contained in the system;
a sending module, configured to send the optimal execution time to an initiator of the first asynchronous task;
the processing module is used for adding the first asynchronous task into an execution queue according to the optimal execution time when a confirmation request returned by an initiator of the first asynchronous task is acquired;
the adding request also comprises attribute information of the first asynchronous task;
the determining an optimal execution time of the first asynchronous task comprises:
predicting the use state of each processor in the system at each time interval according to each execution time of each second asynchronous task and the attribute information of each second asynchronous task;
judging whether the use state corresponding to the initial execution time of the first asynchronous task of each processor meets the attribute information of the first asynchronous task;
and if so, determining the initial execution time of the first asynchronous task as the optimal execution time.
7. An intelligent terminal is characterized by comprising a processor and a memory;
wherein the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, for implementing the task scheduling method according to any one of claims 1 to 5.
8. A computer program product, characterized in that an instruction processor in the computer program product, when executing it, implements the task scheduling method according to any one of claims 1-5.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the task scheduling method according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810168280.5A CN108415765B (en) | 2018-02-28 | 2018-02-28 | Task scheduling method and device and intelligent terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810168280.5A CN108415765B (en) | 2018-02-28 | 2018-02-28 | Task scheduling method and device and intelligent terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108415765A CN108415765A (en) | 2018-08-17 |
CN108415765B true CN108415765B (en) | 2022-06-24 |
Family
ID=63129503
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810168280.5A Active CN108415765B (en) | 2018-02-28 | 2018-02-28 | Task scheduling method and device and intelligent terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108415765B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110134521B (en) * | 2019-05-28 | 2021-06-11 | 北京达佳互联信息技术有限公司 | Resource allocation method, device, resource manager and storage medium |
CN113703939B (en) * | 2021-08-30 | 2024-06-14 | 竞技世界(北京)网络技术有限公司 | Task scheduling method and system and electronic equipment |
CN114675949A (en) * | 2022-03-15 | 2022-06-28 | 傲普(上海)新能源有限公司 | EMS remote control success rate improving method based on resource statistics and instruction sequencing |
CN114706820B (en) * | 2022-05-18 | 2022-09-06 | 北京卡普拉科技有限公司 | Scheduling method, system, electronic device and medium for asynchronous I/O request |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106980546A (en) * | 2016-01-18 | 2017-07-25 | 阿里巴巴集团控股有限公司 | A kind of task asynchronous execution method, apparatus and system |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7769802B2 (en) * | 2003-12-04 | 2010-08-03 | Microsoft Corporation | Systems and methods that employ correlated synchronous-on-asynchronous processing |
CN106598705B (en) * | 2015-10-15 | 2020-08-11 | 菜鸟智能物流控股有限公司 | Asynchronous task scheduling method, device and system and electronic equipment |
CN106648847A (en) * | 2016-10-14 | 2017-05-10 | 郑州云海信息技术有限公司 | Asynchronous task management method and device in cloud computing operation system |
CN106776008A (en) * | 2016-11-23 | 2017-05-31 | 福建六壬网安股份有限公司 | A kind of method and system that load balancing is realized based on zookeeper |
CN107463642A (en) * | 2017-07-19 | 2017-12-12 | 北京京东尚科信息技术有限公司 | The method and apparatus for lifting Tool for Data Warehouse resource utilization |
CN107465548A (en) * | 2017-08-17 | 2017-12-12 | 北京云纵信息技术有限公司 | The dispositions method and device of code |
-
2018
- 2018-02-28 CN CN201810168280.5A patent/CN108415765B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106980546A (en) * | 2016-01-18 | 2017-07-25 | 阿里巴巴集团控股有限公司 | A kind of task asynchronous execution method, apparatus and system |
Also Published As
Publication number | Publication date |
---|---|
CN108415765A (en) | 2018-08-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108415765B (en) | Task scheduling method and device and intelligent terminal | |
CN110196767B (en) | Service resource control method, device, equipment and storage medium | |
JP2021190074A (en) | Resource scheduling method, apparatus, facility, storage medium, and program | |
CN110196770B (en) | Cloud system memory data processing method, device, equipment and storage medium | |
EP3932025B1 (en) | Computing resource scheduling method, scheduler, internet of things system, and computer readable medium | |
CN111338791A (en) | Method, device and equipment for scheduling cluster queue resources and storage medium | |
CN108337127B (en) | Application performance monitoring method, system, terminal and computer readable storage medium | |
US20150113167A1 (en) | Optimized Consumption of Third-Party Web Services in a Composite Service | |
CN112749013B (en) | Thread load detection method and device, electronic equipment and storage medium | |
CN115981871B (en) | GPU resource scheduling method, device, equipment and storage medium | |
CN115576534B (en) | Method and device for arranging atomic service, electronic equipment and storage medium | |
CN115269108A (en) | Data processing method, device and equipment | |
CN113190427A (en) | Caton monitoring method and device, electronic equipment and storage medium | |
CN114637603A (en) | Resource control method and device, computer equipment and storage medium | |
CN114911598A (en) | Task scheduling method, device, equipment and storage medium | |
CN110347546B (en) | Dynamic adjustment method, device, medium and electronic equipment for monitoring task | |
CN112860401B (en) | Task scheduling method, device, electronic equipment and storage medium | |
CN113032207A (en) | Application process monitoring method and device, electronic equipment and storage medium | |
CN107273082B (en) | Image display method, device, terminal and storage medium | |
CN114253686A (en) | Task scheduling method and device, electronic equipment and storage medium | |
CN111459653B (en) | Cluster scheduling method, device and system and electronic equipment | |
CN110647401B (en) | Frequency modulation method, frequency modulation device, storage medium and electronic equipment | |
CN114416326A (en) | Big data control method, device, control system and readable storage medium | |
CN113835733B (en) | Cloud application updating method and device, electronic equipment and storage medium | |
US12135996B2 (en) | Computing resource scheduling method, scheduler, internet of things system, and computer readable medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |