Task scheduling system and method, electronic device and storage medium

By monitoring virtual machine tasks and physical processor load information, dynamically adjusting virtual processor priorities and scheduling, the problem of inconsistent task priorities in heterogeneous operating system hybrid virtualization systems is solved, achieving stable task operation and efficient resource utilization.

CN122152444APending Publication Date: 2026-06-05CHINA MOBILE COMM LTD RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA MOBILE COMM LTD RES INST
Filing Date
2026-01-19
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In heterogeneous operating system hybrid virtualization systems, the lack of a unified metric for task priorities leads to task timeouts when priorities are reversed or physical resource load changes, making it difficult to achieve reliable task scheduling.

Method used

The task awareness module and load awareness module monitor virtual machine task and physical processor load information. The management module dynamically adjusts the priority of virtual processors according to the early warning conditions, and schedules them to the corresponding physical processors for execution through the scheduling module, so as to achieve precise allocation of physical computing resources.

Benefits of technology

It improves system scheduling flexibility and resource utilization efficiency, and ensures the stable operation of virtual machine tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122152444A_ABST
    Figure CN122152444A_ABST
Patent Text Reader

Abstract

The present disclosure discloses a task scheduling system and method, and an electronic device and a storage medium, comprising: a management unit and at least one virtual machine; the management unit comprises a task perception module, a load perception module, a management module and a scheduling module; the task perception module is used for monitoring task information of a virtual machine task in each virtual machine; the load perception module is used for monitoring load information of each physical processor; the management module is used for updating the priority of a virtual processor in the case of determining that the task information and / or the load information meet a pre-warning condition, and generating a scheduling decision for the virtual processor according to the priority of the virtual processor after the update; the scheduling module is used for scheduling the virtual processor to the corresponding physical processor for execution; the accurate information monitoring and the dynamic adjustment of the priority optimize the allocation of physical computing resources, and the pre-warning response and the scheduling execution guarantee the stable operation of the virtual machine task, and improve the scheduling flexibility and the resource utilization efficiency of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a task scheduling system, method, electronic device, and storage medium. Background Technology

[0002] In recent years, driven by factors such as improved performance of central processing units (CPUs), widespread adoption of multi-core technology, and the need to integrate various heterogeneous workloads, the demand for hybrid virtualization of heterogeneous operating systems in embedded systems has become increasingly prominent, and virtualization technology has gradually received widespread attention in embedded systems.

[0003] In related technologies, the scheduling architecture adopted by heterogeneous operating system hybrid virtualization systems is used to support highly scalable scenarios with multiple virtual machines (VMs) running concurrently and to carry out task scheduling. However, the task priorities of heterogeneous operating systems in different VMs lack a unified metric standard, which can easily lead to priority inversion and cannot dynamically adapt to changes in physical resource load, resulting in task processing timeouts and making it difficult to achieve reliable task scheduling. Summary of the Invention

[0004] This disclosure provides a task scheduling system, method, electronic device, and storage medium to solve problems in related technologies. It optimizes the allocation of physical computing resources by relying on accurate information monitoring and dynamic priority adjustment, and ensures the stable operation of virtual machine tasks through early warning response and scheduling execution, thereby improving the system scheduling flexibility and resource utilization efficiency.

[0005] According to a first aspect of this disclosure, a task scheduling system is provided, the system comprising: a management unit and at least one virtual machine; wherein, the management unit includes a task awareness module, a load awareness module, a management module, and a scheduling module; wherein... The task awareness module is used to monitor the task information of virtual machine tasks within each virtual machine and send the task information to the management module. The load awareness module is used to monitor the load information of each physical processor and send the load information to the management module; wherein, the physical processor provides physical computing resources for the virtual processor; The management module is configured to update the priority of the virtual processor when it is determined that the task information and / or the load information meet the warning conditions, and generate a scheduling decision for the virtual processor based on the updated virtual processor priority, and send the scheduling decision to the scheduling module; wherein, the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors; The scheduling module is used to schedule the virtual processor to the corresponding physical processor for execution based on the scheduling decision received from the management module.

[0006] In some embodiments of this disclosure, the management module is further configured to: The scheduling value of each virtual processor is calculated based on the task type in the task information. The priority of each virtual processor is determined based on the scheduling value.

[0007] In some embodiments of this disclosure, the management module is further configured to: For a virtual processor carrying a real-time task, the scheduling time limit and allowable jitter ratio of the real-time task are calculated to obtain a real-time value component; wherein, the task type includes the real-time task and non-real-time task; For the virtual processor carrying the non-real-time task, the runtime of the non-real-time task is calculated to obtain the non-real-time value component. The scheduling value of each virtual processor is determined based on the real-time value component and the non-real-time value component.

[0008] In some embodiments of this disclosure, the management module is further configured to: In the initial state, the virtual processors are sorted by their scheduling value to obtain a sorted list; The scheduling value of each virtual processor is mapped to a preset priority range according to the sorting list to determine the priority allocation of each virtual processor.

[0009] In some embodiments of this disclosure, the management module is further configured to: If the task information is determined to satisfy the condition that the virtual machine task is longer than a preset time threshold, the virtual processor to which the virtual machine task belongs is located, the scheduling value and corresponding priority of the virtual processor are updated, and the target virtual processor is obtained. The scheduling value of the target virtual processor is compared with the scheduling value of the previous adjacent priority virtual processor to obtain a comparison result; wherein, the previous adjacent priority virtual processor is the virtual processor in the sorting list within the same virtual machine that is located before the target virtual processor; If the comparison result indicates that the scheduling value of the target virtual processor is less than or equal to the scheduling value of the previous adjacent priority virtual processor, the scheduling value and corresponding priority of the target virtual processor are updated. If the comparison result indicates that the scheduling value of the target virtual processor is greater than the scheduling value of the previous adjacent priority virtual processor, the priorities of all virtual processors in the sorted list are updated sequentially according to their priority order to obtain the updated sorted list.

[0010] In some embodiments of this disclosure, the management module is further configured to: If the load information satisfies that the physical processor load value is greater than a preset load threshold and there are at least two virtual processors on the physical processor, then all virtual processors on the physical processor are sorted by priority, and the virtual processor with the lowest priority is moved out to the physical processor with normal load. If the load information satisfies that the physical processor load value is greater than a preset load threshold and there is a virtual processor on the physical processor, the virtual machine tasks carried by the virtual processor are adjusted, and the scheduling value and corresponding priority of all virtual processors are updated.

[0011] In some embodiments of this disclosure, the management module is further configured to: If it is determined that the alarm virtual processor is not the lowest priority virtual processor, and the physical processor to which the virtual processors other than the alarm virtual processor belong is a physical processor with normal load, the virtual machine task with the lowest priority in the alarm virtual processor is migrated to the lowest priority virtual processor in the same virtual machine; wherein, the alarm virtual processor is a virtual processor located on a physical processor whose physical processor load value is greater than a preset load threshold. If the alarm virtual processor is determined to be the lowest priority virtual processor, a new virtual processor is created to host the lowest priority virtual machine task.

[0012] In some embodiments of this disclosure, the task awareness module is further configured to: The scheduling delay for this task is determined based on the time interval between the current task scheduling time and the previous adjacent task scheduling time, as well as the task scheduling time limit. Based on the current task scheduling delay, the maximum task scheduling delay and the minimum task scheduling delay are determined, and the task scheduling delay jitter is determined according to the maximum task scheduling delay and the minimum task scheduling delay; wherein, if the task information and / or the load information meet the warning conditions, the task scheduling delay jitter is recalculated. The task information is sent to the management module; wherein the task information includes at least one of the following: the current task scheduling time, the previous adjacent task scheduling time, the current task scheduling delay, the maximum task scheduling delay, the minimum task scheduling delay, and the task scheduling delay jitter.

[0013] In some embodiments of this disclosure, the load sensing module is further configured to: The load value of all physical processors is determined based on the statistical time slice and idle time slice of the physical processors. The load information is sent to the management module; wherein the load information includes at least one of the statistical time slice, the idle time slice, and the load value.

[0014] In some embodiments of this disclosure, the virtual machine includes at least one virtual processor, the virtual processor being used for: The hardware resources of the physical processor are simulated based on virtual resources; wherein, the virtual resources include at least one of virtual page table registers, virtual segment registers, and virtual status registers; Determine whether the virtual machine task needs to be rescheduled; If it is determined that the virtual machine task does not need to be rescheduled, the virtual machine task is executed by a worker thread, and virtual machine task switching is performed within the set of virtual machine tasks determined in the management module; wherein, the worker thread is used to monitor the execution status of the virtual machine task and calculate the task scheduling latency jitter of the virtual machine task; If it is determined that the virtual machine task needs to be rescheduled, the idle time slices of the physical processor are counted by the idle thread.

[0015] According to a second aspect of this disclosure, a task scheduling method is provided, comprising: Monitor the task information of virtual machine tasks within each virtual machine and the load information of each physical processor; wherein, the physical processor provides physical computing resources for the virtual processor; If the task information and / or the load information meet the warning conditions, the priority of the virtual processor is updated, and a scheduling decision for the virtual processor is generated based on the updated priority of the virtual processor; wherein, the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors; Based on the scheduling decision, the virtual processor is scheduled to be executed on the corresponding physical processor.

[0016] In some embodiments of this disclosure, before updating the priority of the virtual processor upon determining that the task information and / or the load information meet the warning conditions, the method further includes: The scheduling value of each virtual processor is calculated based on the task type in the task information. The priority of each virtual processor is determined based on the scheduling value.

[0017] In some embodiments of this disclosure, calculating the scheduling value of each virtual processor based on the task type in the task information includes: For a virtual processor carrying a real-time task, the scheduling time limit and allowable jitter ratio of the real-time task are calculated to obtain a real-time value component; wherein, the task type includes the real-time task and non-real-time task; For the virtual processor carrying the non-real-time task, the runtime of the non-real-time task is calculated to obtain the non-real-time value component. The scheduling value of each virtual processor is determined based on the real-time value component and the non-real-time value component.

[0018] In some embodiments of this disclosure, determining the priority of each virtual processor based on the scheduling value includes: In the initial state, the virtual processors are sorted by their scheduling value to obtain a sorted list; The scheduling value of each virtual processor is mapped to a preset priority range according to the sorting list to determine the priority allocation of each virtual processor.

[0019] In some embodiments of this disclosure, updating the priority of the virtual processor when it is determined that the task information and / or the load information meet the warning conditions includes: If the task information is determined to satisfy the condition that the virtual machine task is longer than a preset time threshold, the virtual processor to which the virtual machine task belongs is located, the scheduling value and corresponding priority of the virtual processor are updated, and the target virtual processor is obtained. The scheduling value of the target virtual processor is compared with the scheduling value of the previous adjacent priority virtual processor to obtain a comparison result; wherein, the previous adjacent priority virtual processor is the virtual processor in the sorting list within the same virtual machine that is located before the target virtual processor; If the comparison result indicates that the scheduling value of the target virtual processor is less than or equal to the scheduling value of the previous adjacent priority virtual processor, the scheduling value and corresponding priority of the target virtual processor are updated. If the comparison result indicates that the scheduling value of the target virtual processor is greater than the scheduling value of the previous adjacent priority virtual processor, the priorities of all virtual processors in the sorted list are updated sequentially according to their priority order to obtain the updated sorted list.

[0020] In some embodiments of this disclosure, updating the priority of the virtual processor when it is determined that the task information and / or the load information meet the warning conditions further includes: If the load information satisfies that the physical processor load value is greater than a preset load threshold and there are at least two virtual processors on the physical processor, then all virtual processors on the physical processor are sorted by priority, and the virtual processor with the lowest priority is moved out to the physical processor with normal load. If the load information satisfies that the physical processor load value is greater than a preset load threshold and there is a virtual processor on the physical processor, the virtual machine tasks carried by the virtual processor are adjusted, and the scheduling value and corresponding priority of all virtual processors are updated.

[0021] In some embodiments of this disclosure, adjusting the virtual machine task carried by the virtual processor when the load information satisfies that the physical processor load value is greater than a preset load threshold and a virtual processor exists on the physical processor includes: If it is determined that the alarm virtual processor is not the lowest priority virtual processor, and the physical processor to which the virtual processors other than the alarm virtual processor belong is a physical processor with normal load, the virtual machine task with the lowest priority in the alarm virtual processor is migrated to the lowest priority virtual processor in the same virtual machine; wherein, the alarm virtual processor is a virtual processor located on a physical processor whose physical processor load value is greater than a preset load threshold. If the alarm virtual processor is determined to be the lowest priority virtual processor, a new virtual processor is created to host the lowest priority virtual machine task.

[0022] In some embodiments of this disclosure, the task information includes at least one of the following: current task scheduling time, previous adjacent task scheduling time, current task scheduling latency, maximum task scheduling latency, minimum task scheduling latency, and task scheduling latency jitter. Monitoring the task information of virtual machine tasks within each virtual machine and the load information of each physical processor includes: The task scheduling delay is determined based on the time interval between the current task scheduling time and the previous adjacent task scheduling time, as well as the task scheduling time limit. Based on the current task scheduling delay, the maximum task scheduling delay and the minimum task scheduling delay are determined, and the task scheduling delay jitter is determined according to the maximum task scheduling delay and the minimum task scheduling delay; wherein, if the task information and / or the load information are determined to meet the warning conditions, the task scheduling delay jitter is recalculated.

[0023] In some embodiments of this disclosure, the monitoring of task information of virtual machine tasks within each virtual machine and load information of each physical processor further includes: Based on the statistical time slices and idle time slices of the physical processors, the load values ​​of all physical processors are determined; wherein the load information includes at least one of the statistical time slices, the idle time slices, and the load values.

[0024] In some embodiments of this disclosure, the operation of the virtual processor includes: The hardware resources of the physical processor are simulated based on virtual resources; wherein, the virtual resources include at least one of virtual page table registers, virtual segment registers, and virtual status registers; Determine whether the virtual machine task needs to be rescheduled; If it is determined that the virtual machine task does not need to be rescheduled, the virtual machine task is executed by a worker thread, and virtual machine task switching is performed within a preset set of virtual machine tasks; wherein, the worker thread is used to monitor the execution status of the virtual machine task and calculate the task scheduling latency jitter of the virtual machine task; If it is determined that the virtual machine task needs to be rescheduled, the idle time slices of the physical processor are counted by the idle thread.

[0025] According to a third aspect of this disclosure, a task scheduling apparatus is provided, comprising: The monitoring unit is used to monitor the task information of virtual machine tasks within each virtual machine and the load information of each physical processor; wherein, the physical processor provides physical computing resources for the virtual processor; An update unit is used to update the priority of the virtual processor when it is determined that the task information and / or the load information meet the warning conditions; A generation unit is configured to generate a scheduling decision for the virtual processor based on the updated priority of the virtual processor; wherein the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors; The scheduling unit is used to schedule the virtual processor to the corresponding physical processor for execution according to the scheduling decision.

[0026] In some embodiments of this disclosure, the apparatus further includes: A calculation unit is configured to calculate the scheduling value of each virtual processor based on the task type in the task information before the update unit updates the priority of the virtual processor when it determines that the task information and / or the load information meet the warning conditions. A determining unit is configured to determine the priority of each virtual processor based on the scheduling value.

[0027] In some embodiments of this disclosure, the computing unit includes: The first calculation module is used to calculate the scheduling time limit and allowable jitter ratio of the real-time task for the virtual processor carrying the real-time task, and obtain the real-time value component; wherein, the task type includes the real-time task and the non-real-time task. The second calculation module is used to calculate the runtime of the non-real-time task for the virtual processor carrying the non-real-time task, and obtain the non-real-time value component. The first determining module is used to determine the scheduling value of each virtual processor based on the real-time value component and the non-real-time value component.

[0028] In some embodiments of this disclosure, the determining unit includes: The first sorting module is used to sort the virtual processors based on their scheduling value in the initial state to obtain a sorted list. The second determining module is used to map the scheduling value of each virtual processor to a preset priority range according to the sorting list, and determine the priority allocation of each virtual processor.

[0029] In some embodiments of this disclosure, the updating unit includes: The first update module is used to locate the virtual processor to which the virtual machine task belongs, update the scheduling value and corresponding priority of the virtual processor, and obtain the target virtual processor when it is determined that the task information satisfies that the virtual machine task is greater than a preset time threshold. The comparison module is used to compare the scheduling value of the target virtual processor with the scheduling value of the previous adjacent priority virtual processor to obtain a comparison result; wherein, the previous adjacent priority virtual processor is the virtual processor located before the target virtual processor in the sorting list within the same virtual machine; The second update module is used to update the scheduling value and corresponding priority of the target virtual processor when the comparison result indicates that the scheduling value of the target virtual processor is less than or equal to the scheduling value of the previous adjacent priority virtual processor. The third update module is used to update the priorities of all virtual processors in the sorted list in order of priority when the comparison result indicates that the scheduling value of the target virtual processor is greater than the scheduling value of the previous adjacent priority virtual processor, so as to obtain the updated sorted list.

[0030] In some embodiments of this disclosure, the updating unit further includes: The second sorting module is used to sort all virtual processors on the physical processor according to priority when it is determined that the load information satisfies that the physical processor load value is greater than a preset load threshold and there are at least two virtual processors on the physical processor, and to move the virtual processor with the lowest priority to the physical processor with normal load. The adjustment module is used to adjust the virtual machine tasks carried by the virtual processor when it is determined that the load information satisfies that the physical processor load value is greater than a preset load threshold and there is a virtual processor on the physical processor; The fourth update module is used to update the scheduling value and corresponding priority of all virtual processors.

[0031] In some embodiments of this disclosure, the adjustment module includes: The migration submodule is used to migrate the lowest priority virtual machine task in the alarm virtual processor to the lowest priority virtual processor in the same virtual machine when it is determined that the alarm virtual processor is not the lowest priority virtual processor and the physical processor to which the virtual processor other than the alarm virtual processor belongs is a physical processor with normal load; wherein, the alarm virtual processor is a virtual processor located on a physical processor whose physical processor load value is greater than a preset load threshold. A submodule is created to create a new virtual processor to host the lowest priority virtual machine task if the alarm virtual processor is determined to be the lowest priority virtual processor.

[0032] In some embodiments of this disclosure, the task information includes at least one of the following: current task scheduling time, previous adjacent task scheduling time, current task scheduling delay, maximum task scheduling delay, minimum task scheduling delay, and task scheduling delay jitter. The monitoring unit includes: The third determining module is used to determine the task scheduling delay based on the time interval between the current task scheduling time and the previous adjacent task scheduling time and the task scheduling time limit; The fourth determining module is used to determine the maximum task scheduling delay and the minimum task scheduling delay based on the current task scheduling delay, and to determine the task scheduling delay jitter based on the maximum task scheduling delay and the minimum task scheduling delay; wherein, if it is determined that the task information and / or the load information meet the warning conditions, the task scheduling delay jitter is recalculated.

[0033] In some embodiments of this disclosure, the monitoring unit further includes: The fifth determining module is used to determine the load value of all physical processors based on the statistical time slice and idle time slice of the physical processor; wherein the load information includes at least one of the statistical time slice, the idle time slice and the load value.

[0034] In some embodiments of this disclosure, the apparatus further includes: an operating unit, the operating unit comprising: The simulation module is used to simulate the hardware resources of the physical processor based on virtual resources; wherein, the virtual resources include at least one of virtual page table registers, virtual segment registers, and virtual status registers; The judgment module is used to determine whether the virtual machine task needs to be rescheduled; The switching module is used to execute the virtual machine task through a worker thread and switch virtual machine tasks within a preset set of virtual machine tasks when it is determined that the virtual machine task does not need to be rescheduled; wherein, the worker thread is used to monitor the execution status of the virtual machine task and calculate the task scheduling latency jitter of the virtual machine task. The statistics module is used to count the idle time slices of the physical processor by using idle threads when it is determined that the virtual machine task needs to be rescheduled.

[0035] According to a fourth aspect of this disclosure, an electronic device is provided, comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in the second aspect of the preceding embodiments.

[0036] According to a fifth aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the method described in the second aspect of the preceding description.

[0037] According to a sixth aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method described in the second aspect of the foregoing.

[0038] In summary, the task scheduling system, method, electronic device, and storage medium provided in this disclosure include: a management unit and at least one virtual machine; wherein the management unit includes a task awareness module, a load awareness module, a management module, and a scheduling module; wherein the task awareness module is used to monitor the task information of virtual machine tasks within each virtual machine and send the task information to the management module; the load awareness module is used to monitor the load information of each physical processor and send the load information to the management module; wherein the physical processor provides physical computing resources for the virtual processor; the management module is used to update the priority of the virtual processor when it is determined that the task information and / or load information meet the warning conditions, and generate a scheduling decision for the virtual processor based on the updated virtual processor priority, and send the scheduling decision to the scheduling module; wherein the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors; the scheduling module is used to schedule the virtual processor to the corresponding physical processor for execution according to the scheduling decision sent by the management module; relying on accurate information monitoring and dynamic priority adjustment, the allocation of physical computing resources is optimized, and the stable operation of virtual machine tasks is ensured through warning response and scheduling execution, thereby improving the system scheduling flexibility and resource utilization efficiency.

[0039] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0040] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein: Figure 1 This is a schematic diagram of the structure of a task scheduling system provided in an embodiment of the present disclosure; Figure 2 A schematic diagram illustrating the scheduling value and priority mapping of a virtual processor provided in an embodiment of this disclosure; Figure 3 A schematic diagram illustrating the priority adjustment process of a virtual processor provided in an embodiment of this disclosure; Figure 4 A schematic diagram of a load adjustment process for a physical processor provided in an embodiment of this disclosure; Figure 5 This is a schematic flowchart of a load sensing module processing provided in an embodiment of the present disclosure; Figure 6This is a schematic diagram illustrating the operation of a virtual processor according to an embodiment of the present disclosure; Figure 7 This is a schematic diagram of the initialization process of a task scheduling system provided in an embodiment of the present disclosure; Figure 8 This is a schematic diagram of a virtual processor reconstruction process provided in an embodiment of the present disclosure; Figure 9 This is a schematic diagram of a collaborative scheduling structure of a task scheduling system provided in an embodiment of the present disclosure; Figure 10 This is a flowchart illustrating a task scheduling method provided in an embodiment of the present disclosure; Figure 11 This is a flowchart illustrating another task scheduling method provided in an embodiment of the present disclosure; Figure 12 This is a flowchart illustrating another task scheduling method provided in an embodiment of the present disclosure; Figure 13 This is a flowchart illustrating another task scheduling method provided in an embodiment of the present disclosure; Figure 14 This is a flowchart illustrating another task scheduling method provided in an embodiment of the present disclosure; Figure 15 This is a flowchart illustrating another task scheduling method provided in an embodiment of the present disclosure; Figure 16 This is a flowchart illustrating another task scheduling method provided in an embodiment of the present disclosure; Figure 17 This is a flowchart illustrating another task scheduling method provided in an embodiment of the present disclosure; Figure 18 This is a flowchart illustrating another task scheduling method provided in an embodiment of the present disclosure; Figure 19 This is a schematic diagram of the structure of a task scheduling device provided in an embodiment of the present disclosure; Figure 20 This is a schematic diagram of another task scheduling device provided in an embodiment of the present disclosure; Figure 21 A schematic block diagram of an example electronic device provided for embodiments of this disclosure. Detailed Implementation

[0041] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0042] The following description, with reference to the accompanying drawings, outlines a task scheduling system, method, electronic device, and storage medium according to embodiments of the present disclosure.

[0043] Figure 1 This is a schematic diagram of the structure of a task scheduling system provided in an embodiment of the present disclosure.

[0044] like Figure 1 As shown, the system includes: The system includes a management unit 1 and at least one virtual machine 2; wherein the management unit 1 comprises a task awareness module 11, a load awareness module 12, a management module 13, and a scheduling module 14; wherein, The task awareness module 11 is used to monitor the task information of virtual machine tasks in each virtual machine 2 and send the task information to the management module 13.

[0045] In some embodiments, the task awareness module 11 acquires relevant status data of virtual machine tasks within each virtual machine 2 and transmits it to the management module 13. It establishes a communication connection with the task management component inside the virtual machine 2 to capture data such as the identification information and current execution status of virtual machine tasks in real time. These data together constitute the task information required for decision-making. In actual applications, the task awareness module 11 and the virtual machine 2 can use a transmission protocol or a dedicated communication bus inside the virtualization system for data transmission. The data transmission method can be flexibly selected according to the scenario. It can be configured to send data periodically at fixed time intervals, or it can be triggered when the status of the virtual machine task is detected to change, ensuring that the management module 13 can obtain the task dynamics in a timely manner.

[0046] The load awareness module 12 is used to monitor the load information of each physical processor and send the load information to the management module 13; wherein, the physical processor provides physical computing resources for the virtual processor.

[0047] In some embodiments, the virtual processor's computational instructions need to rely on the physical processor's resources to be executed. Therefore, the load information collected by the load sensing module 12 reflects the physical processor's resource occupancy status and is the basis for judging whether the resource allocation is reasonable. After the load sensing module 12 obtains the physical processor's operating data in a specific way and organizes it into load information, it synchronously transmits it to the management module 13.

[0048] The management module 13 is used to update the priority of the virtual processor when it is determined that the task information and / or the load information meet the warning conditions, and to generate a scheduling decision for the virtual processor based on the updated priority of the virtual processor, and send the scheduling decision to the scheduling module 14; wherein, the priority of the virtual processor is determined according to the mapping relationship between the virtual machine task and the virtual processor.

[0049] In some embodiments, after receiving task information sent by task awareness module 11 and load information sent by load awareness module 12, management module 13 first checks whether the warning conditions are met according to preset judgment rules. When the warning conditions are met, it adjusts the priority order of virtual processors based on the preset mapping relationship between virtual machine tasks and virtual processors, and then generates a scheduling decision containing scheduling instructions based on the updated priorities. The scheduling decision refers to the instructions used to instruct scheduling module 14 to perform specific scheduling operations, including but not limited to the instructions to schedule a specific virtual processor to a specific physical processor for execution. Finally, the scheduling decision is sent to scheduling module 14.

[0050] The scheduling module 14 is used to schedule the virtual processor to the corresponding physical processor for execution based on the scheduling decision sent by the management module 13.

[0051] In some embodiments, after parsing the received scheduling decision, the scheduling module 14 executes specific scheduling operations. By adjusting the correspondence between virtual processors and physical processors, the virtual processor can run on the matching physical processor, thereby achieving precise adaptation of physical computing resources.

[0052] Through the above structure, the task awareness module 11 and the load awareness module 12 complete the monitoring and transmission of task information and load information. The management module 13 completes early warning judgment, virtual processor priority update and scheduling decision generation based on this information. The scheduling module 14 implements scheduling execution, forming a complete task scheduling closed loop. It realizes effective monitoring of virtual machine task information and physical processor load information, dynamically adjusts virtual processor priority and executes scheduling based on monitoring data, ensures that virtual processors can obtain corresponding physical computing resources, ensures stable execution of virtual machine tasks, and realizes reasonable allocation of physical computing resources.

[0053] In summary, the task scheduling system provided in this disclosure includes: a management unit and at least one virtual machine; wherein the management unit includes a task awareness module, a load awareness module, a management module, and a scheduling module; wherein the task awareness module is used to monitor the task information of virtual machine tasks within each virtual machine and send the task information to the management module; the load awareness module is used to monitor the load information of each physical processor and send the load information to the management module; wherein the physical processor provides physical computing resources for the virtual processor; the management module is used to update the priority of the virtual processor when it is determined that the task information and / or load information meet the warning conditions, and generate a scheduling decision for the virtual processor based on the updated virtual processor priority, and send the scheduling decision to the scheduling module; wherein the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors; the scheduling module is used to schedule the virtual processor to the corresponding physical processor for execution according to the scheduling decision sent by the management module; relying on accurate information monitoring and dynamic priority adjustment, the allocation of physical computing resources is optimized, and the stable operation of virtual machine tasks is ensured through warning response and scheduling execution, thereby improving the system scheduling flexibility and resource utilization efficiency.

[0054] Please continue reading. Figure 1 The management module 13 is further configured to: The scheduling value of each virtual processor is calculated based on the task type in the task information.

[0055] In some embodiments, the management module 13 evaluates the potential benefits of scheduling virtual processors by designing a benefit function, thereby calculating the scheduling value of the virtual processors and providing a basis for assigning appropriate priorities to the virtual processors; wherein, the priority range is preset, for example, the priority range is 1-100, with the larger the number, the higher the priority. It should be noted that the above examples are only illustrative and do not limit the specific content.

[0056] The priority of each virtual processor is determined based on the scheduling value.

[0057] In some embodiments, the management module 13 determines the priority of each virtual processor by sorting the scheduling value of each virtual processor and mapping the sorting results to a preset priority range, for use in virtual processor scheduling.

[0058] Through the above structure, the management module 13 can accurately calculate the scheduling value of the virtual processor based on the task type, and reasonably allocate priorities accordingly, providing a reliable basis for virtual processor scheduling.

[0059] Please continue reading. Figure 1 The management module 13 is further configured to: For a virtual processor carrying a real-time task, the scheduling time limit and allowable jitter ratio of the real-time task are calculated to obtain a real-time value component; wherein, the task type includes the real-time task and non-real-time task.

[0060] In some embodiments, the value of a real-time task, i.e., the real-time value component, is calculated using a formula, specifically: ,in, It is the scheduling time limit for real-time tasks. This is the maximum scheduling time limit for real-time tasks. This is the maximum allowable jitter percentage; the shorter the real-time task scheduling cycle, the higher the real-time requirements of the business, and the higher the real-time value component, and the higher the real-time value component of all tasks. Normalization is required, scaling the values ​​to the 0-1 range to avoid the influence of dimensions.

[0061] For the virtual processor carrying the non-real-time task, the runtime of the non-real-time task is calculated to obtain the non-real-time value component.

[0062] In some embodiments, the value of a non-real-time task, i.e., the non-real-time value component, is calculated using a formula, specifically: ,in, This refers to the runtime of non-real-time tasks; the runtime of all tasks. Normalization is required, scaling the values ​​to the 0-1 range to avoid the influence of dimensions.

[0063] The scheduling value of each virtual processor is determined based on the real-time value component and the non-real-time value component.

[0064] In some embodiments, to enhance the importance of real-time tasks, the real-time tasks are augmented with an amplification factor. The scheduling value of virtual processors The formula for calculating the scheduling value of each virtual processor, derived from the real-time value component, the non-real-time value component, and the amplification factor, is as follows: ,in, For real-time value weighting, This is a non-real-time value component. Amplification factor, This represents the number of virtual processors.

[0065] Through the above structure, the management module 13 can accurately calculate the value components corresponding to real-time tasks and non-real-time tasks respectively, and determine the scheduling value of the virtual processor by combining the amplification factor, so as to ensure the rationality of the scheduling value assessment.

[0066] Please continue reading. Figure 1 The management module 13 is further configured to: In the initial state, the virtual processors are sorted by their scheduling value to obtain a sorted list.

[0067] In some embodiments, in the initial state, the management module 13 allocates a virtual processor to each virtual machine 2. The task scheduler (such as OS Task Scheduler) in the virtual machine 2 schedules virtual machine tasks to the virtual processor. All virtual tasks in each virtual machine 2 are in the virtual processor. The management module 13 calculates the scheduling value of each virtual processor, sorts all virtual processors by value, and obtains an ordered list of virtual processors.

[0068] The scheduling value of each virtual processor is mapped to a preset priority range according to the sorting list to determine the priority allocation of each virtual processor.

[0069] In some embodiments, the management module 13 linearly maps the obtained virtual processor sorting list to a preset priority range, thereby assigning a corresponding priority to each virtual processor for virtual processor scheduling.

[0070] Through the above structure, the management module 13 can sort the virtual processor scheduling value and allocate priorities in the initial state, providing an orderly basis for virtual processor scheduling in the initial stage.

[0071] As one way that this disclosure can be implemented Figure 2 This illustration shows a schematic diagram of the scheduling value and priority mapping of a virtual processor provided in an embodiment of this disclosure. For example... Figure 2 As shown, the management module first calculates the scheduling value of the virtual processors corresponding to each virtual machine (virtual machine 1, ..., virtual machine n); then, it sorts all virtual processors by their scheduling value to obtain a sorted list; subsequently, it linearly maps the scheduling value of each virtual processor in the sorted list to a preset priority range according to the mapping relationship, thereby determining and completing the priority allocation of each virtual processor, so that the scheduling value of the virtual processor and the priority of the virtual processor form a corresponding relationship, providing an orderly basis for the scheduling of virtual processors.

[0072] Please continue reading. Figure 1 The management module 13 is further configured to: If the task information is determined to satisfy the condition that the virtual machine task exceeds a preset time threshold, the virtual processor to which the virtual machine task belongs is located, the scheduling value and corresponding priority of the virtual processor are updated, and the target virtual processor is obtained.

[0073] In some embodiments, when the task awareness module 11 notifies a virtual machine task of a timeout risk (i.e., the task information meets the condition that the virtual machine task exceeds a preset time threshold), the management module 13 finds the virtual processor where the virtual machine task is located as the target virtual processor and updates the scheduling value of the target virtual processor. The formula for calculating the real-time value component is as follows: ,in, The real-time value component of the target virtual processor. It is the scheduling time limit for real-time tasks. This is the maximum scheduling time limit for real-time tasks. It is the maximum allowable jitter percentage. The greater the jitter, the higher the potential value of resetting the priority.

[0074] The scheduling value of the target virtual processor is compared with the scheduling value of the next adjacent priority virtual processor to obtain a comparison result; wherein, the next adjacent priority virtual processor is the virtual processor in the sorting list within the same virtual machine that is located before the target virtual processor.

[0075] In some embodiments, in order to maintain the priority partial order of tasks in the virtual machine, the management module 13 compares the target virtual processor with the scheduling value of the next adjacent priority virtual processor in the same virtual machine in the global sorting list of virtual processors, and determines the size relationship between the two.

[0076] If the comparison result indicates that the scheduling value of the target virtual processor is less than or equal to the scheduling value of the previous adjacent priority virtual processor, the scheduling value and corresponding priority of the target virtual processor are updated.

[0077] In some embodiments, if the updated scheduling value of the target virtual processor is less than or equal to the scheduling value of the adjacent priority virtual processor within the same virtual machine, the management module 13 only updates the scheduling value and corresponding priority of the target virtual processor itself.

[0078] If the comparison result indicates that the scheduling value of the target virtual processor is greater than the scheduling value of the previous adjacent priority virtual processor, the priorities of all virtual processors in the sorted list are updated sequentially according to their priority order to obtain the updated sorted list.

[0079] In some embodiments, if the updated scheduling value of the target virtual processor is greater than the scheduling value of the previous adjacent priority virtual processor in the same virtual machine, the management module 13 will recursively update the priorities of all virtual processors in the sorting list in order of priority size to ensure that the priority relationship of each task in the virtual machine is not reversed by the virtual processor priority adjustment; optionally, priority rollback can be set, and several observation periods can be configured. If the jitter is lower than the alarm ratio during the period, the priority can be reduced. The update process is the same as above, and will not be described in detail.

[0080] Through the above structure, the management module 13 can accurately update the scheduling value and priority of the corresponding virtual processor when the virtual machine task faces the risk of timeout, while ensuring that the priority relationship of each task in the virtual machine is not reversed, thus improving the stability of scheduling.

[0081] As one way that this disclosure can be implemented Figure 3 This illustration shows a flowchart of a virtual processor priority adjustment method provided in an embodiment of the present disclosure. Figure 3 As shown, firstly, the management module receives a virtual machine task timeout warning (i.e., the task information meets the condition that the virtual machine task exceeds a preset time threshold). Next, the management module finds the virtual processor to which the virtual machine task belongs and updates the scheduling value of that virtual processor. Then, the management module determines whether the updated scheduling value is greater than the scheduling value of the preceding adjacent priority virtual processor within the same virtual machine. If the updated scheduling value is greater than the scheduling value of the preceding adjacent priority virtual processor, the scheduling value of the virtual processor is updated. Otherwise, the management module globally sorts the scheduling values ​​of all virtual processors to obtain an updated virtual processor sorting list. Finally, the sorted virtual processor scheduling values ​​are linearly mapped to a preset priority range to complete the virtual processor priority adjustment, thereby achieving dynamic updates of virtual processor priorities while ensuring that the priority relationship between tasks within the virtual machine is not reversed.

[0082] Please continue reading. Figure 1 The management module 13 is further configured to: If the load information satisfies that the physical processor load value is greater than a preset load threshold and there are at least two virtual processors on the physical processor, all virtual processors on the physical processor are sorted by priority, and the virtual processor with the lowest priority is moved to the physical processor with normal load.

[0083] In some embodiments, when the physical processor load sensing module 12 notifies a physical processor that the load is high (i.e., the load information satisfies that the physical processor load value is greater than a preset load threshold), and there are at least two virtual processors on the physical processor, the management module 13 adopts the first stage (virtual processor migration stage) of the two-stage processing method. Considering the overhead of migrating virtual processors between physical processors and ensuring that high real-time tasks are not interfered with by migration, the management module 13 sorts all virtual processors on the physical processor according to priority, selects the virtual processor with the lowest priority to migrate to the physical processor with normal load, so as to reduce the load of the current physical processor.

[0084] If the load information satisfies that the physical processor load value is greater than a preset load threshold and there is a virtual processor on the physical processor, the virtual machine tasks carried by the virtual processor are adjusted, and the scheduling value and corresponding priority of all virtual processors are updated.

[0085] In some embodiments, when the physical processor is under high load and there is only one virtual processor on its physical processor, the management module 13 adopts the second stage (virtual processor expansion stage) of the two-stage processing method; at this time, it indicates that the virtual processor is carrying too many virtual machine tasks and needs to adjust the virtual machine tasks it carries. After the adjustment is completed, the scheduling value and corresponding priority of all virtual processors need to be updated again.

[0086] Through the above structure, the management module 13 can adopt differentiated processing methods for different scenarios with high physical processor load, effectively reducing the physical processor load and ensuring system operating efficiency.

[0087] Please continue reading. Figure 1 If it is determined that the alarm virtual processor is not the lowest priority virtual processor, and the physical processor to which the virtual processor other than the alarm virtual processor belongs is a physical processor with normal load, the virtual machine task with the lowest priority in the alarm virtual processor is migrated to the lowest priority virtual processor in the same virtual machine; wherein, the alarm virtual processor is a virtual processor located on a physical processor whose physical processor load value is greater than a preset load threshold.

[0088] In some embodiments, when the alarm virtual processor is not the lowest priority virtual processor, and the physical processors to which other virtual processors belong have normal loads, the management module 13 first sorts the virtual machine tasks on the alarm virtual processor by priority, selects the virtual machine task with the lowest priority, and migrates it to the virtual processor with the lowest priority within the same virtual machine, thereby increasing the load on other physical processors while saving resources.

[0089] If the alarm virtual processor is determined to be the lowest priority virtual processor, a new virtual processor is created to host the lowest priority virtual machine task.

[0090] In some embodiments, when the alarm virtual processor itself is the lowest priority virtual processor, the management module 13 creates a new virtual processor and selects the lowest priority virtual machine task on the alarm virtual processor to migrate to the newly created virtual processor. Considering the overhead of migrating virtual machine tasks in virtual processors, both adjustment scenarios select the lowest priority virtual machine task for migration, and after adjustment, all virtual processors need to be re-prioritized.

[0091] Through the above structure, the management module 13 can accurately adjust the virtual machine tasks carried by the alarm virtual processor according to the different priorities of the alarm virtual processor, further optimize the physical processor load distribution, and ensure the stable operation of the system.

[0092] As one way that this disclosure can be implemented Figure 4 This illustration shows a flowchart of a physical processor load adjustment process provided in an embodiment of this disclosure. Figure 4 As shown, firstly, the management module receives a load alarm from the physical processor (i.e., the load information meets the condition that the physical processor load value is greater than a preset load threshold). Next, the management module locates the virtual processors running on that physical processor and determines if the number of virtual processors on that physical processor is greater than 1. If the number of virtual processors is greater than 1, it enters Phase 1 processing: the management module sorts all virtual processors on that physical processor by priority, selects the virtual processor with the lowest priority, and then notifies the scheduling module to remove the scheduling relationship between that virtual processor and the current physical processor (i.e., move it to a physical processor with normal load). If the number of virtual processors is less than or equal to 1, it enters Phase 2 processing: the management module first sorts the virtual machine tasks carried by that virtual processor by priority and selects the virtual machine task with the lowest priority. Then, it determines if the current virtual processor is the lowest-value virtual processor. If yes, a new virtual processor is created, and the lowest-priority virtual machine task is placed in the new virtual processor. If no, the lowest-priority virtual machine task is placed in the lowest-priority virtual processor within the same virtual machine. Finally, the management module requests that the scheduling value of all virtual processors be sorted and that a linear priority mapping be completed, thereby completing the load adjustment of the physical processor and achieving a reasonable allocation of physical computing resources.

[0093] Please continue reading. Figure 1 The task awareness module 11 is further configured to: The scheduling delay for this task is determined based on the time interval between the current task scheduling time and the previous adjacent task scheduling time, as well as the task scheduling time limit.

[0094] In some embodiments, the task awareness module 11 is implemented inside the virtual processor. When the worker thread starts, it records the interval between the scheduling time of the previous adjacent task and the scheduling time of the current task, and calculates the scheduling delay of the current task in combination with the scheduling time limit of the virtual machine real-time task. The specific calculation formula is: scheduling delay of the current task = scheduling time of the current task - (scheduling time of the previous adjacent task + scheduling time limit of the virtual machine real-time task).

[0095] Based on the current task scheduling delay, the maximum task scheduling delay and the minimum task scheduling delay are determined, and the task scheduling delay jitter is determined according to the maximum task scheduling delay and the minimum task scheduling delay; wherein, if the task information and / or the load information meet the warning conditions, the task scheduling delay jitter is recalculated.

[0096] In some embodiments, the task awareness module 11 updates the calculated task scheduling delay to the historical delay data, filters out the maximum and minimum task scheduling delays, and determines the task scheduling delay jitter value using the formula: Task scheduling delay jitter = Maximum task scheduling delay - Minimum task scheduling delay. Task scheduling delay jitter is used as a criterion because jitter is a periodic indicator and has better robustness than single-time delays. When the task scheduling delay jitter value exceeds a set time limit proportion... When the value is 0.15, the task awareness module 11 sends a warning message to the management module 13. When the management module 13 reconstructs the virtual processor, the task awareness module 11 needs to reset the historical data of task scheduling delay jitter and start the statistical calculation again. If the task information and / or load information meet the warning conditions, the task scheduling delay jitter is re-determined according to the above calculation logic.

[0097] The task information is sent to the management module; wherein the task information includes at least one of the following: the current task scheduling time, the previous adjacent task scheduling time, the current task scheduling delay, the maximum task scheduling delay, the minimum task scheduling delay, and the task scheduling delay jitter.

[0098] In some embodiments, the task awareness module 11 integrates the current task scheduling time, the previous adjacent task scheduling time, the current task scheduling delay, the maximum task scheduling delay, the minimum task scheduling delay, and the task scheduling delay jitter into task information, and sends it to the management module 13 in real time. When the value of the task scheduling delay jitter meets the warning conditions, a warning flag is added to the sent task information so that the management module 13 can respond in a timely manner.

[0099] Through the above structure, the task awareness module 11 can accurately calculate the scheduling latency and jitter value of virtual machine tasks, collect and transmit task information in real time, and provide reliable data support for the management module 13 to judge the task execution status, trigger early warnings and generate scheduling decisions, thus ensuring the real-time performance and accuracy of task scheduling.

[0100] Please continue reading. Figure 1 The load sensing module 12 is further configured to: The load value of all physical processors is determined based on the statistical time slice and idle time slice of the physical processor.

[0101] In some embodiments, the load sensing module 12 collects the operating data of each physical processor cyclically according to a preset specific statistical time slice, and calculates the load value by combining the idle time slice of the physical processor. The formula for calculating the load value of the physical processor (pCPU load) is as follows: (Where vi is the i-th virtual processor running on the physical processor); Since the overhead of the virtualization manager (VMM) itself is not considered during the calculation, the load warning value should not be set too high to avoid misjudgment of load. For example, the warning value can be set to 0.7. When the load value of the physical processor is greater than this warning value, it is judged as a high load state. It should be noted that the above example is only for illustrative purposes and does not limit the specific content.

[0102] The load information is sent to the management module 13; wherein the load information includes at least one of the statistical time slice, the idle time slice and the load value.

[0103] In some embodiments, the load sensing module 12 integrates the statistical time slice, the idle time slice of the physical processor, and the calculated load value into load information, and sends the load information to the management module 13 at a set period or when the load value is detected to be greater than the warning value, so as to ensure that the management module 13 can keep abreast of the load status of the physical processor.

[0104] Through the above structure, the load sensing module 12 can accurately monitor the load of the physical processor according to the statistical period, generate load information containing load data and transmit it to the management module 13, providing data basis for the management module 13 to determine whether the load meets the early warning conditions and formulate load adjustment strategies, thus ensuring the rational use of physical processor resources.

[0105] As one way that this disclosure can be implemented Figure 5 This illustration shows a flowchart of a load-aware module processing according to an embodiment of the present disclosure. Figure 5As shown, firstly, the load statistics timer of the load awareness module times out, triggering the load statistics process. Then, the load awareness module selects the next physical processor for processing. Next, the load awareness module determines whether all physical processors have been traversed. If traversal is complete, the load statistics timer is set, waiting for the next timer timeout to trigger the process. If traversal is not complete, it continues to determine whether all virtual processors on the current physical processor have been traversed. If all virtual processors on the current physical processor have been traversed, the load value of the current physical processor is calculated. If traversal is not complete, it determines whether the current virtual processor is running on that physical processor. If the current virtual processor is running on that physical processor, the load awareness module accumulates the running time recorded by the idle threads of that virtual processor. After accumulation, the load value of that physical processor is calculated. Subsequently, the load awareness module determines whether the load value of that physical processor meets the high load condition. If not, it continues to select the next physical processor. If the high load condition is met, a load alarm is sent to the management module. After the alarm is triggered, the next physical processor is selected.

[0106] Please continue reading. Figure 1 The virtual machine 2 includes at least one virtual processor 21, the virtual processor 21 being used for: The hardware resources of the physical processor are simulated based on virtual resources; wherein, the virtual resources include at least one of virtual page table registers, virtual segment registers, and virtual status registers.

[0107] In some embodiments, the virtual processor 21 simulates the hardware resources of the physical processor (pCPU) through the virtual resources, so that the virtual processor 21 serves as both a resource allocation unit and has the basic hardware simulation capability to execute virtual machine tasks, providing virtual hardware environment support for the execution of virtual machine tasks.

[0108] Determine whether the virtual machine task needs to be rescheduled.

[0109] In some embodiments, the virtual processor 21 determines whether the virtual machine task needs to be rescheduled based on the mapping relationship between the virtual machine task and the virtual processor determined by the management module 13, combined with the execution status of the virtual machine task monitored by the worker thread (such as whether the task scheduling latency jitter exceeds the warning value), and the determination result is synchronously fed back to the management module 13.

[0110] If it is determined that the virtual machine task does not need to be rescheduled, the virtual machine task is executed by a worker thread, and virtual machine task switching is performed within the set of virtual machine tasks determined in the management module 13; wherein, the worker thread is used to monitor the execution status of the virtual machine task and calculate the task scheduling latency jitter of the virtual machine task.

[0111] In some embodiments, since the management module 13 determines the association between virtual machine tasks and virtual processors 21, the worker thread only switches to execute different virtual machine tasks within the set of virtual machine tasks determined by the management module 13, thereby realizing the function of virtual machine operating system task scheduling. At the same time, the worker thread continuously monitors the execution status of virtual machine tasks during task execution, calculates task scheduling delay jitter according to preset logic, and sends a notification to the management module 13 when the jitter value is greater than the set warning value, thus completing the virtual machine task status perception.

[0112] If it is determined that the virtual machine task needs to be rescheduled, the idle time slices of the physical processor are counted by the idle thread.

[0113] In some embodiments, the function of the idle thread is to record the idle time slices of the physical processor. The collected idle time slice data will be used to calculate and statistically analyze the physical processor load, providing basic data support for the load perception module 12 to determine the physical processor load value.

[0114] Through the above structure, the virtual processor 21 not only simulates the hardware resources of the physical processor, but also completes the execution of virtual machine tasks, state awareness, and idle time slice statistics through working threads and idle threads, respectively. This gives it the dual attributes of resource allocation unit and execution unit, effectively supporting the dynamic mapping of the relationship between virtual machine tasks and virtual processor and the realization of virtual machine task awareness function.

[0115] As one way that this disclosure can be implemented Figure 6 This illustration shows a flowchart of the operation of a virtual processor provided in an embodiment of this disclosure. Figure 6 As shown, firstly, the virtual machine operating system task scheduler issues a scheduling instruction for the virtual machine task, and the management unit enters processing, scheduling the virtual processor corresponding to the virtual machine task. Next, it determines whether the virtual machine task needs to be rescheduled. If it is determined that rescheduling is required, the idle thread processing flow is entered. First, the end time of this task scheduling and the duration of this execution are recorded. Then, it is determined whether there is a ready virtual machine task. If not, the idle thread is run, and the execution time of the idle thread is recorded periodically (this time is used for the statistics of the physical processor idle time slice). If it exists, the task scheduling time is recorded, and the task scheduling latency jitter of the virtual machine task is calculated. If it is determined that rescheduling is not required, the worker thread processing flow is entered. First, the task scheduling time is recorded, the task scheduling latency jitter of the virtual machine task is calculated, and then it is determined whether the task scheduling latency jitter is greater than a set time limit ratio. If the jitter is greater than the set time limit ratio, a notification of virtual machine task scheduling delay is sent to the management module. After the judgment is completed, the context of the virtual machine task is loaded, and the virtual machine task starts running. After the virtual machine task finishes running, the management unit enters processing.

[0116] As one way that this disclosure can be implemented Figure 7 This diagram illustrates the initialization process of a task scheduling system provided in an embodiment of this disclosure. Figure 7 As shown, the virtual machine first triggers the initialization process. The management module allocates one virtual processor to the virtual machine and returns the allocation result to the virtual machine. Subsequently, the virtual machine's operating system task scheduler schedules virtual machine tasks. The management module creates the association between the virtual machine task and the virtual processor, calculates the priority of the virtual processor, and then requests the scheduling module to schedule the virtual processor. The scheduling module selects the virtual processor with the highest priority and schedules it to the corresponding physical processor for execution. Finally, the management module returns the scheduling result to the virtual machine, completing the initialization process of the task scheduling system.

[0117] As one way that this disclosure can be implemented Figure 8 A schematic diagram illustrating a virtual processor reconfiguration process provided in an embodiment of this disclosure is shown. Figure 8 As shown, firstly, the load awareness module detects that the load on the physical processor has reached the warning value, and at the same time, the task awareness module detects that the scheduling latency of the virtual machine task has reached the warning value. The two modules then transmit the corresponding load information and task information to the management module. Next, the management module reconstructs the mapping relationship between virtual machine tasks and virtual processors, and then recalculates the priority of all virtual processors. After completing the above operations, the management module requests virtual processor scheduling from the scheduling module. The scheduling module selects the virtual processor with the highest priority and schedules it to the corresponding physical processor for execution, thereby completing the virtual processor reconstruction process.

[0118] To clearly illustrate the embodiments of this disclosure, the embodiments of this disclosure provide... Figure 9 The diagram shown illustrates the collaborative scheduling structure of the task scheduling system. Figure 9 As shown, this collaborative scheduling is divided into two levels: Level 1 scheduling is completed by the operating system task scheduler in the virtual machine, where the virtual machines include Virtual Machine 1 (RTOS) and Virtual Machine 2 (GPOS), and their respective operating system task schedulers schedule the virtual machine tasks inside to the corresponding virtual processors; Level 2 scheduling is completed by the scheduling module in the management unit, which schedules each virtual processor to the corresponding physical processor for execution, thereby realizing collaborative scheduling between virtual machine tasks, virtual processors and physical processors, ensuring that tasks of different types of virtual machines can obtain physical computing resources through the corresponding virtual processors.

[0119] Corresponding to the task scheduling system described above, this invention also proposes a task scheduling method. Since the method embodiments of this invention correspond to the system embodiments described above, details not disclosed in the method embodiments can be referred to the system embodiments described above, and will not be repeated here.

[0120] Figure 10 This is a flowchart illustrating a task scheduling method provided in an embodiment of the present disclosure.

[0121] like Figure 10 As shown, the method includes the following steps: Step 101: Monitor the task information of virtual machine tasks within each virtual machine and the load information of each physical processor; wherein, the physical processor provides physical computing resources for the virtual processor.

[0122] Step 102: If the task information and / or the load information meet the warning conditions, update the priority of the virtual processor and generate a scheduling decision for the virtual processor based on the updated priority of the virtual processor; wherein, the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors.

[0123] Step 103: According to the scheduling decision, schedule the virtual processor to the corresponding physical processor for execution.

[0124] In summary, the task scheduling method provided in this disclosure includes: monitoring the task information of virtual machine tasks within each virtual machine and the load information of each physical processor; wherein, the physical processor provides physical computing resources to the virtual processor; when the task information and / or load information meet the warning conditions, updating the priority of the virtual processor, and generating a scheduling decision for the virtual processor based on the updated priority; wherein, the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors; and scheduling the virtual processor to the corresponding physical processor for execution according to the scheduling decision. This method, by monitoring virtual machine task information and physical processor load information, dynamically updating the priority of virtual processors in conjunction with the mapping relationship between virtual machine tasks and virtual processors, generating a scheduling decision when the warning conditions are met, and scheduling the virtual processor to the corresponding physical processor for execution, achieves both accurate adaptation and allocation of physical computing resources and ensures stable execution of virtual machine tasks, effectively improving the system scheduling flexibility and resource utilization efficiency.

[0125] Figure 11 A flowchart illustrating a task scheduling method provided in an embodiment of this disclosure is further shown. Based on Figure 10 Implementation examples, Figure 11 This may include the following steps: Step 201: Calculate the scheduling value of each virtual processor based on the task type in the task information.

[0126] Step 202: Determine the priority of each virtual processor based on the scheduling value.

[0127] Figure 12 A flowchart illustrating a task scheduling method provided in an embodiment of this disclosure is further shown. Based on Figure 11 Implementation examples, Figure 12 This may include the following steps: Step 301: For the virtual processor carrying the real-time task, calculate the scheduling time limit and allowable jitter ratio of the real-time task to obtain the real-time value component; wherein, the task type includes the real-time task and non-real-time task.

[0128] Step 302: For the virtual processor carrying the non-real-time task, calculate the runtime of the non-real-time task to obtain the non-real-time value component.

[0129] Step 303: Determine the scheduling value of each virtual processor based on the real-time value component and the non-real-time value component.

[0130] Figure 13 A flowchart illustrating a task scheduling method provided in an embodiment of this disclosure is further shown. Based on Figure 11 Implementation examples, Figure 13 This may include the following steps: Step 401: In the initial state, the virtual processors are sorted by their scheduling value to obtain a sorted list.

[0131] Step 402: Map the scheduling value of each virtual processor to a preset priority range according to the sorting list to determine the priority allocation of each virtual processor.

[0132] Figure 14 A flowchart illustrating a task scheduling method provided in an embodiment of this disclosure is further shown. Based on Figure 10 Implementation examples, Figure 14 This may include the following steps: Step 501: If the task information satisfies that the virtual machine task is greater than a preset time threshold, locate the virtual processor to which the virtual machine task belongs, update the scheduling value and corresponding priority of the virtual processor, and obtain the target virtual processor.

[0133] Step 502: Compare the scheduling value of the target virtual processor with the scheduling value of the previous adjacent priority virtual processor to obtain a comparison result; wherein, the previous adjacent priority virtual processor is the virtual processor in the sorting list within the same virtual machine that is located before the target virtual processor.

[0134] Step 503: If the comparison result indicates that the scheduling value of the target virtual processor is less than or equal to the scheduling value of the previous adjacent priority virtual processor, update the scheduling value and corresponding priority of the target virtual processor.

[0135] Step 504: If the comparison result indicates that the scheduling value of the target virtual processor is greater than the scheduling value of the previous adjacent priority virtual processor, the priorities of all virtual processors in the sorting list are updated sequentially according to their priority order to obtain the updated sorting list.

[0136] Figure 15 A flowchart illustrating a task scheduling method provided in an embodiment of this disclosure is further shown. Based on Figure 10 Implementation examples, Figure 15 This may include the following steps: Step 601: If the load information satisfies that the physical processor load value is greater than a preset load threshold and there are at least two virtual processors on the physical processor, sort all the virtual processors on the physical processor by priority and move the virtual processor with the lowest priority to the physical processor with normal load.

[0137] Step 602: If the load information satisfies that the physical processor load value is greater than a preset load threshold and there is a virtual processor on the physical processor, adjust the virtual machine tasks carried by the virtual processor and update the scheduling value and corresponding priority of all virtual processors.

[0138] Figure 16 A flowchart illustrating a task scheduling method provided in an embodiment of this disclosure is further shown. Based on Figure 15 Implementation examples, Figure 16 This may include the following steps: Step 701: If it is determined that the alarm virtual processor is not the lowest priority virtual processor, and the physical processor to which the virtual processors other than the alarm virtual processor belong is a physical processor with normal load, the lowest priority virtual machine task in the alarm virtual processor is migrated to the lowest priority virtual processor in the same virtual machine; wherein, the alarm virtual processor is a virtual processor located on a physical processor whose physical processor load value is greater than a preset load threshold.

[0139] Step 702: If the alarm virtual processor is determined to be the lowest priority virtual processor, a new virtual processor is created to carry the lowest priority virtual machine task.

[0140] Figure 17 A flowchart illustrating a task scheduling method provided in an embodiment of this disclosure is further shown. Based on Figure 10 Implementation examples, Figure 17 This may include the following steps: Step 801: Determine the task scheduling delay based on the time interval between the current task scheduling time and the previous adjacent task scheduling time and the task scheduling time limit.

[0141] Step 802: Based on the current task scheduling delay, determine the maximum task scheduling delay and the minimum task scheduling delay, and determine the task scheduling delay jitter according to the maximum task scheduling delay and the minimum task scheduling delay; wherein, if it is determined that the task information and / or the load information meet the warning conditions, the task scheduling delay jitter is recalculated.

[0142] In some embodiments of this disclosure, it is also used to: determine the load value of all physical processors based on the statistical time slice and idle time slice of the physical processor; wherein the load information includes at least one of the statistical time slice, the idle time slice and the load value.

[0143] Figure 18 A flowchart illustrating a task scheduling method provided in an embodiment of this disclosure is further shown. Based on Figure 10 Implementation examples, Figure 18 This may include the following steps: Step 901: Simulate the hardware resources of the physical processor based on virtual resources; wherein the virtual resources include at least one of virtual page table registers, virtual segment registers, and virtual status registers.

[0144] Step 902: Determine whether the virtual machine task needs to be rescheduled.

[0145] Step 903: If it is determined that the virtual machine task does not need to be rescheduled, the virtual machine task is executed by a worker thread, and virtual machine task switching is performed within a preset set of virtual machine tasks; wherein, the worker thread is used to monitor the execution status of the virtual machine task and calculate the task scheduling latency jitter of the virtual machine task.

[0146] Step 904: If it is determined that the virtual machine task needs to be rescheduled, the idle time slice of the physical processor is counted by the idle thread.

[0147] Corresponding to the task scheduling method described above, this invention also proposes a task scheduling device. Since the device embodiments of this invention correspond to the method embodiments described above, details not disclosed in the device embodiments can be referred to in the method embodiments described above, and will not be repeated here.

[0148] Figure 19 This is a schematic diagram of the structure of a task scheduling device provided in an embodiment of the present disclosure, as shown below. Figure 19 As shown, it includes: a monitoring unit 51, an update unit 52, a generation unit 53, and a scheduling unit 54.

[0149] The monitoring unit 51 is used to monitor the task information of virtual machine tasks within each virtual machine and the load information of each physical processor; wherein, the physical processor provides physical computing resources for the virtual processor. The update unit 52 is used to update the priority of the virtual processor when it is determined that the task information and / or the load information meet the warning conditions; The generation unit 53 is used to generate a scheduling decision for the virtual processor based on the updated priority of the virtual processor; wherein the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors; The scheduling unit 54 is used to schedule the virtual processor to the corresponding physical processor for execution according to the scheduling decision.

[0150] In summary, the task scheduling device provided in this disclosure includes: monitoring task information of virtual machine tasks within each virtual machine and load information of each physical processor; wherein, the physical processor provides physical computing resources to the virtual processor; when the task information and / or load information meet the warning conditions, updating the priority of the virtual processor, and generating a scheduling decision for the virtual processor based on the updated priority; wherein, the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors; and scheduling the virtual processor to the corresponding physical processor for execution according to the scheduling decision. This method, by monitoring virtual machine task information and physical processor load information, dynamically updating the priority of virtual processors in conjunction with the mapping relationship between virtual machine tasks and virtual processors, generating a scheduling decision when the warning conditions are met, and scheduling the virtual processor to the corresponding physical processor for execution, achieves both accurate adaptation and allocation of physical computing resources and ensures stable execution of virtual machine tasks, effectively improving system scheduling flexibility and resource utilization efficiency.

[0151] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 20 As shown, the device further includes: The calculation unit 55 is configured to calculate the scheduling value of each virtual processor based on the task type in the task information before the update unit 52 updates the priority of the virtual processor when it determines that the task information and / or the load information meet the warning conditions. The determining unit 56 is used to determine the priority of each virtual processor based on the scheduling value.

[0152] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 20 As shown, the computing unit 55 includes: The first calculation module 551 is used to calculate the scheduling time limit and allowable jitter ratio of the real-time task for the virtual processor carrying the real-time task, and obtain the real-time value component; wherein, the task type includes the real-time task and the non-real-time task. The second calculation module 552 is used to calculate the runtime of the non-real-time task for the virtual processor carrying the non-real-time task, and obtain the non-real-time value component. The first determining module 553 is used to determine the scheduling value of each virtual processor based on the real-time value component and the non-real-time value component.

[0153] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 20 As shown, the determining unit 56 includes: The first sorting module 561 is used to sort the virtual processors based on their scheduling value in the initial state to obtain a sorted list. The second determining module 562 is used to map the scheduling value of each virtual processor to a preset priority range according to the sorting list, and determine the priority allocation of each virtual processor.

[0154] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 20 As shown, the update unit 52 includes: The first update module 521 is used to locate the virtual processor to which the virtual machine task belongs, update the scheduling value and corresponding priority of the virtual processor, and obtain the target virtual processor when it is determined that the task information satisfies that the virtual machine task is greater than a preset time threshold. The comparison module 522 is used to compare the scheduling value of the target virtual processor with the scheduling value of the previous adjacent priority virtual processor to obtain a comparison result; wherein, the previous adjacent priority virtual processor is the virtual processor located before the target virtual processor in the sorting list within the same virtual machine; The second update module 523 is used to update the scheduling value and corresponding priority of the target virtual processor when the comparison result indicates that the scheduling value of the target virtual processor is less than or equal to the scheduling value of the previous adjacent priority virtual processor. The third update module 524 is used to update the priorities of all virtual processors in the sorting list in order of priority when the comparison result indicates that the scheduling value of the target virtual processor is greater than the scheduling value of the previous adjacent priority virtual processor, so as to obtain the updated sorting list.

[0155] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 20 As shown, the update unit 52 further includes: The second sorting module 525 is used to sort all virtual processors on the physical processor according to priority when it is determined that the load information satisfies that the physical processor load value is greater than a preset load threshold and there are at least two virtual processors on the physical processor, and to move the virtual processor with the lowest priority to the physical processor with normal load. The adjustment module 526 is used to adjust the virtual machine tasks carried by the virtual processor when it is determined that the load information satisfies that the physical processor load value is greater than a preset load threshold and there is a virtual processor on the physical processor; The fourth update module 527 is used to update the scheduling value and corresponding priority of all virtual processors.

[0156] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 20 As shown, the adjustment module 526 includes: Migration submodule 5261 is used to migrate the lowest priority virtual machine task in the alarm virtual processor to the lowest priority virtual processor in the same virtual machine when it is determined that the alarm virtual processor is not the lowest priority virtual processor and the physical processor to which the virtual processor other than the alarm virtual processor belongs is a physical processor with normal load; wherein, the alarm virtual processor is a virtual processor located on a physical processor whose physical processor load value is greater than a preset load threshold. Submodule 5262 is created to create a new virtual processor to host the lowest priority virtual machine task when the alarm virtual processor is determined to be the lowest priority virtual processor.

[0157] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 20As shown, the task information includes at least one of the following: current task scheduling time, previous adjacent task scheduling time, current task scheduling delay, maximum task scheduling delay, minimum task scheduling delay, and task scheduling delay jitter. The monitoring unit 51 includes: The third determining module 511 is used to determine the current task scheduling delay based on the time interval between the current task scheduling time and the previous adjacent task scheduling time and the task scheduling time limit. The fourth determining module 512 is used to determine the maximum task scheduling delay and the minimum task scheduling delay based on the current task scheduling delay, and to determine the task scheduling delay jitter based on the maximum task scheduling delay and the minimum task scheduling delay; wherein, if it is determined that the task information and / or the load information meet the warning conditions, the task scheduling delay jitter is recalculated.

[0158] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 20 As shown, the monitoring unit 51 further includes: The fifth determining module 513 is used to determine the load value of all physical processors based on the statistical time slice and idle time slice of the physical processor; wherein the load information includes at least one of the statistical time slice, the idle time slice and the load value.

[0159] Furthermore, in one possible implementation of the embodiments of this disclosure, such as Figure 20 As shown, the device further includes: an operation unit 57, the operation unit 57 comprising: The simulation module 571 is used to simulate the hardware resources of the physical processor according to the virtual resources; wherein, the virtual resources include at least one of the virtual page table register, virtual segment register and virtual status register; The judgment module 572 is used to determine whether the virtual machine task needs to be rescheduled; The switching module 573 is used to execute the virtual machine task through a worker thread and switch virtual machine tasks within a preset set of virtual machine tasks when it is determined that the virtual machine task does not need to be rescheduled; wherein, the worker thread is used to monitor the execution status of the virtual machine task and calculate the task scheduling latency jitter of the virtual machine task. The statistics module 574 is used to count the idle time slices of the physical processor by using an idle thread when it is determined that the virtual machine task needs to be rescheduled.

[0160] It should be noted that the foregoing explanation of the method embodiments also applies to the apparatus of the embodiments of this disclosure, and the principle is the same. Therefore, the embodiments of this disclosure are not limited thereto.

[0161] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0162] Figure 21 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0163] like Figure 21 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in ROM (Read-Only Memory) 602 or loaded from storage unit 608 into RAM (Random Access Memory) 603. The RAM 603 may also store various programs and data required for the operation of the electronic device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An I / O (Input / Output) interface 605 is also connected to the bus 604.

[0164] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, such as keyboard, mouse, etc.; output unit 607, such as various types of displays, speakers, etc.; storage unit 608, such as disk, optical disk, etc.; and communication unit 609, such as network card, modem, wireless transceiver, etc. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0165] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, CPUs (Central Processing Units), GPUs (Graphics Processing Units), various special-purpose AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSPs (Digital Signal Processors), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as task scheduling methods. For example, in some embodiments, the task scheduling method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the aforementioned task scheduling method by any other suitable means (e.g., by means of firmware).

[0166] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application-Specific Standard Products), SOCs (System-on-Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0167] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0168] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0169] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0170] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include LANs (Local Area Networks), WANs (Wide Area Networks), the Internet, and blockchain networks.

[0171] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service system that addresses the shortcomings of traditional physical hosts and VPS (Virtual Private Server) services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.

[0172] It's important to note that artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.

[0173] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.

[0174] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A task scheduling system, characterized in that, The system includes: a management unit and at least one virtual machine; wherein, the management unit includes a task awareness module, a load awareness module, a management module, and a scheduling module; wherein, The task awareness module is used to monitor the task information of virtual machine tasks within each virtual machine and send the task information to the management module. The load awareness module is used to monitor the load information of each physical processor and send the load information to the management module; wherein, the physical processor provides physical computing resources for the virtual processor; The management module is configured to update the priority of the virtual processor when it is determined that the task information and / or the load information meet the warning conditions, and generate a scheduling decision for the virtual processor based on the updated virtual processor priority, and send the scheduling decision to the scheduling module; wherein, the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors; The scheduling module is used to schedule the virtual processor to the corresponding physical processor for execution based on the scheduling decision received from the management module.

2. The system according to claim 1, characterized in that, The management module is also used for: The scheduling value of each virtual processor is calculated based on the task type in the task information. The priority of each virtual processor is determined based on the scheduling value.

3. The system according to claim 2, characterized in that, The management module is also used for: For a virtual processor carrying a real-time task, the scheduling time limit and allowable jitter ratio of the real-time task are calculated to obtain a real-time value component; wherein, the task type includes the real-time task and non-real-time task; For the virtual processor carrying the non-real-time task, the runtime of the non-real-time task is calculated to obtain the non-real-time value component. The scheduling value of each virtual processor is determined based on the real-time value component and the non-real-time value component.

