CN113835861A - Process scheduling method, device, equipment and storage medium - Google Patents

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

Info

Publication number
CN113835861A
CN113835861A CN202111126641.8A CN202111126641A CN113835861A CN 113835861 A CN113835861 A CN 113835861A CN 202111126641 A CN202111126641 A CN 202111126641A CN 113835861 A CN113835861 A CN 113835861A
Authority
CN
China
Prior art keywords
processes
executed
starvation
scheduling
execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111126641.8A
Other languages
Chinese (zh)
Inventor
秦民
孙炳彤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Automotive Innovation Co Ltd
Original Assignee
China Automotive Innovation Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Automotive Innovation Co Ltd filed Critical China Automotive Innovation Co Ltd
Priority to CN202111126641.8A priority Critical patent/CN113835861A/en
Publication of CN113835861A publication Critical patent/CN113835861A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Factory Administration (AREA)

Abstract

The application discloses a process scheduling method, a device, equipment and a storage medium, wherein the method comprises the following steps: obtaining waiting time corresponding to a plurality of processes to be executed; performing descending arrangement on the plurality of processes to be executed based on the waiting time to obtain a process linked list; scheduling and executing the plurality of processes to be executed according to the execution priority of the plurality of processes to be executed; when the first execution quantity of the plurality of processes to be executed meets a first switching condition, scheduling and executing the plurality of starvation processes according to the arrangement sequence of the plurality of starvation processes in the process chain table, wherein the plurality of starvation processes are the processes to be executed, and the corresponding waiting time is larger than or equal to a starvation threshold value. By the technical scheme, the scheduling efficiency of the starvation process can be improved while the process to be executed is normally scheduled, and the starvation process is prevented from being starved due to long-time non-execution, so that the flexibility and effectiveness of process scheduling are improved.

Description

