A service processing method, system, device and medium based on a dual real-time kernel

By employing a dual real-time kernel architecture and a multi-dimensional task scheduling strategy in the virtualized operating system, the problems of low efficiency and unstable latency jitter in latency-sensitive real-time task processing in the virtualized operating system are solved, and efficient and stable real-time task scheduling is achieved.

CN115964150BActive Publication Date: 2026-06-26JINAN INSPUR DATA TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINAN INSPUR DATA TECH CO LTD
Filing Date
2022-12-30
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing virtualized operating systems, the task scheduling method of ordinary kernels results in low efficiency of real-time task processing that is sensitive to latency, and is easily affected by interrupts, leading to unstable latency jitter.

Method used

A dual real-time kernel architecture is adopted. By establishing a message sharing channel between the real-time Linux kernel and the real-time virtual machine monitor kernel, and combining multi-dimensional task scheduling strategies and resource allocation and isolation strategies, a kernel-preemptive task scheduling model is realized, and hardware optimization is performed to improve the scheduling efficiency and stability of real-time tasks.

Benefits of technology

It significantly improves the scheduling and processing of latency-sensitive real-time tasks, reduces scheduling latency and jitter, improves task processing efficiency, and can respond to service scheduling within 20us and control jitter within 15us.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115964150B_ABST
    Figure CN115964150B_ABST
Patent Text Reader

Abstract

The application relates to a service processing method, system, device and medium based on a dual real-time kernel. A real-time Linux kernel and a real-time virtual machine monitor kernel are constructed, and a message sharing channel is established between the real-time Linux kernel and the real-time virtual machine monitor kernel; according to a preset multidimensional task scheduling strategy and a preset resource allocation and isolation strategy, the real-time Linux kernel is responsible for system service process scheduling and resource allocation at an operating system level, and the real-time virtual machine monitor kernel is responsible for scheduling, device simulation and resource allocation of a virtual machine service. Through the dual real-time kernel, task scheduling is separated, and the efficiency of task scheduling can be effectively improved. Through the optimized multidimensional task scheduling strategy and the resource allocation and isolation strategy, task scheduling is controlled, and the scheduling delay and jitter of real-time tasks in system services and / or virtual machine services are improved in combination with hardware optimization. The system device and the medium based on the method provided by the application can also achieve the above effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of virtualization operating system optimization, and in particular to a business processing method, system, device and medium based on dual real-time kernels. Background Technology

[0002] With the booming development of cloud computing, more and more performance-sensitive businesses will be migrated to virtualized operating systems. Virtualized operating systems generally use ordinary kernels. In order to achieve high throughput of system tasks, task scheduling only occurs during system calls and interrupt returns. This approach results in slow task processing efficiency and cannot meet the needs of latency-sensitive real-time tasks.

[0003] Currently, to optimize the processing efficiency of sensitive services, some virtualization operating systems employ real-time scheduling. Tasks scheduled in real-time have higher priority than ordinary tasks and can be executed before them. However, for services with higher latency sensitivity requirements, the latency reduction effect of using real-time scheduling to handle real-time tasks is still not ideal, and it is easily affected by interrupts, resulting in a large range of latency jitter and instability. Summary of the Invention

[0004] To solve the above-mentioned technical problems, or at least partially solve them, the present invention provides a service processing method, system, device, and medium based on dual real-time kernels.

[0005] In a first aspect, the present invention provides a service processing method based on dual real-time kernels, comprising: modifying the Linux kernel and the virtual machine monitor kernel into real-time kernels, and establishing a message sharing channel between the real-time Linux kernel and the real-time virtual machine monitor kernel; according to a preset multi-dimensional task scheduling strategy and a preset resource allocation and isolation strategy, the real-time Linux kernel is responsible for system service process scheduling and resource allocation at the operating system level, and the real-time virtual machine monitor kernel is responsible for virtual machine service scheduling, device simulation, and resource allocation; wherein, in response to a request from the virtual machine monitor real-time kernel, the real-time Linux kernel provides memory management and event notifications dependent on the virtual machine monitor real-time kernel through the message sharing channel, and the real-time Linux kernel sends virtual machine operation management notifications to the virtual machine monitor real-time kernel through the message channel.

