Job scheduling method and device in hybrid deployment scenario and electronic equipment

By prioritizing the execution of online jobs in hybrid deployment scenarios and using a restricted queue to process offline jobs, the problems of low efficiency and poor service quality of online jobs are solved, achieving efficient utilization of CPU resources and priority processing of online jobs.

CN115809126BActive Publication Date: 2026-03-17JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-14
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

In internet companies' servers, low CPU utilization is a common problem, especially in scenarios where online and offline services are deployed together, resulting in low efficiency and poor service quality for online jobs.

Method used

When selecting jobs to be processed in the ready job queue, online jobs are executed first to avoid interference from offline jobs. A restricted queue mechanism is used to temporarily store offline jobs until an online job is selected, at which point the offline jobs are executed.

Benefits of technology

It improves CPU resource utilization, ensures the running efficiency and service quality of online jobs, and optimizes the execution efficiency of offline jobs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115809126B_ABST
    Figure CN115809126B_ABST
Patent Text Reader

Abstract

The application provides a job scheduling method and device in a hybrid deployment scenario and electronic equipment. The method comprises the following steps: selecting a to-be-processed job from a ready job queue of a processor; when the to-be-processed job is an offline job and there is an online job in the ready job queue, pushing the to-be-processed job into a limit queue, and reselecting the to-be-processed job until the selected to-be-processed job is an online job; and scheduling an online job process in the selected online job to execute the online job, so as to realize the priority execution of the online job in the ready job queue of the processor, avoid the interference of the offline job on the online job, improve the resource utilization, and ensure the running efficiency and service quality of the online job.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a job scheduling method, apparatus and electronic device for hybrid deployment scenarios. Background Technology

[0002] Currently, internet companies possess massive numbers of servers, most of which run only interactive, latency-sensitive online services, resulting in very low CPU utilization. To improve server CPU utilization, it's necessary to deploy some CPU-intensive but latency-insensitive offline services alongside the servers running online services.

[0003] In related technologies, in scenarios where online and offline services are deployed in a mixed manner, the online operations in the online services have low operating efficiency and poor service quality. Summary of the Invention

[0004] This application aims to at least partially address one of the technical problems in the related art.

[0005] This application proposes a job scheduling method, apparatus, and electronic device for hybrid deployment scenarios, which prioritizes the execution of online jobs in the processor's ready job queue. After the online jobs are completed, offline jobs are then executed, avoiding interference from offline jobs to online jobs. This ensures the operational efficiency and service quality of online jobs while improving resource utilization.

[0006] The first aspect of this application proposes a job scheduling method in a hybrid deployment scenario, applied to a CPU processor in a hybrid deployment scenario, the method comprising:

[0007] Select a job to be processed from the processor's ready job queue;

[0008] When the pending job is an offline job and there is an online job in the ready job queue, the pending job is pushed into the limit queue, and a new pending job is selected until the selected pending job is an online job.

[0009] The selected online job process is scheduled to execute the online job.

[0010] The job scheduling method in the hybrid deployment scenario of this application embodiment involves the CPU processor in the hybrid deployment scenario selecting a job to be processed from the processor's ready job queue; when the job to be processed is an offline job and there are online jobs in the ready job queue, the job to be processed is pushed into a restriction queue, and a job to be processed is reselected until the selected job to be processed is an online job; the online job process in the selected online job is scheduled to execute the online job, thereby achieving priority execution of online jobs in the processor's ready job queue, avoiding interference from offline jobs to online jobs, and ensuring the running efficiency and service quality of online jobs while improving resource utilization.

[0011] A second aspect of this application provides a job scheduling device for a hybrid deployment scenario, applied to a CPU processor in a hybrid deployment scenario, the device comprising:

[0012] The selection module is used to select jobs to be processed from the processor's ready job queue;

[0013] The processing module is used to push the pending job into the restriction queue and reselect the pending job when the pending job is an offline job and there is an online job in the ready job queue, until the selected pending job is an online job.

[0014] The scheduling module is used to schedule the selected online job processes to execute the online job.

