A virtualization method and device suitable for automotive embedded systems

By utilizing virtualization methods supported by ARMv8 and GICv3 hardware, combined with the RT-Thread system, the real-time performance and reliability issues of virtualization technology in automotive embedded systems are resolved, achieving efficient virtual machine scheduling and resource management, making it suitable for intelligent connected vehicles.

CN115934259BActive Publication Date: 2026-03-24HUNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-16
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing virtualization technologies are insufficient to meet the real-time and reliability requirements of automotive embedded systems, especially the management and security needs of the abundant computing resources in intelligent connected vehicles.

Method used

Employing the ARMv8 architecture and GICv3 hardware support, combined with the RT-Thread system, a lightweight virtualization method is implemented by creating virtual machines and using a logger device to record priorities, thereby optimizing virtual machine scheduling and meeting real-time and security requirements.

Benefits of technology

It achieves efficient and fast virtual machine scheduling in automotive embedded systems, reduces virtualization overhead, meets real-time and reliability requirements, and is suitable for computing resource management in intelligent connected vehicles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115934259B_ABST
    Figure CN115934259B_ABST
Patent Text Reader

Abstract

The application discloses a lightweight virtualization technology suitable for an automobile embedded system. A Type-2 virtual machine management software is adopted, and multiple virtual machines are allowed to run simultaneously on an ARMv8 embedded development board; the virtual machine system supports common RT-Thread and Linux systems. According to the characteristics of the embedded system, a device named recorder is mounted to each virtual machine, the priority of a process (or thread) in the virtual machine is mapped to a host computer, the host computer participates in scheduling decision-making, and the scheduling of the virtual machine is optimized in a targeted manner. Relying on the excellent real-time performance of the real-time operating system RT-Thread and the hardware support of the ARM architecture in the virtualization aspect, the virtualization extension of the RT-Thread system is realized. In addition, according to the characteristics of specific applications, a fine-grained virtual machine scheduling mode is proposed, so that the virtual machine scheduling mode is more suitable for the automobile embedded system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to computer virtualization technology, and more particularly to a virtualization method and apparatus suitable for automotive embedded systems. Background Technology

[0002] With the rise of intelligent connected vehicles, the configuration of in-vehicle electronic devices is becoming increasingly sophisticated, making the management of abundant computing resources a major challenge. To address this issue, the industry typically employs virtualization technology to abstract and pool system resources for flexible allocation.

[0003] Virtualization is a resource management technology whose main function is to abstract and transform individual computer hardware resources (CPU, network, memory, etc.) and provide partitioning and recombination to maximize the utilization of physical resources. A key challenge in cloud computing is how to provide services to more users through reasonable resource scheduling without impacting client performance.

[0004] Virtualization technology demonstrates significant flexibility in resource management, making it well-suited for the abundant computing resources of intelligent connected vehicles. It allows for flexible resource allocation and provides strong security isolation for application deployments within the system. However, existing virtualization technologies, such as KVM and Xen, are typically designed for cloud computing systems and do not meet the real-time and reliability requirements of automotive embedded systems. Summary of the Invention

[0005] The main objective of this invention is to provide a virtualization method and apparatus suitable for automotive embedded systems to solve the aforementioned technical problems.

[0006] To achieve the above objectives, the present invention provides a virtualization method suitable for automotive embedded systems, comprising the following steps:

[0007] Step S1: Start the host RT-Thread system on EL2;

[0008] Step S2: Create and run multiple virtual machines with the help of ARMv8 and GICv3 virtualization hardware support;

[0009] Step S3: Attach a device called a logger to each virtual machine and make the virtual machine report the priority of the process to be scheduled through the logger every time it is scheduled.

[0010] Step S4: When scheduling threads on the host machine, obtain all the data reported by the loggers;

[0011] Step S5: Based on the data reported by all the recorders, determine whether there is a situation where the general system is running a real-time process while the real-time system is running an idle thread. If yes, proceed to step S6; otherwise, proceed to step S7.

[0012] Step S6: Schedule the vCPU thread of the general system, and then proceed to step S8;

[0013] Step S7: Schedule the vCPU thread of the real-time system, and then proceed to step S8;

[0014] Step S8, End.

[0015] Furthermore, step S3 also includes writing the priority of the process to be run into the recorder device in the form of a hook function in the virtual machine's scheduling algorithm.

[0016] Furthermore, the general-purpose system includes the Linux system.

[0017] Furthermore, the hardware virtualization extension implemented in step S1 using the ARMv8 architecture enables the host RT-Thread system to run at the EL2 level, while the virtual machine runs as threads at the EL1 and EL0 levels, thus achieving CPU virtualization and memory virtualization.