[0006] Furthermore, the multi-dimensional task scheduling strategy includes: implementing a kernel-wide preemptive task scheduling model through the combination of interrupt routine threading, synchronization mechanisms, and sleep-enabled semaphores; and coordinating resource mutual exclusion and task blocking based on real-time system task priority inheritance and inversion resource coordination.

[0007] Furthermore, the kernel-wide preemptive task scheduling model modifies existing interrupt handling functions to wake up interrupt threads by threading interrupt routines, and assigns interrupt threads the same priority as other threads. Any thread is scheduled based on its priority. For threads corresponding to real-time tasks in system services and / or virtual machine services, a higher priority is assigned than that of interrupt threads, allowing real-time tasks to preempt interrupt threads to improve real-time performance.

[0008] Furthermore, the kernel-wide preemptive task scheduling model enables the critical resource region protected by the critical resource lock to be preempted and actively put to sleep through synchronization mechanisms and semaphore sleep. When a process uses the real-time mutual exclusion mechanism to acquire a lock, if the lock is already occupied, the process is added to the waiting queue, and then the schedule is called for scheduling. When the critical resource is released, the process in the waiting queue is woken up.

[0009] Furthermore, the resource allocation and isolation strategy includes:

[0010] The CPU resources allocated to the real-time tasks are adaptively planned according to the workload of the real-time tasks, and the hardware resources occupied by the real-time tasks are isolated from the influence of other tasks; for non-real-time tasks, resources are reused to the maximum extent and time-sharing scheduling is performed.

[0011] Furthermore, non-real-time system tasks, real-time system tasks, virtual machine monitor and non-real-time virtual machine tasks, and virtual machine monitor and real-time virtual machine tasks are assigned to different CPUs for processing and resource isolation is performed. Based on resource isolation, tasks are bound to the resources they belong to. System tasks are fuzzily bound according to a range, while virtual machine monitor and virtual machine tasks are precisely bound.

[0012] Furthermore, configure double-page mains memory for the Linux operating system.

[0013] Furthermore, hardware optimization is combined to improve the scheduling latency and jitter of real-time tasks in system services and / or virtual machine services. The hardware optimization includes, but is not limited to, improving processing performance at the hardware level based on instruction encoding prediction, branch prediction, cache reservation and memory channel and frequency optimization, and improving processing performance at the hardware level based on CPU power management optimization, frequency management optimization and reducing inter-core interrupt wake-up latency.

[0014] In a second aspect, the present invention provides a task processing system based on dual real-time kernels, comprising: a dual real-time kernel module, a multi-dimensional task scheduling strategy module, a resource allocation and isolation strategy module, and a hardware optimization module;

[0015] The dual real-time kernel module provides a real-time Linux kernel and a virtual machine monitor kernel, establishing a message sharing channel between them. Based on the multi-dimensional task scheduling strategy provided by the multi-dimensional task scheduling strategy module and the resource allocation and isolation strategy provided by the resource allocation and isolation strategy module, the real-time Linux kernel is responsible for system business process scheduling and resource allocation at the operating system level, while the real-time virtual machine monitor kernel is responsible for virtual machine business scheduling, device simulation, and resource allocation. In response to a request from the virtual machine monitor real-time kernel, the real-time Linux kernel provides memory management and event notifications dependent on the virtual machine monitor real-time kernel through the message sharing channel, and the real-time Linux kernel sends virtual machine operation management notifications to the virtual machine monitor real-time kernel through the message channel.

[0016] The hardware optimization module is used to improve the scheduling latency and jitter of real-time tasks in system services and / or virtual machine services through hardware optimization.

