Search

CN-121979616-A - Container resource quota regulation and control method and system for vehicle-mounted system

CN121979616ACN 121979616 ACN121979616 ACN 121979616ACN-121979616-A

Abstract

The invention provides a container resource quota regulating method and system of a vehicle-mounted system, which are applied to the vehicle-mounted Android system, wherein container sub-groups are created for a resource controller of the vehicle-mounted Android system in a starting stage of the vehicle-mounted Android system, and initial resource quota is set for each container sub-group to serve as a resource isolation boundary of a container; the method comprises the steps of mapping all container sub-groups to root catalogs of corresponding resource controllers in a container according to a resource isolation boundary, monitoring gear positions of a target vehicle through a resource management daemon of a vehicle-mounted Android system to obtain a gear position state, adjusting quota parameters and competition weight parameters of each resource controller according to the gear position state and the state of the container to obtain a container resource quota regulation result, and achieving optimal balance of safety and experience while avoiding resources in the container from escaping to a control group of the vehicle-mounted Android system.

Inventors

  • WANG HUAN
  • ZENG HUAN

Assignees

  • 湖南小算科技信息有限公司

Dates

Publication Date
20260505
Application Date
20260127

Claims (9)

  1. 1. The container resource quota regulation and control method of the vehicle-mounted system is characterized by being applied to the vehicle-mounted Android system and comprising the following steps of: step 1, creating container sub-groups for a resource controller of the vehicle-mounted Android system in the starting stage of the vehicle-mounted Android system, and setting initial resource quota for each container sub-group to serve as a resource isolation boundary of a container; Step2, mapping all the container sub-groups to the root catalogs of the corresponding resource controllers in the containers according to the resource isolation boundaries; step 3, monitoring the gear of the target vehicle through the resource management daemon of the vehicle-mounted Android system to obtain a gear state; and step 4, adjusting quota parameters and competition weight parameters of each resource controller according to the gear state and the state of the container to obtain a container resource quota regulation result.
  2. 2. The method for regulating and controlling container resource quota of vehicle-mounted system according to claim 1, wherein the resource controller of the vehicle-mounted Android system comprises: processor time slice controller, processor core binding controller, memory controller, disk read-write bandwidth controller.
  3. 3. The method for regulating and controlling container resource quota of an in-vehicle system according to claim 1, wherein creating a container sub-packet for a resource controller of the in-vehicle Android system comprises: creating a container root group under each resource controller root directory of the vehicle-mounted Android system; A foreground application packet, a background application packet and a high priority application packet are created under each root packet, and a packet hierarchy structure is formed as a container sub-packet.
  4. 4. The container resource quota regulating method of the vehicle-mounted system according to claim 1, wherein setting an initial resource quota for each container sub-packet is: For each container sub-packet, writing a quota value to a quota parameter file of the container sub-packet as an initial resource quota.
  5. 5. The method for regulating and controlling container resource quota of vehicle-mounted system according to claim 2, wherein mapping all container sub-packets to a root directory of a corresponding resource controller inside a container comprises: Mapping the container sub-packets of the processor time slice controller to a root directory of the processor time slice controller; Mapping the container sub-group of the processor core binding controller to a root directory of the processor core binding controller; mapping the container sub-packets of the memory controller to a root directory of the memory controller; And mapping the container sub-group of the disk read-write bandwidth controller into a root directory of the disk read-write bandwidth controller.
  6. 6. The method for regulating and controlling container resource quota of vehicle-mounted system according to claim 1, wherein the step 4 comprises: Adjusting quota parameters of each resource controller according to the gear state to obtain a first adjustment result; Adjusting the competition weight parameters of each resource controller according to the gear state and the state of the container to obtain a second adjustment result; and taking the first adjustment result and the second adjustment result as container resource quota regulation results.
  7. 7. The method for adjusting and controlling container resource quota of vehicle-mounted system according to claim 6, wherein adjusting quota parameters of each resource controller according to the gear state comprises: When the gear state is a parking state, adjusting configuration parameters of each resource controller to a first quota value, and regulating and controlling resource quota of each resource controller based on the first configuration value; and when the gear state is a non-parking state, adjusting the configuration parameters of each resource controller to a second configuration value, and regulating and controlling the resource quota of each resource controller based on the second configuration value.
  8. 8. The method for adjusting and controlling container resource quota of vehicle-mounted system according to claim 6, wherein adjusting the competition weight parameters of each resource controller according to the gear state and the state of the container comprises: When the container is in a foreground and the gear state is in a parking state, the competition weight parameters of all the resource controllers are adjusted to be high-priority weight values, and the resource quota of each resource controller is regulated and controlled based on the high-priority weight values; When the container is in a foreground and the gear state is in a non-parking state, regulating and controlling the resource quota of each resource controller by adopting a medium priority weight value; When the container is in the background, the resource quota of each resource controller is regulated and controlled by adopting a low-priority weight value.
  9. 9. The container resource quota control system of the vehicle-mounted system is characterized by being applied to the vehicle-mounted Android system and comprising: The creating module is used for creating container sub-groups for the resource controllers of the vehicle-mounted Android system in the starting stage of the vehicle-mounted Android system, and setting initial resource quota for each container sub-group to serve as a resource isolation boundary of a container; The mapping module is used for mapping all the container sub-groups to the root catalogue of the corresponding resource controller in the container according to the resource isolation boundary; The monitoring module is used for monitoring the gear of the target vehicle through the resource management daemon of the vehicle-mounted Android system to obtain a gear state; And the adjusting module is used for adjusting the quota parameters and the competition weight parameters of each resource controller according to the gear state and the state of the container to obtain a container resource quota regulating and controlling result.

