CN111104208B - Process scheduling management method, device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN111104208B
CN111104208B CN201911121132.9A CN201911121132A CN111104208B CN 111104208 B CN111104208 B CN 111104208B CN 201911121132 A CN201911121132 A CN 201911121132A CN 111104208 B CN111104208 B CN 111104208B
Authority
CN
China
Prior art keywords
cpu core
scheduling
target
load rate
expected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911121132.9A
Other languages
Chinese (zh)
Other versions
CN111104208A (en
Inventor
蒋永俊
熊友军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ubtech Robotics Corp
Original Assignee
Ubtech Robotics Corp
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 Ubtech Robotics Corp filed Critical Ubtech Robotics Corp
Priority to CN201911121132.9A priority Critical patent/CN111104208B/en
Publication of CN111104208A publication Critical patent/CN111104208A/en
Application granted granted Critical
Publication of CN111104208B publication Critical patent/CN111104208B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • 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
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/48Indexing scheme relating to G06F9/48
    • G06F2209/484Precedence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5021Priority

Abstract

The invention discloses a process scheduling management method, a device, computer equipment and a storage medium, wherein the process scheduling management method comprises the following steps: acquiring a target scheduling request, wherein the target scheduling request comprises a target process and an expected CPU core; acquiring the current load rate of the expected CPU core, and generating a process scheduling instruction based on the current load rate and a load rate threshold; and scheduling system resources for the target process based on the process scheduling instruction. The method can reasonably schedule the process, and solves the problem that the characteristics of the first CPU core and the second CPU core are not fully utilized in the current system resource scheduling process.

Description

Process scheduling management method, device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a process scheduling management method, a device, a computer device, and a storage medium.
Background
The central processor of the smart device is usually built with at least one first CPU core and at least one second CPU core, for example, the ARM processor includes at least one Cortex-a72 and at least one Cortex-a53, so that the processing capacities of different CPU cores in the same ARM processor are not the same. The first CPU core is a CPU core with strong performance and high main frequency, and the second CPU core is a CPU core with weak performance and low main frequency.
In Linux and Android Linux operating systems, the processing level of each process is equal under the default condition, each process runs on a second CPU core in the process of process scheduling, and when the current load rate of the second CPU core reaches a load rate threshold, the process is scheduled to run on a first CPU core, namely, the process scheduling mode can cause that when a certain process needs to run on the first CPU core, the first CPU core cannot be allocated to the process in time. Or in Linux and Android Linux operating systems, when a process is set, a large and small core scheduling operation strategy is preset, and the process scheduling mode of autonomously setting the large and small core scheduling operation strategy can cause a phenomenon of unbalanced process scheduling of a processor, for example, most processes are autonomously set on a first CPU core to be performed, so that the first CPU core is easily blocked, and a second CPU core is easily idle. In summary, in the current system resource scheduling process, the characteristics of the first CPU core and the second CPU core are not fully utilized to schedule the process, so that the utilization effect of the first CPU core and the second CPU core is poor, and the performance of the operating system is reduced.
Disclosure of Invention
The embodiment of the invention provides a process scheduling management method, a device, computer equipment and a storage medium, which are used for solving the problem that the characteristics of a first CPU core and a second CPU core are not fully utilized in the current system resource scheduling process, and the process is reasonably scheduled.
A process scheduling management method, comprising:
acquiring a target scheduling request, wherein the target scheduling request comprises a target process and an expected CPU core;
acquiring the current load rate of the expected CPU core, and generating a process scheduling instruction based on the current load rate and a load rate threshold;
and scheduling system resources for the target process based on the process scheduling instruction.
Preferably, the generating a process scheduling instruction based on the current load rate and the load rate threshold value includes:
if the current load rate is smaller than the load rate threshold, generating a process processing instruction;
the scheduling of system resources for the target process based on the process scheduling instruction includes:
binding the target process to the expected CPU core based on the process processing instruction.
Preferably, the binding the target process to the desired CPU core based on the process processing instruction includes:
and calling an affinity configuration interface based on the process processing instruction, acquiring target affinities corresponding to the target process and the expected CPU core, and binding the target process on the expected CPU core.
Preferably, the generating a process scheduling instruction based on the current load rate and the load rate threshold value includes:
if the current load rate is not smaller than the load rate threshold, generating a process return instruction;
the scheduling of system resources for the target process based on the process scheduling instruction includes:
and based on the process return instruction, carrying out system resource scheduling on the target process by adopting a load scheduling process.
Preferably, the system resource scheduling of the target process by using the load scheduling process includes:
acquiring a target load corresponding to each target process and an available load corresponding to each original CPU core;
determining at least one original CPU core corresponding to the available load larger than the target load as a CPU core to be selected;
and determining a target CPU core corresponding to the target process from at least one CPU core to be selected based on a preset process scheduling operation strategy.
Preferably, the acquiring the target scheduling request includes:
monitoring the request quantity in a process request queue in real time, and monitoring whether an idle CPU core exists or not;
and if the number of the requests is not zero and idle CPU cores exist, sequentially acquiring target scheduling requests from the process request queue.
A process schedule management apparatus comprising:
the target scheduling request acquisition module acquires a target scheduling request, wherein the target scheduling request comprises a target process and an expected CPU core;
the process scheduling instruction generation module is used for acquiring the current load rate of the expected CPU core and generating a process scheduling instruction based on the current load rate and a load rate threshold value;
and the system resource scheduling module is used for scheduling the system resources of the target process based on the process scheduling instruction.
Preferably, the process scheduling instruction generating module includes:
the process processing instruction generating unit is used for acquiring the current load rate of the expected CPU core, and generating a process processing instruction if the current load rate is smaller than the load rate threshold;
the system resource scheduling module comprises:
and the process binding processing unit is used for binding the target process on the expected CPU core based on the process processing instruction.
A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the above-described process scheduling management method when the computer program is executed by the processor.
A computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the above-described process scheduling management method.
According to the process scheduling management method, the device, the computer equipment and the storage medium, the target process and the expected CPU core can be rapidly acquired according to the target scheduling request; and generating a process scheduling instruction based on a comparison result of the current load rate of the expected CPU core and the load rate threshold value, and then performing system resource scheduling on the target process according to the process scheduling instruction so as to enable the process scheduling instruction to be related to the current load rate of the expected CPU core, thereby avoiding blocking the expected CPU core caused by blindly distributing the target process to the expected CPU core and ensuring the rationality of system resource distribution and calling, ensuring the load balance of each CPU core of the processor, and enabling the system to smoothly operate.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the description of the embodiments of the present invention will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a process scheduling management method according to an embodiment of the invention;
FIG. 2 is a flow chart of a process scheduling management method according to an embodiment of the invention;
FIG. 3 is a flow chart of a process scheduling management method according to an embodiment of the invention;
FIG. 4 is a flow chart of a process scheduling management method according to an embodiment of the invention;
FIG. 5 is a flow chart of a process scheduling management method according to an embodiment of the invention;
FIG. 6 is a schematic block diagram of a process scheduling management apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a computer device in accordance with an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The embodiment of the invention provides a process scheduling management method, which is applied to computer equipment, wherein at least one first CPU core and at least one second CPU core are arranged on a processor of the computer equipment. The first CPU core is a CPU core with strong performance and high main frequency, and the second CPU core is a CPU core with weak performance and low main frequency. The computer equipment is provided with a process scheduling management module, and the process scheduling management module can be used for receiving process scheduling requests triggered by different application processes to perform resource scheduling allocation so as to allocate corresponding first CPU cores or second CPU cores to each application process, so that the characteristics of the first CPU cores or the second CPU cores are fully utilized to perform scheduling processing, and the balance of system resource scheduling is ensured.
The process is one running activity of a program with a certain independent function on a certain data set, and is a basic unit of resource allocation and scheduling running of the system. Each process comprises at least one thread, the thread is a basic unit for CPU scheduling and allocation of the system, is the minimum unit for executing operation in the process, and has no system resource and only one resource in the system operation. Accordingly, an application process refers to a process in a computer device in which a particular application program is executing a particular function. A process scheduling request refers to a request triggered by an application process for requesting allocation of system resources.
The process scheduling management module is a module which runs on the computer equipment and is used for carrying out unified scheduling processing on process scheduling requests triggered by different application processes so as to ensure the balance of system resource allocation and scheduling.
In one embodiment, as shown in fig. 1, a process scheduling management method is provided, where the process scheduling management method is applied to a computer device, and the process scheduling management method includes the following steps executed by a process scheduling management module:
s101, acquiring a target scheduling request, wherein the target scheduling request comprises a target process and an expected CPU core.
The target scheduling request is a process scheduling request which is currently required to be processed by a process scheduling management module in the computer equipment. As an example, if the process scheduling management module may receive three process scheduling requests triggered by the application process a, the application process B, and the application process C, the target scheduling request is a process scheduling request that the process scheduling management module needs to perform scheduling processing at the current time.
The target process is a process which needs to be scheduled currently, and specifically is an application process corresponding to the target scheduling request. The desired CPU core refers to a CPU core desired to be allocated to the target process. The target scheduling request comprises a target process and a desired CPU core, and the target process is expected to be distributed to the desired CPU core for processing when the process is autonomously set. It should be noted that, the expected CPU core may be a first CPU core or a second CPU core, specifically, the expected CPU core is determined autonomously according to an operation requirement of the target process, and if the target process needs a CPU core with a stronger function, the expected CPU core configured for the target process is the first CPU core; otherwise, if the target process does not need the CPU core with stronger function, the expected CPU core configured for the target process is the second CPU core, so as to realize reasonable configuration of the CPU core.
For example, if the target process 1 is a process for loading a web page, the operation requirement of the target process 1 is that the response speed is fast, and the expected CPU core set for the target process 1 is the first CPU core; if the target process 2 is a process of information caching, the target process 2 has low requirements on computing capacity and response speed, and the expected CPU core set for the target process 2 is a second CPU core.
As an example, in the system resource scheduling process, a process request queue is created in advance, and is used for caching the process scheduling request triggered by at least one application process, and the process scheduling management module can sequentially obtain the target scheduling request from the process request queue according to the scheduling progress of the system resource scheduling, and analyze the target scheduling request to quickly obtain the target process and the expected CPU core.
S102, acquiring the current load rate of the expected CPU core, and generating a process scheduling instruction based on the current load rate and a load rate threshold.
The current load rate refers to the load rate of a certain CPU core at the current moment. As an example, the current load rate refers to a quotient of a sum of the number of processes running on the desired CPU core and the number of processes waiting for processing by the CPU core divided by the number of processes that the desired CPU core can process within a preset time period. For example, it is desirable that the number of processes running on the CPU core be x 1 The number of processes waiting for CPU core processing is x 2 The number of processes that a CPU core is expected to be able to handle is x 3 The current load factor isIn general, in Linux and Android Linux operating systems, an up time command or a top command can be used to quickly acquire the current load rate of the expected CPU core.
The load factor threshold is a preset value for judging whether or not the current load factor of the desired CPU core reaches a threshold value which is considered as a criterion that can process the target process, and for example, the load factor threshold may be 60%. Comparing the load factor threshold with the current load factor of the desired CPU core may result in two cases: the current load rate of the expected CPU core is smaller than the load rate threshold value or the current load rate of the expected CPU core is not smaller than the load rate threshold value, and the target process is correspondingly processed according to the two conditions.
The process scheduling instruction is an instruction for processing the target process, and comprises two cases of binding the target process and an expected CPU core and not binding the target process and the expected CPU core, so that the target process is flexibly processed, and the situation that the target process is set in the expected CPU core with a larger current load rate, the expected CPU core is blocked and the efficiency of the target process scheduling processing is affected is avoided.
As an example, by adopting an up time command or a top command, the current load rate of the expected CPU core can be rapidly determined, the current load rate is compared with a load rate threshold value, a process scheduling instruction is generated according to a comparison result, a flexible processing target process is realized, and the target process is correspondingly processed according to the process scheduling instruction.
S103, scheduling system resources for the target process based on the process scheduling instruction.
Specifically, the load rate threshold value is compared with the current load rate of the expected CPU core to determine a progress scheduling instruction, wherein the progress scheduling instruction can be a scheduling instruction for binding the target process and the expected CPU core or a scheduling instruction for not binding the target process and the expected CPU core; therefore, after the progress scheduling instruction is acquired, the progress scheduling instruction can be adopted to schedule the target progress, so that the load balance of each CPU core of the ARM processor is ensured, and the operating system can smoothly run.
In the process scheduling management method provided by the embodiment, a target process and an expected CPU core can be quickly acquired according to a target scheduling request; and generating a process scheduling instruction based on a comparison result of the current load rate of the expected CPU core and the load rate threshold value, and then performing system resource scheduling on the target process according to the process scheduling instruction so as to enable the process scheduling instruction to be related to the current load rate of the expected CPU core, thereby avoiding blocking the expected CPU core caused by blindly distributing the target process to the expected CPU core and ensuring the rationality of system resource distribution and calling, ensuring the load balance of each CPU core of the ARM processor, and enabling the system to smoothly operate.
In one embodiment, as shown in fig. 2, a process scheduling management method is provided, where the process scheduling management method is applied to a computer device, and the computer device is provided with a process scheduling management module, and the process scheduling management method includes the following steps executed by the process scheduling management module:
s201: and acquiring a target scheduling request, wherein the target scheduling request comprises a target process and an expected CPU core.
S202: and acquiring the current load rate of the expected CPU core, and if the current load rate is smaller than a load rate threshold value, generating a process processing instruction.
S203: based on the process handling instructions, the target process is bound to the desired CPU core.
It can be understood that the implementation process of step S201 is the same as that of step S101, and in order to avoid redundancy, redundancy is not needed here. Step S202 is a specific embodiment of step S102, and correspondingly step S203 is a specific embodiment of step S103.
The process processing instruction refers to an instruction for binding a target process to a desired CPU core, and is one of process scheduling instructions.
It can be appreciated that when the current load rate of the expected CPU core is large and reaches the load rate threshold of the standard which is considered as unable to process the target process, if the target process is bound to the expected CPU core again, the load of the expected CPU core will be too large, the running speed of the target process on the expected CPU core will be slow, and the smoothness of the system operation will be poor. Therefore, in order to avoid the problem that the load of the expected CPU core is overlarge due to the fact that the target process is distributed to the expected CPU core, the load rate threshold value can be compared with the current load rate of the expected CPU core, when the current load rate of the expected CPU core is smaller than the load rate threshold value, the load of the expected CPU core is smaller, the expected CPU core can process the target process, at the moment, a process processing instruction is generated, the target process is bound to the expected CPU core, so that the expected CPU core can be called to check the target process for processing, smooth system operation is ensured, and experience effects of users are ensured.
In the process scheduling management method provided by the embodiment, when the current load rate of the expected CPU core is smaller than the load rate threshold, a process processing instruction is generated, and the target process is bound on the expected CPU core based on the process processing instruction, so that smooth operation of the system is ensured, experience effect of a user is ensured, and performance of an operating system can be ensured to be in a better state.
In one embodiment, step S201, that is, binding the target process to the desired CPU core based on the process processing instruction, specifically includes the following steps: based on the process processing instruction, calling an affinity configuration interface, acquiring target affinities corresponding to the target process and the expected CPU core, and binding the target process on the expected CPU core.
Where affinity refers to a scheduling attribute that "binds" a process to a CPU core, causing the process to run on the CPU core. The affinity configuration interface is an interface for setting affinities of the target process and the desired CPU core, and may be a function, for example, a sched_affinity function.
As an example, after receiving the process processing instruction, the affinity configuration interface is called to perform affinity setting on the target process and the expected CPU core, so as to quickly obtain the target affinity, thereby implementing binding of the target process on the expected CPU core, and enabling the target process to run on the expected CPU core. Preferably, through affinity setting, the target process can determine the running priority thereof according to the affinity when waiting to run on the expected CPU core, so as to achieve the purpose of autonomously configuring the running priority.
In one embodiment, as shown in fig. 3, a process scheduling management method is provided, where the process scheduling management method is applied to a computer device, and the computer device is provided with a process scheduling management module, and the process scheduling management method includes the following steps executed by the process scheduling management module:
s301: and acquiring a target scheduling request, wherein the target scheduling request comprises a target process and an expected CPU core.
S302: acquiring the current load rate of the expected CPU core, and if the current load rate is not less than the load rate threshold value, generating a process return instruction;
s303: and based on the process return instruction, carrying out system resource scheduling on the target process by adopting a load scheduling process.
It can be understood that the implementation process of step S301 is the same as that of step S101, and in order to avoid redundancy, redundancy is not needed here. Step S302 is a specific embodiment of step S102, and correspondingly, step S303 is a specific embodiment of step S103.
The process return instruction refers to an instruction for returning a target process which is not bound with a desired CPU core to a load scheduling process to redistribute the CPU core, and is one of the process scheduling instructions. The load scheduling process is a process for reassigning another CPU core to a target process which is not bound with the desired CPU core, so as to ensure that the target process can process in time.
Specifically, the load rate threshold value is compared with the current load rate of the expected CPU core, when the current load rate of the expected CPU core is not smaller than the load rate threshold value, the load of the expected CPU core is larger, the target process is not bound on the expected CPU core, smooth operation of the expected CPU core is ensured, and the situation that the expected CPU core is blocked and cannot process the target process in time is avoided. Preferably, in order to ensure that the target process can be processed in time, a process return instruction needs to be generated, a load scheduling process is triggered based on the process return instruction, and another CPU core is redistributed for the target process, so that the target process can be processed in time.
In the process scheduling management method provided by the embodiment, when the current load rate is not less than the load rate threshold, a process return instruction is generated; based on the process return instruction, the load scheduling process is adopted to schedule the system resources of the target process, so that the situation that the target process cannot be processed in time due to the expected CPU core blockage is avoided, and the target process can be processed in time is ensured, so that the scheduling balance of the CPU core is determined.
In one embodiment, as shown in fig. 4, in step S303, a load scheduling process is used to schedule system resources for a target process, which specifically includes the following steps:
s401: and obtaining a target load corresponding to each target process and an available load corresponding to each original CPU core.
The original CPU core refers to any CPU core except the expected CPU core in the operating system. The target load is a resource required by the processing of the target process, and can be understood as a system resource required by the processing of the target process by the CPU core in the Linux and Android Linux operating systems. The available load refers to the available system resources remaining in the original CPU core in addition to the system resources of the process being processed in one processing cycle.
Specifically, when the target process cannot be bound with the desired CPU core, in order to process the target process in time, a target load required by the target process and an available load of any one of the original CPU cores except the desired CPU core in the operating system are acquired, so as to determine the original CPU cores that can be used for processing.
S402: and determining at least one original CPU core corresponding to the available load larger than the target load as a CPU core to be selected.
The CPU cores to be selected are screened from the original CPU cores, and the available load of the CPU cores to be selected is larger than the target load corresponding to the target process, so that the CPU cores to be selected can effectively process the target process without blocking. In this embodiment, the original CPU core with the available load greater than the target load is determined as the candidate CPU core, so as to ensure that the target process is checked and processed by the candidate CPU with the available load greater than the target load, and ensure the smoothness of system operation.
S403: and determining a target CPU core corresponding to the target process from at least one CPU core to be selected based on a preset process scheduling operation strategy.
The process scheduling operation policy refers to a policy of selecting a big core or a small core according to the operation requirement of a target process. In this embodiment, if the target process needs a CPU core with a stronger function, selecting a first CPU core matched with the target process from the CPU cores to be selected as the target CPU core; on the contrary, the target process is a process which can be processed slowly, and a CPU core with a stronger function is not needed, and then a second CPU core matched with the target process is selected from the CPU cores to be selected as the target CPU core, so that the target CPU core is reasonably configured, the target process is processed in time, and the balance and rationality of system resource scheduling are ensured.
In the process scheduling management method provided by the embodiment, the target load corresponding to each target process and the available load corresponding to each original CPU core are obtained, at least one original CPU core with the available load larger than the target load is determined to be the to-be-selected CPU core, so that the target process is ensured to be processed by the to-be-selected CPU core with the available load larger than the target load, the smooth operation of the system is ensured, and the phenomenon that the to-be-selected CPU core is blocked and cannot process the target process in time is avoided. And determining a target CPU core corresponding to the target process from at least one CPU core to be selected based on a preset process scheduling operation strategy, so as to realize reasonable configuration of the CPU core, process the target process in time and ensure the balance and rationality of system resource scheduling.
In one embodiment, as shown in fig. 5, step S101, i.e. obtaining the target scheduling request, includes:
s501: and monitoring the number of requests in the process request queue in real time, and monitoring whether an idle CPU core exists.
Wherein a process request queue refers to a queue comprising at least one process scheduling request. For example, a process request queue may include a process scheduling request 1, a process scheduling request 2, and a process scheduling request 3 for unprocessed processes.
The idle CPU core is a CPU core whose current load rate reaches a standard of being identified as idle, and in this embodiment, by checking the load condition of each CPU core, when the current load rate of the CPU core is less than a load idle threshold, the CPU core is determined as an idle CPU core. The load idle threshold is a threshold preset by the system for evaluating whether the idle standard is reached. The load idle threshold may be greater than or equal to the load rate threshold.
The number of requests refers to the number of process scheduling requests buffered in the process request queue. In this embodiment, a monitor command is used to monitor the process request queue so as to determine the number of requests in the process request queue, and an up time command or a top command is used to check the load condition of each CPU core, so as to determine whether an idle CPU core exists. Snoop commands include, but are not limited to, netstat-an, lsof-i, etc. commands.
S502: and if the number of the requests is not zero and idle CPU cores exist, sequentially acquiring the target scheduling requests from the process request queue.
Specifically, when the number of requests is not zero and idle CPU cores exist, the target scheduling request is acquired only when the idle CPU cores exist, so that resources can be effectively saved, resource waste is avoided, and the target scheduling request is selected from the process request queue according to a preset processing rule. The processing rule may be a first-in first-out rule, i.e. the process monitored first in the request queue is used as the target process, so as to process the target process; or the processing rule can be used for processing the process in real time, so that the target process can be processed in time.
In the process scheduling management method provided by the embodiment, the number of requests in the process request queue is monitored in real time, whether idle CPU cores exist or not is monitored, when the number of requests is not zero and the idle CPU cores exist, resources can be effectively saved, resource waste is avoided, and then target scheduling requests are sequentially acquired from the process request queue so as to ensure that the target process is processed subsequently.
It should be understood that the sequence number of each step in the foregoing embodiment does not mean that the execution sequence of each process should be determined by the function and the internal logic, and should not limit the implementation process of the embodiment of the present invention.
In an embodiment, a process scheduling management apparatus is provided, where the process scheduling management apparatus corresponds to the process scheduling management method in the above embodiment one by one. As shown in fig. 6, the process scheduling management apparatus includes a target scheduling request acquisition module 61, a process scheduling instruction generation module 62, and a system resource scheduling module 63. The functional modules are described in detail as follows:
the target scheduling request acquisition module 61 acquires a target scheduling request including a target process and an expected CPU core.
And the process scheduling instruction generating module 62 is configured to obtain a current load rate of the expected CPU core, and generate a process scheduling instruction based on the current load rate and a load rate threshold.
And the system resource scheduling module 63 is configured to schedule system resources for the target process based on the process scheduling instruction.
Preferably, the process scheduling instruction generating module 62 includes a process processing instruction generating unit 621, configured to obtain a current load rate of the desired CPU core, and if the current load rate is less than the load rate threshold, generate a process processing instruction.
The system resource scheduling module 63 includes a process binding processing unit 631 for binding the target process to the desired CPU core based on the process processing instruction.
Preferably, the process binding processing unit 631 includes a target affinity obtaining subunit 6311, configured to invoke an affinity configuration interface to obtain a target affinity corresponding to the target process and the desired CPU core based on the process processing instruction, and bind the target process to the desired CPU core.
Preferably, the process scheduling instruction generating module 62 includes a process return instruction generating unit 622, configured to obtain a current load rate of the desired CPU core, and generate a process return instruction if the current load rate is not less than the load rate threshold.
The system resource scheduling module 63 includes a process load scheduling unit 632, configured to perform system resource scheduling on the target process by using a load scheduling process based on the process return instruction.
Preferably, the process load scheduling unit 632 includes: the available load acquisition subunit 6321, the candidate CPU core determination subunit 6322, and the target CPU core determination subunit 6323.
The available load obtaining subunit 6321 is configured to obtain a target load corresponding to each target process and an available load corresponding to each original CPU core.
And a CPU core to be selected determining subunit 6322, configured to determine at least one of the original CPU cores corresponding to the available load being greater than the target load as a CPU core to be selected.
The target CPU core determining subunit 6323 is configured to determine, from at least one of the candidate CPU cores, a target CPU core corresponding to the target process based on a preset process scheduling operation policy.
Preferably, the target scheduling request acquisition module 61 includes: a listening unit 611 and a scheduling request acquisition unit 612.
The monitoring unit 611 is configured to monitor, in real time, the number of requests in the process request queue, and monitor whether an idle CPU core exists.
And a scheduling request acquiring unit 612, configured to sequentially acquire the target scheduling request from the process request queue if the number of requests is not zero and there is an idle CPU core.
The specific limitation of the process scheduling management apparatus may be referred to the limitation of the process scheduling management method hereinabove, and will not be described herein. The respective modules in the above-described process scheduling management apparatus may be implemented in whole or in part by software, hardware, or a combination thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database of the computer device is used to store the target affinities. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program, when executed by a processor, implements a process scheduling management method.
In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor executes the computer program to implement steps of the process scheduling management method in the foregoing embodiment, such as steps S201 to S203 shown in fig. 2, or steps shown in fig. 3 to 5, and are not repeated herein. Alternatively, the processor may implement the functions of each module/unit in this embodiment of the process scheduling management apparatus when executing the computer program, for example, the functions of the target scheduling request obtaining module 61, the process scheduling instruction generating module 62, and the system resource scheduling module 63 shown in fig. 6, which are not described herein again for avoiding repetition.
In an embodiment, a computer readable storage medium is provided, and a computer program is stored on the computer readable storage medium, where the computer program when executed by a processor implements the steps of the process scheduling management method in the above embodiment, for example, steps S201 to S203 shown in fig. 2 or steps shown in fig. 3 to 5, and will not be repeated herein. Alternatively, the processor may implement the functions of each module/unit in this embodiment of the process scheduling management apparatus when executing the computer program, for example, the functions of the target scheduling request obtaining module 61, the process scheduling instruction generating module 62, and the system resource scheduling module 63 shown in fig. 6, which are not described herein again for avoiding repetition.
Those skilled in the art will appreciate that implementing all or part of the above described methods may be accomplished by way of a computer program stored on a non-transitory computer readable storage medium, which when executed, may comprise the steps of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention, and are intended to be included in the scope of the present invention.

Claims (9)

1. A process scheduling management method, comprising:
acquiring a target scheduling request, wherein the target scheduling request comprises a target process and an expected CPU core;
acquiring the current load rate of the expected CPU core, wherein the current load rate refers to the quotient of the sum of the number of processes running on the expected CPU core and the number of processes waiting for the CPU core to process divided by the number of processes which can be processed by the expected CPU core in a preset time period; generating a process scheduling instruction based on the current load rate and the load rate threshold value, including: comparing a load rate threshold with the current load rate of an expected CPU core, if the current load rate is not smaller than the load rate threshold, the load of the expected CPU core is larger, and a target process is not bound on the expected CPU core, so that a process return instruction is generated; the process return instruction is an instruction for returning a target process which is not bound with the expected CPU core to the load scheduling process to redistribute the CPU core;
and carrying out system resource scheduling on the target process based on the process scheduling instruction, wherein the system resource scheduling comprises the following steps: triggering a load scheduling process based on the process return instruction, and reallocating a CPU core with the available load larger than the target load of the target process to a target process which is not bound with the expected CPU core, and scheduling system resources of the target process by adopting the load scheduling process; the available load refers to available system resources in the original CPU core that remain in addition to the system resources of the process being processed in one processing cycle.
2. The process scheduling management method of claim 1, wherein the generating process scheduling instructions based on the current load rate and load rate threshold comprises:
if the current load rate is smaller than the load rate threshold, generating a process processing instruction;
the scheduling of system resources for the target process based on the process scheduling instruction includes:
binding the target process to the expected CPU core based on the process processing instruction.
3. The process scheduling management method according to claim 2, wherein binding the target process to the desired CPU core based on the process processing instruction comprises:
and calling an affinity configuration interface based on the process processing instruction, acquiring target affinities corresponding to the target process and the expected CPU core, and binding the target process on the expected CPU core.
4. The process scheduling management method according to claim 1, wherein the performing system resource scheduling on the target process by using a load scheduling process comprises:
acquiring a target load corresponding to each target process and an available load corresponding to each original CPU core;
determining at least one original CPU core corresponding to the available load larger than the target load as a CPU core to be selected;
and determining a target CPU core corresponding to the target process from at least one CPU core to be selected based on a preset process scheduling operation strategy.
5. The process scheduling management method according to claim 1, wherein the obtaining the target scheduling request includes:
monitoring the request quantity in a process request queue in real time, and monitoring whether an idle CPU core exists or not;
and if the number of the requests is not zero and idle CPU cores exist, sequentially acquiring target scheduling requests from the process request queue.
6. A process schedule management apparatus, comprising:
the target scheduling request acquisition module acquires a target scheduling request, wherein the target scheduling request comprises a target process and an expected CPU core;
the process scheduling instruction generation module is used for acquiring the current load rate of the expected CPU core, wherein the current load rate refers to the quotient of the sum of the number of processes running on the expected CPU core and the number of processes waiting for the processing of the CPU core divided by the number of processes which can be processed by the expected CPU core in a preset time period; generating a process scheduling instruction based on the current load rate and the load rate threshold value, including: comparing a load rate threshold with the current load rate of an expected CPU core, if the current load rate is not smaller than the load rate threshold, the load of the expected CPU core is larger, and a target process is not bound on the expected CPU core, so that a process return instruction is generated; the process return instruction is an instruction for returning a target process which is not bound with the expected CPU core to the load scheduling process to redistribute the CPU core;
the system resource scheduling module is configured to schedule system resources for the target process based on the process scheduling instruction, and includes: triggering a load scheduling process based on the process return instruction, and reallocating a CPU core with the available load larger than the target load of the target process to a target process which is not bound with the expected CPU core, and scheduling system resources of the target process by adopting the load scheduling process; the available load refers to available system resources in the original CPU core that remain in addition to the system resources of the process being processed in one processing cycle.
7. The process scheduling management apparatus according to claim 6, wherein the process scheduling instruction generating module comprises:
the process processing instruction generating unit is used for acquiring the current load rate of the expected CPU core, and generating a process processing instruction if the current load rate is smaller than the load rate threshold;
the system resource scheduling module comprises:
and the process binding processing unit is used for binding the target process on the expected CPU core based on the process processing instruction.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the process scheduling management method according to any one of claims 1 to 5 when executing the computer program.
9. A computer-readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the steps of the process schedule management method according to any one of claims 1 to 5.
CN201911121132.9A 2019-11-15 2019-11-15 Process scheduling management method, device, computer equipment and storage medium Active CN111104208B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911121132.9A CN111104208B (en) 2019-11-15 2019-11-15 Process scheduling management method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911121132.9A CN111104208B (en) 2019-11-15 2019-11-15 Process scheduling management method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111104208A CN111104208A (en) 2020-05-05
CN111104208B true CN111104208B (en) 2023-12-29

Family

ID=70420615

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911121132.9A Active CN111104208B (en) 2019-11-15 2019-11-15 Process scheduling management method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111104208B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112083946B (en) * 2020-09-17 2024-02-06 南方电网科学研究院有限责任公司 Method, device, terminal and medium for predicting program load rate of direct current protection system
CN112667373A (en) * 2020-12-17 2021-04-16 北京紫光展锐通信技术有限公司 Task scheduling method, device and system based on heterogeneous CPU architecture and storage medium
CN112579299B (en) * 2020-12-28 2022-11-18 北京紫光展锐通信技术有限公司 Resource scheduling method, electronic device and storage medium
CN112764933A (en) * 2021-01-27 2021-05-07 惠州Tcl移动通信有限公司 CPU configuration method, device, terminal and computer readable storage medium
CN113176906A (en) * 2021-04-25 2021-07-27 京东数字科技控股股份有限公司 Model management method, model management device, computer equipment and storage medium
CN116737346B (en) * 2023-08-14 2023-10-24 南京翼辉信息技术有限公司 Scheduling configuration system for large and small core processors and implementation method thereof

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105009083A (en) * 2013-12-19 2015-10-28 华为技术有限公司 Method and device for scheduling application process
CN108536538A (en) * 2018-03-13 2018-09-14 Oppo广东移动通信有限公司 Processor core dispatching method, device, terminal and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105009083A (en) * 2013-12-19 2015-10-28 华为技术有限公司 Method and device for scheduling application process
CN108536538A (en) * 2018-03-13 2018-09-14 Oppo广东移动通信有限公司 Processor core dispatching method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN111104208A (en) 2020-05-05

Similar Documents

Publication Publication Date Title
CN111104208B (en) Process scheduling management method, device, computer equipment and storage medium
US9430388B2 (en) Scheduler, multi-core processor system, and scheduling method
US20060288159A1 (en) Method of controlling cache allocation
CN108334396B (en) Data processing method and device, and resource group creation method and device
JP2014517434A (en) Computer-implemented method and computer system
JP2014520346A (en) Computer-implemented method and computer system
KR20130087257A (en) Method and apparatus for resource allocation of gpu
CN111338779B (en) Resource allocation method, device, computer equipment and storage medium
US20130097382A1 (en) Multi-core processor system, computer product, and control method
CN112256417B (en) Data request processing method and device and computer readable storage medium
US9037703B1 (en) System and methods for managing system resources on distributed servers
CN111309644B (en) Memory allocation method and device and computer readable storage medium
CN112905334A (en) Resource management method, device, electronic equipment and storage medium
CN111104219A (en) Binding method, device, equipment and storage medium of virtual core and physical core
CN110838987B (en) Queue current limiting method and storage medium
CN111625339A (en) Cluster resource scheduling method, device, medium and computing equipment
US9563532B1 (en) Allocation of tasks in large scale computing systems
CN113760543A (en) Resource management method and device, electronic equipment and computer readable storage medium
CN112948113A (en) Cluster resource management scheduling method, device, equipment and readable storage medium
CN105103138A (en) Embedded memory management scheme for real-time applications
CN111143063A (en) Task resource reservation method and device
US9405470B2 (en) Data processing system and data processing method
CN113760549B (en) Pod deployment method and device
CN111813564B (en) Cluster resource management method and device and container cluster management system
CN113127179A (en) Resource scheduling method and device, electronic equipment 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