CN117971473A - Offline task resource isolation method and device - Google Patents

Offline task resource isolation method and device Download PDF

Info

Publication number
CN117971473A
CN117971473A CN202410122028.6A CN202410122028A CN117971473A CN 117971473 A CN117971473 A CN 117971473A CN 202410122028 A CN202410122028 A CN 202410122028A CN 117971473 A CN117971473 A CN 117971473A
Authority
CN
China
Prior art keywords
offline
task
scheduling
online
online application
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
CN202410122028.6A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202410122028.6A priority Critical patent/CN117971473A/en
Publication of CN117971473A publication Critical patent/CN117971473A/en
Pending legal-status Critical Current

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Hardware Redundancy (AREA)

Abstract

The embodiment of the application provides a method and a device for isolating offline task resources, wherein the method comprises the following steps: detecting the offline state of a task process in a current task queue; scheduling the received offline task process through a pre-established offline scheduling class so as to enable an online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system; the application can overcome the problems of untimely online preemption, increased burrs, increased service failure times and the like, realizes the absolute preemption of the offline task process by the online application process and the classification load balancing of the online process by introducing an independent offline scheduling class, and effectively improves the isolation capability of the CPU resources of the online process and the offline process in an offline mixed part scene.

Description

Offline task resource isolation method and device
Technical Field
The application relates to the field of offline mixing parts, in particular to an offline task resource isolation method and device.
Background
In the current computing environment, improving the utilization rate of physical resources and reducing the operation cost are important core targets. The technology of off-line mixing part is widely accepted and recommended by the industry because of the capability of achieving the aim, and the technology is used for mixing and deploying on-line service and off-line service on the same physical resource. The utilization of the complementarity of the online and offline business on the tidal cycle of the resource usage effectively improves the utilization of the server resource.
At the heart of the offline hybrid technology is resource isolation, where CPU resources are the most important part of the system, and its isolation capability is particularly critical. In general, existing off-line blending schemes rely primarily on the fair scheduling class (fair_ sched _class) of Linux for CPU resource isolation.
In a CPU resource isolation scheme based on a fair scheduling class, resource isolation is achieved by configuring different priorities for processes of online and offline applications. In the method, the online service is given higher weight and the offline service is given lower weight in one scheduling period of the CPU. The weight determines the actual run time that the service gets in one CPU scheduling period, i.e. online service usually gets more run time, while offline service is relatively less.
However, since the fair scheduling policy ensures that each process has an opportunity to run for at least one scheduling period, it may cause on-line traffic to preempt CPU resources not in time, thereby increasing the response time and instability (glitch) of the system.
In addition, due to the untimely resource preemption, the number of online service processing failures may also increase. In scenarios where stringent requirements are placed on response time and system stability, the above-described problems are likely to limit the application of computing services in environments that efficiently handle large numbers of online and offline tasks.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides the off-line task resource isolation method and the off-line task resource isolation device, which can solve the problems of untimely on-line preemption, increased burrs, increased service failure times and the like, and realize the absolute preemption of the off-line task process by the on-line application process and the classification load balancing of the on-line process and the off-line process by introducing independent off-line scheduling classes, thereby effectively improving the isolation capability of the on-line process CPU resources and the off-line process under the off-line mixed part scene.
In order to solve at least one of the problems, the application provides the following technical scheme:
according to a first aspect of an embodiment of the present application, the present application provides an offline task resource isolation method, including:
detecting the offline state of a task process in a current task queue;
and scheduling the received offline task process through a pre-established offline scheduling class so as to enable the online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system.
According to any embodiment of the present application, before detecting the offline state of the task process in the current task queue, the method further includes:
And giving different scheduling identifications to the online application process and the offline task process, wherein the priority of the scheduling identification of the online application process is higher than that of the scheduling identification of the offline task process.
According to any embodiment of the present application, the scheduling, by means of the pre-created offline scheduling class, of the received offline task process, so that the online application process performs absolute preemption on the offline task process, includes:
and in response to the online application process needing to acquire the CPU resources, distributing CPU time slices in the current CPU scheduling period in preference to the offline task process.
According to any embodiment of the present application, the scheduling, by means of the pre-created offline scheduling class, of the received offline task process, so that the online application process performs absolute preemption on the offline task process, includes:
checking whether an online application process exists in the current running queue, if so, not entering the offline task process into the queue, and continuing to wait;
If the current running queue does not have the online application process, the offline task process enters the running queue, and a CPU time slice is distributed in the current CPU scheduling period.
According to any embodiment of the present application, the scheduling, by means of the pre-created offline scheduling class, of the received offline task process, so that the online application process performs absolute preemption on the offline task process, includes:
Checking whether the current CPU core needs to be awakened by an online application process, if so, outputting an operation queue by an offline task process, and inputting the online application process into the operation queue.
According to any embodiment of the application, further comprising:
In a multi-CPU core environment, the distribution of offline task processes among different CPU cores is adjusted to preferentially migrate the CPU cores of the offline tasks until the load among the whole CPU cores is balanced.
According to a second aspect of an embodiment of the present application, the present application provides an offline task resource isolation device, including:
The state judging module is used for: in response to receiving the task process, judging the offline state of the current task process;
An offline scheduling module, configured to: and scheduling the received offline task process through a pre-established offline scheduling class so as to enable the online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system.
According to any embodiment of the application, the system further comprises an identification module for:
And giving different scheduling identifications to the online application process and the offline task process, wherein the priority of the scheduling identification of the online application process is higher than that of the scheduling identification of the offline task process.
According to any embodiment of the present application, the offline scheduling module includes:
a priority operation unit configured to: and in response to the online application process needing to acquire the CPU resources, distributing CPU time slices in the current CPU scheduling period in preference to the offline task process.
According to any embodiment of the present application, the offline scheduling module includes:
A first priority operation unit configured to: checking whether an online application process exists in the current running queue, if so, not entering the offline task process into the queue, and continuing to wait;
A second priority operation unit configured to: if the current running queue does not have the online application process, the offline task process enters the running queue, and a CPU time slice is distributed in the current CPU scheduling period.
According to any embodiment of the present application, the offline scheduling module includes:
a second priority operation unit configured to: checking whether the current CPU core needs to be awakened by an online application process, if so, outputting an operation queue by an offline task process, and inputting the online application process into the operation queue.
According to any embodiment of the present application, the load balancing module is further configured to:
In a multi-CPU core environment, the distribution of offline task processes among different CPU cores is adjusted to preferentially migrate the CPU cores of the offline tasks until the load among the whole CPU cores is balanced.
According to a third aspect of the embodiments of the present application, there is provided an electronic device including a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the off-line task resource isolation method when executing the program.
According to a fourth aspect of embodiments of the present application, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the off-line task resource isolation method.
According to a fifth aspect of embodiments of the present application, there is provided a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the off-line task resource isolation method.
According to the technical scheme, the application provides an off-line task resource isolation method and device, and the off-line state of a task process in a current task queue is detected; scheduling the received offline task process through a pre-established offline scheduling class so as to enable an online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system; the problems of untimely online preemption, increased burrs, increased service failure times and the like can be solved, the absolute preemption of an offline task process by an online application process and the classification load balancing of the online process and the offline process are realized by introducing independent offline scheduling classes, and the isolation capability of CPU resources of the online process and the offline process in an offline mixed part scene is effectively improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to the above drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an off-line task resource isolation method according to an embodiment of the present application;
FIG. 2 is a second flowchart of an off-line task resource isolation method according to an embodiment of the present application;
FIG. 3 is a third flowchart of an off-line task resource isolation method according to an embodiment of the present application;
FIG. 4 is a flowchart of an off-line task resource isolation method according to an embodiment of the present application;
FIG. 5 is a flowchart of an off-line task resource isolation method according to an embodiment of the present application;
FIG. 6 is a flowchart of an off-line task resource isolation method according to an embodiment of the present application;
FIG. 7 is a flowchart of an off-line task resource isolation method according to an embodiment of the present application;
FIG. 8 is a block diagram of an off-line task resource isolation device in an embodiment of the application;
FIG. 9 is a second block diagram of an off-line task resource isolation device according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The technical scheme of the application obtains, stores, uses, processes and the like the data, which all meet the relevant regulations of national laws and regulations.
The application provides an off-line task resource isolation method and device, which can realize absolute occupation of off-line task processes by on-line application processes and classification load balancing of on-line and off-line processes by introducing independent off-line scheduling classes, thereby effectively improving the isolation capability of on-line and off-line process CPU resources in an off-line mixed part scene.
In order to solve the problems of untimely online preemption, increased burrs, increased service failure times and the like, the method realizes absolute preemption of an offline task process and classification load balancing of an online process and an offline process by introducing an independent offline scheduling class, and effectively improves the isolation capability of CPU resources of the online process and the offline process in an offline mixed part scene. The application provides an embodiment of an off-line task resource isolation method, referring to fig. 1, the off-line task resource isolation method specifically comprises the following contents:
Step S101: detecting the offline state of a task process in a current task queue;
First, the status of each task process in the task queue is identified and detected, particularly distinguishing between online and offline task processes. By way of example, the distinction can be made by analyzing the running mode, the resource occupancy mode or other identifiers of the task processes.
The accurate detection of the task state is a precondition for realizing effective resource scheduling, and in an offline mixed part environment, the accurate identification of online and offline tasks is critical for optimizing resource utilization and guaranteeing service quality.
Step S102: and scheduling the received offline task process through a pre-established offline scheduling class so as to enable the online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system.
The identified offline task process is processed using a pre-created offline scheduling class. The offline scheduling class has a lower priority than the fair scheduling class to which the online application process in the system belongs.
When the offline task process is identified, it will be scheduled according to the rules of the offline scheduling class, that is, the process will be in a lower priority on resource allocation. This scheduling ensures that the online application process can obtain priority on resource allocation even in the case of intense CPU resource competition.
By the method, the online application process can realize the absolute preemption of the offline task process. That is, when there are online and offline tasks running simultaneously in the system, the online tasks will preferentially acquire processing resources. The response efficiency and the processing speed of the online task are obviously improved, and meanwhile, the stable operation of the offline task is ensured.
In an embodiment of the off-line task resource isolation method of the present application, referring to fig. 2, before detecting an off-line state of a task process in a current task queue, the method further includes:
step S100: and giving different scheduling identifications to the online application process and the offline task process, wherein the priority of the scheduling identification of the online application process is higher than that of the scheduling identification of the offline task process.
Illustratively, the Linux operating system uses a scheduling class to manage CPU resources, deciding which process gets the CPU time slices at what time. Scheduling classes optimize resource allocation and system response time based on a complex series of algorithms.
Fair scheduling class (fair_ sched _class): is the default scheduling class in Linux systems for handling most standard processes. The offline task scheduling class (offline_ sched _class) provided by the application is specially designed for processing offline tasks.
In Linux systems, processes of different scheduling classes have different priorities. In the present application, the processes of the fair scheduling class (online application processes) are higher in priority than the processes of the offline task scheduling class. I.e. meaning that on resource allocation, the online application process will take precedence to get CPU time slices.
Each process is distinguished as to which scheduling class it belongs by assigning it a unique identification. Illustratively, the identification not only reflects the type of process (online or offline), but may also contain other information for scheduling decisions, such as priority, resource requirements, etc.
In an embodiment of the off-line task resource isolation method of the present application, referring to fig. 3, the scheduling of the received off-line task process by the pre-created off-line scheduling class, so that the on-line application process performs absolute preemption on the off-line task process, includes:
step S102A: and in response to the online application process needing to acquire the CPU resources, distributing CPU time slices in the current CPU scheduling period in preference to the offline task process.
Illustratively, when an online application process requests a CPU resource (e.g., in response to user input, processing instant data, etc.), the request will trigger a scheduling class of the operating system that detects the request for an online task and marks it as a high priority task.
The CPU scheduling period refers to a cycle in which the CPU allocates a time slice to a process. In the period, the CPU decides which process obtains the processing time according to the scheduling algorithm. The scheduling class may dynamically adjust the allocation of time slices in response to the urgency and importance of different processes during a given scheduling period.
When the online application process requests the CPU resource, the scheduling class will re-evaluate the current resource allocation, giving priority to the high priority process. This may result in the running low priority offline tasks being temporarily suspended to free up resources for the online tasks.
While offline task processes are ordered in a scheduling order after online application processes. The offline task process is considered when the needs of the online application process are satisfied. That is, offline tasks may experience some delay while waiting to acquire CPU resources.
In an embodiment of the off-line task resource isolation method of the present application, referring to fig. 4, the scheduling of the received off-line task process by the pre-created off-line scheduling class, so that the on-line application process performs absolute preemption on the off-line task process, may further specifically include the following contents:
Step S102B: checking whether an online application process exists in the current running queue, if so, not entering the offline task process into the queue, and continuing to wait;
Step S102C: if the current running queue does not have the online application process, the offline task process enters the running queue, and a CPU time slice is distributed in the current CPU scheduling period.
If the checking result shows that the running queue has an online application process, the offline task process is not added into the running queue. This means that the offline task needs to continue waiting until the processing requirements of the online task are met.
If there is no online application process in the run queue, then the offline task process will be added to the run queue. At this point, the offline task has gained the opportunity to acquire the CPU time slices.
In an operating system, a run queue is a list that manages waiting CPU time or running processes. The scheduling class periodically checks the run queue to determine if an online application process exists.
The above method enables the operating system to dynamically optimize its scheduling policy to accommodate changing task loads. On-line tasks get priority for their urgency, while off-line tasks get processed when resources are sufficient.
In an embodiment of the off-line task resource isolation method of the present application, referring to fig. 5, the scheduling of the received off-line task process by the pre-created off-line scheduling class, so that the on-line application process performs absolute preemption on the off-line task process, may further specifically include the following contents:
step S102D: checking whether the current CPU core needs to be awakened by an online application process, if so, outputting an operation queue by an offline task process, and inputting the online application process into the operation queue.
In an operating system, a process may temporarily stop executing while in a multitasking environment by waiting for some event or signal (e.g., hardware initialization, timer expiration, etc.). The process in the wait state is placed in a special queue called "wait queue" and marked as "sleep" state.
When a waiting event or signal occurs, the system needs to check and wake up the corresponding process. The "wake" process involves moving a process from the wait queue back to the run queue.
The priority of wake-up processes is determined based on the presence state to which they pertain. In the present application, the online application process has a higher priority than the offline task scheduling class. If it is found that there is an online application process that needs to wake up while checking the current CPU core, the system will pause or defer execution of the offline task process in the running queue. The offline task process will be removed from the run queue, while the online application process that needs to wake up will be added to the run queue.
The scheduling mechanism ensures that the system can quickly respond to the online application process requiring the emergency resource, thereby improving the overall system response performance and providing greater flexibility and efficiency for the operating system when processing various types of processes.
In an embodiment of the off-line task resource isolation method of the present application, referring to fig. 6, the following may be further specifically included:
Step S104: in a multi-CPU core environment, the distribution of offline task processes among different CPU cores is adjusted to preferentially migrate the CPU cores of the offline tasks until the load among the whole CPU cores is balanced.
The load balancing characterizes that the workload of all CPU cores in the system is approximately the same, and the condition that some cores are overloaded and other cores are idle is avoided.
In Linux systems, each CPU core executes a process according to the order of the run queues. The run queue determines which processes are to be allocated to the CPU time slices.
In a multi-core system, the operating system needs to continually redistribute processes among the various CPU cores to achieve load balancing. Since offline tasks typically have lower priorities and their processing requires less immediate responsiveness, the system prioritizes the scheduling of offline task processes when load balancing between CPU cores is required.
In order to avoid affecting the stability and response speed of the online application process as much as possible, the offline task process is preferably switched between the CPU cores, and the migration of the online application process is reduced as much as possible.
By the method, the system can effectively allocate and optimize the workload of each CPU core on the premise of not influencing the performance of the online task, and frequent scheduling and migration of online application processes are reduced, so that the stability and reliability of the online task are improved.
As can be seen from the above description, the offline task resource isolation method provided by the embodiment of the application improves the response efficiency of online tasks: by giving higher priority to the online application process in CPU scheduling, the online task is ensured to quickly obtain necessary CPU resources, so that the response speed and the processing efficiency are obviously improved.
In addition, by introducing independent offline task scheduling classes and implementing careful resource scheduling strategies, offline tasks, albeit with lower priority, can still be efficiently processed without affecting online tasks.
The system performance fluctuation caused by resource competition is reduced by accurate resource allocation and scheduling, and the overall stability of the system is enhanced.
The offline tasks are scheduled preferentially among the multiple CPU cores to complete load balancing, so that repeated migration scheduling of online application processes is reduced, and the overall performance and efficiency of the system are further improved. In online business, as required CPU resources can be acquired more quickly, the risks of processing delay and failure are greatly reduced in an application scene with higher requirements on real-time performance.
In order to further explain the scheme, the application also provides a specific application example of the method for implementing the off-line task resource isolation by applying the off-line task resource isolation device, referring to fig. 7, which specifically includes the following contents:
Step S01: and judging whether an online application process exists in the running queue in a short period. If yes, go to step S02, if not, go to step S03;
step S02: off-line tasks are not put into the queue and continue waiting;
step S03: the offline tasks are put into a queue and run;
Step S04: judging whether an online application process wakes up, if so, entering a step S05, and if not, entering a step S03;
step S05: on-line application processes enqueue, and off-line task processes dequeue and wait.
In particular, in an alternative embodiment, in the case of a cloud service, or a large data center environment, where a large number of online interactive applications (e.g., web services, real-time data analysis) and resource-intensive offline batch tasks (e.g., data mining, log analysis) need to be processed simultaneously, efficient management of CPU resources is critical to ensure responsiveness of the online applications and successful completion of the offline tasks.
Based on the method of the application, when the system is started, different scheduling identifications are distributed for all online application processes and offline task processes, so that the priority of the scheduling identifications of the online application processes is ensured to be higher than that of the offline task processes.
At operating system initialization, an offline scheduling class named "offline_ sched _class" is created, whose priority is set lower than the fair scheduling class.
All processes identified as offline tasks are assigned to the newly created scheduling class.
The system continuously monitors the current task queue and the load condition of each CPU core. When an online application process requests CPU resources, the system preferentially allocates CPU time slices to the process. If an online application process is detected to exist in the running queue, the system temporarily prevents an offline task process from entering the queue. Once the online application process completes the task or no additional CPU resources are needed, the offline task process is allowed to enter the run queue.
In each CPU scheduling cycle, it is checked whether there is an online application process that needs to be awakened. If so, the corresponding offline task process is moved out of the run queue for the online application process to execute preferentially.
In addition, the load condition among the CPU cores is continuously evaluated, and the offline task process is redistributed when necessary, so that the load balance among the CPU cores is realized. And the CPU cores of the offline tasks are preferentially migrated, so that the migration of the online task processes is reduced, and the stability of online service is ensured.
Through the implementation steps, the big data center in the embodiment can ensure high responsiveness and stability of online application, simultaneously effectively process a large number of offline tasks and optimize the overall use efficiency of CPU resources.
In order to solve the problems of untimely online preemption, increased burrs, increased service failure times and the like, the method realizes absolute preemption of an offline task process and classification load balancing of an online process and an offline process by introducing an independent offline scheduling class, and effectively improves the isolation capability of CPU resources of the online process and the offline process in an offline mixed part scene. The present application provides an embodiment of an offline task resource isolation device for implementing all or part of the content of the offline task resource isolation method, referring to fig. 8, the offline task resource isolation device specifically includes the following contents:
A state judgment module 1101, configured to: in response to receiving the task process, judging the offline state of the current task process;
An offline scheduling module 1102, configured to: and scheduling the received offline task process through a pre-established offline scheduling class so as to enable the online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system.
According to any embodiment of the application, the system further comprises an identification module for:
And giving different scheduling identifications to the online application process and the offline task process, wherein the priority of the scheduling identification of the online application process is higher than that of the scheduling identification of the offline task process.
According to any embodiment of the present application, the offline scheduling module includes:
a priority operation unit configured to: and in response to the online application process needing to acquire the CPU resources, distributing CPU time slices in the current CPU scheduling period in preference to the offline task process.
According to any embodiment of the present application, referring to fig. 9, the offline scheduling module includes:
a first priority operation unit 1102A, configured to: checking whether an online application process exists in the current running queue, if so, not entering the offline task process into the queue, and continuing to wait;
A second priority operation unit 1102B for: if the current running queue does not have the online application process, the offline task process enters the running queue, and a CPU time slice is distributed in the current CPU scheduling period.
According to any embodiment of the present application, the offline scheduling module includes:
a second priority operation unit configured to: checking whether the current CPU core needs to be awakened by an online application process, if so, outputting an operation queue by an offline task process, and inputting the online application process into the operation queue.
According to any embodiment of the present application, the load balancing module is further configured to:
In a multi-CPU core environment, the distribution of offline task processes among different CPU cores is adjusted to preferentially migrate the CPU cores of the offline tasks until the load among the whole CPU cores is balanced.
According to a third aspect of the embodiments of the present application, there is provided an electronic device including a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the off-line task resource isolation method when executing the program.
As can be seen from the above description, the offline task resource isolation device provided by the embodiment of the application can realize absolute occupation of the offline task process by the online application process and classification load balancing of the online process by introducing an independent offline scheduling class, thereby effectively improving the isolation capability of the online process and the offline process CPU resources in an offline mixed part scene.
In order to solve the problems of untimely online preemption, increased burrs, increased service failure times and the like in the hardware level, the method realizes absolute preemption of an offline task process by an online application process and classification load balancing of the online process and the offline process by introducing an independent offline scheduling class, and effectively improves the isolation capability of CPU resources of the online process and the offline process in an offline mixed part scene. The application provides an embodiment of an electronic device for realizing all or part of contents in the off-line task resource isolation method, which specifically comprises the following contents:
A processor (processor), a memory (memory), a communication interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete communication with each other through the bus; the communication interface is used for realizing information transmission between the off-line task resource isolation device and related equipment such as a core service system, a user terminal, a related database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, etc., and the embodiment is not limited thereto. In this embodiment, the logic controller may refer to an embodiment of the offline task resource isolation method and an embodiment of the offline task resource isolation device in the embodiments, and the contents thereof are incorporated herein, and are not repeated here.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Wherein, intelligent wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the off-line task resource isolation method may be performed on the electronic device side as described above, or all operations may be performed in the client device. Specifically, the selection may be made according to the processing capability of the client device, and restrictions of the use scenario of the user. The application is not limited in this regard. If all operations are performed in the client device, the client device may further include a processor.
The client device may have a communication module (i.e. a communication unit) and may be connected to a remote server in a communication manner, so as to implement data transmission with the server. The server may include a server on the side of the task scheduling center, and in other implementations may include a server of an intermediate platform, such as a server of a third party server platform having a communication link with the task scheduling center server. The server may include a single computer device, a server cluster formed by a plurality of servers, or a server structure of a distributed device.
Fig. 10 is a schematic block diagram of a system configuration of an electronic device 9600 according to an embodiment of the present application. As shown in fig. 10, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 10 is exemplary; other types of structures may also be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one embodiment, the offline task resource isolation method functionality may be integrated into the central processor 9100.
The central processor 9100 may be configured to perform the following control:
Step S101: detecting the offline state of a task process in a current task queue;
Step S102: and scheduling the received offline task process through a pre-established offline scheduling class so as to enable the online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system.
As can be seen from the above description, the electronic device provided by the embodiment of the application realizes absolute occupation of the offline task process and classification load balancing of the online process by the online application process through introducing the independent offline scheduling class, and effectively improves the isolation capability of the online process and the offline process CPU resources in the offline mixed part scene.
In another embodiment, the off-line task resource isolation device may be configured separately from the central processor 9100, for example, the off-line task resource isolation device may be configured as a chip connected to the central processor 9100, and the off-line task resource isolation method function is implemented under the control of the central processor.
As shown in fig. 10, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 need not include all of the components shown in fig. 10; in addition, the electronic device 9600 may further include components not shown in fig. 10, and reference may be made to the related art.
As shown in fig. 10, the central processor 9100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, which central processor 9100 receives inputs and controls the operation of the various components of the electronic device 9600.
The memory 9140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the central processor 9100 can execute the program stored in the memory 9140 to realize information storage or processing, and the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 9140 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, etc. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 storing application programs and function programs or a flow for executing operations of the electronic device 9600 by the central processor 9100.
The memory 9140 may also include a data store 9143, the data store 9143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. A communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of conventional mobile communication terminals.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and to receive audio input from the microphone 9132 to implement usual telecommunications functions. The audio processor 9130 can include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100 so that sound can be recorded locally through the microphone 9132 and sound stored locally can be played through the speaker 9131.
The embodiment of the present application further provides a computer readable storage medium capable of implementing all the steps in the offline task resource isolation method in which the execution subject is a server or a client in the above embodiment, and the computer readable storage medium stores a computer program thereon, where the computer program when executed by a processor implements all the steps in the offline task resource isolation method in which the execution subject is a server or a client in the above embodiment, for example, the processor implements the following steps when executing the computer program:
Step S101: detecting the offline state of a task process in a current task queue;
Step S102: and scheduling the received offline task process through a pre-established offline scheduling class so as to enable the online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system.
As can be seen from the above description, the computer readable storage medium provided by the embodiment of the present application realizes absolute occupation of the offline task process by the online application process and classification load balancing of the online process and the offline process by introducing an independent offline scheduling class, thereby effectively improving the isolation capability of the CPU resources of the online process and the offline process in the offline mixed portion scenario.
The embodiment of the present application further provides a computer program product capable of implementing all the steps in the offline task resource isolation method in which the execution subject is a server or a client in the above embodiment, where the computer program/instructions implement the steps of the offline task resource isolation method when executed by a processor, for example, the computer program/instructions implement the steps of:
Step S101: detecting the offline state of a task process in a current task queue;
Step S102: and scheduling the received offline task process through a pre-established offline scheduling class so as to enable the online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system.
The computer program product realizes absolute occupation of the online application process on the offline task process and classification load balancing of the online process and the offline process by introducing an independent offline scheduling class, and effectively improves the isolation capability of the CPU resources of the online process and the offline process in an offline mixed part scene.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. The computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
The computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principles and embodiments of the present invention have been described in detail with reference to specific examples, which are provided to facilitate understanding of the method and core ideas of the present invention; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (10)