Process scheduling method, device, equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a process scheduling method, apparatus, device, and storage medium.
Background
The real-time operating system is generally scheduled based on priority and time slice rotation, the system gives a priority to each process, and the process with the highest current priority is scheduled each time process switching is needed; and for the processes with the same priority, using time slice round robin scheduling.
However, if a high-priority process is executing all the time, a low-priority process cannot execute, which causes the low-priority process to starve or even starve, and therefore, a more scientific and effective technical solution needs to be provided.
Disclosure of Invention
The application provides a process scheduling method, a device, equipment and a storage medium, which can improve the scheduling efficiency of a starvation process while normally scheduling a process to be executed, and avoid starvation of the starvation process due to long-time non-execution, thereby improving the flexibility and effectiveness of the process scheduling method, and the technical scheme of the application is as follows:
in one aspect, a method for scheduling a process is provided, where the method includes:
obtaining waiting time corresponding to a plurality of processes to be executed;
performing descending arrangement on the plurality of processes to be executed based on the waiting time to obtain a process linked list;
scheduling and executing the plurality of processes to be executed according to the execution priority of the plurality of processes to be executed;
when the first execution quantity of the plurality of processes to be executed meets a first switching condition, scheduling and executing the plurality of starvation processes according to the arrangement sequence of the plurality of starvation processes in the process chain table, wherein the plurality of starvation processes are the processes to be executed, and the corresponding waiting time is larger than or equal to a starvation threshold value.
In another aspect, an apparatus for scheduling a process is provided, the apparatus including:
the waiting time acquisition module is used for acquiring waiting times corresponding to a plurality of processes to be executed;
the process linked list module is used for carrying out descending arrangement on the plurality of processes to be executed based on the waiting time to obtain a process linked list;
the first scheduling execution module is used for scheduling and executing the plurality of processes to be executed according to the execution priority of the plurality of processes to be executed;
and the second scheduling execution module is used for scheduling and executing the plurality of starved processes according to the arrangement sequence of the plurality of starved processes in the process chain table when the first execution quantity of the plurality of processes to be executed meets a first switching condition, wherein the plurality of starved processes are the processes to be executed, and the corresponding waiting time of the plurality of processes to be executed is greater than or equal to a starvation threshold value.
In another aspect, a process scheduling apparatus is provided, which includes a processor and a memory, where at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the process scheduling method as described above.
In another aspect, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the process scheduling method as described above.
The process scheduling method, the device, the equipment and the storage medium have the following technical effects:
by using the technical scheme provided by the application, the process chain table can be obtained after the plurality of processes to be executed are subjected to descending order arrangement based on the waiting time, the plurality of processes to be executed are scheduled and executed according to the execution priority, when the switching condition is met, the plurality of starved processes are scheduled and executed according to the arrangement order of the plurality of starved processes in the process chain table, the scheduling efficiency of the starved processes is improved while the processes to be executed are normally scheduled, and the starved processes are prevented from being starved due to long-time non-execution, so that the flexibility and the effectiveness of the process scheduling method are improved.
Drawings
In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a process scheduling method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a process chain table provided in an embodiment of the present application;
fig. 3 is a schematic flowchart illustrating scheduling execution of the multiple processes to be executed according to the execution priorities of the multiple processes to be executed according to an embodiment of the present application;
fig. 4 is a schematic flowchart illustrating a process of performing scheduling execution on a plurality of starvation processes according to an arrangement order of the plurality of starvation processes in the process chain table according to an embodiment of the present application;
fig. 5 is a flowchart illustrating another process scheduling method according to an embodiment of the present application;
fig. 6 is a schematic diagram of a process scheduling apparatus according to an embodiment of the present application;
fig. 7 is a hardware block diagram of a server according to a process scheduling method provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or server that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
A process scheduling method provided in the embodiment of the present application is described below, and fig. 1 is a schematic flow chart of the process scheduling method provided in the embodiment of the present application. It is noted that the present specification provides the method steps as described in the examples or flowcharts, but may include more or less steps based on routine or non-inventive labor. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. In actual system or product execution, sequential execution or parallel execution (e.g., parallel processor or multi-threaded environment) may be possible according to the embodiments or methods shown in the figures. Specifically, as shown in fig. 1, the method may include:
s101, obtaining waiting time corresponding to a plurality of processes to be executed.
In this embodiment, the waiting time may be an interval duration between the current time and the last scheduling time of the corresponding to-be-executed process.
In practical applications, the process state in the operating system may include: the system comprises a running state, a ready state, a suspended state, a dormant state and the like, wherein the plurality of processes to be executed can be a plurality of processes in the ready state in an operating system. In the embodiment of the present specification, the operating system may be a real-time operating system, such as RT-Linux, VxWorks, μ C/OS-II, and the like.
S103, performing descending order arrangement on the plurality of processes to be executed based on the waiting time to obtain a process linked list.
In practical applications, a Process Control Block (PCB) is a data structure in an operating system core for representing the state of a process. The operating system can form a queue from the PCBs of the processes in a linked list mode according to the process states, and accordingly corresponding running queues, ready queues, suspension queues and the like are generated. In a specific embodiment, a plurality of processes to be executed are arranged in a descending order based on waiting time, a queue is formed by PCBs of the plurality of processes to be executed in a linked list mode, and a ready queue corresponding to the process linked list is generated, wherein the processes to be executed with longer scheduling time from the last time are arranged in front of the linked list, and the processes to be executed with shorter scheduling time from the last time are arranged in the back of the linked list.
In an alternative embodiment, as shown in fig. 2, a pointer field may be added in the PCB, so that a target pointer P corresponding to the pointer field points to a first non-starving process in the process chain table, where the non-starving process is a process to be executed whose waiting time is less than the starvation threshold. In the process chain table, the wait time for the process to be executed before the target pointer exceeds a starvation threshold. When the target pointer points to the head (head) of the process chain table, the process chain table indicates that all the process chain tables are non-starved processes and no starvation process exists, wherein the starvation process is a process to be executed, and the corresponding waiting time is greater than or equal to a starvation threshold value. Preferably, the starvation threshold may be set in combination with the number of processes in the process chain table and the waiting time in the actual application.
And S105, scheduling and executing the plurality of processes to be executed according to the execution priorities of the plurality of processes to be executed.
In a specific embodiment, as shown in fig. 3, the scheduling execution of the multiple processes to be executed according to the execution priorities of the multiple processes to be executed may include:
s301, determining the currently scheduled processes to be executed from the plurality of processes to be executed according to the execution priority.
Specifically, the processes to be executed with higher execution priority are scheduled first, and the processes to be executed with the same execution priority are scheduled in a time slice rotation manner.
And S303, executing the currently scheduled process to be executed.
S305, after the execution of the currently scheduled process to be executed is finished, adding the currently scheduled process to be executed to the tail part of the process linked list.
S307, repeatedly executing the first scheduling process from the currently scheduled to-be-executed process determined from the multiple to-be-executed processes according to the execution priority to the adding of the currently scheduled to-be-executed process to the tail of the process linked list until the first execution number in the first scheduling process meets the first switching condition.
In an alternative embodiment, the first switching condition may include: the first execution number is greater than or equal to a first number threshold, wherein the first number threshold can be set by combining the number of starved processes and non-starved processes in a process chain table in the actual application.
According to the embodiment, the multiple processes to be executed are scheduled and executed according to the execution priority, so that the normal scheduling requirements of the processes to be executed can be met, and the scheduling efficiency of the processes to be executed is improved.
And S107, when the first execution quantity of the plurality of processes to be executed meets a first switching condition, scheduling and executing the plurality of starvation processes according to the arrangement sequence of the plurality of starvation processes in the process chain table, wherein the plurality of starvation processes are the processes to be executed, and the corresponding waiting time of which is greater than or equal to the starvation threshold value.
In a specific embodiment, as shown in fig. 4, the performing scheduling on the plurality of starved processes according to the arrangement order of the plurality of starved processes in the process chain table may include:
s401, according to the arrangement sequence, executing the first starvation process in the starvation processes.
Specifically, the first starvation process is executed, that is, the starvation process with the longest waiting time among the plurality of starvation processes is executed, so that the starvation process is prevented from being starved due to the overlong waiting time.
And S403, after the first starvation process is executed, adding the first starvation process to the tail part of the process linked list.
S405, updating the plurality of starvation processes to obtain a plurality of updated starvation processes.
In practical applications, when the waiting time of some non-starving processes exceeds the starvation threshold, the non-starving processes are treated as starving processes and are scheduled based on the arrangement order in the process chain table.
Specifically, the waiting time corresponding to a plurality of non-starvation processes in the process chain table is updated to obtain the updating waiting time corresponding to the plurality of non-starvation processes; updating the plurality of non-starvation processes based on the update waiting time to obtain a plurality of updated non-starvation processes; and updating the plurality of hungry processes based on the plurality of updated non-hungry processes to obtain a plurality of updated hungry processes.
S407, based on the plurality of updated hungry processes, repeatedly executing the above sequence to update the plurality of hungry processes, and obtaining a second scheduling process of the plurality of updated hungry processes until a second execution number of the hungry processes executed in the second scheduling process satisfies a second switching condition.
In an optional embodiment, the second switching condition may include: the second execution number is greater than or equal to a second number threshold, or the number of the current starvation processes in the process chain table is zero, wherein the second number threshold can be set by combining the number of the starvation processes and the number of the non-starvation processes in the process chain table in practical application.
It can be seen from the above embodiments that, the multiple starvation processes are scheduled and executed according to the arrangement order of the multiple starvation processes in the process chain table, and the starvation processes with long waiting time are preferentially executed, so that starvation of the starvation processes due to long-time non-execution is avoided, and the scheduling efficiency of the starvation processes is improved.
In an alternative embodiment, as shown in fig. 5, the method may further include:
and S109, when the second execution quantity meets the second switching condition, scheduling and executing the current processes to be executed according to the execution priority of the current processes to be executed.
Specifically, when the second execution amount satisfies the second switching condition, the second scheduling process for the current starvation process is switched to the first scheduling process for the current process to be executed.
According to the embodiment, based on the preset switching condition, the first scheduling process of the process to be executed and the second scheduling process of the starvation process are flexibly switched, the scheduling requirements of different types of processes are met, and the flexibility and universality of the process scheduling method are improved.
In an optional embodiment, the method may further include: and when the process to be executed in the suspended state exists in the plurality of processes to be executed, removing the process to be executed in the suspended state from the process linked list.
Specifically, the to-be-executed process in the suspended state may be a to-be-executed process that is temporarily eliminated from the system memory when the system memory resources cannot meet the requirement for running the plurality of to-be-executed processes.
The embodiments can be seen in the foregoing, suspended processes in the process linked list can be adjusted in time, and the efficiency of resource allocation and process scheduling is improved.
As can be seen from the foregoing embodiments of the present application, according to the technical solutions provided by the embodiments of the present application, a process chain table can be obtained after a plurality of processes to be executed are sorted in a descending order based on waiting time, on one hand, a plurality of processes to be executed are scheduled and executed according to an execution priority, so that a normal scheduling requirement of the processes to be executed can be met, and scheduling efficiency of the processes to be executed is improved; on the other hand, the multiple starvation processes are scheduled and executed according to the arrangement sequence of the multiple starvation processes in the process chain table, the starvation processes with long waiting time are preferentially executed, starvation of the starvation processes due to long-time non-execution is avoided, and the scheduling efficiency of the starvation processes is improved; on the other hand, based on the preset switching condition, the first scheduling process of the process to be executed and the second scheduling process of the starvation process are flexibly switched, so that the scheduling requirements of different types of processes are met, and the flexibility and universality of the process scheduling method are improved; on the other hand, the suspended process in the process linked list can be adjusted in time, and the efficiency of resource allocation and process scheduling is improved.
An embodiment of the present application provides a process scheduling apparatus, as shown in fig. 6, the apparatus includes:
a waiting time obtaining module 610, configured to obtain waiting times corresponding to multiple processes to be executed;
a process linked list module 620, configured to perform descending order arrangement on the multiple processes to be executed based on the waiting time, so as to obtain a process linked list;
a first scheduling execution module 630, configured to perform scheduling execution on the multiple processes to be executed according to the execution priorities of the multiple processes to be executed;
the second scheduling execution module 640 is configured to, when the first execution number of the multiple processes to be executed meets a first switching condition, perform scheduling execution on the multiple starved processes according to an arrangement order of the multiple starved processes in the process chain table, where the multiple starved processes are the processes to be executed whose corresponding waiting time is greater than or equal to a starvation threshold.
In a specific embodiment, the first scheduling executing module 630 may include:
a first scheduling unit, configured to determine, according to the execution priority, a currently scheduled to-be-executed process from the multiple to-be-executed processes;
the first execution unit is used for executing the currently scheduled process to be executed;
a first adding unit, configured to add the currently scheduled process to be executed to the tail of the process linked list after the currently scheduled process to be executed is executed;
a first repeating unit, configured to repeatedly execute the first scheduling process from the to-be-executed process determined to be currently scheduled to the tail of the process linked list to which the to-be-executed process currently scheduled is added according to the execution priority until the first execution number in the first scheduling process meets the first switching condition.
In a specific embodiment, the second scheduling executing module 640 may include:
a second execution unit, configured to execute a first starvation process of the plurality of starvation processes according to the ordering order;
a second adding unit, configured to add the first starvation process to the tail of the process chain table after the first starvation process is executed;
a starvation process updating unit, configured to update the starvation processes to obtain a plurality of updated starvation processes;
a second repeating unit, configured to repeat, based on the plurality of updated starvation processes, the execution of the first starvation process to the update of the plurality of starvation processes according to the ranking order to obtain a second scheduling process of the plurality of updated starvation processes until a second execution number of the starvation processes executed in the second scheduling process meets a second switching condition.
In an optional embodiment, the apparatus may further include:
and the third scheduling execution module is used for scheduling and executing the plurality of current processes to be executed according to the execution priority of the plurality of current processes to be executed when the second execution quantity meets the second switching condition.
In an optional embodiment, the apparatus may further include:
and the removing module is used for removing the process to be executed in the suspended state from the process linked list when the process to be executed in the suspended state exists in the plurality of processes to be executed.
The device and method embodiments in the device embodiment described above are based on the same inventive concept. And will not be described in detail herein.
The embodiment of the present application provides a process scheduling apparatus, where the process scheduling apparatus includes a processor and a memory, where the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the process scheduling method provided in the above method embodiment.
The memory may be used to store software programs and modules, and the processor may execute various functional applications and data processing by operating the software programs and modules stored in the memory. The memory can mainly comprise a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs needed by functions and the like; the storage data area may store data created according to the use of the above-described apparatus, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory may also include a memory controller to provide the processor access to the memory.
The method embodiments provided in the embodiments of the present application may be executed in an operating system of a mobile terminal, a computer terminal, a server, or a similar computing device, that is, the computer device may include a mobile terminal, a computer terminal, a server, or a similar computing device. Taking the example of running on a server, fig. 7 is a hardware structure block diagram of the server of the process scheduling method provided in the embodiment of the present application. As shown in fig. 7, the server 700 may have a relatively large difference due to different configurations or performances, and may include one or more Central Processing Units (CPUs) 710 (the processor 710 may include but is not limited to a Processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 730 for storing data, and one or more storage media 720 (e.g., one or more mass storage devices) for storing applications 723 or data 722. Memory 730 and storage medium 720 may be, among other things, transient storage or persistent storage. The program stored in the storage medium 720 may include one or more modules, each of which may include a series of instruction operations for the server. Still further, central processor 710 may be configured to communicate with storage medium 720 and execute a series of instruction operations in storage medium 720 on server 700. The server 700 may also include one or more power supplies 760, one or more wired or wireless network interfaces 750, one or more input-output interfaces 740, and/or one or more operating systems 721, further the operating system 721 may be a real-time operating system, such as RT-Linux, VxWorks, μ C/OS-II, and so forth.
The input/output interface 740 may be used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the server 700. In one example, the input/output Interface 740 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the input/output interface 740 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
It will be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration and is not intended to limit the structure of the electronic device. For example, server 700 may also include more or fewer components than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
The present application further provides a storage medium, where the storage medium may be disposed in a server to store at least one instruction or at least one program for implementing a process scheduling method in one of the method embodiments, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the process scheduling method provided in the method embodiment.
Alternatively, in this embodiment, the storage medium may be located in at least one network server of a plurality of network servers of a computer network. Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
As can be seen from the embodiments of the process scheduling method, the apparatus, the device, or the storage medium provided by the present application, by using the technical solution provided by the embodiments of the present application, a process chain table can be obtained after a plurality of processes to be executed are arranged in a descending order based on the waiting time, on one hand, the plurality of processes to be executed are scheduled and executed according to the execution priority, so that the normal scheduling requirements of the processes to be executed can be met, and the scheduling efficiency of the processes to be executed is improved; on the other hand, the multiple starvation processes are scheduled and executed according to the arrangement sequence of the multiple starvation processes in the process chain table, the starvation processes with long waiting time are preferentially executed, starvation of the starvation processes due to long-time non-execution is avoided, and the scheduling efficiency of the starvation processes is improved; on the other hand, based on the preset switching condition, the first scheduling process of the process to be executed and the second scheduling process of the starvation process are flexibly switched, so that the scheduling requirements of different types of processes are met, and the flexibility and universality of the process scheduling method are improved; on the other hand, the suspended process in the process linked list can be adjusted in time, and the efficiency of resource allocation and process scheduling is improved.
It should be noted that: the sequence of the embodiments of the present application is only for description, and does not represent the advantages and disadvantages of the embodiments. And specific embodiments thereof have been described above. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, device and storage medium embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program to instruct relevant hardware to implement the above program, and the above program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (10)

1. A method for scheduling a process, the method comprising:
obtaining waiting time corresponding to a plurality of processes to be executed;
performing descending arrangement on the plurality of processes to be executed based on the waiting time to obtain a process linked list;
scheduling and executing the plurality of processes to be executed according to the execution priority of the plurality of processes to be executed;
when the first execution quantity of the plurality of processes to be executed meets a first switching condition, scheduling and executing the plurality of starvation processes according to the arrangement sequence of the plurality of starvation processes in the process chain table, wherein the plurality of starvation processes are the processes to be executed, and the corresponding waiting time is larger than or equal to a starvation threshold value.
2. The method according to claim 1, wherein the scheduling execution of the plurality of processes to be executed according to the execution priorities of the plurality of processes to be executed comprises:
determining a currently scheduled process to be executed from the plurality of processes to be executed according to the execution priority;
executing the currently scheduled process to be executed;
after the currently scheduled process to be executed is executed, adding the currently scheduled process to be executed to the tail part of the process linked list;
and repeatedly executing the first scheduling process from the currently scheduled to-be-executed process determined from the multiple to-be-executed processes to the tail part of the process linked list added with the currently scheduled to-be-executed process according to the execution priority until the first execution number in the first scheduling process meets the first switching condition.
3. The method of claim 1, wherein the performing scheduling execution on the plurality of starved processes according to the rank order of the plurality of starved processes in the process chain table comprises:
executing a first starvation process of the plurality of starvation processes according to the ranking order;
after the first starvation process is executed, adding the first starvation process to the tail part of the process linked list;
updating the plurality of starvation processes to obtain a plurality of updated starvation processes;
and repeatedly executing the first starvation process in the plurality of starvation processes to the plurality of updated starvation processes according to the arrangement sequence based on the plurality of updated starvation processes to obtain a second scheduling process of the plurality of updated starvation processes until a second execution number of the starvation processes executed in the second scheduling process meets a second switching condition.
4. The method of claim 3, further comprising:
and when the second execution quantity meets the second switching condition, scheduling and executing the plurality of current processes to be executed according to the execution priority of the plurality of current processes to be executed.
5. The method of any of claims 1 to 4, further comprising:
when the process to be executed in the suspended state exists in the plurality of processes to be executed, removing the process to be executed in the suspended state from the process linked list.
6. The method according to any of claims 1 to 4, wherein the first switching condition comprises:
the first execution number is greater than or equal to a first number threshold.
7. The method according to claim 3 or 4, wherein the second handover condition comprises:
the second execution number is greater than or equal to a second number threshold;
or the like, or, alternatively,
the number of current starving processes in the process chain table is zero.
8. An apparatus for scheduling processes, the apparatus comprising:
the waiting time acquisition module is used for acquiring waiting times corresponding to a plurality of processes to be executed;
the process linked list module is used for carrying out descending arrangement on the plurality of processes to be executed based on the waiting time to obtain a process linked list;
the first scheduling execution module is used for scheduling and executing the plurality of processes to be executed according to the execution priority of the plurality of processes to be executed;
and the second scheduling execution module is used for scheduling and executing the plurality of starved processes according to the arrangement sequence of the plurality of starved processes in the process chain table when the first execution quantity of the plurality of processes to be executed meets a first switching condition, wherein the plurality of starved processes are the processes to be executed, and the corresponding waiting time of the plurality of processes to be executed is greater than or equal to a starvation threshold value.
9. A process scheduling apparatus, comprising a processor and a memory, wherein at least one instruction or at least one program is stored in the memory, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the process scheduling method according to any one of claims 1 to 7.
10. A computer-readable storage medium, in which at least one instruction or at least one program is stored, which is loaded and executed by a processor to implement the process scheduling method according to any one of claims 1 to 7.
CN202111126641.8A 2021-09-24 2021-09-24 Process scheduling method, device, equipment and storage medium Pending CN113835861A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111126641.8A CN113835861A (en) 2021-09-24 2021-09-24 Process scheduling method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111126641.8A CN113835861A (en) 2021-09-24 2021-09-24 Process scheduling method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113835861A true CN113835861A (en) 2021-12-24

Family

ID=78970261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111126641.8A Pending CN113835861A (en) 2021-09-24 2021-09-24 Process scheduling method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113835861A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105204938A (en) * 2015-11-02 2015-12-30 重庆大学 Data-intensive process scheduling method of memory access
US20160077870A1 (en) * 2014-09-16 2016-03-17 Freescale Semiconductor, Inc. Starvation control in a data processing system
CN110175073A (en) * 2019-05-31 2019-08-27 杭州数梦工场科技有限公司 Dispatching method, sending method, device and the relevant device of data exchange operation
CN110489217A (en) * 2019-07-11 2019-11-22 新华三大数据技术有限公司 A kind of method for scheduling task and system
CN111506413A (en) * 2020-07-02 2020-08-07 上海有孚智数云创数字科技有限公司 Intelligent task scheduling method and system based on business efficiency optimization
CN112416546A (en) * 2020-11-10 2021-02-26 光华临港工程应用技术研发(上海)有限公司 Multitask scheduling method, electronic device and computer storage medium
CN112764904A (en) * 2021-01-22 2021-05-07 珠海亿智电子科技有限公司 Method for preventing starvation of low priority tasks in multitask-based system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160077870A1 (en) * 2014-09-16 2016-03-17 Freescale Semiconductor, Inc. Starvation control in a data processing system
CN105204938A (en) * 2015-11-02 2015-12-30 重庆大学 Data-intensive process scheduling method of memory access
CN110175073A (en) * 2019-05-31 2019-08-27 杭州数梦工场科技有限公司 Dispatching method, sending method, device and the relevant device of data exchange operation
CN110489217A (en) * 2019-07-11 2019-11-22 新华三大数据技术有限公司 A kind of method for scheduling task and system
CN111506413A (en) * 2020-07-02 2020-08-07 上海有孚智数云创数字科技有限公司 Intelligent task scheduling method and system based on business efficiency optimization
CN112416546A (en) * 2020-11-10 2021-02-26 光华临港工程应用技术研发(上海)有限公司 Multitask scheduling method, electronic device and computer storage medium
CN112764904A (en) * 2021-01-22 2021-05-07 珠海亿智电子科技有限公司 Method for preventing starvation of low priority tasks in multitask-based system

Similar Documents

Publication Publication Date Title
CN110096353B (en) Task scheduling method and device
CN108762896B (en) Hadoop cluster-based task scheduling method and computer equipment
CN110489217A (en) A kind of method for scheduling task and system
CN112214319B (en) Task scheduling method for sensing computing resources
CN114327843A (en) Task scheduling method and device
CN115454589A (en) Task scheduling method and device and Kubernetes scheduler
CN111258774A (en) Flow processing method and device, computer equipment and storage medium
CN112199180A (en) Multitask scheduling method and device, electronic equipment and readable storage medium
CN114629960B (en) Resource scheduling method, device, system, equipment, medium and program product
CN106775975B (en) Process scheduling method and device
CN111597044A (en) Task scheduling method and device, storage medium and electronic equipment
CN112860387A (en) Distributed task scheduling method and device, computer equipment and storage medium
CA2631255A1 (en) Scalable scheduling of tasks in heterogeneous systems
CN111930516B (en) Load balancing method and related device
CN113835861A (en) Process scheduling method, device, equipment and storage medium
WO2023165485A1 (en) Scheduling method and computer system
CN111338787B (en) Data processing method and device, storage medium and electronic device
CN109189581B (en) Job scheduling method and device
CN110851245A (en) Distributed asynchronous task scheduling method and electronic equipment
CN109086128B (en) Task scheduling method and device
CN115712572A (en) Task testing method and device, storage medium and electronic device
Khelghatdoust et al. Peacock: Probe-based scheduling of jobs by rotating between elastic queues
CN110968420A (en) Scheduling method and device for multi-crawler platform, storage medium and processor
CN112948104B (en) Load balancing data acquisition method and device
CN113434271A (en) Task execution method and device, storage medium and electronic device

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