Container resource quota regulation and control method and system of vehicle-mounted system
By creating container subgroups and dynamically adjusting resource quotas during the startup phase of the in-vehicle Android system, the problems of resource escape and static allocation are solved, achieving a balance between safety and user experience and adapting to the resource needs of different driving scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN XIAOSUAN TECH INFORMATION CO LTD
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-05
AI Technical Summary
In automotive Android systems, existing container technologies suffer from risks of resource escape, static resource allocation that cannot be dynamically adjusted, and compatibility issues, all of which affect system stability.
During the startup phase of the in-vehicle Android system, container subgroups are created for the resource controller, and initial resource quotas are set. The resource management daemon monitors the gear status and dynamically adjusts the resource quotas and contention weight parameters to achieve resource isolation and intelligent control.
It achieves secure isolation of container resources, prevents resource escape, provides an optimal balance between security and user experience, and adapts to the dynamic resource requirements of different driving scenarios.
Smart Images

Figure CN121979616A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle operating system technology, and in particular to a method and system for regulating container resource quotas in a vehicle system. Background Technology
[0002] Containers are a lightweight, portable, and self-contained software packaging technology that allows applications to run in the same way almost anywhere. Unlike traditional virtualization technologies, containers run in a user space of the operating system, isolated from other processes, and are much smaller in size than virtual machines. Starting a container does not require booting the entire operating system, making container deployment and startup faster, less expensive, and easier to migrate.
[0003] Current mainstream container technologies, such as Docker, are typically based on features of the Linux operating system kernel (such as namespaces and cgroups), and cannot be directly ported to other operating systems that lack these features. However, the Linux operating system also has its limitations and is not universally applicable. For example, in fields such as industrial robots and autonomous driving, certain operating systems with strong real-time requirements are more suitable. To combine the advantages of both, the operating system kernel needs to be modified to possess features similar to namespaces and cgroups to enable container functionality.
[0004] A key feature of Linux container technology is resource isolation and resource limiting. Resource limiting is achieved through control groups in the Linux kernel, while resource isolation is achieved through namespaces. Porting resource isolation functionality from container technology requires implementing a technique similar to namespaces to isolate system calls.
[0005] Existing Linux container technologies typically employ the following methods for resource isolation of control groups: The controller mount point of the host machine's control group is directly mapped to the container. The controller can be a processor time slice controller, a processor core binding controller, a memory controller, or a disk read / write bandwidth controller. Processes within a container can directly access and manipulate the host machine's control group hierarchy; Basic isolation is achieved by relying on the namespace of the control group, but the isolation effect is limited in the control group environment.
[0006] However, in the context of automotive Android containers, existing technologies have the following problems: Resource escape risk: Processes in the Android system within the container may escape outside the host's resource control scope by writing to the host's control group, causing resource limits to fail. Static resource allocation: Traditional solutions use fixed resource quotas, which cannot be dynamically adjusted according to driving scenarios; Compatibility issues: Modifying the control group path of Android within the container requires extensive adaptation work, which can affect system stability. Summary of the Invention
[0007] This invention provides a method and system for regulating container resource quotas in a vehicle system, aiming to achieve an optimal balance between safety and user experience while eliminating the risk of resource escape.
[0008] To achieve the above objectives, the present invention provides a method for regulating container resource quotas in an in-vehicle system, applied to an in-vehicle Android system, comprising: Step 1: During the startup phase of the vehicle Android system, create container subgroups for the resource controller of the vehicle Android system and set initial resource quotas for each container subgroup as the resource isolation boundary of the container. Step 2: Map all container subgroups to the root directory of the corresponding resource controller inside the container based on the resource isolation boundary; Step 3: Monitor the gear position of the target vehicle through the resource management daemon of the vehicle's Android system to obtain the gear position status; Step 4: Adjust the quota parameters and competition weight parameters of each resource controller according to the gear status and the status of the container to obtain the container resource quota control result.
[0009] Furthermore, the resource controller of the in-vehicle Android system includes: Processor time slice controller, processor core binding controller, memory controller, disk read / write bandwidth controller.
[0010] Furthermore, create container subgroups for the resource controller of the in-vehicle Android system, including: Create a container root group in the root directory of each resource controller in the in-vehicle Android system; Under each root group, create a foreground application group, a background application group, and a high-priority application group to form a hierarchical group structure as container subgroups.
[0011] Furthermore, the initial resource quotas for each container subgroup are set as follows: For each container subgroup, write the quota value into the container subgroup's quota parameter file as the initial resource quota.
[0012] Furthermore, map all container subgroups to the root directory of the corresponding resource controller inside the container, including: Map the container subgroups of the processor time slice controller to the root directory of the processor time slice controller; Map the container subgroups of the processor core-bound controller to the root directory of the processor core-bound controller; Map the container subgroups of the memory controller to the root directory of the memory controller; Map the container subgroup of the disk read / write bandwidth controller to the root directory of the disk read / write bandwidth controller.
[0013] Furthermore, step 4 includes: The quota parameters of each resource controller are adjusted according to the gear status to obtain the first adjustment result; The competition weight parameters of each resource controller are adjusted according to the gear status and the state of the container to obtain the second adjustment result; Both the first and second adjustment results will be used as the container resource quota control results.
[0014] Furthermore, the quota parameters of each resource controller are adjusted according to the gear status, including: When the gear position is in the parking state, the configuration parameters of each resource controller are adjusted to the first quota value, and the resource quota of each resource controller is regulated based on the first configuration value. When the gear position is in the non-parking state, the configuration parameters of each resource controller are adjusted to the second configuration value, and the resource quota of each resource controller is controlled based on the second configuration value.
[0015] Furthermore, the contention weight parameters of each resource controller are adjusted based on the gear status and the container's current state, including: When the container is in the foreground and the gear position is in the park state, the competition weight parameters of each resource controller are adjusted to high priority weight values, and the resource quota of each resource controller is regulated based on the high priority weight values. When the container is in the foreground and the gear status is non-parked, the resource quota of each resource controller is adjusted using a medium priority weight value. When the container is in the background, the resource quotas of each resource controller are adjusted using low priority weight values.
[0016] This invention also provides a container resource quota control system for an in-vehicle system, applied to an in-vehicle Android system, comprising: A module is created to create container subgroups for the resource controller of the in-vehicle Android system during the startup phase of the in-vehicle Android system, and to set initial resource quotas for each container subgroup as the resource isolation boundary of the container; The mapping module is used to map all container subgroups to the root directory of the corresponding resource controller inside the container based on resource isolation boundaries; The monitoring module is used to monitor the gear position of the target vehicle through the resource management daemon process of the vehicle's Android system and obtain the gear position status. The adjustment module is used to adjust the quota parameters and competition weight parameters of each resource controller according to the gear status and the status of the container, so as to obtain the container resource quota control result.
[0017] The above-described solution of the present invention has the following beneficial effects: This invention is applied to an in-vehicle Android system. During the system's startup phase, it creates container subgroups for the resource controller and sets initial resource quotas for each subgroup as resource isolation boundaries. Based on these boundaries, all subgroups are mapped to the root directory of the corresponding resource controller within each container. The system's resource management daemon monitors the vehicle's gear position to obtain its status. Based on the gear position and container status, the quota parameters and contention weight parameters of each resource controller are adjusted to achieve container resource quota control. Compared to existing technologies, this invention achieves secure isolation and intelligent control of container resources by pre-creating resource control subgroups during the system's startup phase, mapping these subgroups to containers, and dynamically adjusting quotas according to driving scenarios. This prevents resources within containers from escaping to the in-vehicle Android system's control group while achieving an optimal balance between safety and user experience.
[0018] Other beneficial effects of the present invention will be described in detail in the following detailed description section. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating an embodiment of the present invention. Detailed Implementation
[0020] To make the technical problems, solutions, and advantages of this invention clearer, a detailed description will be provided below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0021] In the description of this invention, it should be noted that the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0022] Furthermore, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0023] This invention addresses existing problems by providing a method and system for regulating container resource quotas in vehicle systems.
[0024] like Figure 1 As shown, an embodiment of the present invention provides a container resource quota control method for an in-vehicle system, applied to an in-vehicle Android system, including: Step 1: During the startup phase of the vehicle Android system, create container subgroups for the resource controller of the vehicle Android system and set initial resource quotas for each container subgroup as the resource isolation boundary of the container. Step 2: Map all container subgroups to the root directory of the corresponding resource controller inside the container based on the resource isolation boundary; Step 3: Monitor the gear position of the target vehicle through the resource management daemon of the vehicle's Android system to obtain the gear position status; Step 4: Adjust the quota parameters and competition weight parameters of each resource controller according to the gear status and the status of the container to obtain the container resource quota control result.
[0025] Specifically, the resource controller of the in-vehicle Android system includes: Processor time slice controller, processor core binding controller, memory controller, disk read / write bandwidth controller.
[0026] Specifically, create container subgroups for the resource controller of the in-vehicle Android system, including: Create a container root group in the root directory of each resource controller in the in-vehicle Android system; Under each root group, create a foreground application group, a background application group, and a high-priority application group to form a hierarchical group structure as container subgroups.
[0027] In this embodiment of the invention, taking the processor time slice controller as an example, a container root group is created in the root directory of the processor time slice controller, and a foreground application group, a background application group, a high-priority application group, a medium-priority application group, and a low-priority application group are further created under the root group to form a complete group hierarchy structure as container subgroups.
[0028] Specifically, the initial resource quotas for each container subgroup are set as follows: For each container subgroup, a quota value is written to the quota parameter file of the container subgroup as the initial resource quota. The initial resource quota is used to limit the total amount of resources that all processes in the subgroup can use.
[0029] In this embodiment of the invention, during the container startup phase, all container subgroups are mapped to the root directory of the corresponding resource controller inside the container by binding and mounting.
[0030] Specifically, all container subgroups are mapped to the root directory of the corresponding resource controller inside the container, including: Map the container subgroups of the processor time slice controller to the root directory of the processor time slice controller; Map the container subgroups of the processor core-bound controller to the root directory of the processor core-bound controller; Map the container subgroups of the memory controller to the root directory of the memory controller; Map the container subgroup of the disk read / write bandwidth controller to the root directory of the disk read / write bandwidth controller.
[0031] After the above mapping, when the operating system inside the container accesses the resource controller directory, it actually operates on the pre-built subgroups in the vehicle Android system, rather than the root group of the vehicle Android system. The system inside the container cannot perceive the upper-level resource control group of the vehicle Android system, thereby achieving resource isolation. At the same time, the operating system inside the container does not need to modify any code. Its original process scheduling service writes the processes into the corresponding groups according to the original logic. These write operations actually act on the subgroups of the vehicle Android system and are naturally subject to the root group quota.
[0032] In this embodiment of the invention, during the operation of the in-vehicle Android system, the resource management daemon of the in-vehicle Android system monitors the vehicle's gear changes in real time through a callback interface provided by the vehicle manufacturer. The specific process is as follows: By registering a vehicle gear change listener callback using a resource management daemon, resource adjustment logic is immediately triggered when the gear changes, achieving millisecond-level real-time response.
[0033] Specifically, resource quotas are dynamically adjusted based on tier status and container foreground / background status, including: The quota parameters of each resource controller are adjusted according to the gear status to obtain the first adjustment result; The competition weight parameters of each resource controller are adjusted according to the gear status and the state of the container to obtain the second adjustment result; Both the first and second adjustment results will be used as the container resource quota control results.
[0034] Specifically, the quota parameters of each resource controller are adjusted according to the gear status, including: When the gear position is in the park state, the configuration parameters of each resource controller are adjusted to the first quota value. Based on the first configuration value, the resource quota of each resource controller is regulated to ensure the smooth operation of the application within the container. When the gear position is in non-parking mode, the configuration parameters of each resource controller are adjusted to the second configuration value. Based on the second configuration value, the resource quota of each resource controller is regulated to prioritize the resource supply for the core functions of the vehicle system.
[0035] In this embodiment of the invention, the first quota value is greater than the second quota value, and the quotas of each subgroup within the container all follow the same control principle.
[0036] Specifically, the contention weight parameters of each resource controller are adjusted based on the gear status and the state of the container, including: When the container is in the foreground and the gear position is in the park state, the contention weight parameters of each resource controller are adjusted to high priority weight values, and the resource quotas of each resource controller are adjusted based on the high priority weight values to maximize container performance. When the container is in the foreground and the gear position is non-parking, the resource quota of each resource controller is adjusted using a medium priority weight value to balance performance and driving safety. When the container is in the background, regardless of whether the gear is parked or not, the resource quota of each resource controller is adjusted using a low priority weight value to reduce background resource consumption.
[0037] This invention is applied to an in-vehicle Android system. During the startup phase of the in-vehicle Android system, container subgroups are created for the system's resource controllers, and initial resource quotas are set for each subgroup as resource isolation boundaries. Based on these resource isolation boundaries, all container subgroups are mapped to the root directory of the corresponding resource controller within the container. The resource management daemon of the in-vehicle Android system monitors the gear position of the target vehicle to obtain the gear position status. Based on the gear position status and the container's status, the quota parameters and contention weight parameters of each resource controller are adjusted to obtain the container resource quota control result. Compared with existing technologies, this invention achieves secure isolation and intelligent control of container resources by pre-creating resource control subgroups during the startup phase of the in-vehicle Android system, mapping these subgroups to the container, and dynamically adjusting quotas according to the driving scenario. This prevents resources within the container from escaping to the control group of the in-vehicle Android system while achieving an optimal balance between safety and user experience.
[0038] Corresponding to the container resource quota control method for in-vehicle systems described in the above embodiments, this invention also provides a container resource quota control system for in-vehicle systems, applied to an in-vehicle Android system, including: A module is created to create container subgroups for the resource controller of the in-vehicle Android system during the startup phase of the in-vehicle Android system, and to set initial resource quotas for each container subgroup as the resource isolation boundary of the container; The mapping module is used to map all container subgroups to the root directory of the corresponding resource controller inside the container based on resource isolation boundaries; The monitoring module is used to monitor the gear position of the target vehicle through the resource management daemon process of the vehicle's Android system and obtain the gear position status. The adjustment module is used to adjust the quota parameters and competition weight parameters of each resource controller according to the gear status and the status of the container, so as to obtain the container resource quota control result.
[0039] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for regulating container resource quotas in a vehicle-mounted system, characterized in that, Applications to in-vehicle Android systems include: Step 1: During the startup phase of the vehicle Android system, create container subgroups for the resource controller of the vehicle Android system, and set initial resource quotas for each container subgroup as the resource isolation boundary of the container. Step 2: Map all container subgroups to the root directory of the corresponding resource controller inside the container according to the resource isolation boundary; Step 3: Monitor the gear position of the target vehicle through the resource management daemon process of the in-vehicle Android system to obtain the gear position status; Step 4: Adjust the quota parameters and competition weight parameters of each resource controller according to the gear status and the container status to obtain the container resource quota control result.
2. The container resource quota control method for an on-board system according to claim 1, characterized in that, The resource controller of the in-vehicle Android system includes: Processor time slice controller, processor core binding controller, memory controller, disk read / write bandwidth controller.
3. The container resource quota control method for an on-board system according to claim 1, characterized in that, Create container subgroups for the resource controller of the in-vehicle Android system, including: Create a container root group in the root directory of each resource controller of the in-vehicle Android system; Under each root group, create a foreground application group, a background application group, and a high-priority application group to form a hierarchical group structure as container subgroups.
4. The container resource quota control method for an on-board system according to claim 1, characterized in that, Set the initial resource quota for each container subgroup as follows: For each container subgroup, a quota value is written into the quota parameter file of that container subgroup as an initial resource quota.
5. The container resource quota control method for an on-board system according to claim 2, characterized in that, Map all container subgroups to the root directory of the corresponding resource controller inside the container, including: Map the container subgroups of the processor time slice controller to the root directory of the processor time slice controller; Map the container subgroup of the processor core-bound controller to the root directory of the processor core-bound controller; Map the container subgroups of the memory controller to the root directory of the memory controller; Map the container subgroups of the disk read / write bandwidth controller to the root directory of the disk read / write bandwidth controller.
6. The container resource quota control method for an on-board system according to claim 1, characterized in that, Step 4 includes: The quota parameters of each resource controller are adjusted according to the gear status to obtain the first adjustment result; The competition weight parameters of each resource controller are adjusted according to the gear position and container status to obtain a second adjustment result; Both the first adjustment result and the second adjustment result are used as the container resource quota control results.
7. The container resource quota control method for an on-board system according to claim 6, characterized in that, Adjusting the quota parameters of each resource controller according to the gear status includes: When the gear position is in the parking state, the configuration parameters of each resource controller are adjusted to the first quota value, and the resource quota of each resource controller is regulated based on the first configuration value. When the gear position is in a non-parking state, the configuration parameters of each resource controller are adjusted to the second configuration value, and the resource quota of each resource controller is controlled based on the second configuration value.
8. The container resource quota control method for an on-board system according to claim 6, characterized in that, The contention weight parameters of each resource controller are adjusted based on the gear position and container status, including: When the container is in the foreground and the gear position is in the parking state, the competition weight parameters of each resource controller are adjusted to high priority weight values, and the resource quota of each resource controller is regulated based on the high priority weight values. When the container is in the foreground and the gear position is in the non-parking state, the resource quota of each resource controller is adjusted using a medium priority weight value. When the container is in the background, the resource quotas of each resource controller are adjusted using low priority weight values.
9. A container resource quota control system for an on-board system, characterized in that, Applications to in-vehicle Android systems include: A creation module is used to create container subgroups for the resource controller of the vehicle Android system during the startup phase of the vehicle Android system, and to set initial resource quotas for each container subgroup as the resource isolation boundary of the container; The mapping module is used to map all container subgroups to the root directory of the corresponding resource controller inside the container according to the resource isolation boundary; The monitoring module is used to monitor the gear position of the target vehicle through the resource management daemon process of the vehicle Android system and obtain the gear position status. The adjustment module is used to adjust the quota parameters and competition weight parameters of each resource controller according to the gear status and the container status, so as to obtain the container resource quota control result.