[0017] Thirdly, the present invention provides a task processing device based on dual real-time kernels, comprising: at least one processing unit, a storage unit, and a bus unit, wherein the bus unit connects the processing unit and the storage unit, the storage unit stores a computer program, and the processing unit executes the computer program to implement the business processing method based on dual real-time kernels.

[0018] Fourthly, the present invention provides a computer-readable storage medium for implementing a business processing method based on dual real-time kernels, wherein the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, implements the business processing method based on dual real-time kernels.

[0019] The technical solutions provided in the embodiments of the present invention have the following advantages compared with the prior art:

[0020] In the virtualized operating system implemented in this application, a real-time Linux kernel and a real-time virtual machine monitor kernel share a message channel. Based on a preset multi-dimensional task scheduling strategy and a preset resource allocation and isolation strategy, the real-time Linux kernel is responsible for system business process scheduling and resource allocation at the operating system level, while the real-time virtual machine monitor kernel is responsible for virtual machine business scheduling, device simulation, and resource allocation. Separating task scheduling through dual real-time kernels effectively improves scheduling efficiency.

[0021] The multi-dimensional task scheduling strategy modifies existing interrupt handling functions to wake up interrupt threads by threading interrupt routines. Interrupt threads are assigned the same priority as other threads, and task scheduling is based on priority. For threads corresponding to real-time tasks in system and / or virtual machine services, a higher priority is configured than that of interrupt threads. Real-time tasks can preempt interrupt threads to improve real-time performance and avoid scheduling jitter caused by interrupts. Based on real-time system task priority inheritance and inversion resource coordination, resource mutual exclusion and task blocking coordination are performed to effectively manage real-time task blocking.

[0022] The resource allocation and isolation strategy adaptively plans the CPU resources allocated to the real-time task based on the workload of the real-time task, and isolates the hardware resources occupied by the real-time task from the influence of other tasks; for non-real-time tasks, it maximizes resource reuse and performs time-sharing scheduling.

[0023] Improve scheduling latency and jitter of real-time tasks in system services and / or virtual machine services by combining hardware optimization.

[0024] In summary, it can significantly improve the scheduling and processing of latency-sensitive real-time tasks, greatly reduce task latency, and avoid the problem of latency jitter and instability caused by interruptions. Attached Figure Description

[0025] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0027] Figure 1 A flowchart illustrating a service processing method based on dual real-time kernels provided in an embodiment of the present invention;

[0028] Figure 2 This is a schematic diagram of the architecture of a virtualized operating system including a real-time Linux kernel and a real-time virtual machine monitor kernel, provided in an embodiment of the present invention.

[0029] Figure 3 A schematic diagram of a service processing system based on dual real-time kernels provided in an embodiment of the present invention;

[0030] Figure 4 This is a schematic diagram of a task processing device based on dual real-time kernels, provided as an embodiment of the present invention. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0032] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0033] The terms and explanations used in the specific embodiments of this application are as follows:

[0034] Locks: In high-performance parallel programs, consistent data access is a very important part. Generally, lock mechanisms are used to protect shared data. The basic idea of ​​the lock mechanism is to first access a global variable (lock) when accessing critical resources, and control the thread's access to critical resources through the state of the global variable.

[0035] Mutual exclusion (Mutex) is a mechanism used in multithreaded environments to prevent two threads from simultaneously reading and writing to the same shared resource. It is implemented by slicing the code into critical sections. A critical section is a block of code that accesses a shared resource.

[0036] A semaphore is a facility used in a multithreaded environment to ensure that two or more critical code segments are not called concurrently.

[0037] Spinlocks are used for non-blocking synchronization, specifically for mutual exclusion of shared data in a non-sleep context. Only one process can acquire the spinlock at a time; other processes that cannot acquire the spinlock spin in place until they obtain it. In other words, if a process tries to acquire a spinlock but it is already held by another process, the process will loop and continuously attempt to acquire the spinlock until the holder releases it and the thread finally acquires it, at which point it will exit the loop.