4. The system according to claim 2, characterized in that, The management module is also used for: In the initial state, the virtual processors are sorted by their scheduling value to obtain a sorted list; The scheduling value of each virtual processor is mapped to a preset priority range according to the sorting list to determine the priority allocation of each virtual processor.

5. The system according to claim 4, characterized in that, The management module is also used for: If the task information is determined to satisfy the condition that the virtual machine task is longer than a preset time threshold, the virtual processor to which the virtual machine task belongs is located, the scheduling value and corresponding priority of the virtual processor are updated, and the target virtual processor is obtained. The scheduling value of the target virtual processor is compared with the scheduling value of the previous adjacent priority virtual processor to obtain a comparison result; wherein, the previous adjacent priority virtual processor is the virtual processor in the sorting list within the same virtual machine that is located before the target virtual processor; If the comparison result indicates that the scheduling value of the target virtual processor is less than or equal to the scheduling value of the previous adjacent priority virtual processor, the scheduling value and corresponding priority of the target virtual processor are updated. If the comparison result indicates that the scheduling value of the target virtual processor is greater than the scheduling value of the previous adjacent priority virtual processor, the priorities of all virtual processors in the sorted list are updated sequentially according to their priority order to obtain the updated sorted list.

6. The system according to claim 1, characterized in that, The management module is also used for: If the load information satisfies that the physical processor load value is greater than a preset load threshold and there are at least two virtual processors on the physical processor, then all virtual processors on the physical processor are sorted by priority, and the virtual processor with the lowest priority is moved out to the physical processor with normal load. If the load information satisfies that the physical processor load value is greater than a preset load threshold and there is a virtual processor on the physical processor, the virtual machine tasks carried by the virtual processor are adjusted, and the scheduling value and corresponding priority of all virtual processors are updated.

7. The system according to claim 6, characterized in that, The management module is also used for: If it is determined that the alarm virtual processor is not the lowest priority virtual processor, and the physical processor to which the virtual processors other than the alarm virtual processor belong is a physical processor with normal load, the virtual machine task with the lowest priority in the alarm virtual processor is migrated to the lowest priority virtual processor in the same virtual machine; wherein, the alarm virtual processor is a virtual processor located on a physical processor whose physical processor load value is greater than a preset load threshold. If the alarm virtual processor is determined to be the lowest priority virtual processor, a new virtual processor is created to host the lowest priority virtual machine task.

8. The system according to claim 1, characterized in that, The task awareness module is also used for: The scheduling delay for this task is determined based on the time interval between the current task scheduling time and the previous adjacent task scheduling time, as well as the task scheduling time limit. Based on the current task scheduling delay, the maximum task scheduling delay and the minimum task scheduling delay are determined, and the task scheduling delay jitter is determined according to the maximum task scheduling delay and the minimum task scheduling delay; wherein, if the task information and / or the load information meet the warning conditions, the task scheduling delay jitter is recalculated. The task information is sent to the management module; wherein the task information includes at least one of the following: the current task scheduling time, the previous adjacent task scheduling time, the current task scheduling delay, the maximum task scheduling delay, the minimum task scheduling delay, and the task scheduling delay jitter.

9. The system according to claim 1, characterized in that, The load sensing module is also used for: The load value of all physical processors is determined based on the statistical time slice and idle time slice of the physical processors. The load information is sent to the management module; wherein the load information includes at least one of the statistical time slice, the idle time slice, and the load value.

10. The system according to claim 1, characterized in that, The virtual machine includes at least one virtual processor, which is used for: The hardware resources of the physical processor are simulated based on virtual resources; wherein, the virtual resources include at least one of virtual page table registers, virtual segment registers, and virtual status registers; Determine whether the virtual machine task needs to be rescheduled; If it is determined that the virtual machine task does not need to be rescheduled, the virtual machine task is executed by a worker thread, and virtual machine task switching is performed within the set of virtual machine tasks determined in the management module; wherein, the worker thread is used to monitor the execution status of the virtual machine task and calculate the task scheduling latency jitter of the virtual machine task; If it is determined that the virtual machine task needs to be rescheduled, the idle time slices of the physical processor are counted by the idle thread.

11. A task scheduling method, characterized in that, The method includes: Monitor the task information of virtual machine tasks within each virtual machine and the load information of each physical processor; wherein, the physical processor provides physical computing resources for the virtual processor; If the task information and / or the load information meet the warning conditions, the priority of the virtual processor is updated, and a scheduling decision for the virtual processor is generated based on the updated priority of the virtual processor; wherein, the priority of the virtual processor is determined according to the mapping relationship between virtual machine tasks and virtual processors; Based on the scheduling decision, the virtual processor is scheduled to be executed on the corresponding physical processor.

12. The method according to claim 11, characterized in that, Before updating the priority of the virtual processor upon determining that the task information and / or the load information meet the warning conditions, the method further includes: The scheduling value of each virtual processor is calculated based on the task type in the task information. The priority of each virtual processor is determined based on the scheduling value.

13. The method according to claim 12, characterized in that, The step of calculating the scheduling value of each virtual processor based on the task type in the task information includes: For a virtual processor carrying a real-time task, the scheduling time limit and allowable jitter ratio of the real-time task are calculated to obtain a real-time value component; wherein, the task type includes the real-time task and non-real-time task; For the virtual processor carrying the non-real-time task, the runtime of the non-real-time task is calculated to obtain the non-real-time value component. The scheduling value of each virtual processor is determined based on the real-time value component and the non-real-time value component.

14. The method according to claim 12, characterized in that, Determining the priority of each virtual processor based on the scheduling value includes: In the initial state, the virtual processors are sorted by their scheduling value to obtain a sorted list; The scheduling value of each virtual processor is mapped to a preset priority range according to the sorting list to determine the priority allocation of each virtual processor.

15. The method according to claim 14, characterized in that, The step of updating the priority of the virtual processor when it is determined that the task information and / or the load information meet the warning conditions includes: If the task information is determined to satisfy the condition that the virtual machine task is longer than a preset time threshold, the virtual processor to which the virtual machine task belongs is located, the scheduling value and corresponding priority of the virtual processor are updated, and the target virtual processor is obtained. The scheduling value of the target virtual processor is compared with the scheduling value of the previous adjacent priority virtual processor to obtain a comparison result; wherein, the previous adjacent priority virtual processor is the virtual processor in the sorting list within the same virtual machine that is located before the target virtual processor; If the comparison result indicates that the scheduling value of the target virtual processor is less than or equal to the scheduling value of the previous adjacent priority virtual processor, the scheduling value and corresponding priority of the target virtual processor are updated. If the comparison result indicates that the scheduling value of the target virtual processor is greater than the scheduling value of the previous adjacent priority virtual processor, the priorities of all virtual processors in the sorted list are updated sequentially according to their priority order to obtain the updated sorted list.

16. The method according to claim 11, characterized in that, The step of updating the priority of the virtual processor when it is determined that the task information and / or the load information meet the warning conditions further includes: If the load information satisfies that the physical processor load value is greater than a preset load threshold and there are at least two virtual processors on the physical processor, then all virtual processors on the physical processor are sorted by priority, and the virtual processor with the lowest priority is moved out to the physical processor with normal load. If the load information satisfies that the physical processor load value is greater than a preset load threshold and there is a virtual processor on the physical processor, the virtual machine tasks carried by the virtual processor are adjusted, and the scheduling value and corresponding priority of all virtual processors are updated.

17. The method according to claim 16, characterized in that, The step of adjusting the virtual machine tasks carried by the virtual processor when it is determined that the load information satisfies the condition that the physical processor load value is greater than a preset load threshold and that there is a virtual processor on the physical processor includes: If it is determined that the alarm virtual processor is not the lowest priority virtual processor, and the physical processor to which the virtual processors other than the alarm virtual processor belong is a physical processor with normal load, the virtual machine task with the lowest priority in the alarm virtual processor is migrated to the lowest priority virtual processor in the same virtual machine; wherein, the alarm virtual processor is a virtual processor located on a physical processor whose physical processor load value is greater than a preset load threshold. If the alarm virtual processor is determined to be the lowest priority virtual processor, a new virtual processor is created to host the lowest priority virtual machine task.

18. The method according to claim 11, characterized in that, The task information includes at least one of the following: current task scheduling time, previous adjacent task scheduling time, current task scheduling latency, maximum task scheduling latency, minimum task scheduling latency, and task scheduling latency jitter. Monitoring the task information of virtual machine tasks within each virtual machine and the load information of each physical processor includes: The task scheduling delay is determined based on the time interval between the current task scheduling time and the previous adjacent task scheduling time, as well as the task scheduling time limit. Based on the current task scheduling delay, the maximum task scheduling delay and the minimum task scheduling delay are determined, and the task scheduling delay jitter is determined according to the maximum task scheduling delay and the minimum task scheduling delay; wherein, if the task information and / or the load information are determined to meet the warning conditions, the task scheduling delay jitter is recalculated.

19. The method according to claim 11, characterized in that, The monitoring of task information for virtual machine tasks within each virtual machine and load information for each physical processor also includes: Based on the statistical time slices and idle time slices of the physical processors, the load values ​​of all physical processors are determined; wherein the load information includes at least one of the statistical time slices, the idle time slices, and the load values.

20. The method according to claim 11, characterized in that, The operation of the virtual processor includes: The hardware resources of the physical processor are simulated based on virtual resources; wherein, the virtual resources include at least one of virtual page table registers, virtual segment registers, and virtual status registers; Determine whether the virtual machine task needs to be rescheduled; If it is determined that the virtual machine task does not need to be rescheduled, the virtual machine task is executed by a worker thread, and virtual machine task switching is performed within a preset set of virtual machine tasks; wherein, the worker thread is used to monitor the execution status of the virtual machine task and calculate the task scheduling latency jitter of the virtual machine task; If it is determined that the virtual machine task needs to be rescheduled, the idle time slices of the physical processor are counted by the idle thread.

21. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 11-20.

22. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 11-20.

23. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 11-20.