[0015] The job scheduling device in the hybrid deployment scenario of this application embodiment selects a job to be processed from the ready job queue of the CPU processor in the hybrid deployment scenario; when the job to be processed is an offline job and there is an online job in the ready job queue, the job to be processed is pushed into the restriction queue, and a job to be processed is reselected until the selected job to be processed is an online job; the online job process in the selected online job is scheduled to execute the online job, thereby realizing the priority execution of online jobs in the ready job queue of the processor, avoiding interference of offline jobs to online jobs, and ensuring the running efficiency and service quality of online jobs while improving resource utilization.

[0016] A third aspect of this application provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute the job scheduling method for a hybrid deployment scenario proposed in the first aspect of this application.

[0017] The fourth aspect of this application provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the job scheduling method for a hybrid deployment scenario proposed in the first aspect of this application.

[0018] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0019] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0020] Figure 1 This is a flowchart illustrating the job scheduling method in a hybrid deployment scenario provided in Embodiment 1 of this application;

[0021] Figure 2 A schematic diagram of the ready job queue;

[0022] Figure 3 This diagram illustrates how, after online jobs in the ready job queue have completed execution, offline jobs in the queue are restricted from returning to the ready job queue.

[0023] Figure 4 This is a flowchart illustrating the job scheduling method in a hybrid deployment scenario provided in Embodiment 2 of this application;

[0024] Figure 5 This is a schematic diagram of the job scheduling device in a hybrid deployment scenario provided in Embodiment 3 of this application;

[0025] Figure 6 A block diagram of an exemplary computer device suitable for implementing embodiments of the present application is shown. Detailed Implementation

[0026] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0027] Currently, internet companies possess massive numbers of servers, most of which run only interactive, latency-sensitive online services, resulting in very low CPU utilization. To improve server CPU utilization, it's necessary to deploy some CPU-intensive but latency-insensitive offline services alongside the servers running online services.

[0028] In related technologies, in scenarios where online and offline services are deployed in a mixed manner, the online operations in the online services have low operating efficiency and poor service quality.

[0029] Therefore, this application mainly addresses the technical problems of low operating efficiency and poor service quality of online jobs in hybrid deployment scenarios in related technologies, and proposes a job scheduling method, device and electronic equipment for hybrid deployment scenarios.

[0030] The job scheduling method in the hybrid deployment scenario of this application embodiment involves the CPU processor in the hybrid deployment scenario selecting a job to be processed from the processor's ready job queue; when the job to be processed is an offline job and there are online jobs in the ready job queue, the job to be processed is pushed into a restriction queue, and a job to be processed is reselected until the selected job to be processed is an online job; the online job process in the selected online job is scheduled to execute the online job, thereby achieving priority execution of online jobs in the processor's ready job queue, avoiding interference from offline jobs to online jobs, and ensuring the running efficiency and service quality of online jobs while improving resource utilization.

[0031] The following description, with reference to the accompanying drawings, describes a job scheduling method, apparatus, and electronic device in a hybrid deployment scenario according to embodiments of this application.

[0032] Figure 1 This is a flowchart illustrating the job scheduling method in a hybrid deployment scenario provided in Embodiment 1 of this application.

[0033] This application embodiment illustrates the use of a job scheduling method in a hybrid deployment scenario configured in a job scheduling device in a hybrid deployment scenario. This job scheduling device in a hybrid deployment scenario can be applied to any electronic device, or to the CPU processor in an electronic device, or to the Completely Fair Scheduler (CFS) in the CPU processor, so that the electronic device can perform job scheduling functions in a hybrid deployment scenario.

[0034] The electronic devices can be personal computers (PCs), cloud devices, mobile devices, etc. Mobile devices can be hardware devices with various operating systems, touch screens, and / or displays, such as mobile phones, tablets, personal digital assistants, wearable devices, and in-vehicle devices. In the following embodiments, the job scheduling device in a hybrid deployment scenario is described using the CPU processor in the hybrid deployment scenario as an example.

[0035] like Figure 1 As shown, the job scheduling method in this hybrid deployment scenario may include the following steps:

[0036] Step 101: Select a job to be processed from the processor's ready job queue.

[0037] In this embodiment, the jobs in the ready job queue are jobs that the processor is waiting to process or execute. In related technologies, regardless of whether a job process is offline or online, it will occupy some CPU resources to run after creation or wake-up, potentially causing interruption of the currently running process. To avoid the aforementioned impact of offline job processes on online job processes, in this embodiment, the CPU processor's update process for the ready job queue can, for example, involve obtaining created or woken-up offline job processes; and updating the offline job to the corresponding offline job in the ready job queue when the offline job to which the offline job process belongs is located.