[0038] Read Copy Modification Lock (RCUlock): Used for non-blocking synchronization. For shared data protected by RCUlock, readers do not need to acquire any lock to access it. However, when a writer accesses it, it first copies a copy, then modifies the copy, and finally uses a callback mechanism to replace the pointer to the original data with the modified copy at an appropriate time. This time is when all CPUs referencing the data exit the access to the shared data.

[0039] Example 1

[0040] This invention provides a service processing method based on dual real-time kernels, which improves the processing speed of real-time tasks in system services and implementation tasks in virtual machine services in terms of task scheduling and processing efficiency. Compared with the millisecond-level scheduling latency of ordinary virtualization operating systems, the service scheduling latency can be responded to within 20us after applying this application, resulting in a significant performance improvement. At the same time, the scheduling jitter can also be controlled within 15us.

[0041] See Figure 1 As shown, the process of the service processing method based on dual real-time kernels includes:

[0042] S100 modifies the Linux kernel and virtual machine monitor kernel of the virtualized operating system into real-time kernels, and establishes a message sharing channel between the real-time Linux kernel and the real-time virtual machine monitor kernel.

[0043] In the specific implementation process, when modifying the Linux kernel to a real-time Linux kernel, kernel preemption needs to be enabled, the spinlock and read-copy-modify lock (RCUlock) need to be set to preemptive, and the interrupt routines need to be forced to be threaded; then the Linux kernel is recompiled to obtain the real-time Linux kernel.

[0044] In the specific implementation process, when modifying the virtual machine monitor kernel to a real-time virtual machine monitor kernel, it is necessary to replace the non-preemptible lock of the virtual machine monitor kernel with a preemptible lock, add the implementation mode enable parameter, and then recompile the virtual machine monitor kernel to obtain the real-time virtual machine monitor kernel.

[0045] like Figure 2 As shown, step S100 constructs an architecture for a virtualized operating system that includes a real-time Linux kernel and a real-time virtual machine monitor kernel.

[0046] S200 provides preset multi-dimensional task scheduling strategies and preset resource allocation and isolation strategies.

[0047] The multi-dimensional task scheduling strategy includes:

[0048] A preemptive kernel task scheduling model is implemented through the threading of interrupt routines, synchronization mechanisms, and semaphore-based sleep functionality. Based on real-time system task priority inheritance and inversion resource coordination, resource mutual exclusion and task blocking coordination are achieved. Specifically, the preemptive kernel task scheduling model modifies existing interrupt handling functions to wake up interrupt threads through interrupt routine threading, assigning interrupt threads the same priority as other threads. Any thread is scheduled based on its priority. For threads corresponding to real-time tasks in system and / or virtual machine services, a higher priority than the interrupt threads is configured, allowing real-time tasks to preempt interrupt threads to improve their real-time performance.

[0049] The kernel-wide preemptive task scheduling model uses synchronization mechanisms and semaphores to enable sleep, allowing critical resource regions protected by critical resource locks to be preempted and to actively sleep. When a process uses a real-time mutual exclusion mechanism to acquire a lock, if the lock is already occupied, the process is added to a waiting queue, and then the schedule is called for scheduling. When the critical resource is released, the processes in the waiting queue are woken up.

[0050] In one feasible implementation, the priority range of real-time tasks is set to 1-99. Priority is configured by calling the system command chrt -f -p priority value process ID or by using the priority configuration API int sched_setscheduler(pid_t pid, int policy, const struct sched_param*param).

[0051] In one feasible implementation, the multi-dimensional task scheduling strategy follows the SCHED_FIFO method. Under the SCHED_FIFO method, high-priority real-time services will continue to run until a higher-priority real-time task arrives or the CPU is voluntarily relinquished.

[0052] The synchronization mechanism involves resource mutual exclusion, which may cause high-priority real-time tasks to be blocked by low-priority real-time tasks. Real-time tasks with priorities between the two can run and complete before the high-priority task resumes; this phenomenon is called priority inversion. Priority inheritance solves the problem of priority inversion. When a low-priority real-time task occupies resources needed by a high-priority real-time task, thus blocking the high-priority task, the low-priority real-time task inherits the priority of the high-priority task, thereby releasing the resources as quickly as possible. After the resources are released, the inheritance becomes invalid. The purpose of this application is to optimize real-time task processing; therefore, when describing priority inversion and priority inheritance, the object is a real-time task. Priority inversion and inheritance are also effective for non-real-time tasks.

[0053] The resource allocation and isolation strategies include:

[0054] The CPU resources allocated to real-time tasks are adaptively planned based on their workload, and the hardware resources occupied by real-time tasks are isolated from other tasks. For non-real-time tasks, resource reuse is maximized through time-sharing scheduling. Specifically, the more real-time tasks run, the more CPU and related hardware resources are allocated to them, and the remaining hardware resources are used for non-real-time tasks. This ensures both efficient processing of real-time tasks and the manageability of non-real-time tasks.

[0055] In one preferred implementation, the CPU resource configuration calls the instructions sysctl -w kernel.sched_rt_period_us=950000 and sysctl -w kernel.sched_rt_runtime_us=1000000 to configure the CPU resources allocated to real-time tasks. In the above instructions, the proportion of CPU resources allocated to real-time tasks is 95%, and the proportion of CPU resources reserved for non-real-time tasks is 5%.

[0056] The resource allocation and isolation strategy combines resource allocation with task and interrupt binding during the resource allocation process. For example, binding a task to a CPU, instead of scheduling it through the system scheduler, can reduce cache invalidation and scheduling overhead caused by task switching; binding an interrupt to a specific CPU can prevent cache invalidation problems caused by interrupts being processed across multiple CPUs.

[0057] In a preferred embodiment, in a device with multiple CPUs and / or multiple CPU cores, non-real-time system tasks, real-time system tasks, virtual machine monitors and non-real-time virtual machine tasks, and virtual machine monitors and real-time virtual machine tasks are assigned to different CPUs or CPU cores for processing and resource isolation is performed; based on resource isolation, tasks are bound to the resources they belong to, wherein system tasks are fuzzily bound according to a range, and virtual machine monitors and virtual machine tasks are precisely bound.

[0058] S300, based on the strategy in step S200, the real-time Linux kernel is responsible for system service process scheduling and resource allocation at the operating system level, while the real-time virtual machine monitor kernel is responsible for virtual machine service scheduling, device simulation, and resource allocation. This aims to improve the processing speed of real-time tasks in system services and tasks implemented in virtual machine services in terms of task scheduling and processing efficiency. Specifically, in response to a request from the virtual machine monitor real-time kernel, the real-time Linux kernel provides memory management and event notifications dependent on the virtual machine monitor real-time kernel through the message sharing channel, and the real-time Linux kernel sends virtual machine operation management notifications to the virtual machine monitor real-time kernel through the message channel.

[0059] S400, through hardware optimization, improves the scheduling latency and jitter of real-time tasks in system services and / or virtual machine services. Specifically, the hardware optimization includes, but is not limited to, improving processing performance at the hardware level based on instruction encoding prediction, branch prediction, cache reservation, and memory channel and frequency optimization; and improving processing performance at the hardware level based on CPU power management optimization, frequency management optimization, and reducing inter-core interrupt wake-up latency. For example, enabling CPU branch prediction and instruction prefetching functions in the BIOS.

[0060] As an optimization applicable to the dual-real-time kernel-based business processing method described in this application, a dual-level big page configuration is provided for the Linux operating system memory. The Transport Huge Pages (THP) mechanism supports 2MB of big page memory allocation, compared to the conventional 4KB unit allocation. Using dual-level big pages reduces the number of memory allocations and effectively reduces memory reclamation, thus preventing cache invalidation.

