Task scheduling method, electronic equipment, storage medium and computer program product

By detecting the switch of the physical processor's operating mode to virtualization mode and using the running bitmap in the running queue structure to determine the target scheduling priority, the problems of poor task scheduling timeliness and low resource utilization in the virtualization architecture are solved, and more efficient task scheduling is achieved.

CN121187718APending Publication Date: 2025-12-23ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410815128.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2025-12-23

AI Technical Summary

Technical Problem

In existing technologies, task scheduling strategies in virtualization architectures have failed to effectively address the problems of poor timeliness, low accuracy, and low system resource utilization in task scheduling.

Method used

By detecting when the physical processor switches to virtualization mode, the scheduling priority of the target to be scheduled is determined using the running bitmap in the running queue structure, and the tasks in the target scheduling queue are scheduled.

Benefits of technology

It improves the timeliness and accuracy of task scheduling and enhances the utilization rate of system resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121187718A_ABST
    Figure CN121187718A_ABST
Patent Text Reader

Abstract

The invention discloses a task scheduling method, electronic equipment, a storage medium and a computer program product. The method comprises the following steps: detecting an operation mode of a physical processor to obtain a detection result; in response to the detection result indicating that the physical processor is switched from the physical mode to the virtualization mode, a target scheduling priority to be scheduled is determined based on an operation bitmap in an operation queue structure corresponding to the physical processor, and different bits in the operation bitmap correspond to different scheduling priorities respectively; and scheduling the to-be-executed scheduling task in the target scheduling queue corresponding to the target scheduling priority. The technical problems of poor task scheduling timeliness, low accuracy and low system resource utilization rate are solved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular, to a task scheduling method, an electronic device, a storage medium and a computer program product. BACKGROUND

[0002] In a traditional operating system, a virtual processor (VCPU for short) can exist in the form of an independent process, and the operating system schedules the independent process corresponding to the VCPU to execute according to a preset scheduling algorithm. However, in a virtualized operating system architecture (virtualized architecture for short), a physical processor (PCPU for short) is switched to a VCPU, and the VCPU can exist in the form of a scheduling task, rather than an independent process. In addition, the virtualized architecture includes various scheduling tasks to be executed, such as a least recently used (LRU for short) detection task and a swap space (Swap for short) task. Therefore, the task scheduling strategy in the virtualized architecture usually needs to consider various scheduling influencing factors related to various scheduling tasks. However, an effective strategy for scheduling the virtualized architecture has not been proposed in the prior art.

[0003] That is, for the virtualized architecture, how to perform efficient, accurate and timely task scheduling has become one of the important technical problems in the related technical field. In view of the above problems, an effective solution has not been proposed. SUMMARY

[0004] Embodiments of the present application provide a task scheduling method, an electronic device, a storage medium and a computer program product to at least solve the technical problems of poor timeliness, low accuracy and low system resource utilization of task scheduling.

[0005] According to an aspect of an embodiment of the present application, a task scheduling method is provided, including: detecting a running mode of a physical processor to obtain a detection result; in response to the detection result indicating that the physical processor is switched from a physical mode to a virtualized mode, determining a target scheduling priority to be scheduled based on a running bitmap in a running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities; and scheduling a scheduling task to be executed in a target scheduling queue corresponding to the target scheduling priority.

[0006] According to another aspect of the embodiments of the present application, a task scheduling method is also provided, including: obtaining a task scheduling request through a first application programming interface, wherein the request data carried in the task scheduling request includes: identification information of a physical processor, the identification information being used to indicate detection of a running mode of the physical processor to obtain a detection result; and returning a task scheduling response through a second application programming interface, wherein the response data carried in the task scheduling response includes: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on a scheduling task to be executed in a target scheduling queue corresponding to a target scheduling priority to be scheduled, the target scheduling priority being determined based on a running bitmap in a running queue structure corresponding to the physical processor, different bits in the running bitmap corresponding to different scheduling priorities respectively, in response to the detection result indicating that the physical processor is switched from a physical mode to a virtual mode.

[0007] According to another aspect of the embodiments of the present application, a task scheduling method is also provided, including: obtaining a task scheduling request through a first application programming interface, wherein the request data carried in the task scheduling request includes: identification information of a physical processor, the identification information being used to indicate detection of a running mode of the physical processor to obtain a detection result; and returning a task scheduling response through a second application programming interface, wherein the response data carried in the task scheduling response includes: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on a scheduling task to be executed in a target scheduling queue corresponding to a target scheduling priority to be scheduled, the target scheduling priority being determined based on a running bitmap in a running queue structure corresponding to the physical processor, different bits in the running bitmap corresponding to different scheduling priorities respectively, in response to the detection result indicating that the physical processor is switched from a physical mode to a virtual mode.

[0008] According to another aspect of the embodiments of the present application, an electronic device is also provided, including: a memory storing an executable program; and a processor configured to execute the program, wherein the program performs any of the task scheduling methods described above when executed.

[0009] According to another aspect of the embodiments of the present application, a computer readable storage medium is also provided, including a stored executable program, wherein the executable program controls a device where the computer readable storage medium is located to perform any of the task scheduling methods described above when executed.

[0010] According to another aspect of the embodiments of the present application, a computer program product is also provided, including a computer program, the computer program implementing any of the task scheduling methods described above when executed by a processor.

[0011] In the embodiments of the present application, the running mode of the physical processor is detected to obtain a detection result; in response to the detection result indicating that the physical processor switches from the physical mode to the virtualization mode, a target scheduling priority to be scheduled is determined based on a running bitmap in a running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities respectively; and further, a scheduling task to be executed in a target scheduling queue corresponding to the target scheduling priority is scheduled. Thus, for the processor in the virtualization mode, the present application schedules the scheduling task in the target scheduling queue corresponding to the processor according to the scheduling priority of the scheduling task to be scheduled, ensures timely response and priority scheduling of the scheduling task to be scheduled with a higher scheduling priority, and compared with the scheme in the related art lacking reasonable task scheduling strategy in the virtualization mode, the scheme provided in the embodiments of the present application achieves the purpose of considering the scheduling priorities of multiple scheduling tasks corresponding to the running queue structure for task scheduling, thereby achieving the technical effects of enhancing the timeliness and accuracy of task scheduling and improving the system resource utilization, and further solving the technical problems of poor timeliness, low accuracy of task scheduling and low system resource utilization.

[0012] It is easily noticed that the general description above and the detailed description below are only for exemplifying and explaining the present application, and do not constitute the limitation of the present application. BRIEF DESCRIPTION OF DRAWINGS

[0013] The drawings described herein are used to provide further understanding of the present application, constitute a part of the present application, and the illustrative embodiments of the present application and the description thereof are used to explain the present application, and do not constitute the improper limitation of the present application. In the drawings:

[0014] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing the task scheduling method is shown;

[0015] Figure 2 An illustrative diagram of an embodiment using the computer terminal (or mobile device) as a sending terminal or receiving terminal is shown;

[0016] Figure 3 is a flowchart of a task scheduling method according to Embodiment 1 of the present application;

[0017] Figure 4 is a flowchart of a task scheduling method according to Embodiment 2 of the present application;

[0018] Figure 5 is a flowchart of a task scheduling method according to Embodiment 3 of the present application;

[0019] Figure 6 is a structure schematic diagram of a task scheduling device according to Embodiment 4 of the present application;

[0020] Figure 7 is a structural schematic diagram of another task scheduling device according to Embodiment 4 of the present application;

[0021] Figure 8 is a structural schematic diagram of still another task scheduling device according to Embodiment 4 of the present application;

[0022] Figure 9 is a structural block diagram of a computer terminal according to Embodiment 5 of the present application. DETAILED DESCRIPTION

[0023] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative work should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to the process, method, product or device.

[0025] First, some of the nouns or terms appearing in the description of the embodiments of the present application are applicable to the following explanations:

[0026] Virtualization architecture: refers to the architecture obtained by virtualizing an operating system using virtualization technology. In a virtualization architecture, multiple virtual instances can be run on one physical server, and each virtual instance has independent computing resources (such as processor resources and memory resources).

[0027] Lightweight virtualization architecture: refers to the process of performing lightweight virtualization on a running physical host to obtain a corresponding virtual machine, wherein lightweight virtualization refers to converting a physical processor in the physical host into a virtual processor while omitting the virtualization processing of unnecessary functions (such as device functions), and in lightweight virtualization, registers are kept in pass-through mode (that is, the input end and the output end are connected to the common passage) as much as possible. That is, the lightweight virtualization architecture in the present application can be customized according to the application scenario requirements, and part of the functions in the host is selected for virtualization processing.

[0028] Task scheduling: refers to the process of allocating tasks to available resources or processors for execution according to certain rules or strategies. In the field of computer, task scheduling is used to manage and optimize the resource utilization scheme in computer system, to ensure that tasks can be executed in time according to certain priority, time requirement or other constraint conditions. Task scheduling can help system to use resources more efficiently, improve the execution efficiency and response speed of tasks.

[0029] Physical processor: refers to the physical hardware in computer system, which is usually composed of one or more processors (CPU) hardware devices for executing computer programs and processing data. Physical processor is directly connected with the mainboard and other hardware devices of computer system, and is the core component of computer system.

[0030] Virtual processor: refers to the logical processor simulated by software virtualization technology. Virtual processor can run multiple operating system instances or virtual machines on one physical processor. Virtual processor can access the computing resources of physical processor, and can be independently allocated to different virtual machines or operating system instances, so as to realize multitasking processing and resource isolation.

[0031] Idle task (also known as IDLE task): refers to the task in idle state. In computer field, when the task is not executing any operation or waiting for external event to occur, it can be determined as IDLE task. IDLE task usually refers to the task without any processor resource or input / output resource being occupied in system. In operating system, IDLE task is usually used to represent the idle time of system, so that the system can execute some scheduling tasks or perform resource scheduling.

[0032] Embodiment 1

[0033] According to the embodiments of the present application, a task scheduling method embodiment is also provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a group of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in different order.

[0034] The method provided by the embodiment one of the application can be executed in a mobile terminal, a computer terminal or similar computing device. Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing the task scheduling method is shown. As shown in the figure, Figure 1 The computer terminal 10 (or mobile device 10) can include one or more processors 102 (the processor 102 can include but is not limited to a microcontroller unit (MCU) or a field programmable gate array (FPGA) and the like processing device), a memory 104 for storing data, and a transmission device 106 for communication function. In addition, the computer terminal 10 can also include a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which can be included as one of the ports of the computer bus), a network interface, a cursor control device (such as a mouse, a touchpad, etc.), a keyboard, a power supply and / or a camera.