1. An off-line task resource isolation method, comprising:
detecting the offline state of a task process in a current task queue;
and scheduling the received offline task process through a pre-established offline scheduling class so as to enable the online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system.
2. The method of claim 1, further comprising, prior to detecting an offline state of a task process in a current task queue:
And giving different scheduling identifications to the online application process and the offline task process, wherein the priority of the scheduling identification of the online application process is higher than that of the scheduling identification of the offline task process.
3. The method for isolating offline task resources according to claim 1, wherein the scheduling, by the pre-created offline scheduling class, the received offline task process so that the online application process performs absolute preemption on the offline task process includes:
and in response to the online application process needing to acquire the CPU resources, distributing CPU time slices in the current CPU scheduling period in preference to the offline task process.
4. The method for isolating offline task resources according to claim 1, wherein the scheduling, by the pre-created offline scheduling class, the received offline task process so that the online application process performs absolute preemption on the offline task process includes:
checking whether an online application process exists in the current running queue, if so, not entering the offline task process into the queue, and continuing to wait;
If the current running queue does not have the online application process, the offline task process enters the running queue, and a CPU time slice is distributed in the current CPU scheduling period.
5. The method for isolating offline task resources according to claim 1, wherein the scheduling, by the pre-created offline scheduling class, the received offline task process so that the online application process performs absolute preemption on the offline task process includes:
Checking whether the current CPU core needs to be awakened by an online application process, if so, outputting an operation queue by an offline task process, and inputting the online application process into the operation queue.
6. The offline task resource isolation method according to claim 1, further comprising:
In a multi-CPU core environment, the distribution of offline task processes among different CPU cores is adjusted to preferentially migrate the CPU cores of the offline tasks until the load among the whole CPU cores is balanced.
7. An off-line task resource isolation device, the device comprising:
The state judging module is used for: in response to receiving the task process, judging the offline state of the current task process;
An offline scheduling module, configured to: and scheduling the received offline task process through a pre-established offline scheduling class so as to enable the online application process to absolutely preempt the offline task process, wherein the priority of the offline scheduling class is lower than the priority of a fair scheduling class to which the online application process belongs in the current system.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the off-line task resource isolation method of any one of claims 1 to 6 when the program is executed by the processor.
9. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the off-line task resource isolation method of any of claims 1 to 6.
10. A computer program product comprising computer programs/instructions which when executed by a processor implement the steps of the off-line task resource isolation method of any of claims 1 to 6.
CN202410122028.6A 2024-01-29 2024-01-29 Offline task resource isolation method and device Pending CN117971473A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410122028.6A CN117971473A (en) 2024-01-29 2024-01-29 Offline task resource isolation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410122028.6A CN117971473A (en) 2024-01-29 2024-01-29 Offline task resource isolation method and device