[0061] As an optimization that can be applied to the dual-real-time kernel-based business processing method described in this application, based on compiler optimization and the principle of cache locality, regular program branch judgments or branchless code are designed to optimize the software performance of the virtualization system and improve the processing speed of real-time tasks. For example, based on the principle of program execution locality, the system program and virtual monitor are statically compiled, reducing branch judgments and using likely and unlikely prediction mechanisms.

[0062] Example 2

[0063] Based on the aforementioned service processing method based on dual real-time kernels, this invention provides a task processing system based on dual real-time kernels, see below. Figure 3 As shown, it includes: a dual real-time kernel module, a multi-dimensional task scheduling strategy module, a resource allocation and isolation strategy module, a hardware optimization module, and a software optimization module.

[0064] The dual real-time kernel module provides a real-time Linux kernel and a virtual machine monitor kernel, establishing a message sharing channel between them. Based on the multi-dimensional task scheduling strategy provided by the multi-dimensional task scheduling strategy module and the resource allocation and isolation strategy provided by the resource allocation and isolation strategy module, the real-time Linux kernel is responsible for system business process scheduling and resource allocation at the operating system level, while the real-time virtual machine monitor kernel is responsible for virtual machine business scheduling, device simulation, and resource allocation. Specifically, in response to a request from the virtual machine monitor real-time kernel, the real-time Linux kernel provides memory management and event notifications dependent on the virtual machine monitor real-time kernel through the message sharing channel, and the real-time Linux kernel sends virtual machine operation management notifications to the virtual machine monitor real-time kernel through the message channel.

[0065] The multi-dimensional task scheduling strategy module implements a kernel-wide preemptive task scheduling model through the combination of interrupt routine threading, synchronization mechanisms, and semaphore sleep functionality; and coordinates resource mutual exclusion and task blocking based on real-time system task priority inheritance and inversion resource coordination.

[0066] The resource allocation and isolation strategy module adaptively plans the CPU resources allocated to the real-time task based on the workload of the real-time task, and isolates the hardware resources occupied by the real-time task from being affected by other tasks; for non-real-time tasks, it maximizes resource reuse and performs time-sharing scheduling.

[0067] The hardware optimization module optimizes hardware parameters to improve processing performance at the hardware level based on instruction encoding prediction, branch prediction, cache reservation, memory channel and frequency optimization, and improves processing performance at the hardware level based on CPU power management optimization, frequency management optimization and reduction of inter-core interrupt wake-up latency.

[0068] The software optimization module, based on compiler optimization and the principle of cache locality, designs regular program branch judgments or branchless code to optimize the software performance of the virtualization system and improve the real-time task processing speed.

[0069] Example 3

[0070] This invention provides a task processing device based on dual real-time kernels, see below. Figure 4 As shown, it includes: at least one processing unit, a storage unit, and a bus unit. The bus unit connects the processing unit and the storage unit. The storage unit, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as the software program, computer-executable program, and modules corresponding to the dual-real-time kernel-based business processing method in this embodiment of the invention (e.g., a dual-real-time kernel module, a multi-dimensional task scheduling strategy module, a resource allocation and isolation strategy module, a hardware optimization module, and a software optimization module in a dual-real-time kernel-based task processing system). The processing unit implements the above-mentioned dual-real-time kernel-based business processing method by running the software program, computer-executable program, and modules stored in the storage unit.

[0071] Furthermore, the storage unit may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the storage unit may further include memory remotely located relative to the processing unit, and this remote memory may be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0072] Example 4

[0073] Embodiment 4 of the present invention also provides a computer-readable storage medium for implementing a service processing method based on dual real-time kernels. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the aforementioned service processing method based on dual real-time kernels. The method includes:

[0074] The Linux kernel and the virtual machine monitor kernel are modified to be real-time kernels, and a message sharing channel is established between the real-time Linux kernel and the real-time virtual machine monitor kernel. Based on a preset multi-dimensional task scheduling strategy and a preset resource allocation and isolation strategy, the real-time Linux kernel is responsible for system business process scheduling and resource allocation at the operating system level, while the real-time virtual machine monitor kernel is responsible for virtual machine business scheduling, device simulation, and resource allocation. Specifically, in response to a request from the virtual machine monitor real-time kernel, the real-time Linux kernel provides memory management and event notifications dependent on the virtual machine monitor real-time kernel through the message sharing channel, and the real-time Linux kernel sends virtual machine operation management notifications to the virtual machine monitor real-time kernel through the message channel. Hardware optimization is combined to improve the scheduling latency and jitter of real-time tasks in system business and / or virtual machine business.

[0075] Of course, the computer-readable storage medium that implements the dual real-time kernel-based business processing method provided in the embodiments of the present invention stores computer programs that are not limited to the method operations described above, and can also execute related operations in the dual real-time kernel-based business processing method provided in any embodiment of the present invention.

[0076] Based on the above description of the implementation methods, those skilled in the art can clearly understand that the present invention can be implemented using software and necessary general-purpose hardware, and of course, it can also be implemented using hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk, or optical disk, etc., including several instructions to cause an electronic device (which may be a mobile phone, personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0077] In the embodiments provided by this invention, it should be understood that the disclosed structures and methods can be implemented in other ways. For example, the structural embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interfaces, structures, or units, and may be electrical, mechanical, or other forms.

[0078] The units described as separate components may or may not be physically separate. 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0079] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0080] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A service processing method based on dual real-time kernels, characterized in that, include: Modify the Linux kernel and the virtual machine monitor kernel to be real-time kernels, and establish a message sharing channel between the real-time Linux kernel and the real-time virtual machine monitor kernel; Based on the preset multi-dimensional task scheduling strategy and the preset resource allocation and isolation strategy, the real-time Linux kernel is responsible for the scheduling of system business processes and resource allocation at the operating system level, and the real-time virtual machine monitor kernel is responsible for the scheduling of virtual machine services, device simulation and resource allocation. Combined with hardware optimization, the scheduling latency and jitter of real-time tasks in system services and / or virtual machine services are improved. The multi-dimensional task scheduling strategy includes: implementing a kernel-wide preemptive task scheduling model through the threading of interrupt routines, synchronization mechanisms, and sleepable semaphores; coordinating resource mutual exclusion and task blocking based on real-time system task priority inheritance and inversion resource coordination; the kernel-wide preemptive task scheduling model modifies existing interrupt handling functions to wake up interrupt threads through interrupt routine threading, assigns interrupt threads the same priority as other threads, and schedules tasks based on the priority of any thread; for threads corresponding to real-time tasks in system services and / or virtual machine services, a higher priority is configured than that of interrupt threads, allowing real-time tasks to preempt interrupt threads to improve real-time performance; the kernel-wide preemptive task scheduling model, through synchronization mechanisms and sleepable semaphores, allows critical resource regions protected by critical resource locks to be preempted and actively put to sleep; when a process uses a real-time mutual exclusion mechanism to acquire a lock, if the lock is already occupied, the process is added to a waiting queue, and then scheduled by calling schedule; when the critical resource is released, the processes in the waiting queue are woken up. The resource allocation and isolation strategy includes: adaptively planning CPU resources allocated to real-time tasks based on their workload, and isolating the hardware resources occupied by real-time tasks from other tasks; for non-real-time tasks, maximizing resource reuse and performing time-sharing scheduling; allocating system non-real-time tasks, system real-time tasks, virtual machine monitors and virtual machine non-real-time tasks, and virtual machine monitors and virtual machine real-time tasks to different CPUs for processing and isolating them with resources; based on resource isolation, binding tasks to the resources, wherein system tasks are fuzzily bound according to a range, and virtual machine monitors and virtual machine tasks are precisely bound. In this process, the real-time Linux kernel responds to the virtual machine monitor's real-time kernel request by providing memory management and event notifications that the virtual machine monitor's real-time kernel depends on through the message sharing channel, and the real-time Linux kernel sends virtual machine operation management notifications to the virtual machine monitor's real-time kernel through the message sharing channel.