[0035] Those skilled in the art can understand that, Figure 1 The structure shown is only schematic, which does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 10 can include more or less components than those shown in the figure, or have a different configuration from that shown in the figure. Figure 1 Figure 1 For example, the computer terminal 10 can include more or less components than those shown in the figure, or have a different configuration from that shown in the figure.

[0036] It should be noted that the one or more processors 102 and / or other data processing circuits described above can be referred to as "data processing circuits" herein. The data processing circuit can be embodied in whole or in part as software, hardware, firmware or any combination thereof. In addition, the data processing circuit can be a single independent processing module, or any one of the other elements combined into the computer terminal 10 (or mobile device) in whole or in part. As referred to in the embodiments of the application, the data processing circuit is a processor control (for example, the selection of the variable resistance terminal path connected with the interface).

[0037] ​The memory 104 can be used to store software programs of application software and modules, such as program instructions / data storage means corresponding to the task scheduling method in the embodiments of the present application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, i.e. implements the task scheduling method described above. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include memories remotely arranged with respect to the processor 102, which can be connected to the computer terminal 10 through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0038] The transmission device 106 is used to connect with a network via a network interface to receive or send data. The specific examples of the network can include wired and / or wireless networks provided by a communication provider of the computer terminal 10. In one example, the transmission device 106 includes a network adapter (NIC), which can be connected with other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet in a wireless manner.

[0039] The display as shown can be a touch screen type liquid crystal display (LCD), which can enable a user to interact with the user interface of the computer terminal 10 (or mobile device). Figure 1

[0040] Figure 1 The hardware structure diagram as shown can not only serve as an exemplary block diagram of the computer terminal 10 (or mobile device) described above, but also serve as an exemplary block diagram of the server described above. In an alternative embodiment, Figure 2 An embodiment in which the computer terminal (or mobile device) is used as a sending terminal or a receiving terminal is shown. As shown in Figure 2 ​As shown, the computer terminal 10 (or mobile device) can be connected to one or more servers (e.g., security servers, resource servers, game servers, etc.) via a data network connection or an electronic connection. In an optional embodiment, the computer terminal 10 (or mobile device) can be any mobile computing device, etc. The data network connection can be a local area network connection, a wide area network connection, an Internet connection, or other types of data network connections. The computer terminal 10 (or mobile device) can be configured to connect to a network service executed by one server (e.g., a security server) or a group of servers 20. The network server is a network-based user service, such as a social network, a cloud resource, an email, an online payment, or other online applications.

[0041] In the above operating environment, the present application provides a task scheduling method as shown in Figure 3 Figure 3 is a flowchart of a task scheduling method according to Embodiment 1 of the present application, as shown in Figure 3 The task scheduling method comprises the following steps:

[0042] Step S31, detecting the running mode of the physical processor to obtain a detection result;

[0043] Step S32, in response to the detection result indicating that the physical processor switches from the physical mode to the virtualization mode, determining a target scheduling priority to be scheduled based on a running bitmap in a running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities respectively;

[0044] Step S33, scheduling and processing the scheduling tasks to be executed in the target scheduling queue corresponding to the target scheduling priority.

[0045] The physical processor can be a computing component in the physical architecture of the operating system for executing computing tasks. When the running mode of the physical processor is switched to the virtualization mode, the physical processor is switched to a virtual processor in the virtualization architecture corresponding to the operating system.

[0046] It should be noted that the category of the physical processor can be a processor (Central Processing Unit, CPU for short), a graphics processor (Graphics Processing Unit, GPU for short), a physical processor unit (Physics Processing Unit, PPU for short), a mathematical coprocessor (Math Coprocessor), a digital signal processor (Digital Signal Processor, DSP for short), a network processor (Network Processor Unit, NPU for short), etc. ​

[0047] In an application scenario, there can be a running mode switching during the running of a physical processor. Specifically, according to the scene requirement, a virtualization technology is used to perform virtualization conversion on a physical architecture to obtain a virtualization architecture, at which time the running mode of the physical processor is switched from a physical mode to a virtualization mode. The above method steps provided by the embodiments of the present application can be used in a scenario of task scheduling involving a virtualization architecture in a preset application scenario, so as to enhance the resource utilization rate and running performance of the virtualization architecture. The above preset application scenario can be, but is not limited to, a scenario involving the use of a virtualization operating system in the fields of e-commerce, education, medical treatment, conference, social network, financial product, logistics and navigation. Correspondingly, the above physical processor is a physical computing unit pre-set in the above preset application scenario, and based on this, the technical scheme provided by the embodiments of the present application can provide a task scheduling service considering the scheduling priority for the above preset application scenario.

[0048] The above method steps can be applied to a scenario of task scheduling involving a virtualization architecture in a preset application scenario, so as to enhance the resource utilization rate and running performance of the virtualization architecture. The above preset application scenario can be, but is not limited to, a scenario involving the use of a virtualization operating system in the fields of e-commerce, education, medical treatment, conference, social network, financial product, logistics and navigation. Correspondingly, the above physical processor is a physical computing unit pre-set in the above preset application scenario, and based on this, the technical scheme provided by the embodiments of the present application can provide a task scheduling service considering the scheduling priority for the above preset application scenario.

[0049] In the embodiments of the present application, the running mode of the physical processor is detected to obtain a detection result; in response to the detection result indicating that the physical processor is switched from a physical mode to a virtualization mode, a target scheduling priority of a to-be-scheduled task is determined based on a running bitmap in a running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities; and further, a scheduling task to be executed in a target scheduling queue corresponding to the target scheduling priority is scheduled.

[0050] It is easy to note that, for a processor in a virtualization mode, the present application schedules a scheduling task in a target scheduling queue corresponding to the processor according to the scheduling priority of a to-be-scheduled task, so as to ensure timely response and priority scheduling of a to-be-scheduled task with a higher scheduling priority. Compared with the scheme in the related art lacking a reasonable task scheduling strategy in a virtualization mode, the scheme provided by the embodiments of the present application achieves the purpose of considering the scheduling priorities of multiple scheduling tasks corresponding to a running queue structure to perform task scheduling, thereby realizing the technical effects of enhancing the timeliness and accuracy of task scheduling and improving the system resource utilization rate, and further solving the technical problems of poor timeliness, low accuracy of task scheduling and low system resource utilization rate.

[0051] In an application scenario, the scheduling tasks (such as foreground and background scheduling tasks) in the lightweight virtualization architecture need to consider the task characteristics of various scheduling tasks to design a task scheduling strategy for the lightweight virtualization architecture, so as to ensure the timeliness and rationality of the scheduling tasks and improve the resource utilization and operation performance of the system.

[0052] The above method steps provided by the embodiments of the present application in the lightweight virtualization architecture are further described below. The following description is illustrative of an example embodiment. The physical processor is PCPU, and the virtual processor is VCPU.

[0053] In an optional embodiment, in step S32, the target scheduling priority to be scheduled is determined based on the running bitmap in the running queue structure corresponding to the physical processor, including the following method steps:

[0054] Step S321, a target bit is selected from the running bitmap in the running queue structure corresponding to the physical processor, wherein the position of the target bit in the running bitmap and the value of the target bit satisfy a preset condition, and the plurality of scheduling priorities corresponding to the running queue structure are distributed in the plurality of bit positions in the running bitmap in a preset arrangement order.

[0055] Step S322, the target scheduling priority to be scheduled is determined based on the target bit.

[0056] According to the above optional embodiment, a running queue structure is defined for each PCPU in the virtualization architecture, and each running queue structure includes a plurality of regular scheduling queues and an emergency scheduling queue, wherein the plurality of regular scheduling queues correspond to a plurality of predefined scheduling priorities. The above running queue structure can also include a plurality of scheduling control fields, for example, the plurality of scheduling control fields include: a scheduling period, a scheduling ratio corresponding to the plurality of scheduling priorities, a task quantity corresponding to the plurality of scheduling priorities, and a task running time of the plurality of scheduling priorities in a last scheduling period adjacent to a current scheduling period. It should be noted that the above task running time is the real running time of the task of each scheduling priority, which is used to compare with the set running time of the corresponding task to obtain a comparison result, and then the task scheduling accuracy is dynamically adjusted according to the comparison result.

[0057] For example, in an application scenario, the plurality of predefined scheduling priorities include: VCPU level, FCPU level, BACK level and IDLE level, wherein the VCPU level represents the scheduling priority corresponding to the VCPU obtained after the physical processor is switched to virtualization, the FCPU level represents the scheduling priority corresponding to the newly created VCPU, the BACK level represents the scheduling priority corresponding to the background task, and the IDLE level represents the scheduling priority corresponding to the idle task (i.e. IDLE task).

[0058] In the application scenario, after the running mode of the physical processor is switched to the virtualization mode, the running subject corresponding to the physical processor runs the main function (denoted as hv_run) in a specified cycle. Specifically, after the physical processor is switched to the virtual processor running mode, the running subject corresponding to the physical processor actually runs the main function in a cycle according to the execution cycle. The main function will cyclically call the scheduling main function (that is, the main function of the scheduling algorithm, denoted as hv_sched) to determine the target scheduling entity to be run. After starting to run the scheduling main function hv_sched, the running bitmap in the running queue structure corresponding to the physical processor is obtained, and the target scheduling priority to be scheduled by the physical processor is determined according to the running bitmap.

[0059] In the above optional embodiment, the preset arrangement order of the plurality of scheduling priorities can be from high to low. For example, in the application scenario, the plurality of scheduling priorities are arranged in the order from high to low as follows: VCPU level, FCPU level, BACK level, and IDLE level.

[0060] The plurality of scheduling priorities defined in advance correspond to different bit positions in the running bitmap. Specifically, the plurality of scheduling priorities correspond to the candidate values of the plurality of bit positions in the running bitmap from large to small in the order from high to low. That is, through the current value of a bit position in the running bitmap, the specific scheduling priority of the task to be scheduled corresponding to the bit position (which can be one of the VCPU level, FCPU level, BACK level, and IDLE level in this example) can be determined.

[0061] According to the above optional embodiment, the target bit position is selected from the values of the plurality of bit positions in the running bitmap corresponding to the physical processor. For example, the plurality of bit positions in the running bitmap can be traversed, and the first bit position with a non-zero value in the traversal is selected as the target bit position. The scheduling priority corresponding to the target bit position is taken as the target scheduling priority to be scheduled.

[0062] Further, after the scheduling priority corresponding to the target bit position is determined as the target scheduling priority, the value of the target bit position in the running bitmap is reset to 0, the current running priority field (denoted as pro) in the running queue structure is assigned to the historical running priority field (denoted as last_pro), and the target scheduling priority is recorded in the current running priority field (pro) in the running queue structure.

[0063] According to the optional embodiment, the application utilizes the values of the plurality of bits in the running bitmap to represent the plurality of scheduling priorities corresponding to the running queue structure of the physical processor, and further, in the process of system running, the target scheduling priority of the physical processor to be scheduled can be determined in real time through the running bitmap, and then the scheduling task corresponding to the target scheduling priority is scheduled, and the task scheduling of the virtualization architecture in the above process is timely, and thus the utilization of resources of the system can be improved by reasonably and quickly scheduling the tasks.

[0064] In an optional embodiment, in step S33, the scheduling task to be executed in the target scheduling queue corresponding to the target scheduling priority is scheduled, including the following method steps:

[0065] In step S331, a first scheduling entity corresponding to the scheduling task is selected from the target scheduling queue corresponding to the target scheduling priority, wherein the first scheduling entity is contained in the structure of the scheduling task, and the first scheduling entity is mounted in the target scheduling queue.

[0066] In step S332, the first scheduling entity is run based on the target scheduling priority, and the scheduling task is scheduled.

[0067] In the above optional embodiment, each scheduling task (for example, the scheduling task of the virtualized operating system) in the virtualization architecture can be provided with a structure, and the scheduling task is contained in the structure as a scheduling entity, thereby associating the scheduling entity with the scheduling task.

[0068] As an exemplary embodiment, the structure corresponding to the VCPU task is set as VCPU_task, and the VCPU_task at least includes a VCPU scheduling entity; the structure corresponding to the LRU detection task is set as LRU_task, and the LRU_task at least includes an LRU scheduling entity; and the structure corresponding to the Swap task is set as Swap_task, and the Swap_task at least includes a Swap scheduling entity. In addition, each scheduling entity contains a regular node, and the scheduling entity can be mounted in the corresponding regular scheduling queue through the regular node; and each scheduling entity also contains an emergency node, and the scheduling entity can be mounted in the corresponding emergency scheduling queue through the emergency node.

[0069] According to the method steps of the above optional embodiment, after the target scheduling priority is determined, a first scheduling entity corresponding to the scheduling task is selected from the target scheduling queue corresponding to the target scheduling priority. For example, the regular running queue corresponding to the target scheduling priority is determined, and the scheduling entity currently at the head of the queue is selected as the first scheduling entity from the plurality of scheduling entities mounted in the regular running queue.

[0070] It should be noted that the target scheduling queue can be a regular scheduling queue or an urgent scheduling queue. That is, according to the method steps of the optional embodiment, the scheduling of the regular scheduling tasks with different scheduling priorities in the operating system can be processed, and the scheduling of the urgent scheduling tasks in the operating system can also be processed.

[0071] In an optional embodiment, the structure of the scheduling task in the task scheduling method includes a scheduling control field, wherein the scheduling control field is used to record the current scheduling state of the structure of the scheduling task, the scheduling plan of the first scheduling entity, and the running time information of the scheduling plan of the first scheduling entity.

[0072] In the above optional embodiment, the structure of the scheduling task in the running queue structure can further include a plurality of scheduling control fields.

[0073] As an exemplary embodiment, a first field in the plurality of scheduling control fields is used to represent the current scheduling state of the current structure corresponding to the scheduling task, for example, the structure is being scheduled, the structure is being enqueued, etc. A second field in the plurality of scheduling control fields is used to represent the scheduling plan of the first scheduling entity. A third field in the plurality of scheduling control fields is used to represent the running time information corresponding to the scheduling plan, wherein the running time information can include but is not limited to: set running time, real running time, compensation running time, and penalty running time.

[0074] In addition, the structure corresponding to each scheduling task in the virtualization architecture can further include a set of scheduling operation functions, and the plurality of scheduling operation functions included in the set of scheduling operation functions include: an enqueuing operation function, an enqueuing, dequeuing operation function, a running operation function, a queue updating operation function, a time slice calculation operation function, a priority changing operation function, and a scheduling entity selection operation function. Through the set of scheduling operation functions, the scheduling task can control the corresponding operation in the virtualization architecture, thereby ensuring that the plurality of scheduling tasks in the virtualization architecture can reasonably share system resources, and improving the performance and efficiency of the virtualization architecture.

[0075] In an optional embodiment, the task scheduling method further includes the following method steps:

[0076] Step S34, in response to the target scheduling priority being the lowest scheduling priority in the plurality of scheduling priorities or the target scheduling queue being provided with a refresh flag, calculating the scheduling time slice of each scheduling entity in the scheduling queue corresponding to different scheduling priorities in the plurality of scheduling priorities.

[0077] According to the optional embodiment above, in the application scenario, when it is detected that the target scheduling priority is the lowest scheduling priority (for example, the IDLE level mentioned above), or it is detected that the target scheduling queue selected according to the target scheduling priority is provided with a refresh flag, a time slice recalculation process is triggered. In the time slice recalculation process, the scheduling time slices corresponding to each scheduling entity in the scheduling queue corresponding to different scheduling priorities in the plurality of scheduling priorities are calculated and updated.

[0078] Specifically, in the time slice recalculation process, if it is detected that the target scheduling queue is provided with a refresh flag, it indicates that the scheduling proportions corresponding to the plurality of scheduling priorities in the plurality of scheduling control fields change, at this time, the scheduling time slices of the scheduling entities mounted in the scheduling queues corresponding to the plurality of scheduling priorities are recalculated according to the updated scheduling proportions in the running queue structure and the scheduling period.

[0079] In an optional embodiment, the task scheduling method further includes the following method steps:

[0080] Step S351, determining whether there is a first scheduling entity in the target scheduling queue;

[0081] Step S352, in response to the existence of the first scheduling entity in the target scheduling queue, setting a target bit in the running bitmap.

[0082] According to the optional embodiment above, in the process of recalculating the scheduling time slice, the scheduling entities mounted in the scheduling queues corresponding to the plurality of scheduling priorities are iteratively calculated to obtain the scheduling time slice corresponding to each scheduling entity. In the iterative calculation, firstly, it is judged whether there is at least one scheduling entity in the scheduling queue corresponding to the current scheduling priority. If there is no scheduling entity in the scheduling queue corresponding to the current scheduling priority, the running bitmap is cleaned and reset; if there is at least one scheduling entity in the scheduling queue corresponding to the current scheduling priority, a target bit is set in the running bitmap according to the first scheduling entity selected from the at least one scheduling entity.

[0083] In an optional embodiment, the task scheduling method further includes the following method steps:

[0084] Step S361, in response to the existence of a single scheduling entity in the target scheduling queue, allocating a scheduling time slice to the first scheduling entity;

[0085] Step S362, in response to the existence of a plurality of scheduling entities including the first scheduling entity in the target scheduling queue, allocating a scheduling time slice to the plurality of scheduling entities.

[0086] According to the above optional embodiment, for the first type of priority in the plurality of scheduling priorities (such as the VCPU level and the IDLE level as mentioned above), there is one scheduling entity in the scheduling queue corresponding to each scheduling priority, and the scheduling time slice allocated to the scheduling queue corresponding to the scheduling priority is equal to the scheduling time slice allocated to the scheduling entity.

[0087] For the second type of priority in the plurality of scheduling priorities (such as the FCPU level and the BACK level as mentioned above), there can be multiple scheduling entities in the scheduling queue corresponding to each scheduling priority, and when there are multiple scheduling entities in the scheduling queue corresponding to each scheduling priority, the scheduling time slice allocated to the scheduling queue corresponding to the scheduling priority is allocated to the multiple scheduling entities in the scheduling queue (for example, can be allocated to the multiple scheduling entities evenly).

[0088] In an optional embodiment, the task scheduling method further comprises the following method steps:

[0089] Step S371, determining whether the scheduling time slice allocated for the first scheduling entity is used up or not;

[0090] Step S372, in response to the scheduling time slice allocated for the first scheduling entity not being used up, recording the remaining time slice of the scheduling time slice which is not used up, wherein the remaining time slice is used to supplement the scheduling time slice occupied by the scheduling task corresponding to the subsequent scheduling priority, and the subsequent scheduling priority is lower than the target scheduling priority.

[0091] According to the above optional embodiment, the usage surplus of the scheduling time slice corresponding to the first scheduling entity is calculated during the task scheduling process, and when the usage surplus is not zero, it indicates that the scheduling time slice corresponding to the first scheduling entity is not used up, and at this time the remaining time slice corresponding to the usage surplus is recorded.

[0092] For example, the target scheduling priority of the current scheduling period is the FCPU level, and the target scheduling priority of the adjacent previous scheduling period of the current scheduling period is the VCPU level, and it is calculated whether the time slice allocated for the first scheduling entity corresponding to the VCPU level in the previous scheduling period is used up or not, and if the time slice allocated for the first scheduling entity corresponding to the VCPU level in the previous scheduling period is not used up (i.e. the usage surplus is not zero), at this time the remaining time slice (denoted as surplus) corresponding to the usage surplus is recorded, and the remaining time slice is used to supplement the use of the first scheduling entity corresponding to the FCPU level in the current scheduling period.

[0093] In another alternative embodiment, the running time of the first scheduling entity in the target scheduling priority can also be counted during the task scheduling process, and the running time is used to determine whether the target scheduling priority is switched during the task scheduling process. If the last running priority field (last_pro) in the running queue structure is different from the current running priority field (pro), it is determined that the target scheduling priority is switched during the task scheduling process. In this case, the actual running time of the first scheduling entity in the target scheduling priority corresponding to the last running priority field (last_pro) is recorded, and the running start time of the first scheduling entity in the target scheduling priority corresponding to the current running priority field (pro) is recorded. It should be noted that the actual running time of the first scheduling entity in the target scheduling priority corresponding to the last running priority field (last_pro) can be determined by the current time and the running start time of the first scheduling entity in the target scheduling priority corresponding to the last running priority field (last_pro).

[0094] In an alternative embodiment, in step S331, the first scheduling entity corresponding to the scheduling task is selected from the target scheduling queue corresponding to the target scheduling priority, including the following method steps:

[0095] In step S3311, it is determined whether there is a second scheduling entity that meets the preset condition in the virtualization mode, wherein the scheduling urgency of the second scheduling entity is higher than that of the first scheduling entity.

[0096] In step S3312, in response to the absence of a second scheduling entity that meets the preset condition, the first scheduling entity corresponding to the scheduling task is selected from the target scheduling queue corresponding to the target scheduling priority.

[0097] In the above alternative embodiment, the emergency scheduling queue in the running queue structure is a local emergency scheduling queue corresponding to the physical processor. The operating system architecture can also be provided with a global emergency scheduling queue.

[0098] In an exemplary application scenario, after the operating system architecture is switched to a virtualization architecture, when entering the task scheduling process, it is first checked whether there is a second scheduling entity in the global emergency scheduling queue. If there is a second scheduling entity in the global emergency scheduling queue, the target scheduling priority is adjusted to the scheduling priority corresponding to the second scheduling entity, and the second scheduling entity is preferentially scheduled.

[0099] Further, if the second scheduling entity does not exist in the global emergency scheduling queue, it is checked whether the second scheduling entity exists in the local emergency scheduling queue in the running queue structure. If the second scheduling entity exists in the local emergency scheduling queue, the target scheduling priority is adjusted to the scheduling priority corresponding to the second scheduling entity, and the second scheduling entity is preferentially scheduled.

[0100] Further, if the second scheduling entity does not exist in the global emergency scheduling queue and the local emergency scheduling queue, a scheduling entity at the head of the queue in the regular scheduling queue corresponding to the target scheduling priority is selected as the second scheduling entity. It should be noted that if the currently selected second scheduling entity is a root scheduling entity of a certain group of scheduling, a specific scheduling entity is further selected as the second scheduling entity based on the root scheduling entity.

[0101] Further, after the second scheduling entity is selected, it is judged whether a sub-scheduling selection function exists in the scheduling operation function set corresponding to the second scheduling entity. If the sub-scheduling selection function exists in the scheduling operation function set corresponding to the second scheduling entity, the sub-scheduling selection function is called for execution. For example, the target scheduling priority is FCPU level, and a plurality of newly created VCPUs corresponding to the FCPU level will run on the PCPU in a specified range, and the plurality of newly created VCPUs will be organized in a queue, at this time, a specific target VCPU is selected from the plurality of newly created VCPUs of the FCPU level to run.

[0102] It should be noted that if the target scheduling entity is not selected in the global emergency scheduling queue and the regular scheduling queue corresponding to the target scheduling priority and the local emergency scheduling queue, the target scheduling priority is re-determined according to the running bitmap.

[0103] In an optional embodiment, the task scheduling method further comprises one of the following method steps:

[0104] Step S381, in response to the plurality of scheduling entities corresponding to the target scheduling priority being bound on the physical processor, performing an enqueue operation on the first scheduling entity to make the first scheduling entity enqueued to the target scheduling queue;

[0105] Step S382, in response to the plurality of scheduling entities corresponding to the target scheduling priority being bound on the physical processor, performing a dequeue operation on the first scheduling entity to make the first scheduling entity dequeued from the target scheduling queue.

[0106] In an exemplary embodiment, after selecting the first scheduling entity or the second scheduling entity as the target scheduling entity to be run, a dequeue operation function corresponding to the target scheduling entity is invoked to implement entity dequeue of the target scheduling entity. It should be noted that the dequeue operation function can be customized for different scheduling priorities or different scheduling entities.

[0107] It should be noted that if the scheduling priority of the target scheduling entity is VCPU level or IDLE level, and there is a scheduling entity (i.e. the target scheduling entity) corresponding to the VCPU level or the IDLE level, the target scheduling entity does not need to perform dequeue operation and enqueue operation during its running period, and the dequeue operation and the enqueue operation can be performed during the startup and destruction of the scheduler corresponding to the target scheduling entity.

[0108] When performing enqueue operation on the target scheduling entity, if the scheduling priority of the target scheduling entity is FCPU level, it is determined whether the target scheduling entity is mounted on a newly created global VCPU queue when not running. If the target scheduling entity is mounted on the newly created global VCPU queue when not running, the target scheduling entity is controlled to dequeue from the newly created global VCPU queue. If the target scheduling entity is not mounted on the newly created global VCPU queue when not running but is bound to PCPU for running, the target scheduling entity is controlled to dequeue from a regular scheduling queue corresponding to the target scheduling priority.

[0109] When performing enqueue operation on the target scheduling entity, if the scheduling priority of the target scheduling entity is BACK level, the target scheduling entity is controlled to dequeue from a regular scheduling queue corresponding to the target scheduling priority.

[0110] Further, during the scheduling entity enqueue process, if the scheduling priority corresponding to the target scheduling entity is VCPU level or IDLE level, the target scheduling entity does not need to perform enqueue operation during its running period.

[0111] During the scheduling entity enqueue process, if the scheduling priority corresponding to the target scheduling entity is FCPU level, if the target scheduling entity is not bound to PCPU, the target scheduling entity is enqueued to the tail of a newly created global VCPU queue. If the target scheduling entity is bound to PCPU, the target scheduling entity is enqueued to the tail of a regular scheduling queue corresponding to the target scheduling priority. Similarly, if the scheduling priority corresponding to the target scheduling entity is BACK level, the target scheduling entity is enqueued to the tail of a regular scheduling queue corresponding to the target scheduling priority.

[0112] In an optional embodiment, in step S332, the first scheduling entity is run based on the target scheduling priority to perform scheduling processing on the scheduling task, including the following method steps:

[0113] Step S3321, the first scheduling entity is parsed based on the target scheduling priority, and a scheduling task corresponding to the target scheduling priority is obtained;

[0114] Step S3322, the scheduling task is scheduled according to the target scheduling mode corresponding to the target scheduling priority.

[0115] According to the above optional embodiment, in the process of running the target scheduling entity, if the scheduling priority corresponding to the target scheduling entity is VCPU level, the VCPU structure corresponding to the target scheduling entity is obtained, and the VCPU running function (denoted as VCPU_run) corresponding to the target scheduling entity is called to run.

[0116] Specifically, before starting to run the VCPU running function, the start running time (denoted as start) is recorded; further, according to the current time (denoted as now), the scheduling slice (denoted as slice), the use exceeding time (denoted as penalty) of the last scheduling period, and the remaining time slice (denoted as surplus) of the previous scheduling entity running in the current scheduling period, the timeout time (denoted as timeout) of the VCPU running function is determined. The above-mentioned previous scheduling entity is a scheduling entity running at a higher scheduling priority than the scheduling priority corresponding to the target scheduling entity, and the above-mentioned use exceeding time is the part of the real running time of the target scheduling entity in the last scheduling period exceeding the timeout time in the current scheduling period.

[0117] Further, if the calculated timeout time (timeout) is less than or equal to the start running time (start), it indicates that the scheduling entity running in the current scheduling period has generated too much use exceeding time, resulting in that the current scheduling period is limited to run by the system penalty, at this time, the preset minimum running time (denoted as min) is allocated to the VCPU running function of the current scheduling period according to the configuration information of the virtualization architecture.

[0118] Further, when the VCPU running function ends running, the end running time (denoted as end) is recorded, and the real running time (denoted as run) of the VCPU running function is determined according to the start running time (start) and the end running time (end). If the real running time (run) is greater than the timeout time (timeout), the part of the real running time (run) exceeding the timeout time (timeout) is accumulated into the use exceeding time (penalty).

[0119] In addition, if the scheduling priority corresponding to the target scheduling entity is FCPU level, the running logic corresponding to the above-mentioned VCPU level can be referred to for running.

[0120] If the scheduling priority corresponding to the target scheduling entity is the BACK level, the target scheduling entity is parsed according to the type of the scheduling task corresponding to the target scheduling entity, and an LRU detection task or a Swap task is obtained, so as to realize background hot and cold data updating or memory swapping.

[0121] If the scheduling priority corresponding to the target scheduling entity is the IDLE level, the target scheduling entity is parsed to obtain an IDLE task. If there is no runnable scheduling entity mounted on the queue corresponding to the IDLE task, the IDLE task is executed. If there is a runnable scheduling entity mounted on the queue corresponding to the IDLE task, the running of the target scheduling entity is exited.

[0122] In addition, during the scheduling process of the scheduling task, the running time distribution of the target scheduling entity (which can be the first scheduling entity or the second scheduling entity) is counted, so as to monitor the scheduling running situation of the scheduling task in real time.

[0123] It should be noted that during the task scheduling process, the scheduling range adjustment logic of the specified category of scheduling entity can also be added. For example, the LRU detection task is set to run in a specified PCPU segment. At this time, the de-queue operation is performed on a certain type of task that has been mounted but is not running in the specified PCPU segment. Further, if the de-queue operation is completed and the target scheduling priority corresponding to the regular scheduling queue is not controlled, the bitmap of the target scheduling priority is reset to zero. Further, it is judged whether the running queue in the specified PCPU segment is mounted with a certain type of scheduling task. If the running queue in the specified PCPU segment is not mounted with a certain type of scheduling task, the en-queue operation is performed on the scheduling task.

[0124] It should be noted that during the task scheduling process, the scheduling time slice and the scheduling control field can be customized according to the architecture characteristics of the virtualization architecture and the scene requirements of the application scene.

[0125] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation portal for user to choose authorization or refusal.

[0126] It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all described as a combination of a series of actions, but those skilled in the art should know that the present application is not limited to the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the present application.

[0127] Those skilled in the art can clearly understand from the description of the foregoing embodiments that the method according to the foregoing embodiments can be realized by means of software and a necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk) and includes a number of instructions for causing an end device (which can be a mobile phone, a computer, a server, or a network device) to perform the method described in each embodiment of the present application.

[0128] Embodiment 2

[0129] In the running environment as in Embodiment 1, the present application provides another task scheduling method as shown in Figure 4 . Figure 4 is a flowchart of a task scheduling method according to Embodiment 2 of the present application, as shown in Figure 4 , the task scheduling method comprises:

[0130] Step S41, obtaining a task scheduling request through a first application programming interface, wherein the request data carried in the task scheduling request includes: identification information of a physical processor, the identification information being used to instruct to detect the running mode of the physical processor to obtain a detection result;

[0131] Step S42, returning a task scheduling response through a second application programming interface, wherein the response data carried in the task scheduling response includes: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on a to-be-executed scheduling task in a target scheduling queue corresponding to a target scheduling priority, the target scheduling priority being responsive to the detection result indicating that the physical processor is switched from the physicalization mode to the virtualization mode, and being determined based on a running bitmap in a running queue structure corresponding to the physical processor, different bits in the running bitmap respectively corresponding to different scheduling priorities.

[0132] According to the above method steps, a method for implementing task scheduling cloud service is provided, and the method runs on a cloud server. The cloud server obtains a task scheduling request issued by a service invoker through a first application programming interface, executes a task scheduling process based on request data (i.e., identification information of a physical processor) carried by the task scheduling request, thereby obtaining a scheduling processing result, and further returns a task scheduling response to the service invoker through a second application programming interface, so as to provide the scheduling processing result to the service invoker.

[0133] The first application programming interface and the second application programming interface can be the same application programming interface or different application programming interfaces. In an optional embodiment, interface parameters in the first application programming interface and the second application programming interface can include, but are not limited to, an interface global identification interface signature key, an interface timestamp, an interface request identification, a system call credential identification, and the like. The first application programming interface can use a GET (get) or POST (post) method as an interface request method to obtain a file processing request. The second application programming interface can use a JSON (JavaScript Object Notation) format to feed back a file processing response.

[0134] The physical processor can be a computing component for executing a computing task in an operating system physical architecture. When the running mode of the physical processor is switched to a virtualization mode, the physical processor is switched to a virtual processor in a virtualization architecture corresponding to the operating system.

[0135] It should be noted that the category of the physical processor can be a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), a PPU (Physics Processing Unit), a math coprocessor, a DSP (Digital Signal Processor), an NPU (Network Processor Unit), and the like.

[0136] In an application scenario, there can be a running mode switching during the running of a physical processor. Specifically, according to the scene requirements, a virtualization technology is used to perform virtualization conversion on a physical architecture to obtain a virtualization architecture, at which time the running mode of the physical processor is switched from a physical mode to a virtualization mode. The above method steps provided by the embodiments of the present application can be used in a scenario of task scheduling involving a virtualization architecture in a preset application scenario, so as to enhance the resource utilization rate and running performance of the virtualization architecture. The above preset application scenario can be, but is not limited to, a scenario involving the use of a virtualization operating system in the fields of e-commerce, education, medical treatment, conferences, social networks, financial products, logistics, navigation, etc. Correspondingly, the above physical processor is a physical computing unit that is pre-set in the above preset application scenario, and based on this, the technical solutions provided by the embodiments of the present application can provide task scheduling services considering the scheduling priority for the above preset application scenario.

[0137] The above method steps can be applied to a scenario of task scheduling involving a virtualization architecture in a preset application scenario, so as to enhance the resource utilization rate and running performance of the virtualization architecture. The above preset application scenario can be, but is not limited to, a scenario involving the use of a virtualization operating system in the fields of e-commerce, education, medical treatment, conferences, social networks, financial products, logistics, navigation, etc. Correspondingly, the above physical processor is a physical computing unit that is pre-set in the above preset application scenario, and based on this, the technical solutions provided by the embodiments of the present application can provide task scheduling services considering the scheduling priority for the above preset application scenario.

[0138] In the embodiments of the present application, a task scheduling request is obtained through a first application programming interface, wherein the request data carried in the task scheduling request includes: identification information of the physical processor, the identification information being used to instruct to detect the running mode of the physical processor to obtain a detection result; a task scheduling response is returned through a second application programming interface, wherein the response data carried in the task scheduling response includes: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on a scheduling task to be executed in a target scheduling queue corresponding to a target scheduling priority to be scheduled, the target scheduling priority being determined based on a running bitmap in a running queue structure corresponding to the physical processor, different bits in the running bitmap respectively corresponding to different scheduling priorities.

[0139] It is easy to note that, according to the embodiments of the present application, the scheduling tasks in the target scheduling queue corresponding to the processor are scheduled according to the scheduling priority corresponding to the task to be scheduled, so as to achieve the purpose of considering the scheduling priority of the multiple scheduling tasks corresponding to the running queue structure for task scheduling, thereby realizing the technical effects of enhancing the timeliness and accuracy of task scheduling and improving the system resource utilization rate, and further solving the technical problems of poor timeliness, low accuracy and low system resource utilization rate of task scheduling.

[0140] It should be noted that the preferred embodiments of the present embodiment can refer to the related description in Embodiment 1, which will not be repeated here.

[0141] Embodiment 3

[0142] In the running environment as in Embodiment 1, the present application provides another task scheduling method as shown in Figure 5 Figure 5 is a flowchart of a task scheduling method according to Embodiment 3 of the present application, as shown in Figure 5

[0143] Step S51, obtaining a current input task scheduling dialogue request, wherein the information carried in the task scheduling dialogue request includes: identification information of a physical processor, the identification information being used to instruct to detect the running mode of the physical processor to obtain a detection result;

[0144] Step S52, returning a task scheduling dialogue reply in response to the task scheduling dialogue request, wherein the information carried in the task scheduling dialogue reply includes: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on the to-be-executed scheduling task in a target scheduling queue corresponding to a target scheduling priority to be scheduled, the target scheduling priority being determined based on a running bitmap in a running queue structure corresponding to the physical processor in response to the detection result indicating that the physical processor is switched from the physicalization mode to the virtualization mode, different bit positions in the running bitmap respectively corresponding to different scheduling priorities;

[0145] Step S53, displaying the scheduling processing result in a graphical user interface.

[0146] According to the above method steps, a visualization scheme for a task scheduling function is provided. A terminal device provides a graphical user interface, and the graphical user interface displays at least a task scheduling scene. The display content of the graphical user interface further includes an input component (such as a text input box, a voice input control, etc.) and a display component (such as a text display window). A user inputs a task scheduling dialogue request through the input component to specify the identification information of a physical processor in a task scheduling task. After detecting the input behavior of the user, a task scheduling process is performed based on the identification information of the physical processor to obtain a scheduling processing result, and further, the scheduling processing result is displayed through the display component in the graphical user interface.

[0147] The above-mentioned physical processor can be a computing component in an operating system physical architecture for performing a computing task, and when the running mode of the physical processor is switched to the virtualization mode, the physical processor is switched to a virtual processor in a virtualization architecture corresponding to the operating system.

[0148] ​​It should be noted that the category of the physical processor can be: a processor (Central Processing Unit, CPU for short), a graphics processor (Graphics Processing Unit, GPU for short), a physical processor unit (Physics Processing Unit, PPU for short), a mathematical coprocessor (Math Coprocessor), a digital signal processor (Digital Signal Processor, DSP for short), a network processor (Network Processor Unit, NPU for short), etc.

[0149] In an application scenario, during the running of the physical processor, there can be a running mode switching situation. Specifically, according to the scene requirement, the physical architecture is converted into a virtualized architecture by using a virtualization technology, at which time the running mode of the physical processor is switched from a physical mode to a virtualization mode. In the above method steps provided by the embodiments of the present application, when it is detected that the physical processor is switched to run in the virtualization mode, the running bitmap in the running queue structure corresponding to the physical processor is obtained, and the scheduling priority corresponding to the plurality of tasks in the running queue structure is determined according to the plurality of bits in the running bitmap.

[0150] The above method steps can be applied to a scenario involving task scheduling of a virtualized architecture in a preset application scenario, so as to enhance the resource utilization rate and running performance of the virtualized architecture. The above preset application scenario can be but is not limited to a scenario involving the use of a virtualization operating system in the fields of e-commerce, education, medical treatment, conferences, social networks, financial products, logistics, and navigation. Correspondingly, the above physical processor is a physical computing unit pre-set in the above preset application scenario, and based on this, the technical scheme provided by the embodiments of the present application can provide a task scheduling service considering scheduling priority for the above preset application scenario.

[0151] In the embodiments of the present application, a current input task scheduling dialogue request is obtained, wherein the information carried in the task scheduling dialogue request includes: identification information of the physical processor, the identification information being used to instruct to detect the running mode of the physical processor to obtain a detection result; in response to the task scheduling dialogue request, a task scheduling dialogue reply is returned, wherein the information carried in the task scheduling dialogue reply includes: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on the scheduling tasks to be executed in the target scheduling queue corresponding to a target scheduling priority to be scheduled, the target scheduling priority being determined based on a running bitmap in a running queue structure corresponding to the physical processor in response to the detection result indicating that the physical processor is switched from the physical mode to the virtualization mode, different bits in the running bitmap respectively corresponding to different scheduling priorities; and the scheduling processing result is displayed in a graphical user interface.

[0152] It is easily noticed that the application is directed to a processor in a virtualization mode, and the scheduling tasks in a target scheduling queue corresponding to the processor are scheduled according to the scheduling priority corresponding to the tasks to be scheduled, so as to achieve the purpose of considering the scheduling priority of the multiple scheduling tasks corresponding to the running queue structure for task scheduling, thereby realizing the technical effects of enhancing the timeliness and accuracy of task scheduling and improving the system resource utilization, and further solving the technical problems of poor timeliness, low accuracy and low system resource utilization of task scheduling.

[0153] It should be noted that the preferred embodiments of the present embodiment can refer to the related description in Embodiment 1 or Embodiment 2, which will not be repeated here.

[0154] Embodiment 4

[0155] According to the embodiments of the application, an apparatus embodiment for implementing the above task scheduling method is also provided. Figure 6 is a structural schematic diagram of a task scheduling apparatus according to Embodiment 4 of the application, as Figure 6 shown, the apparatus comprises:

[0156] The detection module 601 is configured to detect the running mode of the physical processor to obtain a detection result.

[0157] The determination module 602 is configured to, in response to the detection result indicating that the physical processor is switched from the physicalization mode to the virtualization mode, determine a target scheduling priority to be scheduled based on a running bitmap in a running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities.

[0158] The scheduling module 603 is configured to schedule a scheduling task to be executed in a target scheduling queue corresponding to the target scheduling priority.