[0038] In other words, in this embodiment, after an online job process is created or woken up, the CPU processor can allocate resources to run the online job process; however, after an offline job process is created or woken up, the CPU processor does not allocate resources to run the offline job process, but instead updates the offline job process to the offline job list in the ready job queue. This avoids the impact of the creation or wake-up of offline job processes on the running online job processes.

[0039] In this embodiment, the CPU processor can create a container for each job, used for the execution of that job. For example, a container can be created for each online job; a container can be created for each offline job. The container is used to utilize the CPU processor's resources to run the various job processes within the corresponding job.

[0040] In this embodiment, the ready job queue can be represented, for example, as a red-black tree. A red-black tree is a self-balancing binary search tree, a data structure used in computer science, typically for implementing associative arrays. Figure 2 The image shown is a schematic diagram of the ready job queue. Figure 2 In CFS-RQ, the ready job queue can include online jobs and offline jobs. Offline CFS-RQ represents offline jobs, which includes multiple job processes; these offline job processes include, for example... Figure 2 The offline SE is shown in the image. Online CFS-RQ represents online jobs, which include multiple job processes within the online job; these online job processes include, for example... Figure 2 The online version of SE is shown in the image.

[0041] In this embodiment of the application, a job to be processed can be selected from the ready job queue according to a certain selection strategy using the cfs pick next class.

[0042] Step 102: When the pending job is an offline job and there is an online job in the ready job queue, push the pending job into the limit queue and reselect the pending job until the selected pending job is an online job.

[0043] In this application embodiment, online jobs are characterized by at least one of the following features: long running time, latency sensitivity, and resource tidal phenomenon. Offline jobs are characterized by at least one of the following features: short running time, high computational requirements, high fault tolerance, latency insensitivity, and allowance for rerunning. Examples of offline jobs include MapReduce jobs and Spark jobs in the Hadoop ecosystem.

[0044] It should be noted that the ready job queue is marked with a flag indicating whether there are online jobs in the ready job queue. Specifically, when the flag is a first value, it indicates that there are online jobs in the ready job queue; when the flag is a value other than the first value, it indicates that there are no online jobs in the ready job queue.

[0045] Among them, the ready job queue is Figure 2 As shown in the example, when the job to be processed is an offline job and there are online jobs in the ready job queue, the job to be processed is pushed into the limit queue. For example, the job to be processed is put into the percpu thrott leli st through the thrott le action. Figure 2 In this context, percpu thrott leli st represents a restricted queue.

[0046] Step 103: Schedule the online job process from the selected online jobs to execute the online job.

[0047] In this embodiment, the selected online job may include multiple online job processes. The CPU processor can sequentially schedule each online job process within the online job, allocating CPU resources to the container where the online job resides, so that the container can utilize the CPU resources to run the online job process. Once all the online job processes included in the online job have completed running, the online job is determined to have completed execution.

[0048] In this embodiment of the application, after step 103, the method may further include the following steps: after the online jobs in the ready job queue are executed, the offline jobs in the restriction queue are returned to the ready job queue.

[0049] Among them, such as Figure 3 The diagram illustrates how, after an online job in the ready job queue completes its execution, an offline job in the queue is returned to the ready job queue. Figure 3 Once all online job processes in the ready job queue have completed execution, the offline jobs in the limit queue are returned to the ready job queue. The action of returning offline jobs from the limit queue to the ready job queue can be, for example, `unthrott le`.

[0050] In this embodiment of the application, the method further includes: when the job to be processed is an offline job and there is no online job in the ready job queue, scheduling the offline job process of the selected offline job to execute the offline job; or, when the job to be processed is an online job, scheduling the online job process of the selected online job to execute the online job.

[0051] Among these, the pending jobs are online jobs, and there are two scenarios. The first scenario is that there are no offline jobs in the ready job queue. The second scenario is that there are offline jobs in the ready job queue. In both scenarios, the queue may or may not contain offline jobs.

