Task scheduling method and device, electronic device and readable storage medium
A task scheduling and task instance technology, applied in the computer field, can solve problems such as easy to ignore, reduce user experience, and low execution efficiency, so as to avoid cumbersome operations, improve user experience, and ensure fairness
Patent Information
- Authority / Receiving Office
- CN · China
- Current Assignee / Owner
- Publication Date
- 2022-04-01
Smart Images

Figure 1 
Figure 2 
Figure 3
Abstract
Description
technical field
[0001] The present application relates to the field of computer technology, in particular to a task scheduling method, device, electronic device, and readable storage medium. Background technique
[0002] With the rapid development of computer technology and Internet technology, users can easily access the Internet and submit tasks to servers on the Internet, and the server can provide users with corresponding services by executing the tasks submitted by users. However, when the server is accessed and used by a large number of users at the same time, the server will continuously receive task request instructions, usually save all task request instructions in the message queue, pile up the tasks, and then pass some scheduling strategies , continuously select a task from the message queue to execute.
[0003] The patent application document with the publication number "CN107423120A" discloses a method and device for task scheduling, specifically setting the pr...
Examples
Embodiment 1
[0040] This embodiment provides a task scheduling method. The priority is determined by the resource ratio of each execution queue, and a task polling mechanism is introduced to select tasks from different execution queues each time. That is to say, the resources of the execution queue The higher the proportion, the higher the priority, and the higher the priority of the task is in the execution queue, the greater the probability of being selected for execution, and it is guaranteed that the tasks in the low priority execution queue will have a higher priority There is still a probability to be executed first when the execution queue is executed, which not only ensures that the priority definition of the execution queue is valid, but also takes into account the low-priority execution queue, ensuring the orderly and effective execution of task instances.
[0041] specific reference figure 1 , the task scheduling method includes steps S1-S4:
[0042] Step S1: Acquiring at least...
Embodiment 2
[0076] Based on the same idea, this embodiment also provides a task scheduling device, which is used to implement the task scheduling method described in Embodiment 1. For details, refer to figure 2 , the device consists of the following modules:
[0077] An initialization module, configured to obtain at least one computing resource, create at least one execution queue corresponding to each of the computing resources, and assign a resource ratio of the corresponding computing resource to each of the execution queues;
[0078] A task allocation module, configured to acquire at least one task instance and task information of each task instance, and allocate each task instance to a designated execution queue of a designated computing resource according to the task information;
[0079] A priority adjustment module, configured to obtain the probability of being selected for each candidate task instance according to the resource ratios of all available execution queues in the same...
Embodiment 3
[0082] This embodiment also provides an electronic device, refer to image 3 , including a memory 404 and a processor 402, where a computer program is stored in the memory 404, and the processor 402 is configured to run the computer program to execute the steps of any task scheduling method in the foregoing embodiments.
[0083] Specifically, the processor 402 may include a central processing unit (CPU), or an Application Specific Integrated Circuit (ASIC for short), or may be configured to implement one or more integrated circuits in the embodiments of the present application.
[0084] Wherein, the memory 404 may include a mass memory 404 for data or instructions. By way of example and not limitation, the memory 404 may include a hard disk drive (Hard Disk Drive, referred to as HDD), a floppy disk drive, a solid state drive (Solid State Drive, referred to as SSD), flash memory, optical disk, magneto-optical disk, magnetic tape or general serial A bus (UniversalSerial Bus, re...