[0159] Optionally, the determination module 602 is further configured to: select a target bit from a running bitmap in a running queue structure corresponding to the physical processor, wherein the position of the target bit in the running bitmap and the value of the target bit satisfy a preset condition, and the multiple scheduling priorities corresponding to the running queue structure are distributed in the multiple bits in the running bitmap in a preset arrangement order; and determine the target scheduling priority to be scheduled based on the target bit.

[0160] Optionally, the scheduling module 603 is further configured to: select a first scheduling entity corresponding to the scheduling task from a target scheduling queue corresponding to the target scheduling priority, wherein the first scheduling entity is contained in a structure of the scheduling task, and the first scheduling entity is mounted in the target scheduling queue; and run the first scheduling entity based on the target scheduling priority to schedule the scheduling task.

[0161] Optionally, in the task scheduling apparatus, the structure of the scheduling task comprises a scheduling control field, wherein the scheduling control field is used for recording a current scheduling state of the structure of the scheduling task, a scheduling plan of the first scheduling entity, and running time information of the scheduling plan of the first scheduling entity.

[0162] Optionally, in addition to comprising all the above modules, the task scheduling apparatus further comprises a refreshing module 604 (not shown in the figure) configured to: in response to the target scheduling priority being the lowest scheduling priority among the plurality of scheduling priorities or the target scheduling queue being provided with a refreshing flag, calculate the scheduling time slice corresponding to each scheduling entity in the scheduling queue corresponding to each different scheduling priority among the plurality of scheduling priorities.

[0163] Optionally, in addition to comprising all the above modules, the task scheduling apparatus further comprises a setting module 605 (not shown in the figure) configured to: determine whether the first scheduling entity exists in the target scheduling queue; and in response to the first scheduling entity existing in the target scheduling queue, set the target bit in the running bitmap.

[0164] Optionally, in addition to comprising all the above modules, the task scheduling apparatus further comprises an allocating module 606 (not shown in the figure) configured to: in response to a single scheduling entity existing in the target scheduling queue, allocate the scheduling time slice to the first scheduling entity; and in response to a plurality of scheduling entities including the first scheduling entity existing in the target scheduling queue, allocate the scheduling time slice to the plurality of scheduling entities.

[0165] Optionally, in addition to comprising all the above modules, the task scheduling apparatus further comprises a recording module 607 (not shown in the figure) configured to: determine whether the scheduling time slice allocated to the first scheduling entity is used up; and in response to the scheduling time slice allocated to the first scheduling entity not being used up, record a remaining time slice in the scheduling time slice which is not used up, wherein the remaining time slice is used for supplementing the scheduling time slice occupied by the scheduling task corresponding to a subsequent scheduling priority, the subsequent scheduling priority being lower than the target scheduling priority.

[0166] Optionally, the scheduling module 603 is further configured to: determine whether a second scheduling entity satisfying a preset condition exists in the virtualization mode, wherein the scheduling urgency of the second scheduling entity is higher than the scheduling urgency of the first scheduling entity; and in response to the second scheduling entity satisfying the preset condition not existing, select the first scheduling entity corresponding to the scheduling task from the target scheduling queue corresponding to the target scheduling priority.

[0167] Optionally, the task scheduling apparatus further comprises an in-out queue module 608 (not shown in the figure) configured to: in response to the physical processor being bound with the plurality of scheduling entities corresponding to the target scheduling priority, perform an in-queue operation on the first scheduling entity to make the first scheduling entity in-queue to the target scheduling queue; or, in response to the physical processor being bound with the plurality of scheduling entities corresponding to the target scheduling priority, perform an out-queue operation on the first scheduling entity to make the first scheduling entity out-queue from the target scheduling queue.

[0168] Optionally, the scheduling module 603 is further configured to: perform analysis on the first scheduling entity based on the target scheduling priority to obtain a scheduling task corresponding to the target scheduling priority; and perform scheduling processing on the scheduling task according to a target scheduling manner corresponding to the target scheduling priority.

[0169] It should be noted that the detection module 601, the determination module 602, and the scheduling module 603 correspond to steps S31 to S33 in Embodiment 1, and the three modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware components or software components stored in a memory (for example, the memory 104) and processed by one or more processors (for example, the processors 102a, 102b, …, 102n), and the above modules can also be run in the computer terminal 10 provided in Embodiment 1 as a part of the apparatus.

[0170] According to the embodiments of the present application, an apparatus embodiment for implementing the task scheduling method in Embodiment 2 is further provided. Figure 7 is a structural schematic diagram of another task scheduling apparatus according to Embodiment 4 of the present application, as shown in Figure 7 The apparatus comprises:

[0171] The obtaining module 701 is configured to obtain a task scheduling request through a first application programming interface, wherein the request data carried in the task scheduling request comprises: identification information of a physical processor, the identification information being used to instruct to detect a running mode of the physical processor to obtain a detection result;

[0172] The response module 702 is configured to return a task scheduling response through a second application programming interface, wherein the response data carried in the task scheduling response comprises: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on a scheduling task to be executed in a target scheduling queue corresponding to a target scheduling priority to be scheduled, the target scheduling priority being in response to the detection result indicating that the physical processor is switched from a physical mode to a virtual mode, the target scheduling priority being determined based on a running bitmap in a running queue structure corresponding to the physical processor, and different bits in the running bitmap respectively corresponding to different scheduling priorities.

[0173] It should be noted that the above-mentioned obtaining module 701 and the response module 702 correspond to steps S41 to S42 in embodiment 2, the two modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in the above-mentioned embodiment 2. It should be noted that the above-mentioned module or unit can be a hardware component or a software component stored in the memory (for example, the memory 104) and processed by one or more processors (for example, the processors 102a, 102b, …, 102n), and the above-mentioned module can also be run in the computer terminal 10 provided in embodiment 1 as part of the device.

[0174] According to the embodiments of the present application, a device embodiment for implementing the task scheduling method in the above-mentioned embodiment 3 is also provided. Figure 8 is a structural schematic diagram of still another task scheduling device according to the embodiment 4 of the present application, as shown in Figure 8 The device comprises:

[0175] The obtaining module 801 is configured to obtain a task scheduling dialogue request input at present, wherein the information carried in the task scheduling dialogue request comprises: identification information of a physical processor, the identification information being used to instruct to detect the running mode of the physical processor to obtain a detection result;

[0176] The reply module 802 is configured to return a task scheduling dialogue reply in response to the task scheduling dialogue request, wherein the information carried in the task scheduling dialogue reply comprises: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on the to-be-executed scheduling task in the target scheduling queue corresponding to the target scheduling priority to be scheduled, the target scheduling priority being determined based on a running bitmap in the running queue structure corresponding to the physical processor in response to the detection result indicating that the physical processor is switched from the physicalization mode to the virtualization mode, different bits in the running bitmap corresponding to different scheduling priorities;

[0177] The display module 803 is configured to display the scheduling processing result in a graphical user interface.

[0178] It should be noted that the above-mentioned obtaining module 801, the reply module 802 and the display module 803 correspond to steps S51 to S53 in embodiment 3, the three modules have the same instances and application scenarios as the corresponding steps, but are not limited to the content disclosed in the above-mentioned embodiment 3. It should be noted that the above-mentioned module or unit can be a hardware component or a software component stored in the memory (for example, the memory 104) and processed by one or more processors (for example, the processors 102a, 102b, …, 102n), and the above-mentioned module can also be run in the computer terminal 10 provided in embodiment 1 as part of the device.

[0179] It should be noted that the preferred embodiments of the present embodiment can refer to the related description in Embodiment 1, Embodiment 2 or Embodiment 3, which will not be repeated here.

[0180] Embodiment 5

[0181] According to the embodiments of the present application, a computer terminal is also provided, which can be any one of the computer terminal devices in the computer terminal group. Alternatively, in the present embodiment, the above-mentioned computer terminal can also be replaced by a terminal device such as a mobile terminal.

[0182] Alternatively, in the present embodiment, the above-mentioned computer terminal can be located in at least one of the network devices of the computer network.

[0183] In the present embodiment, the above-mentioned computer terminal can execute the program code of the following steps in the task scheduling method: detecting the running mode of the physical processor to obtain a detection result; in response to the detection result indicating that the physical processor is switched from the physical mode to the virtualization mode, determining a target scheduling priority to be scheduled based on the running bitmap in the running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities; and scheduling the scheduling tasks to be executed in the target scheduling queue corresponding to the target scheduling priority.

[0184] Alternatively, Figure 9 is a structural block diagram of a computer terminal according to Embodiment 5 of the present application, as Figure 9 shown, the computer terminal 90 can include one or more (only one is shown in the figure) processors 902, a memory 904, a storage controller 906, and a peripheral interface 908, wherein the peripheral interface 908 is connected with a radio frequency module, an audio module and a display.

[0185] The memory 904 can be used to store software programs and modules, such as the program instructions / modules corresponding to the task scheduling method and device in the embodiments of the present application. The processor executes the software programs and modules stored in the memory, thereby performing various functional applications and data processing, i.e., implementing the above-mentioned task scheduling method. The memory 904 can include a high-speed random access memory, and can also include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 904 can further include a memory remotely arranged with respect to the processor, which can be connected to the computer terminal 90 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0186] The processor 902 can invoke the information and application stored in the memory through the transmission device to perform the following steps: detecting the running mode of the physical processor to obtain a detection result; in response to the detection result indicating that the physical processor is switched from the physical running mode to the virtual running mode, determining a target scheduling priority to be scheduled based on a running bitmap in a running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities; and scheduling and processing a scheduling task to be executed in a target scheduling queue corresponding to the target scheduling priority.

[0187] Optionally, the processor 902 can further execute program codes of the following steps: selecting a target bit from a running bitmap in a running queue structure corresponding to the physical processor, wherein the position of the target bit in the running bitmap and the value of the target bit satisfy a preset condition, and a plurality of scheduling priorities corresponding to the running queue structure are distributed in a plurality of bits in the running bitmap in a preset arrangement order; and determining a target scheduling priority to be scheduled based on the target bit.

[0188] Optionally, the processor 902 can further execute program codes of the following steps: selecting a first scheduling entity corresponding to a scheduling task from a target scheduling queue corresponding to the target scheduling priority, wherein the first scheduling entity is contained in a structure of the scheduling task, and the first scheduling entity is mounted in the target scheduling queue; and running the first scheduling entity based on the target scheduling priority to schedule and process the scheduling task.