[0018] Furthermore, in step S1, the hardware support for interrupt virtualization provided by the general interrupt controller GICv3 is relied upon to complete the virtual interrupt setting, redirection, and injection operations.

[0019] The present invention also provides a virtualization device suitable for automotive embedded systems, comprising a memory, a processor, a computer program stored in the memory and executable on the processor, and a controller receiving instructions from the processor, characterized in that the processor, when executing the computer program, implements the steps of the virtualization method suitable for automotive embedded systems as described in any of the preceding claims.

[0020] The virtualization part of the above technical solution relies on the hardware support of ARMv8 architecture and GICv3, with low virtualization overhead. At the same time, it uses the O(1) time efficiency scheduling algorithm of the host RT-Thread system to ensure the fast scheduling of virtual machines and meet the requirements of practical applications. Attached Figure Description

[0021] Figure 1 This is a module structure diagram of the virtualization system of an automotive embedded system according to an embodiment of the present invention;

[0022] Figure 2 This is a flowchart illustrating a virtualization method for an automotive embedded system according to an embodiment of the present invention.

[0023] Figure 3 This is a structural diagram of the recorder module of the virtualization method for an automotive embedded system according to an embodiment of the present invention;

[0024] Figure 4 This is a schematic diagram of the module structure of a virtualization device for an automotive embedded system according to an embodiment of the present invention.

[0025] The objectives, features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Implementation

[0026] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0027] In the following description, the use of suffixes such as "module," "part," or "unit" to denote elements is solely for the purpose of illustrative purposes and has no specific meaning in itself. Therefore, "module," "part," or "unit" may be used interchangeably.

[0028] Please see Figure 1-3 To achieve the above objectives, the first embodiment of the present invention provides a virtualization method and apparatus suitable for automotive embedded systems.

[0029] In terms of specific implementation, the approach adopted is based on Type-2 virtual machine management software. Leveraging the excellent real-time performance of the RT-Thread real-time operating system and the hardware support for virtualization in the ARM architecture, virtualization extensions of the RT-Thread system are achieved. Furthermore, a fine-grained virtual machine scheduling method is proposed to better suit the characteristics of specific applications, making it more suitable for automotive embedded systems.

[0030] Implementation idea:

[0031] (1) With the help of the hardware virtualization extension implemented by the ARMv8 architecture, the host RT-Thread system runs at the EL2 level, while the virtual machine runs at the EL1 and EL0 levels in the form of threads, realizing CPU virtualization and memory virtualization;

[0032] (2) Relying on the hardware support of the general interrupt controller GICv3 for interrupt virtualization, complex operations such as virtual interrupt setting, redirection and injection are completed, reducing interrupt virtualization overhead;

[0033] (3) In terms of device management, it supports direct device pass-through and mainstream VirtIO technology to meet the access and management needs of various devices;

[0034] (4) Considering the characteristics of specific applications, the real-time level of the threads (or processes) running in the virtual machine is mapped to the host machine in a semi-virtualized manner. This information will be referenced when the RT-Thread system on the host machine performs scheduling, and a more reasonable scheduling will be made.

[0035] The virtualization part relies on the ARMv8 architecture and GICv3 hardware support, with low virtualization overhead. At the same time, it uses the O(1) time-efficient scheduling algorithm of the host RT-Thread system to ensure the fast scheduling of virtual machines and meet the requirements of practical applications.

[0036] The virtualization method 100 for automotive embedded systems includes the following steps:

[0037] Step S1: Start the host RT-Thread system on EL2;

[0038] Step S2: Create and run multiple virtual machines with the help of ARMv8 and GICv3 virtualization hardware support;

[0039] Step S3: Attach a device called a logger to each virtual machine and make the virtual machine report the priority of the process to be scheduled through the logger every time it is scheduled.

[0040] Step S4: When scheduling threads on the host machine, obtain all the data reported by the loggers;

[0041] Step S5: Based on the data reported by all the recorders, determine whether there is a situation where the general system is running a real-time process while the real-time system is running an idle thread. If yes, proceed to step S6; otherwise, proceed to step S7.

[0042] Step S6: Schedule the vCPU thread of the general system, and then proceed to step S8;

[0043] Step S7: Schedule the vCPU thread of the real-time system, and then proceed to step S8;

[0044] Step S8, End.

[0045] This method allows multiple virtual machines to run simultaneously on an ARMv8 embedded development board. The virtual machine systems support commonly used RT-Thread and Linux systems.

[0046] This method also optimizes virtual machine scheduling by attaching a recorder device to each virtual machine, taking into account the characteristics of embedded systems. This allows the priorities of processes (or threads) within the virtual machine to be mapped to the host machine, participating in the host machine's scheduling decisions. Detailed process... Figure 2 .