Description

Container resource quota regulation and control method and system for vehicle-mounted system Technical Field The invention relates to the technical field of vehicle-mounted operating systems, in particular to a method and a system for regulating and controlling container resource quota of a vehicle-mounted system. Background The container is a lightweight, portable, self-contained software packaging technology that allows applications to run in the same manner almost anywhere. Unlike conventional virtualization techniques, the container runs in some user space of the operating system, isolated from other processes of the operating system, and is much smaller in volume than a virtual machine. The whole operating system does not need to be started, so that the container is faster in deployment and starting speed, lower in cost and easier to migrate. Currently mainstream container technologies, such as dock, are typically implemented based on the characteristics of the Linux operating system kernel (e.g., namespace, control group cgroup, etc.), which cannot be directly migrated to other operating systems without these characteristics. However, linux operating systems have limitations that are not well-defined in the four seas. For example, in the fields of industrial robots, autopilot, etc., some operating systems with strong real-time are more suitable. To combine the advantages of both, the operating system kernel needs to be modified to have similar namespace and control group characteristics to implement container functionality. Important functions of Linux container technology are resource isolation and resource limitation. The resource limiting function is realized by means of a control group function in the Linux kernel. And the resource isolation is realized by means of a naming space function in the Linux kernel. To implement migration of resource isolation functions in container technology, one of the links is to implement a namespace-like technique to perform isolated system calls. Existing Linux container technology typically performs resource isolation of control groups in the following manner: Directly mapping a controller mounting point of a control group of a host into a container, wherein the controller can be a processor time slice controller, a processor core binding controller, a memory controller and a disk read-write bandwidth controller; the processes in the container can directly access and operate the control group hierarchy of the host; the control group is dependent on the namespace for basic isolation, but the isolation effect is limited in the control group environment. However, in the on-vehicle Android container scenario, the following problems exist in the prior art: the resource escape risk is that the process of the Android system in the container can escape out of the resource control range of the host machine by writing the host machine control group, so that the resource limitation is invalid; Static resource allocation, wherein the traditional scheme adopts fixed resource quota and cannot be dynamically adjusted according to driving scenes; and the compatibility problem is that if the path of the Android control group in the container is modified, a large amount of adaptation work is needed, and the stability of the system is affected. Disclosure of Invention The invention provides a container resource quota regulating method and system of a vehicle-mounted system, and aims to realize optimal balance of safety and experience while avoiding resource escape risks. In order to achieve the above object, the present invention provides a method for regulating and controlling container resource quota of a vehicle-mounted system, which is applied to a vehicle-mounted Android system, and comprises: Step 1, creating container sub-groups for a resource controller of a vehicle-mounted Android system in a vehicle-mounted Android system starting stage, and setting initial resource quota for each container sub-group to serve as a resource isolation boundary of a container; step 2, mapping all the container sub-groups to the root catalogs of the corresponding resource controllers in the containers according to the resource isolation boundaries; Step 3, monitoring the gear of the target vehicle through a resource management daemon of the vehicle-mounted Android system to obtain a gear state; And step 4, adjusting quota parameters and competition weight parameters of each resource controller according to the gear state and the state of the container to obtain a container resource quota regulation result. Further, the resource controller of the vehicle-mounted Android system includes: processor time slice controller, processor core binding controller, memory controller, disk read-write bandwidth controller. Further, creating a container sub-group for a resource controller of the vehicle-mounted Android system includes: Creating a container root group under each resource controller root direc