[0189] Optionally, the processor 902 can further execute program codes of the following steps: the structure of the scheduling task includes a scheduling control field, wherein the scheduling control field is used to record a current scheduling state of the structure of the scheduling task, a scheduling plan of the first scheduling entity, and running time information of the scheduling plan of the first scheduling entity.

[0190] Optionally, the processor 902 can further execute program codes of the following steps: in response to the target scheduling priority being a lowest scheduling priority in a plurality of scheduling priorities or the target scheduling queue being provided with a refresh flag, calculating a scheduling time slice corresponding to each scheduling entity in a scheduling queue corresponding to each scheduling priority in the plurality of scheduling priorities.

[0191] Optionally, the processor 902 can further execute program codes of the following steps: determining whether the first scheduling entity exists in the target scheduling queue; and in response to the first scheduling entity existing in the target scheduling queue, setting the target bit in the running bitmap.

[0192] Optionally, the processor 902 can further execute program codes of the following steps: in response to the existence of a single scheduling entity in the target scheduling queue, allocating a scheduling time slice to the first scheduling entity; and in response to the existence of a plurality of scheduling entities including the first scheduling entity in the target scheduling queue, allocating a scheduling time slice to the plurality of scheduling entities.

[0193] Optionally, the processor 902 can further execute program codes of the following steps: determining whether the scheduling time slice allocated to the first scheduling entity is used up; and in response to the scheduling time slice allocated to the first scheduling entity not being used up, recording a remaining time slice of the scheduling time slice which is not used up, wherein the remaining time slice is used to supplement a scheduling time slice occupied by a scheduling task corresponding to a subsequent scheduling priority which is lower than the target scheduling priority.

[0194] Optionally, the processor 902 can further execute program codes of the following steps: determining whether there exists a second scheduling entity satisfying a preset condition in the virtualization mode, wherein the scheduling urgency of the second scheduling entity is higher than the scheduling urgency of the first scheduling entity; and in response to the non-existence of the second scheduling entity satisfying the preset condition, selecting the first scheduling entity corresponding to the scheduling task from the target scheduling queue corresponding to the target scheduling priority.

[0195] Optionally, the processor 902 can further execute program codes of the following steps: in response to the binding of a plurality of scheduling entities corresponding to the target scheduling priority on the physical processor, performing an enqueuing operation on the first scheduling entity so as to make the first scheduling entity enqueued to the target scheduling queue; or in response to the binding of a plurality of scheduling entities corresponding to the target scheduling priority on the physical processor, performing a dequeuing operation on the first scheduling entity so as to make the first scheduling entity dequeued from the target scheduling queue.

[0196] Optionally, the processor 902 can further execute program codes of the following steps: performing analysis processing on the first scheduling entity based on the target scheduling priority to obtain a scheduling task corresponding to the target scheduling priority; and performing scheduling processing on the scheduling task according to a target scheduling mode corresponding to the target scheduling priority.

[0197] The processor 902 can call information and application programs stored in the memory through the transmission device to perform the following steps: obtaining a task scheduling request through a first application programming interface, wherein the request data carried in the task scheduling request includes: identification information of a physical processor, the identification information being used to indicate detection of a running mode of the physical processor to obtain a detection result; returning a task scheduling response through a second application programming interface, wherein the response data carried in the task scheduling response includes: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on a scheduling task to be executed in a target scheduling queue corresponding to a target scheduling priority to be scheduled; and the target scheduling priority being determined based on a running bitmap in a running queue structure corresponding to the physical processor, different bit positions in the running bitmap corresponding to different scheduling priorities.

[0198] The processor 902 can call information and application programs stored in the memory through the transmission device to perform the following steps: obtaining a task scheduling request through a first application programming interface, wherein the request data carried in the task scheduling request includes: identification information of a physical processor, the identification information being used to indicate detection of a running mode of the physical processor to obtain a detection result; returning a task scheduling response through a second application programming interface, wherein the response data carried in the task scheduling response includes: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on a scheduling task to be executed in a target scheduling queue corresponding to a target scheduling priority to be scheduled; and the target scheduling priority being determined based on a running bitmap in a running queue structure corresponding to the physical processor, different bit positions in the running bitmap corresponding to different scheduling priorities.

[0199] The embodiment of the present application provides a computer terminal for implementing the above task scheduling method. The running mode of the physical processor is detected to obtain a detection result; in response to the detection result indicating that the physical processor is switched from the physical mode to the virtualization mode, a target scheduling priority to be scheduled is determined based on a running bitmap in a running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities; and further, a scheduling task to be executed in a target scheduling queue corresponding to the target scheduling priority is scheduled. The present application is directed to the processor in the virtualization mode, the scheduling task in the target scheduling queue corresponding to the processor is scheduled according to the scheduling priority corresponding to the task to be scheduled, the purpose of considering the scheduling priorities of the multiple scheduling tasks corresponding to the running queue structure for task scheduling is achieved, so that the technical effects of enhancing the timeliness and accuracy of task scheduling and improving the system resource utilization are realized, and the technical problems of poor timeliness, low accuracy and low system resource utilization of task scheduling are solved.

[0200] Those skilled in the art can understand that, Figure 9 The structure shown is only schematic, and the computer terminal can also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a mobile Internet device (MID) and the like. Figure 9 It does not limit the structure of the above computer terminal. For example, the computer terminal 90 can further include more or fewer components (such as a network interface, a display device, etc.) than those shown in the figure, or have a different configuration from that shown in the figure. Figure 9 The computer terminal 90 can further include more or fewer components (such as a network interface, a display device, etc.) than those shown in the figure, or have a different configuration from that shown in the figure. Figure 9 The computer terminal 90 can further include more or fewer components (such as a network interface, a display device, etc.) than those shown in the figure, or have a different configuration from that shown in the figure.

[0201] Those skilled in the art can understand that all or part of the steps in the above-mentioned embodiments can be completed by programs instructing the hardware of the terminal device, and the programs can be stored in a computer readable storage medium, which can include a flash disk, a ROM, a RAM, a magnetic disk or an optical disk, etc.

[0202] Embodiment 6

[0203] According to the embodiment of the present application, a computer readable storage medium is further provided. Optionally, in the embodiment, the above storage medium can be used to save the program code executed by the task scheduling method provided in the above embodiment 1, embodiment 2 or embodiment 3.

[0204] Optionally, in the embodiment, the above storage medium can be located in any one of the computer terminals in a computer terminal group in a computer network, or in any one of the mobile terminals in a mobile terminal group.

[0205] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: detecting a running mode of the physical processor to obtain a detection result; in response to the detection result indicating that the physical processor switches from the physical mode to the virtualization mode, determining a target scheduling priority to be scheduled based on a running bitmap in a running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities respectively; and scheduling a scheduling task to be executed in a target scheduling queue corresponding to the target scheduling priority.

[0206] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: selecting a target bit from a running bitmap in a running queue structure corresponding to the physical processor, wherein a position of the target bit in the running bitmap and a value of the target bit satisfy a preset condition, and a plurality of scheduling priorities corresponding to the running queue structure are distributed in a plurality of bits in the running bitmap in a preset arrangement order; and determining a target scheduling priority to be scheduled based on the target bit.

[0207] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: selecting a first scheduling entity corresponding to a scheduling task from a target scheduling queue corresponding to the target scheduling priority, wherein the first scheduling entity is contained in a structure of the scheduling task, and the first scheduling entity is mounted in the target scheduling queue; and running the first scheduling entity based on the target scheduling priority to schedule the scheduling task.

[0208] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: the structure of the scheduling task includes: a scheduling control field, wherein the scheduling control field is used to record a current scheduling state of the structure of the scheduling task, a scheduling plan of the first scheduling entity, and running time information of the scheduling plan of the first scheduling entity.

[0209] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: in response to the target scheduling priority being a lowest scheduling priority in a plurality of scheduling priorities or the target scheduling queue being provided with a refresh flag, calculating a scheduling time slice corresponding to each scheduling entity in a scheduling queue corresponding to a different scheduling priority in the plurality of scheduling priorities.

[0210] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: determining whether the first scheduling entity exists in the target scheduling queue; and in response to the first scheduling entity existing in the target scheduling queue, setting the target bit in the running bitmap.

[0211] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: in response to the target scheduling queue containing a single scheduling entity, allocating a scheduling time slice to the first scheduling entity; in response to the target scheduling queue containing a plurality of scheduling entities including the first scheduling entity, allocating a scheduling time slice to the plurality of scheduling entities.

[0212] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: determining whether the scheduling time slice allocated to the first scheduling entity is used up; in response to the scheduling time slice allocated to the first scheduling entity not being used up, recording a remaining time slice of the scheduling time slice which is not used up, wherein the remaining time slice is used to supplement a scheduling time slice occupied by a scheduling task corresponding to a subsequent scheduling priority which is lower than the target scheduling priority.

[0213] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: determining whether there is a second scheduling entity satisfying a preset condition in the virtualization mode, wherein the scheduling urgency of the second scheduling entity is higher than the scheduling urgency of the first scheduling entity; in response to there being no second scheduling entity satisfying the preset condition, selecting the first scheduling entity corresponding to the scheduling task from the target scheduling queue corresponding to the target scheduling priority.

[0214] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: in response to the physical processor being bound with a plurality of scheduling entities corresponding to the target scheduling priority, performing an enqueuing operation on the first scheduling entity to make the first scheduling entity enqueued to the target scheduling queue; or, in response to the physical processor being bound with a plurality of scheduling entities corresponding to the target scheduling priority, performing a dequeuing operation on the first scheduling entity to make the first scheduling entity dequeued from the target scheduling queue.

[0215] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: performing analysis processing on the first scheduling entity based on the target scheduling priority to obtain a scheduling task corresponding to the target scheduling priority; and performing scheduling processing on the scheduling task according to a target scheduling mode corresponding to the target scheduling priority.

[0216] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: obtaining a task scheduling request through a first application programming interface, wherein the request data carried in the task scheduling request comprises: identification information of the physical processor, the identification information being used to instruct to detect the running mode of the physical processor to obtain a detection result; returning a task scheduling response through a second application programming interface, wherein the response data carried in the task scheduling response comprises: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on the to-be-executed scheduling tasks in the target scheduling queue corresponding to a target scheduling priority; the target scheduling priority being determined based on a running bitmap in a running queue structure corresponding to the physical processor in response to the detection result indicating that the physical processor is switched from the physicalization mode to the virtualization mode, different bit positions in the running bitmap respectively corresponding to different scheduling priorities.