Publications (1)

Publication Number Publication Date
CN117971473A true CN117971473A (en) 2024-05-03

Family

ID=90863805

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410122028.6A Pending CN117971473A (en) 2024-01-29 2024-01-29 Offline task resource isolation method and device

Country Status (1)

Country Link
CN (1) CN117971473A (en)

Similar Documents

Publication Publication Date Title
CN109298936B (en) Resource scheduling method and device
CN109992403B (en) Optimization method and device for multi-tenant resource scheduling, terminal equipment and storage medium
CN109766172B (en) Asynchronous task scheduling method and device
CN107832143B (en) Method and device for processing physical machine resources
CN108600005A (en) A method of defence micro services avalanche effect
CN105589750A (en) CPU (Central Processing Unit) resource scheduling method and server
CN113032152B (en) Scheduling method, scheduling apparatus, electronic device, storage medium, and program product for deep learning framework
CN112380020A (en) Computing power resource allocation method, device, equipment and storage medium
CN112600878B (en) Data transmission method and device
CN112783659A (en) Resource allocation method and device, computer equipment and storage medium
CN112162835A (en) Scheduling optimization method for real-time tasks in heterogeneous cloud environment
CN111445331A (en) Transaction matching method and device
CN113722056A (en) Task scheduling method and device, electronic equipment and computer readable medium
CN114371926B (en) Refined resource allocation method and device, electronic equipment and medium
CN112888005A (en) MEC-oriented distributed service scheduling method
CN113986497B (en) Queue scheduling method, device and system based on multi-tenant technology
CN111597044A (en) Task scheduling method and device, storage medium and electronic equipment
CN115658311A (en) Resource scheduling method, device, equipment and medium
CN114968567A (en) Method, apparatus and medium for allocating computing resources of a compute node
CN113326025A (en) Single cluster remote continuous release method and device
CN112905338A (en) Automatic allocation method and device for computing resources
CN116450290A (en) Computer resource management method and device, cloud server and storage medium
CN109189581B (en) Job scheduling method and device
CN108829516B (en) Resource virtualization scheduling method for graphic processor
CN117971473A (en) Offline task resource isolation method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination