Chip resource elastic allocation method and apparatus based on elastic microkernel

By dynamically allocating chip resources through elastic microkernel technology, the problem of low resource utilization in traditional industrial control systems is solved, and efficient and low-cost computing resource management is achieved.

WO2025189913A1PCT designated stage Publication Date: 2025-09-18KYLAND TECH CO LTD

Patent Information

Application Number
PCT/CN2024/143588
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-03-15
Filing Date
2024-12-30
Publication Date
2025-09-18

AI Technical Summary

Technical Problem

Traditional industrial control system architecture cannot meet the high computing power requirements in intelligent and green and low-carbon scenarios, resulting in low computing resource utilization, idle resources or waste.

Method used

By adopting elastic microkernel technology, computing resources are dynamically allocated and adjusted to meet sudden CPU demands according to changes in computing task requirements of adaptive partitions, achieving elastic allocation of chip resources.

Benefits of technology

It improves the utilization rate of computing resources, meets the computing power requirements of different tasks, reduces user costs, and achieves efficient use of resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024143588_18092025_PF_FP_ABST
    Figure CN2024143588_18092025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a chip resource elastic allocation method and apparatus based on an elastic microkernel. The method comprises: configuring a data structure of a partition scheduler of each adaptive partition and a budgeted CPU running time of each adaptive partition; on the basis of the data structure of each adaptive partition, scheduling a corresponding budgeted CPU running time for a task in each adaptive partition; and when the CPU running time actually used by any adaptive partition is less than the budgeted CPU running time thereof, allocating the remaining CPU running time of the adaptive partition to other adaptive partitions that have tasks waiting for scheduling. In the technical solution of the embodiments of the present application, chip resources are dynamically and elastically allocated by means of an elastic microkernel, and on the basis of demand changes of a computing task in each adaptive partition, computing resources are dynamically allocated and adjusted, thereby ensuring bursty CPU demands, and thus meeting computing power demands of different tasks.
Need to check novelty before this filing date? Find Prior Art

Description

A chip resource elastic allocation method and device based on elastic microkernel

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 15, 2024, with application number 2024103012201 and application name “A method and device for elastic allocation of chip resources based on elastic microkernel”. Technical Field

[0002] The present application relates to the field of computer software technology, and in particular to a method and device for elastically allocating chip resources based on an elastic microkernel. Background Art

[0003] As industry evolves from automation to intelligence, the demand for intelligent, heterogeneous, and high-computing edge devices is exploding. Traditional industrial control system architectures cannot meet the demands of intelligent, green, and low-carbon scenarios. A microkernel system is needed that supports dynamic allocation and intelligent adjustment of chip computing resources, fully utilizes computing resources, and reduces user costs. Elastic allocation of computing resources can improve resource utilization. By rationally allocating resources, organizations can avoid idle or wasted resources, maximize resource utilization efficiency, and meet low-carbon, green, and energy-saving requirements. Summary of the Invention

[0004] In view of this, the embodiments of the present application provide a method and device for elastic allocation of chip resources based on an elastic microkernel. The technical solution of the embodiments of the present application dynamically and elastically allocates chip resources through an elastic microkernel, dynamically allocates and adjusts computing resources according to the changes in the demand of computing tasks of each adaptive partition, and ensures sudden CPU demand to meet the computing power requirements of different tasks.

[0005] In the first aspect, an embodiment of the present application provides a chip resource elastic allocation method based on an elastic microkernel, which is used for the elastic microkernel of the computer, including: configuring the data structure of the partition scheduler of each adaptive partition and the CPU running time budgeted by each adaptive partition, each adaptive partition being a combination of several abstracted chip resources; scheduling the corresponding budgeted CPU running time for the tasks of each adaptive partition according to the data structure of each adaptive partition; when the CPU running time actually used by any adaptive partition is lower than its budgeted CPU running time, allocating the remaining CPU running time of the adaptive partition to other adaptive partitions with tasks waiting to be scheduled.

[0006] As described above, the elastic microkernel schedules the usage resources of the computing tasks of each adaptive partition. According to the changes in the demand of the computing tasks of each adaptive partition, computing resources are dynamically allocated and adjusted to ensure sudden CPU demand and meet the computing power requirements of different tasks.

[0007] In a possible implementation of the first aspect, allocating the remaining CPU runtime of the adaptive partition to other adaptive partitions with tasks waiting to be scheduled specifically includes: scheduling the remaining CPU runtime to the adaptive partition with the highest priority among the other adaptive partitions.

[0008] As described above, the elastic microkernel implements dynamic resource scheduling of the adaptive partitions by scheduling the remaining CPU runtime of the currently scheduled adaptive partition to the adaptive partition with the highest priority among other adaptive partitions.

[0009] In a possible implementation of the first aspect, allocating the remaining CPU runtime of the adaptive partition to other adaptive partitions with tasks waiting to be scheduled further includes: scheduling the remaining CPU runtime to the highest priority task in the highest priority adaptive partition.

[0010] As described above, by scheduling the remaining CPU running time to the highest priority task in the adaptive partition with the highest priority in other partitions, the elastic microkernel implements on-demand scheduling of tasks in the high-priority partition in the high-priority adaptive partition.