[0047] Regarding the lightweighting of virtualization technology, since a Type-2 implementation approach is adopted, which extends virtualization functionality on existing mature real-time operating systems and supports hardware-assisted virtualization, this method implements concise virtual machine management software. The final effective code count is only 7.8k (excluding the real-time operating system part), which also indirectly confirms the reliability of the software.

[0048] Furthermore, step S3 also includes writing the priority of the process to be run into the recorder device in the form of a hook function in the virtual machine's scheduling algorithm.

[0049] Information about the logger synchronization scheduling process, such as Figure 3 As shown, this method attaches a device called a logger to the virtual machine and allows the virtual machine to actively synchronize information about the processes it is about to schedule. This enables the host machine to gain a deep understanding of the virtual machine's current running state and make more appropriate scheduling decisions. The logger is a virtual device, essentially composed of a portion of host-visible memory, and can only record the process priorities within the virtual machine. Besides creating the virtual device, a corresponding device driver needs to be implemented within the virtual machine. In the virtual machine's scheduling algorithm, the priority of the process about to run is written to this device through hook functions. The data recorded by each virtual machine is invisible to each other and is only used as a reference by the host machine during scheduling. This ensures that the virtual machine's running status is not leaked, guaranteeing maximum safety in thread scheduling.

[0050] Furthermore, the general-purpose system includes the Linux system.

[0051] Furthermore, the hardware virtualization extension implemented in step S1 using the ARMv8 architecture enables the host RT-Thread system to run at the EL2 level, while the virtual machine runs as threads at the EL1 and EL0 levels, thus achieving CPU virtualization and memory virtualization.

[0052] Furthermore, in step S1, the hardware support for interrupt virtualization provided by the general interrupt controller GICv3 is relied upon to complete the virtual interrupt setting, redirection, and injection operations.

[0053] The present invention also provides a virtualization device suitable for automotive embedded systems, comprising a memory, a processor, a computer program stored in the memory and executable on the processor, and a controller receiving instructions from the processor, characterized in that the processor, when executing the computer program, implements the steps of the virtualization method suitable for automotive embedded systems as described in any of the preceding claims.

[0054] Please refer to Figure 4In one embodiment of the present invention, the present invention also provides a virtualization device 10 for an automotive embedded system, or a computer system, including a memory 51, a processor 52, and a computer program 53 stored in the memory 51 and executable on the processor 52. When the processor 52 executes the computer program 53, it implements the steps of the virtualization method 100 for the automotive embedded system described above.

[0055] For example, a computer program on a computer-readable storage medium includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc.

[0056] In the description of this specification, references to terms such as "one embodiment," "another embodiment," "other embodiments," or "first embodiment to Xth embodiment," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, method steps, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0057] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0058] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.

Claims

1. A virtualization method suitable for automotive embedded systems, characterized in that, Including the following steps: Step S1: Start the host RT-Thread system on EL2; In step S1, the hardware virtualization extension implemented by the ARMv8 architecture enables the host RT-Thread system to run at the EL2 level as a whole, while the virtual machine runs as threads at the EL1 and EL0 levels, realizing CPU virtualization and memory virtualization; In step S1, the hardware support for interrupt virtualization provided by the general interrupt controller GICv3 is relied upon to complete the virtual interrupt setting, redirection and injection operations; Step S2: Create and run multiple virtual machines with the help of ARMv8 and GICv3 virtualization hardware support; Step S3 involves attaching a device called a logger to each virtual machine and having the virtual machine report the priority of the process to be scheduled through the logger during each scheduling process. Step S3 also includes writing the priority of the process to be run into the logger device in the form of a hook function in the virtual machine's scheduling algorithm. Step S4: When scheduling threads on the host machine, obtain all the data reported by the loggers; Step S5: Based on the data reported by all the recorders, determine whether there is a situation where the general system is running a real-time process while the real-time system is running an idle thread. If yes, proceed to step S6; otherwise, proceed to step S7. Step S6: Schedule the vCPU thread of the general system, and then proceed to step S8; Step S7: Schedule the vCPU thread of the real-time system, and then proceed to step S8; Step S8, End.

2. The method according to claim 1, characterized in that, The general-purpose system includes the Linux system.

3. A virtualization device suitable for automotive embedded systems, characterized in that, The system includes a memory, a processor, a computer program stored in the memory and executable on the processor, and a controller that receives instructions from the processor. The processor, when executing the computer program, implements the steps of the virtualization method for automotive embedded systems as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Kernel virtual machine scheduling policy-based implementation method

    CN101894047A

  • Running method for embedded type virtual device and system

    US20190317791A1