[0052] The job scheduling method in the hybrid deployment scenario of this application embodiment involves the CPU processor in the hybrid deployment scenario selecting a job to be processed from the processor's ready job queue; when the job to be processed is an offline job and there are online jobs in the ready job queue, the job to be processed is pushed into a restriction queue, and a new job to be processed is selected until the selected job to be processed is an online job; the online job process in the selected online job is scheduled to execute the online job, thereby achieving priority execution of online jobs in the processor's ready job queue, avoiding interference from offline jobs to online jobs, and ensuring the running efficiency and service quality of online jobs while improving resource utilization.

[0053] Figure 4 This is a flowchart illustrating the job scheduling method in a hybrid deployment scenario provided in Embodiment 2 of this application.

[0054] like Figure 4 As shown, in Figure 1 Based on the illustrated embodiment, the job scheduling method in this hybrid deployment scenario may further include the following steps:

[0055] Step 401: Select a job to be processed from the processor's ready job queue.

[0056] Step 402: When the job to be processed is an offline job and there is an online job in the ready job queue, push the job to be processed into the limit queue and reselect the job to be processed until the selected job to be processed is an online job.

[0057] Step 403: Schedule the online job process from the selected online jobs to execute the online job.

[0058] Step 404: Obtain the first offline job in the restriction queue according to the restriction duration of the offline job in the restriction queue; wherein the restriction duration of the first offline job is greater than the preset restriction duration threshold.

[0059] In this embodiment of the application, when an offline job is pushed into the restriction queue, the restriction duration of the offline job can be timed and the timed restriction duration can be obtained; when the restriction duration is greater than the preset restriction duration threshold, the offline job is regarded as the first offline job.

[0060] Step 405: Add a sleep condition to the offline job process of the first offline job to obtain the processed first offline job; wherein, when the sleep condition is met, the first offline job is transferred to the sleep queue.

[0061] The sleep condition may include, for example, a sleep trigger position, which can be a specific position of the offline job process. When the offline job process is running and reaches that specific position, the sleep condition is met.

[0062] Step 406: Return the processed first offline job to the ready job queue.

[0063] In this embodiment of the application, after the processed first offline job is put back into the ready job queue, if the CPU processor selects the first offline job from the ready job queue, it can schedule the offline job process from the first offline job. After scheduling the offline job process and running the offline job process, if it runs to the sleep trigger position in the offline job process, the sleep condition is met, and the first offline job is transferred to the sleep queue.

[0064] In this embodiment, the sleep conditions may further include the required sleep duration. Correspondingly, the method may further include the following steps: when a second offline job exists in the sleep queue, the second offline job is transferred to the ready job queue; wherein the actual sleep duration of the second offline job is greater than or equal to the required sleep duration. The sleep queue includes multiple first offline jobs, and the multiple first offline jobs include the second offline job.

[0065] Specifically, for the first offline job in the sleep queue, the sleep duration is timed when the first offline job is transferred to the sleep queue; when the actual sleep duration of the first offline job is greater than the required sleep duration, the first offline job is transferred to the ready job queue as the second offline job, and the ready job queue is updated.

[0066] It should be noted that when transferring the second offline job to the ready job queue, the sleep condition in the second offline job can be deleted.

[0067] Among them, the transfer processing of offline jobs in the restricted queue can shorten the length of the restricted queue, reduce the time spent putting offline jobs back into the ready job queue, and further improve the running efficiency and service quality of offline jobs.

[0068] The descriptions of steps 401 to 403 can be found in [reference needed]. Figure 1 The detailed description of steps 101 to 103 in the illustrated embodiment will not be repeated here.

[0069] The job scheduling method in a hybrid deployment scenario according to this application embodiment involves the CPU processor selecting a job to be processed from the processor's ready job queue. If the job to be processed is an offline job and there are online jobs in the ready job queue, the job to be processed is pushed into a restricted queue, and a new job is selected until the selected job is an online job. The online job process within the selected online job is scheduled to execute the online job. Based on the restricted duration of the offline jobs in the restricted queue, a first offline job is obtained from the restricted queue, wherein the restricted duration of the first offline job is greater than a preset restricted duration threshold. A sleep condition is added to the offline job process of the first offline job to obtain a processed first offline job. When the sleep condition is met, the first offline job is transferred to the sleep queue. The processed first offline job is then returned to the ready job queue. This achieves priority execution of online jobs in the processor's ready job queue, avoids interference from offline jobs to online jobs, improves the operating efficiency and service quality of online jobs, and ensures the operating efficiency and service quality of offline jobs.