2. The service processing method based on dual real-time kernels according to claim 1, characterized in that, The hardware optimizations include, but are not limited to, improving processing performance at the hardware level based on instruction encoding prediction, branch prediction, cache reservation, and memory channel and frequency optimization, and improving processing performance at the hardware level based on CPU power management optimization, frequency management optimization, and reducing inter-core interrupt wake-up latency.

3. A task processing system based on dual real-time kernels, characterized in that, include: Dual real-time kernel module, multi-dimensional task scheduling strategy module, resource allocation and isolation strategy module, and hardware optimization module; The dual real-time kernel module provides a real-time Linux kernel and an implementation virtual machine monitor kernel, and establishes a message sharing channel between the real-time Linux kernel and the real-time virtual machine monitor kernel; Based on the multi-dimensional task scheduling strategy provided by the multi-dimensional task scheduling strategy module and the resource allocation and isolation strategy provided by the resource allocation and isolation strategy module, the real-time Linux kernel is responsible for the scheduling of system business processes and resource allocation at the operating system level, and the real-time virtual machine monitor kernel is responsible for the scheduling of virtual machine services, device simulation and resource allocation. The multi-dimensional task scheduling strategy includes: implementing a kernel-wide preemptive task scheduling model through the threading of interrupt routines, synchronization mechanisms, and sleepable semaphores; coordinating resource mutual exclusion and task blocking based on real-time system task priority inheritance and inversion resource coordination; the kernel-wide preemptive task scheduling model modifies existing interrupt handling functions to wake up interrupt threads through interrupt routine threading, assigns interrupt threads the same priority as other threads, and schedules tasks based on the priority of any thread; for threads corresponding to real-time tasks in system services and / or virtual machine services, a higher priority is configured than that of interrupt threads, allowing real-time tasks to preempt interrupt threads to improve real-time performance; the kernel-wide preemptive task scheduling model, through synchronization mechanisms and sleepable semaphores, allows critical resource regions protected by critical resource locks to be preempted and actively put to sleep; when a process uses a real-time mutual exclusion mechanism to acquire a lock, if the lock is already occupied, the process is added to a waiting queue, and then scheduled by calling schedule; when the critical resource is released, the processes in the waiting queue are woken up. The resource allocation and isolation strategy includes: adaptively planning CPU resources allocated to real-time tasks based on their workload, and isolating the hardware resources occupied by real-time tasks from other tasks; for non-real-time tasks, maximizing resource reuse and performing time-sharing scheduling; allocating system non-real-time tasks, system real-time tasks, virtual machine monitors and virtual machine non-real-time tasks, and virtual machine monitors and virtual machine real-time tasks to different CPUs for processing and isolating them with resources; based on resource isolation, binding tasks to the resources, wherein system tasks are fuzzily bound according to a range, and virtual machine monitors and virtual machine tasks are precisely bound. In this context, the real-time Linux kernel responds to the virtual machine monitor real-time kernel's request by providing memory management and event notifications that the virtual machine monitor real-time kernel depends on through the message sharing channel, and the real-time Linux kernel sends virtual machine operation management notifications to the virtual machine monitor real-time kernel through the message sharing channel; The hardware optimization module is used to improve the scheduling latency and jitter of real-time tasks in system services and / or virtual machine services through hardware optimization.

4. A task processing device based on dual real-time kernels, characterized in that, include: The system includes at least one processing unit, a storage unit, and a bus unit. The bus unit connects the processing unit and the storage unit. The storage unit stores a computer program. The processing unit executes the computer program to implement the business processing method based on a dual real-time kernel as described in claim 1 or 2.

5. A computer-readable storage medium for implementing a business processing method based on dual real-time kernels, wherein the computer-readable storage medium stores a computer program, characterized in that, When the computer program is executed by the processor, it implements the business processing method based on dual real-time kernels as described in claim 1 or 2.