[0011] In a possible implementation of the first aspect, the maximum CPU runtime actually used by each adaptive partition in a scheduling main frame is the sum of the remaining CPU runtime of other adaptive partitions occupied by the adaptive partition and its own budgeted CPU runtime.

[0012] From the above, by limiting the actual CPU running time used by each adaptive partition in a scheduling main frame to the maximum of the sum of the remaining CPU running time of other adaptive partitions occupied by the adaptive partition and its own budgeted CPU running time, tasks in high-priority adaptive partitions can use resources exceeding the budget ratio, and tasks in low-priority adaptive partitions can use resources not exceeding the budget ratio, so that tasks in high-priority adaptive partitions can be scheduled on demand.

[0013] In a possible implementation of the first aspect, when scheduling the corresponding budgeted CPU running time for the tasks of each adaptive partition according to the data structure of each adaptive partition, the CPU running time scheduled for the tasks whose priority is lower than the threshold is the duration of the minimum scheduling granularity.

[0014] As described above, by scheduling the CPU running time of tasks with priorities lower than the threshold to be the duration of the minimum scheduling granularity, high-priority tasks can be scheduled in a timely manner.

[0015] In a possible implementation manner of the first aspect, the method further includes: setting a lowest priority thread containing an infinite loop in an adaptive partition to convert the adaptive partition into a static partition.

[0016] As described above, by converting the adaptive partition into a static partition, it dynamically supports the running of tasks with high isolation and high security.

[0017] In a possible implementation of the first aspect, the data structure of each adaptive partition is configured based on one of the following methods: RMS monotonic rate, priority, and time schedule.

[0018] As mentioned above, the partition scheduler of each adaptive partition supports multiple scheduling methods to support task scheduling in different scenarios.

[0019] In a possible implementation of the first aspect, the method further includes abstracting the CPU core resources of the computer into the CPU runtime of the computer.

[0020] As described above, by abstracting the CPU core resources of a computer into the CPU running time of the computer, the scheduling of various numbers of various CPU cores can be supported.

[0021] In a possible implementation of the first aspect, the task runs in one of the following scenarios: a thread, a process, a container, or a virtual machine.

[0022] As shown above, each adaptive partition can support multiple scenarios such as threads, processes, containers, and virtual machines.

[0023] In the second aspect, an embodiment of the present application provides a chip resource elastic allocation device based on an elastic microkernel, which is deployed in the elastic microkernel and includes: a resource configuration module, which is used to configure the data structure of the partition scheduler of each adaptive partition and the budgeted CPU running time of each adaptive partition; a resource scheduling module, which is used to schedule the corresponding budgeted CPU running time for the tasks of each adaptive partition according to the data structure of each adaptive partition; and a resource adjustment module, which is used to allocate the remaining CPU running time of any adaptive partition to other adaptive partitions with tasks waiting to be scheduled when the CPU running time actually used by any adaptive partition is lower than its budgeted CPU running time.

[0024] As described above, the elastic microkernel schedules the usage resources of the computing tasks of each adaptive partition. According to the changes in the demand of the computing tasks of each adaptive partition, computing resources are dynamically allocated and adjusted to ensure sudden CPU demand and meet the computing power requirements of different tasks.

[0025] In a possible implementation of the second aspect, when the resource adjustment module allocates the remaining CPU running time of the adaptive partition to other adaptive partitions with tasks waiting to be scheduled, it is used to schedule the remaining CPU running time to the adaptive partition with the highest priority among the other adaptive partitions.

[0026] As described above, the elastic microkernel implements dynamic resource scheduling of the adaptive partitions by scheduling the remaining CPU runtime of the currently scheduled adaptive partition to the adaptive partition with the highest priority among other adaptive partitions.

[0027] In a possible implementation of the second aspect, when the resource adjustment module allocates the remaining CPU running time of the adaptive partition to other adaptive partitions with tasks waiting to be scheduled, it is also used to schedule the remaining CPU running time to the highest priority task in the highest priority adaptive partition.

[0028] As described above, by scheduling the remaining CPU running time to the highest priority task in the adaptive partition with the highest priority in other partitions, the elastic microkernel implements on-demand scheduling of tasks in the high-priority partition in the high-priority adaptive partition.

[0029] In a possible implementation of the second aspect, the maximum CPU runtime actually used by each adaptive partition in a scheduling main frame is the sum of the remaining CPU runtime of other adaptive partitions occupied by the adaptive partition and its own budgeted CPU runtime.

[0030] From the above, by limiting the maximum CPU running time actually used by each adaptive partition in a scheduling main frame to the sum of the remaining CPU running time of other adaptive partitions occupied by each adaptive partition and its own budgeted CPU running time, tasks in high-priority adaptive partitions can use resources exceeding the budget ratio, and tasks in low-priority adaptive partitions can use resources not exceeding the budget ratio, so that tasks in high-priority adaptive partitions can be scheduled on demand.

[0031] In a possible implementation of the second aspect, when the resource scheduling module schedules the corresponding budgeted CPU running time for the tasks of each adaptive partition according to the data structure of each adaptive partition, the CPU running time scheduled for the tasks with a priority lower than a threshold is the duration of the minimum scheduling granularity.

[0032] As described above, by scheduling the CPU running time of tasks with priorities lower than the threshold to be the duration of the minimum scheduling granularity, high-priority tasks can be scheduled in a timely manner.

[0033] In a possible implementation manner of the second aspect, the resource adjustment module is further configured to set a lowest priority thread containing an infinite loop in an adaptive partition, so as to convert the adaptive partition into a static partition.

[0034] As described above, by converting the adaptive partition into a static partition, it dynamically supports the running of tasks with high isolation and high security.

[0035] In a possible implementation of the second aspect, the data structure of each adaptive partition is configured based on one of the following methods: RMS monotonic rate, priority, and time schedule.

[0036] As mentioned above, the partition scheduler of each adaptive partition supports multiple scheduling methods to support task scheduling in different scenarios.

[0037] In a possible implementation of the second aspect, the resource allocation module is further configured to abstract the CPU core resources of the computer into the CPU runtime of the computer.

[0038] As described above, by abstracting the CPU core resources of a computer into the CPU running time of the computer, the scheduling of various numbers of various CPU cores can be supported.

[0039] In a possible implementation of the second aspect, the task runs in one of the following scenarios: a thread, a process, a container, or a virtual machine.

[0040] As shown above, each adaptive partition can support multiple scenarios such as threads, processes, containers, and virtual machines.

[0041] In a third aspect, an embodiment of the present application provides a computing device, including:

[0042] bus;

[0043] a communication interface connected to the bus;

[0044] at least one processor connected to the bus; and

[0045] At least one memory is connected to the bus and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes any implementation method of the first aspect of the present application.

[0046] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a computer, causes the computer to execute any of the implementations described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] FIG1 is a schematic diagram of the structure of a novel industrial operating system of the present application;

[0048] FIG2 is a flow chart of a first embodiment of a chip resource elastic allocation method based on an elastic microkernel of the present application;

[0049] FIG3 is a schematic diagram of the structure of a computer in a first embodiment of a chip resource elastic allocation method based on an elastic microkernel of the present application;

[0050] FIG4 is a flow chart of a second embodiment of a chip resource elastic allocation method based on an elastic microkernel of the present application;

[0051] FIG5 is a schematic structural diagram of a first embodiment of a chip resource elastic allocation device based on an elastic microkernel of the present application;

[0052] FIG6 is a schematic structural diagram of a second embodiment of a chip resource elastic allocation device based on an elastic microkernel of the present application;

[0053] FIG7 is a schematic diagram of the structure of a computing device according to various embodiments of the present application. DETAILED DESCRIPTION

[0054] In the following description, reference is made to “some embodiments”, which describes a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0055] In the following description, the terms "first\second\third, etc." or module A, module B, module C, etc. are only used to distinguish similar objects, or to distinguish different embodiments, and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0056] In the following description, the numbers representing the steps, such as S110, S120, etc., do not necessarily mean that the steps must be executed in this manner. If permitted, the order of the steps can be interchanged or they can be executed simultaneously.

[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.

[0058] An embodiment of the present application provides a method and apparatus for elastically allocating chip resources based on an elastic microkernel. The method includes: configuring a data structure of a partition scheduler for each adaptive partition and a budgeted CPU runtime for each adaptive partition; scheduling the corresponding budgeted CPU runtime for each adaptive partition's tasks based on the data structure of each adaptive partition; and when the CPU runtime actually used by any adaptive partition is lower than its budgeted CPU runtime, allocating the remaining CPU runtime of the adaptive partition to other adaptive partitions with tasks waiting to be scheduled.

[0059] The technical solution of the embodiment of the present application dynamically and flexibly allocates chip resources through an elastic microkernel, dynamically allocates and adjusts computing resources according to the changes in the demand of computing tasks of each adaptive partition, ensures sudden CPU demand, and meets the computing power requirements of different tasks.

[0060] The following describes various embodiments of the present application in conjunction with the accompanying drawings. First, the scenarios in which the embodiments of the present application are used are described.

[0061] The various embodiments of this application are used to dynamically allocate resources for tasks on physical nodes in an industrial cloud, achieving deterministic task execution. The industrial cloud is managed by a new industrial operating system, which is described below in conjunction with Figure 1. Figure 1 shows the structure of a new industrial operating system of this application, which includes, from bottom to top: a base layer, a platform layer, and a service layer. The various embodiments of this application are mainly used in the base layer.

[0062] The base layer is deployed on each physical node in the industrial cloud and includes the node's elastic microkernel and several runtime capsules. The elastic microkernel allocates hardware resources to the runtime capsules. One possible implementation of the base layer is in the new Rust language, leveraging its features to provide memory safety. The system utilizes a standardized functional component design approach, enabling modular assembly. This allows for flexible, on-demand integration of advanced features to support virtualization and provide enhanced security isolation.

[0063] Among them, the elastic microkernel includes componentized hardware resources, which are used to allocate componentized hardware resources to each running capsule. The elastic microkernel manages the hardware resources of the physical node in a componentized manner, and each componentized hardware resource is a standardized resource component. The elastic microkernel elastically loads and / or deletes each resource component according to demand to achieve elastic management of the hardware resources on the physical node. The resources include the CPU core on the chip, the motherboard and / or chip memory, the physical node peripherals, etc. The elastic microkernel is a super-elastic microkernel that can randomly and quickly combine the size of chip resources according to demand. The elastic microkernel is also used to statically and / or dynamically allocate componentized hardware resources to the running capsules on the physical node, realizing elastic allocation of resource components.

[0064] Among them, the running capsule supports one of the following scenarios: thread, process, real-time container, non-real-time container, real-time virtual machine, non-real-time virtual machine. The running capsule includes the running environment of one of the above scenarios, which is used to run tasks in the service components of the new industrial operating system. The running environment includes the running resources of the running capsule of the corresponding scenario.

[0065] For example, Figure 1 shows two partitioned virtual machines and one non-partitioned container. The real-time operating environment of one partitioned virtual machine supports real-time application tasks, the high-security operating environment of one partitioned virtual machine supports high-security application tasks, and the non-real-time operating environment in the non-partitioned container supports the application tasks of the non-real-time container.

[0066] Run capsules can also be divided into real-time run capsules and non-real-time run capsules, which are used to run real-time tasks and non-real-time tasks respectively. Real-time run capsules are time-critical run capsules.

[0067] The platform layer is used to schedule running capsules with matching capabilities on several physical nodes for each task in the service component of the new industrial operating system from the industrial cloud, so that at least the predicted delay of the service component obtained based on the computational delay of the scheduled running capsules and the transmission delay between the scheduled physical nodes meets the deterministic constraints of the service component.

[0068] In a possible implementation of the platform layer, the platform layer includes an orchestrator, a scheduler, and middleware.

[0069] Among them, the coordinator is deployed on the physical node used for management of the industrial cloud in each region, and is used to schedule several physical nodes from the industrial cloud for each task in the service components of the new industrial operating system.

[0070] The orchestrator is deployed regionally, on physical nodes managed within the central and / or edge clouds of each region's industrial cloud. It schedules multiple physical nodes from the industrial cloud for tasks within the new industrial operating system's service components. The orchestrator operates in a hierarchical manner, providing cross-system and cross-regional device coordination and centralized control, real-time monitoring, and remote collaboration.

[0071] The scheduler is deployed on the physical node used for management in the edge cloud of each region. The scheduler uses an end-to-end task delay analysis algorithm to calculate the worst-case delay constraints of tasks in a multi-level dynamic scheduling framework. It uses real-time scheduling analysis technology for multi-core systems to establish a time-predictable basic structure model of multi-core processors and perform scheduling analysis based on it, thereby fully utilizing the powerful parallel computing capabilities provided by multi-core processors.

[0072] The scheduler schedules running capsules that match the capacity of each task in each service component from the physical nodes scheduled by the orchestrator, and predicts the predicted delay of running the service component based on the computational delay of the scheduled running capsules and the transmission delay between the scheduled physical nodes. The predicted delay at least meets the deterministic constraints of the scheduled service component.

[0073] For example, the scheduler schedules three serial tasks A1, B1, and C1 of a service component to run capsules A2, B2, and C2, respectively. The physical nodes where run capsules A2, B2, and C2 reside are connected via a TSN network. Based on the computing power of run capsules A2, B2, and C2, the scheduler uses a preset model to predict the completion times t1, t2, and t3, respectively. It also predicts the transmission delay p1 from run capsule A2 to run capsule B2, and the transmission delay p2 from run capsule B2 to run capsule C2. The estimated delay for completing the service component is (t1+t2+t3+p1+p2). If this estimated delay is less than the deterministic constraint of the service component, the service component can complete the deterministic computation.

[0074] Middleware manages communication between physical nodes, stores data, and supports artificial intelligence engines. These middleware runs on runtime capsules on physical nodes dedicated to their specific functions and can be scheduled statically or dynamically. Together with the runtime capsules dispatched by the scheduler, the middleware helps the service components of the new industrial operating system complete their functions.

[0075] The service layer includes the Industrial Application Cloud Development Kit, deployed on physical nodes within the Industrial Cloud with an integrated development environment. This kit is used to develop service components that form various service suites. The Industrial Application Cloud Development Kit decomposes each service suite into several service components. Each service component is open to users and broken down into tasks that can be subscribed to. Service component tasks are typically dispatched by the platform layer to runtime capsules for execution.

[0076] The service layer also deploys industrial control suites and industrial simulation cloud platforms. The industrial control suites include time-critical industrial control components. The tasks of the industrial control components are scheduled by the platform layer to real-time running capsules (such as partition-based real-time containers or real-time virtual machines). The service layer is also used to start related service components in the industrial control suite to control and access industrial actuators or sensors connected to the edge cloud in the industrial cloud through the platform layer and the base layer to complete industrial control.

[0077] The following describes, in conjunction with FIG2 , a first embodiment of a chip resource elastic allocation method based on an elastic microkernel of the present application.

[0078] FIG2 shows a process of a first embodiment of a method for elastically allocating chip resources based on an elastic microkernel, including steps S210 to S230 .

[0079] S210: Configure the data structure of the partition scheduler of each adaptive partition and the CPU running time budget of each adaptive partition.

[0080] Each adaptive partition comprises a combination of several abstract and componentized chip resources, providing resources for the runtime capsules of the base layer of the new industrial operating system in the application scenarios of each embodiment of this application. An adaptive partition can have multiple runtime capsules, each of which supports threads, processes, containers, or one of the operating system scenarios. Computers are physical nodes of the new industrial operating system in the application scenarios of each embodiment of this application.

[0081] Unlike conventional partitions, adaptive partitions do not necessarily require a partition operating system. For example, when running threads, processes, and containers, a partition operating system is not required. The lack of a partition operating system means that the adaptive partitions do not have a partition scheduler for the partition operating system. However, the elastic microkernel does have a partition scheduler for adaptive partitions, and all subsequent partition schedulers in this embodiment are embedded in the elastic microkernel. The data structure of each adaptive partition's partition scheduler defines the scheduling algorithm for that adaptive partition.

[0082] Computer resources are abstracted into resource components. This includes abstracting CPU core resources into CPU runtime. CPU runtime is abstracted into a single unit based on the CPU architecture (x86, ARM), the number of CPU cores, and the computing power of each CPU core. Each adaptive partition's CPU runtime is allocated according to its budget.

[0083] The abstracted virtual CPU execution time is divided into a certain proportion to ensure that each adaptive partition has a set of engineered resources. Each adaptive partition can run one or more threads / processes.

[0084] FIG3 shows the structure of the computer of this embodiment, which includes, from bottom to top: computing resources, an elastic microkernel, and several adaptive partitions.

[0085] Among them, computer resources include chip resources, and the chip can be a SoC chip, an MPU chip, an MCU chip, or a GPU or an NPU chip.

[0086] The elastic microkernel includes a resource component and a kernel scheduler. The resource component is a virtual component that abstracts chip resources and isolates adaptive partitions from chip resources. The kernel scheduler connects to the partition scheduler of each adaptive partition, and the kernel scheduler in the elastic microkernel directly schedules tasks for the adaptive partitions.

[0087] Among them, each adaptive partition can support scenarios such as threads, processes, containers or virtual machines. The components of each adaptive partition are allocated by the elastic microkernel from the resource components in the elastic microkernel according to the adaptive partition budget ratio. The usage time of the allocated resource components can be dynamically adjusted by the elastic microkernel. It should be emphasized that: Figure 3 shows three adaptive partitions, which support threads, processes and virtual operating environments respectively. In actual scenarios, there can be multiple adaptive partitions, each of which can support one of the scenarios of threads, processes, containers or virtual machines. The number of threads, processes, containers or virtual machines on each adaptive partition can vary.

[0088] In some embodiments, the data structure of the partition scheduler of each adaptive partition is configured based on one of the following: RMS monotonic rate, priority, time schedule.

[0089] In some embodiments, when scheduling the corresponding budgeted CPU runtime for each adaptively partitioned task, the CPU runtime scheduled for tasks with a priority lower than a threshold is the duration of the minimum scheduling granularity. When no high-priority task is scheduled, the scheduling time of the low-priority task is more than the minimum scheduling granularity. Task priority ensures that critical tasks run, but does not provide guaranteed CPU time for important non-critical tasks, which may be starved during normal operation. Partitioning technology is used to ensure that low-priority tasks can obtain a minimum-granularity CPU runtime when the system load is high. Prevent unimportant or untrusted applications from monopolizing system resources. Provide security to prevent resources from being occupied and causing functions to become unresponsive.

[0090] S220: Schedule the corresponding budgeted CPU running time for the tasks of each adaptive partition according to the data structure of the partition scheduler of each adaptive partition.

[0091] Tasks run in one of the following scenarios: threads, processes, containers, and virtual machines. Accordingly, each adaptive partition's scheduler can be a thread, process, container, or virtual machine scheduler, but they essentially support task scheduling in the corresponding scenario in a thread-based manner.

[0092] Each adaptive partition's partition scheduler is attached to the elastic microkernel, which schedules tasks for each adaptive partition based on the data structure of the partition scheduler, achieving flexible scheduling of chip resources. Existing technology uses the microkernel to schedule resources for each partition. At this point, each partition's resources are already statically scheduled, and the partition scheduler within the partition performs secondary scheduling, which fails to achieve flexible scheduling of chip resources.

[0093] In some embodiments, the budgeted CPU runtime of each adaptive partition is converted into a CPU runtime time slice within a scheduling main frame, and when the elastic microkernel schedules a task for an adaptive partition, the time slice is scheduled to the task.

[0094] S230: When the CPU runtime actually used by any adaptive partition is lower than its budgeted CPU runtime, the remaining CPU runtime of the adaptive partition is allocated to other adaptive partitions with tasks waiting to be scheduled.

[0095] Among them, when the actual CPU runtime used by an adaptive partition is lower than its budgeted CPU runtime, the elastic microkernel does not need to wait for the budgeted CPU runtime to be used up, but directly allocates the remaining CPU runtime of the adaptive partition to other adaptive partitions with tasks waiting to be scheduled.

[0096] In some embodiments, allocating the remaining CPU runtime of an adaptive partition to other adaptive partitions with tasks waiting to be scheduled specifically includes scheduling the remaining CPU runtime to the adaptive partition with the highest priority among the other adaptive partitions with tasks waiting to be scheduled. Thus, by scheduling the remaining CPU runtime to the adaptive partition with the highest priority among the other partitions, the elastic microkernel implements dynamic resource scheduling for the high-priority adaptive partition.

[0097] In some embodiments, allocating the remaining CPU runtime of an adaptive partition to other adaptive partitions with tasks waiting to be scheduled further specifically includes scheduling the remaining CPU runtime to the highest-priority task in the highest-priority adaptive partition. Thus, by scheduling the remaining CPU runtime to the highest-priority task in the highest-priority adaptive partition among other partitions, the elastic microkernel implements on-demand scheduling of tasks in high-priority partitions within high-priority adaptive partitions.

[0098] In some embodiments, the maximum CPU runtime actually used by each adaptive partition within a scheduling main frame is the sum of the remaining CPU runtime of other adaptive partitions occupied by the adaptive partition and its own budgeted CPU runtime. That is, when an adaptive partition is called within a scheduling main frame to occupy the remaining CPU runtime of other adaptive partitions, its scheduled time can exceed its own budgeted CPU runtime, and is at most equal to the sum of the remaining CPU runtime of other adaptive partitions occupied by the adaptive partition and its own budgeted CPU runtime. When an adaptive partition is called within a scheduling main frame and does not occupy the remaining CPU runtime of other adaptive partitions, its scheduled time is at most its own budgeted CPU runtime.

[0099] In some embodiments, a lowest priority thread including an infinite loop is set in an adaptive partition to convert the adaptive partition into a static partition, so as to improve the isolation between the adaptive partition and other adaptive partitions.

[0100] In summary, embodiment 1 of a chip resource elastic allocation method based on an elastic microkernel dynamically and elastically allocates chip resources through an elastic microkernel, dynamically allocates and adjusts computing resources according to the changes in the demand of the computing tasks of each adaptive partition, ensures sudden CPU demand, and meets the computing power requirements of different tasks.

[0101] A second embodiment of a chip resource elastic allocation method based on an elastic microkernel is a detailed implementation of the first embodiment of a chip resource elastic allocation method based on an elastic microkernel, with all its advantages.

[0102] FIG4 shows a flow chart of a second embodiment of a method for elastically allocating chip resources based on an elastic microkernel, including steps S310 to S360 .

[0103] S310: Abstract computer resources into component resources and allocate them to each adaptive partition.

[0104] Computer resources (including chip resources and devices) are abstracted into virtual component resources. Each adaptive partition is a combination of several component resources, ensuring that each adaptive partition has a set of engineered resources. Each partition can run one or more threads / processes.

[0105] The number of CPU cores and the computing power of each CPU core are abstracted into a single CPU runtime to configure and schedule the CPU core resources of any chip in subsequent steps. The data structure of the partition scheduler for each adaptive partition and the CPU runtime budget for each adaptive partition are configured.

[0106] The data structure of each adaptive partition's partition scheduler is attached to the elastic microkernel's kernel scheduler, and the CPU runtime of each adaptive partition is allocated according to the budget ratio. The data structure of each adaptive partition's partition scheduler is configured based on one of the following methods: RMS monotonic rate, priority, or time schedule.

[0107] S320: Schedule the corresponding budgeted CPU running time for each adaptive partition's task according to the data structure of the partition scheduler of each adaptive partition.

[0108] The budgeted CPU runtime for each adaptive partition is converted into a CPU runtime time slice within a scheduling master frame. When the elastic microkernel schedules a task for an adaptive partition, it assigns the time slice to the task. The task can run in one of the following scenarios: thread, process, container, or virtual machine.

[0109] S330: Within the CPU runtime budget of the current adaptive partition, before selecting a task to be run, check whether the CPU runtime used by the adaptive partition exceeds the budget.

[0110] The check is performed only within the budgeted CPU running time of the current adaptive partition. If the check is performed within the remaining time of other adaptive partitions, the check in this step is not performed.

[0111] If it does not exceed, step S340 is executed; otherwise, step S320 is executed to schedule the task in the next adaptive partition.

[0112] S340: Select the task to be run according to the data structure of the current partition scheduler.

[0113] The selection is based on one of the following: RMS monotonic rate, priority, or time schedule.

[0114] S350: Determine whether the actual CPU running time used by any adaptive partition is lower than its budgeted CPU running time.

[0115] If so, step S360 is executed; otherwise, step S320 is executed to schedule the task in the next adaptive partition.

[0116] S360: Schedule the remaining CPU running time to the adaptive partition with the highest priority among other adaptive partitions with tasks waiting to be scheduled, and schedule the task with the highest priority from the adaptive partition with the highest priority to run.

[0117] In this step, no matter whether the adaptive partition with the highest priority has been scheduled before in the current scheduling main frame, it can occupy the remaining CPU running time.

[0118] Among them, if the adaptive partition with the highest priority has not been scheduled before in this scheduling main frame, then after the remaining CPU running time is used up, the adaptive partition with the highest priority will continue to be scheduled until its scheduling time reaches the sum of its own budgeted CPU running time and the remaining CPU running time.

[0119] If the adaptive partition with the highest priority has been scheduled before in the current scheduling main frame, then after the remaining CPU running time is used up, the adaptive partition with the highest priority will occupy the remaining CPU running time.

[0120] 5 and 6 , an embodiment of a chip resource elastic allocation device based on an elastic microkernel is described below.

[0121] A device for elastically allocating chip resources based on an elastic microkernel, embodiment 1, is used to run a method for elastically allocating chip resources based on an elastic microkernel, and the method described in embodiment 1 has all its advantages.

[0122] FIG5 shows the structure of a first embodiment of a chip resource elastic allocation device based on an elastic microkernel, including a resource configuration module 510 , a resource scheduling module 520 and a resource adjustment module 530 .

[0123] The resource configuration module 510 is used to configure the data structure of the partition scheduler of each adaptive partition and the CPU running time budget of each adaptive partition. For its working principle and advantages, please refer to step S210 of the first embodiment of a chip resource elastic allocation method based on an elastic microkernel.

[0124] Resource scheduling module 520 is used to schedule the corresponding budgeted CPU runtime for each adaptive partition's tasks based on the data structure of each adaptive partition's partition scheduler. For details on its working principle and advantages, please refer to step S220 of the first embodiment of a method for elastically allocating chip resources based on an elastic microkernel.

[0125] When the actual CPU runtime used by any adaptive partition falls below its budgeted CPU runtime, resource adjustment module 530 allocates the remaining CPU runtime of that adaptive partition to other adaptive partitions with tasks waiting to be scheduled. For its operating principles and advantages, please refer to step S230 of Example 1 of a method for elastic chip resource allocation based on an elastic microkernel.

[0126] A second embodiment of a device for elastically allocating chip resources based on an elastic microkernel is used to run a second embodiment of a method for elastically allocating chip resources based on an elastic microkernel, and the method has all the advantages thereof.

[0127] Figure 6 shows the structure of a second embodiment of a chip resource elastic allocation device based on an elastic microkernel, including: a resource configuration module 610, a resource scheduling module 620, a budget judgment module 630, a task scheduling module 640, a remaining judgment module 650 and a remaining scheduling module 660.

[0128] The resource allocation module 610 is used to abstract computer resources into component resources and allocate them to each adaptive partition. For its working principle and advantages, please refer to step S310 of the second embodiment of a chip resource elastic allocation method based on an elastic microkernel.

[0129] Resource scheduling module 620 is used to schedule the corresponding budgeted CPU runtime for each adaptive partition's tasks based on the data structure of each adaptive partition's partition scheduler. For details on its working principle and advantages, please refer to step S320 of Example 2 of a method for elastically allocating chip resources based on an elastic microkernel.

[0130] Budget determination module 630 is used to check whether the CPU runtime used by the adaptive partition exceeds the budgeted CPU runtime of the current adaptive partition before selecting a task to run. For its operating principle and advantages, please refer to step S330 of Example 2 of a method for elastically allocating chip resources based on an elastic microkernel.

[0131] The task scheduling module 640 is used to select the task to be run according to the data structure of the current partition scheduler. For its working principle and advantages, please refer to step S340 of the second embodiment of a chip resource elastic allocation method based on an elastic microkernel.

[0132] The remaining judgment module 650 is used to determine whether the actual CPU runtime used by any adaptive partition is less than its budgeted CPU runtime. For its working principle and advantages, please refer to step S350 of the second embodiment of a chip resource elastic allocation method based on an elastic microkernel.

[0133] The remaining scheduling module 660 is used to schedule the remaining CPU runtime to the highest-priority adaptive partition among the other adaptive partitions with tasks waiting to be scheduled, and to schedule the highest-priority task from this highest-priority adaptive partition. For its operating principles and advantages, please refer to step S360 of Example 2 of a method for elastically allocating chip resources based on an elastic microkernel.

[0134] The embodiment of the present application also provides a computing device, which is described in detail below in conjunction with FIG. 7 .

[0135] The computing device 700 includes a processor 710 , a memory 720 , a communication interface 730 , and a bus 740 .

[0136] It should be understood that the communication interface 730 in the computing device 700 shown in this figure can be used to communicate with other devices.

[0137] The processor 710 may be connected to a memory 720. The memory 720 may be used to store the program code and data. Therefore, the memory 720 may be a storage unit within the processor 710, an external storage unit independent of the processor 710, or a component including both a storage unit within the processor 710 and an external storage unit independent of the processor 710.

[0138] Optionally, computing device 700 may further include a bus 740. Memory 720 and communication interface 730 may be connected to processor 710 via bus 740. Bus 740 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, for example. Bus 740 may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figure uses only one line, but this does not imply that there is only one bus or only one type of bus.

[0139] It should be understood that in the embodiment of the present application, the processor 710 can adopt a central processing unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. Alternatively, the processor 710 uses one or more integrated circuits to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0140] The memory 720 may include a read-only memory and a random access memory, and provides instructions and data to the processor 710. A portion of the processor 710 may also include a non-volatile random access memory. For example, the processor 710 may also store information about the device type.

[0141] When the computing device 700 is running, the processor 710 executes the computer-executable instructions in the memory 720 to perform the operating steps of each method embodiment.

[0142] It should be understood that the computing device 700 according to the embodiment of the present application can correspond to the corresponding subject in executing the method according to each embodiment of the present application, and the above-mentioned and other operations and / or functions of each module in the computing device 700 are respectively for implementing the corresponding processes of each method of the present embodiment. For the sake of brevity, they will not be repeated here.

[0143] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0144] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0145] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0146] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0147] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0148] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0149] An embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it is used to perform the operating steps of each method embodiment.

[0150] The computer storage medium of the embodiment of the present application can adopt any combination of one or more computer-readable media.Computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium.Computer-readable storage medium can be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof.More specific examples (non-exhaustive list) of computer-readable storage medium include, an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0151] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0152] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0153] The computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0154] Note that the above are only preferred embodiments of the present application and the technical principles employed. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments, and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application has been described in more detail through the above embodiments, the present application is not limited to the above embodiments and may include many other equivalent embodiments without departing from the scope of protection of the present application, all of which fall within the scope of protection of the present application.

Claims

1. A chip resource elastic allocation method based on an elastic microkernel, characterized in that: A resilient microkernel for computers, including: Configure the data structure of the partition scheduler for each adaptive partition and the CPU runtime budget for each adaptive partition. Each adaptive partition is a combination of several abstracted chip resources. Scheduling the corresponding budgeted CPU running time for each adaptive partition's task according to the data structure of each adaptive partition; When the CPU runtime actually used by any adaptive partition is lower than its budgeted CPU runtime, the remaining CPU runtime of the adaptive partition is allocated to other adaptive partitions with tasks waiting to be scheduled.

2. The method according to claim 1, characterized in that The method of allocating the remaining CPU running time of the adaptive partition to other adaptive partitions having tasks waiting to be scheduled includes: The remaining CPU running time is scheduled to the adaptive partition with the highest priority among the other adaptive partitions.

3. The method according to claim 2, characterized in that The method of allocating the remaining CPU running time of the adaptive partition to other adaptive partitions having tasks waiting to be scheduled further includes: The remaining CPU runtime is scheduled to the task with the highest priority in the adaptive partition with the highest priority.

4. The method according to claim 1, characterized in that The maximum CPU running time used by each adaptive partition in a scheduling main frame is the sum of the remaining CPU running time of other adaptive partitions occupied by the adaptive partition and its own budgeted CPU running time.

5. The method according to claim 1, characterized in that: When scheduling the corresponding budgeted CPU running time for each task of each adaptive partition according to the data structure of each adaptive partition, the CPU running time scheduled for the task with a priority lower than a threshold is the duration of the minimum scheduling granularity.

6. The method according to claim 1, characterized in that Also includes: Set a lowest-priority thread containing an infinite loop in an adaptive partition to convert the adaptive partition into a static partition.

7. The method according to claim 1, characterized in that: The data structure of each adaptive partition is configured based on one of the following: RMS monotonic rate, priority, time schedule.

8. The method according to claim 1, characterized in that: Also includes: Abstract the computer's CPU core resources as the computer's CPU running time.

9. The method according to claim 1, characterized in that: The task runs in one of the following scenarios: thread, process, container, virtual machine.

10. A chip resource elastic allocation device based on an elastic microkernel, characterized in that: Deployed in an elastic microkernel, including: Resource configuration module, used to configure the data structure of the partition scheduler of each adaptive partition and the CPU running time budget of each adaptive partition; A resource scheduling module, configured to schedule the corresponding budgeted CPU running time of each task of each adaptive partition according to the data structure of each adaptive partition; The resource adjustment module is used to allocate the remaining CPU running time of any adaptive partition to other adaptive partitions with tasks waiting to be scheduled when the CPU running time actually used by the adaptive partition is lower than its budgeted CPU running time.

11. A computing device, characterized in that include, bus; a communication interface connected to the bus; at least one processor connected to the bus; as well as At least one memory is connected to the bus and stores program instructions, and when the program instructions are executed by the at least one processor, the at least one processor executes the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that Program instructions are stored thereon, and when the program instructions are executed by a computer, the computer is caused to perform the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Task scheduling apparatus and method for embedded operating system

    CN101452404A

  • Hybrid critical task scheduling method based on quasi-partitioning

    CN109298920A

  • Resource scheduling system and method, and computing equipment

    CN114035941A

  • Multi-core processor-oriented partition operating system deterministic scheduling method

    CN117687749A

  • Systems and methods for scheduling tasks and managing computing resource allocation for closed loop control systems

    US20190286478A1

Cited By

  • Hierarchical real-time scheduling robot operation control and sensing system resource isolation method

    CN122008182A