[0070] Figure 5 This is a schematic diagram of the job scheduling device in a hybrid deployment scenario provided in Embodiment 3 of this application.

[0071] like Figure 5 As shown, the job scheduling device 500 in the hybrid deployment scenario is applied to the CPU processor in the hybrid deployment scenario and may include: a selection module 510, a processing module 520 and a scheduling module 530.

[0072] The selection module 510 is used to select a job to be processed from the ready job queue of the processor.

[0073] The processing module 520 is used to push the pending job into the restriction queue and reselect the pending job when the pending job is an offline job and there is an online job in the ready job queue, until the selected pending job is an online job.

[0074] The scheduling module 530 is used to schedule the selected online job processes to execute the online job.

[0075] Furthermore, in one possible implementation of this application embodiment, the processing module 520 is further configured to, after the online jobs in the ready job queue have been executed, return the offline jobs in the restriction queue to the ready job queue.

[0076] Furthermore, in one possible implementation of this application embodiment, the processing module 520 is further configured to, when the job to be processed is an offline job and there is no online job in the ready job queue, schedule an offline job process among the selected offline jobs to execute the offline job; or, when the job to be processed is an online job, schedule an online job process among the selected online jobs to execute the online job.

[0077] Furthermore, in one possible implementation of this application embodiment, the apparatus further includes: an acquisition module; the acquisition module is configured to acquire a first offline job in the restriction queue according to the restriction duration of offline jobs in the restriction queue; wherein the restriction duration of the first offline job is greater than a preset restriction duration threshold; the processing module 520 is further configured to add a sleep condition to the offline job process of the first offline job to obtain a processed first offline job; wherein when the sleep condition is met, the first offline job is transferred to the sleep queue; and the processed first offline job is returned to the ready job queue.

[0078] Furthermore, in one possible implementation of this application embodiment, the sleep conditions include the required sleep duration, and the processing module 520 is further configured to transfer the second offline job to the ready job queue when there is a second offline job in the sleep queue; wherein the actual sleep duration of the second offline job is greater than or equal to the required sleep duration.

[0079] Furthermore, in one possible implementation of this application embodiment, the processing module 520 is further configured to: obtain an offline job process that has been created or awakened; and when the offline job to which the offline job process belongs is located in the ready job queue, update the offline job process to the offline job to which it belongs in the ready job queue.

[0080] Furthermore, in one possible implementation of this application embodiment, the ready job queue is equipped with a marker, the marker indicating whether there are online jobs in the ready job queue.

[0081] It should be noted that the explanations in the aforementioned Embodiment 1 also apply to the job scheduling device in the hybrid deployment scenario of this embodiment, and will not be repeated here.

[0082] The job scheduling device in the hybrid deployment scenario of this application embodiment selects a job to be processed from the ready job queue of the CPU processor in the hybrid deployment scenario; when the job to be processed is an offline job and there is an online job in the ready job queue, the job to be processed is pushed into the restriction queue, and a job to be processed is reselected until the selected job to be processed is an online job; the online job process in the selected online job is scheduled to execute the online job, thereby realizing the priority execution of online jobs in the ready job queue of the processor, avoiding interference of offline jobs to online jobs, and ensuring the running efficiency and service quality of online jobs while improving resource utilization.

[0083] To implement the above embodiments, this application also proposes an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute the job scheduling method for a hybrid deployment scenario proposed in the foregoing embodiments of this application.

[0084] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the job scheduling method in a hybrid deployment scenario as proposed in the foregoing embodiments of this application.

[0085] Figure 6 A block diagram of an exemplary computer device suitable for implementing embodiments of the present application is shown. Figure 6 The computer device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0086] like Figure 6 As shown, the computer device 12 is represented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing unit 16).

[0087] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0088] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0089] Memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 6 Not shown; usually referred to as a "hard drive"). Although Figure 6 As not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disc drive for reading and writing to a removable non-volatile optical disc (e.g., a compact disc read-only memory (CD-ROM), a digital video disc read-only memory (DVD-ROM), or other optical media). In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.

[0090] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of this application.

[0091] Computer device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with computer device 12, and / or with any device that enables computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0092] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the methods mentioned in the foregoing embodiments.