[0217] Optionally, in the embodiment, the computer readable storage medium is configured to store program code for performing the following steps: obtaining a task scheduling request through a first application programming interface, wherein the request data carried in the task scheduling request comprises: identification information of the physical processor, the identification information being used to instruct to detect the running mode of the physical processor to obtain a detection result; returning a task scheduling response through a second application programming interface, wherein the response data carried in the task scheduling response comprises: a scheduling processing result, the scheduling processing result being obtained by performing scheduling processing on the to-be-executed scheduling tasks in the target scheduling queue corresponding to a target scheduling priority; the target scheduling priority being determined based on a running bitmap in a running queue structure corresponding to the physical processor in response to the detection result indicating that the physical processor is switched from the physicalization mode to the virtualization mode, different bit positions in the running bitmap respectively corresponding to different scheduling priorities.

[0218] The embodiment of the present application provides a computer readable storage medium for implementing the above task scheduling method. The running mode of the physical processor is detected to obtain a detection result; in response to the detection result indicating that the physical processor is switched from the physical mode to the virtualization mode, a target scheduling priority to be scheduled is determined based on a running bitmap in a running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities; and further, a scheduling task to be executed in a target scheduling queue corresponding to the target scheduling priority is scheduled. The present application is directed to the processor in the virtualization mode, the scheduling task in the target scheduling queue corresponding to the processor is scheduled according to the scheduling priority corresponding to the task to be scheduled, the scheduling priority of the multiple scheduling tasks corresponding to the running queue structure is considered in the task scheduling, and therefore, the technical effects of enhancing the timeliness and accuracy of the task scheduling and improving the system resource utilization are achieved, and the technical problems of poor timeliness, low accuracy and low system resource utilization of the task scheduling are solved.

[0219] According to the embodiment of the present application, a computer program product is further provided. Optionally, in the embodiment, the computer program product can provide the task scheduling service based on the task scheduling method provided in the above embodiment 1, embodiment 2 or embodiment 3.

[0220] Optionally, in the embodiment, the computer program product can be a set of instructions and codes pre-written according to the above task scheduling method. The computer program product can run on various different computer platforms, including personal computers, servers, mobile devices and the like.

[0221] Optionally, in the embodiment, the instructions and codes corresponding to the computer program product are used to implement the following method steps: detecting the running mode of the physical processor to obtain a detection result; in response to the detection result indicating that the physical processor is switched from the physical mode to the virtualization mode, determining a target scheduling priority to be scheduled based on a running bitmap in a running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities; and scheduling a scheduling task to be executed in a target scheduling queue corresponding to the target scheduling priority.

[0222] By means of the computer program product, the task scheduling service can be provided in the application scenario related to task scheduling in the virtualized computing environment, the scheduling tasks in the target scheduling queue corresponding to the processor are scheduled according to the scheduling priority corresponding to the to-be-scheduled task, the scheduling priority of the plurality of scheduling tasks corresponding to the running queue structure is considered for the task scheduling, and the technical effects of enhancing the timeliness and accuracy of task scheduling and improving the system resource utilization are achieved, and thus the technical problems of poor timeliness, low accuracy and low system resource utilization of task scheduling are solved.

[0223] The sequence numbers of the above embodiments of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.

[0224] In the above embodiments of the present application, the description of each embodiment has its own emphasis, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0225] In the several embodiments provided by the present application, it should be understood that the disclosed technology can be implemented in other ways. Of course, the unit embodiment described above is only schematic. For example, the division of the units is only a logical function division. There can be another division manner for actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed coupling or direct coupling or communication connection between the units can be indirect coupling or communication connection through some interface, or electrical or other form.

[0226] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment.

[0227] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0228] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a ROM, a RAM, a mobile hard disk, a magnetic disk or an optical disk.

[0229] The above is only the preferred embodiment of the present application. It should be noted that for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should also be considered as the protection scope of the present application.

Claims

1. A task scheduling method, characterized in that, include: The operating mode of the physical processor is detected, and the detection results are obtained; In response to the detection result indicating that the physical processor has switched from physical mode to virtualization mode, the target scheduling priority to be scheduled is determined based on the running bitmap in the running queue structure corresponding to the physical processor, wherein different bits in the running bitmap correspond to different scheduling priorities. The scheduling tasks to be executed in the target scheduling queue corresponding to the target scheduling priority are scheduled.

2. The task scheduling method according to claim 1, characterized in that, Based on the running bitmap in the running queue structure corresponding to the physical processor, the target scheduling priority to be scheduled is determined by: A target bit is selected from the running bitmap in the running queue structure corresponding to the physical processor, wherein the position of the target bit in the running bitmap and the value of the target bit satisfy a preset condition, and multiple scheduling priorities corresponding to the running queue structure are distributed in a preset order among multiple bits in the running bitmap. The target scheduling priority is determined based on the target bit.

3. The task scheduling method according to claim 1, characterized in that, The scheduling process for the scheduled tasks to be executed in the target scheduling queue corresponding to the target scheduling priority includes: Select the first scheduling entity corresponding to the scheduling task from the target scheduling queue corresponding to the target scheduling priority, wherein the first scheduling entity is contained in the structure of the scheduling task and the first scheduling entity is attached to the target scheduling queue; The first scheduling entity is run based on the target scheduling priority to perform scheduling processing on the scheduling task.

4. The task scheduling method according to claim 3, characterized in that, The structure of the scheduling task includes a scheduling control field, wherein the scheduling control field is used to record the current scheduling status of the structure of the scheduling task, the scheduling plan of the first scheduling entity, and the running time information of the scheduling plan of the first scheduling entity.

5. The task scheduling method according to claim 3, characterized in that, The task scheduling method further includes: In response to the target scheduling priority being the lowest among multiple scheduling priorities or the target scheduling queue being set with a refresh flag, the scheduling time slices corresponding to each scheduling entity in the scheduling queue corresponding to different scheduling priorities among the multiple scheduling priorities are calculated.

6. The task scheduling method according to claim 3, characterized in that, The task scheduling method further includes: Determine whether the first scheduling entity exists in the target scheduling queue; In response to the presence of the first scheduling entity in the target scheduling queue, the target bit is set in the running bitmap.

7. The task scheduling method according to claim 5, characterized in that, The task scheduling method further includes: In response to the presence of a single scheduling entity in the target scheduling queue, the scheduling time slice is allocated to the first scheduling entity; In response to the existence of multiple scheduling entities including the first scheduling entity in the target scheduling queue, the scheduling time slice is allocated to the multiple scheduling entities.

8. The task scheduling method according to claim 7, characterized in that, The task scheduling method further includes: Determine whether the scheduling time slice allocated to the first scheduling entity has been used up; In response to the fact that the scheduling time slice allocated to the first scheduling entity is not fully used, the remaining unused time slice in the scheduling time slice is recorded, wherein the remaining time slice is used to supplement the scheduling time slice occupied by the scheduling task corresponding to the subsequent scheduling priority, and the subsequent scheduling priority is lower than the target scheduling priority.

9. The task scheduling method according to claim 3, characterized in that, Selecting the first scheduling entity corresponding to the scheduling task from the target scheduling queue corresponding to the target scheduling priority includes: Determine whether a second scheduling entity that meets preset conditions exists in the virtualization mode; In response to the absence of a second scheduling entity that meets the preset conditions, a first scheduling entity corresponding to the scheduling task is selected from the target scheduling queue corresponding to the target scheduling priority; The scheduling urgency of the second scheduling entity is higher than that of the first scheduling entity.

10. The task scheduling method according to claim 3, characterized in that, The task scheduling method further includes: In response to the fact that multiple scheduling entities corresponding to the target scheduling priority are bound to the physical processor, an enqueue operation is performed on the first scheduling entity to enqueue the first scheduling entity into the target scheduling queue; or... In response to the multiple scheduling entities bound to the physical processor corresponding to the target scheduling priority, a dequeue operation is performed on the first scheduling entity to dequeue the first scheduling entity from the target scheduling queue.

11. The task scheduling method according to claim 3, characterized in that, The first scheduling entity is run based on the target scheduling priority, and the scheduling processing of the scheduling task includes: Based on the target scheduling priority, the first scheduling entity is parsed to obtain the scheduling task corresponding to the target scheduling priority; The scheduling task is processed according to the target scheduling method corresponding to the target scheduling priority.

12. A task scheduling method, characterized in that, include: A task scheduling request is obtained through a first application programming interface, wherein the request data carried in the task scheduling request includes: identification information of the physical processor, the identification information being used to indicate the detection of the physical processor's operating mode in order to obtain the detection result; The task scheduling response is returned through the second application programming interface. The response data carried in the task scheduling response includes: a scheduling processing result, which is obtained by scheduling the scheduled tasks to be executed in the target scheduling queue corresponding to the target scheduling priority to be scheduled. The target scheduling priority is determined based on the running bitmap in the running queue structure corresponding to the physical processor, in response to the detection result indicating that the physical processor has switched from physical mode to virtualization mode. Different bits in the running bitmap correspond to different scheduling priorities.

13. A task scheduling method, characterized in that, include: Obtain the currently input task scheduling dialogue request, wherein the information carried in the task scheduling dialogue request includes: the identification information of the physical processor, which is used to indicate the detection of the physical processor's operating mode to obtain the detection result; In response to the task scheduling dialogue request, a task scheduling dialogue response is returned, wherein the information carried in the task scheduling dialogue response includes: a scheduling processing result, which is obtained by scheduling the scheduled tasks to be executed in the target scheduling queue corresponding to the target scheduling priority to be scheduled, and the target scheduling priority is determined based on the running bitmap in the running queue structure corresponding to the physical processor in response to the detection result indicating that the physical processor has switched from physical mode to virtualization mode, and different bits in the running bitmap correspond to different scheduling priorities; The scheduling results are displayed within a graphical user interface.

14. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, executes the task scheduling method according to any one of claims 1 to 13.

15. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium resides to perform the task scheduling method according to any one of claims 1 to 13.

16. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the task scheduling method according to any one of claims 1 to 13.