[0093] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0094] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0095] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0096] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0097] It should be understood that various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0098] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0099] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0100] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.

Claims

1. A method for job scheduling in a hybrid deployment scenario, characterized in that, The method applied to a CPU processor in a hybrid deployment scenario comprises: selecting a to-be-processed job from a ready job queue of the processor; when the to-be-processed job is an offline job and there is an online job in the ready job queue, pushing the to-be-processed job into a limit queue, and reselecting a to-be-processed job until the selected to-be-processed job is an online job; scheduling an online job process in the selected online job to execute the online job; according to a limit duration of an offline job in the limit queue, obtaining a first offline job in the limit queue; wherein the limit duration of the first offline job is greater than a preset limit duration threshold; adding a sleep condition in an offline job process of the first offline job to obtain a processed first offline job; wherein when the sleep condition is met, the first offline job is transferred to a sleep queue; putting the processed first offline job back into the ready job queue.

2. The method of claim 1, wherein, The method further comprises: after the execution of the online job in the ready job queue is completed, putting the offline job in the limit queue back into the ready job queue.

3. The method of claim 1, wherein, The method further comprises: when the to-be-processed job is an offline job and there is no online job in the ready job queue, scheduling an offline job process in the selected offline job to execute the offline job; or, when the to-be-processed job is an online job, scheduling an online job process in the selected online job to execute the online job.

4. The method of claim 1, wherein, The sleep condition comprises a required sleep duration, and the method further comprises: when there is a second offline job in the sleep queue, transferring the second offline job to the ready job queue; wherein an actual sleep duration of the second offline job is greater than or equal to the required sleep duration.

5. The method of claim 1, wherein, The method further comprises: obtaining an offline job process that has been created or woken up; when the offline job process belongs to an offline job in the ready job queue, updating the offline job process to the offline job in the ready job queue.

6. The method of claim 1, wherein, The ready job queue is provided with a mark representing whether there is an online job in the ready job queue.

7. A job scheduling device for a hybrid deployment scenario, characterized in that, The device applied to a CPU processor in a hybrid deployment scenario comprises: a selection module for selecting a to-be-processed job from a ready job queue of the processor; a processing module for, when the to-be-processed job is an offline job and there is an online job in the ready job queue, pushing the to-be-processed job into a limit queue, and reselecting a to-be-processed job until the selected to-be-processed job is an online job; a scheduling module for scheduling an online job process in the selected online job to execute the online job; an obtaining module for, according to a limit duration of an offline job in the limit queue, obtaining a first offline job in the limit queue; wherein the limit duration of the first offline job is greater than a preset limit duration threshold; The processing module is further configured to add a sleep condition in an offline job process of the first offline job to obtain a processed first offline job; when the sleep condition is met, the first offline job is transferred to a sleep queue; and the processed first offline job is put back to the ready job queue.

8. The apparatus of claim 7, wherein, The processing module is further configured to, after execution of an online job in the ready job queue is completed, put offline jobs in the limit queue back to the ready job queue.

9. The apparatus of claim 7, wherein, The processing module is further configured to, when the to-be-processed job is an offline job and the ready job queue does not contain the online job, schedule an offline job process in the selected offline job to execute the offline job; or, when the to-be-processed job is an online job, schedule an online job process in the selected online job to execute the online job.

10. The apparatus of claim 7, wherein, The sleep condition includes a required sleep duration, and the processing module is further configured to, when a second offline job exists in the sleep queue, transfer the second offline job to the ready job queue; wherein an actual sleep duration of the second offline job is greater than or equal to the required sleep duration.

11. The apparatus of claim 7, wherein, The processing module is further configured to, obtain an offline job process that has been created or woken up; when an offline job to which the offline job process belongs is in the ready job queue, update the offline job process to the offline job in the ready job queue.

12. The apparatus of claim 7, wherein, The ready job queue is provided with a mark, and the mark represents whether an online job exists in the ready job queue.

13. An electronic device, comprising: Comprise: at least one processor; and a memory in communication connection with the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any one of claims 1-6.

14. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to execute the method of any one of claims 1-6.

Citation Information

Patent Citations

  • Virtual machine task scheduling method and device, computer equipment and storage medium

    CN112130963A