Disclosure of Invention
In order to overcome the problems in the related art, the present disclosure provides a vehicle control method and apparatus.
According to a first aspect of embodiments of the present disclosure, there is provided a vehicle control method applied to a vehicle including a first operating system and a plurality of second operating systems provided for different mechanisms of the vehicle, the plurality of second operating systems being deployed in different containers when the vehicle is started, the method comprising:
Determining load information of a second operating system in each container through the first operating system;
and distributing system resources in the vehicle to the container where each second operating system is located according to the load information of each second operating system through the first operating system.
Optionally, the allocating, by the first operating system, system resources in the vehicle for a container where each second operating system is located according to load information of each second operating system includes:
Determining, for each second operating system, a relationship between load information of the second operating system and total load information of all second operating systems by the first operating system;
Determining system resources to be allocated to a container where the second operating system is located according to the system resources allocated to the first operating system by the vehicle and the relation;
and allocating the determined system resources to a container where the second operating system is located.
Optionally, the method further comprises:
When the vehicle starts, starting a container manager through the first operating system;
creating and launching a plurality of containers by the container manager;
the plurality of second operating systems are deployed in different containers by the container manager.
Optionally, the method further comprises:
receiving a vehicle control instruction through the first operating system, wherein the vehicle mechanism control instruction indicates a target mechanism to be controlled;
And starting a target second operating system for controlling the target mechanism by using the container manager through the first operating system, so as to control the target mechanism through the started target second operating system.
Optionally, the method further comprises:
In response to the container manager determining that a container is exiting due to an operational anomaly, recording, by the container manager, a cause of the operational anomaly of the container, and restarting the container.
Optionally, the vehicle further comprises a real-time operating system, and the method further comprises:
When the vehicle is started, starting a virtual machine manager;
creating two virtual machines through the virtual machine manager;
the real-time operating system and the first operating system are deployed in different virtual machines through the virtual machine manager, and the plurality of second operating systems are deployed in the virtual machines in which the first operating system is located.
Optionally, the method further comprises:
Starting the real-time operating system through the virtual machine manager;
And starting the first operating system through the real-time operating system.
According to a second aspect of the embodiments of the present disclosure, there is provided a vehicle control apparatus applied to a vehicle including a first operating system and a plurality of second operating systems provided for different mechanisms of the vehicle, the plurality of second operating systems being disposed in different containers at the time of start-up of the vehicle, the apparatus comprising:
A determining module configured to determine, by the first operating system, load information of a second operating system in each container;
And the distribution module is configured to distribute system resources in the vehicle to the container where each second operating system is located according to the load information of each second operating system through the first operating system.
Optionally, the distribution module includes:
a first determination submodule configured to determine, for each second operating system, a relationship between load information of the second operating system and total load information of all second operating systems by the first operating system;
a second determination submodule configured to determine system resources to be allocated to a container in which the second operating system is located according to the relationship and the system resources allocated to the first operating system by the vehicle;
And the allocation submodule is configured to allocate the determined system resources to the container where the second operating system is located.
Optionally, the apparatus further comprises:
A first launch module configured to launch a container manager through the first operating system upon launch of the vehicle;
A first creation module configured to create and launch a plurality of containers through the container manager;
a first deployment module configured to deploy the plurality of second operating systems in different containers through the container manager.
Optionally, the apparatus further comprises:
A receiving module configured to receive a vehicle control instruction through the first operating system, the vehicle mechanism control instruction indicating a target mechanism to be controlled;
and the second starting module is configured to start a target second operating system for controlling the target mechanism by using the container manager through the first operating system so as to control the target mechanism through the started target second operating system.
Optionally, the apparatus further comprises:
A recording module configured to record, by the container manager, a cause of an operational anomaly of a container in response to the container manager determining that the container is exited due to the operational anomaly;
a launch module configured to restart the container through the container manager.
Optionally, the vehicle further comprises a real-time operating system, and the device further comprises:
a third starting module configured to start a virtual machine manager when the vehicle is started;
a second creation module configured as a module configured to create two virtual machines through the virtual machine manager;
The second deployment module is configured to deploy the real-time operating system and the first operating system in different virtual machines through the virtual machine manager and deploy the plurality of second operating systems in the virtual machines in which the first operating system is located.
Optionally, the apparatus further comprises:
a fourth starting module configured to start the real-time operating system through the virtual machine manager;
and a fifth starting module configured to start the first operating system through the real-time operating system.
According to a third aspect of embodiments of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of any of the first aspects described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a vehicle comprising:
A memory for storing machine executable instructions corresponding to vehicle control;
a processor for reading the machine-executable instructions on the memory and executing the machine-executable instructions to perform operations comprising:
Determining load information of a second operating system in each container through the first operating system;
and distributing system resources in the vehicle to the container where each second operating system is located according to the load information of each second operating system through the first operating system.
The technical scheme provided by the embodiment of the disclosure can comprise the following beneficial effects:
In the embodiment of the disclosure, the vehicle comprises a first operating system and a plurality of second operating systems which are arranged for different mechanisms of the vehicle, the second operating systems are deployed in different containers when the vehicle is started, the load information of the second operating systems in each container is determined through the first operating system, and system resources in the vehicle are allocated to the container where each second operating system is located according to the load information of each second operating system. According to the embodiment of the disclosure, the container technology is adopted, so that the vehicle can dynamically allocate the system resources to the second operating system, and the full utilization of the system resources is facilitated.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in this disclosure to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The term "if" as used herein may be interpreted as "at..once" or "when..once" or "in response to a determination", depending on the context.
FIG. 1 is a flow chart illustrating a vehicle control method according to an exemplary embodiment, the method shown in FIG. 1 being applied to a vehicle including a first operating system and a plurality of second operating systems configured for different mechanisms of the vehicle, the plurality of second operating systems being deployed in different containers at vehicle start-up, the method comprising:
in step 101, load information of a second operating system in each container is determined by a first operating system.
In this embodiment, the first operating system may be a Linux operating system, or may be another suitable operating system. There are various kinds of second operating systems, for example, an infotainment operating system, a driving interactive operating system, a communication network operating system, and the like, wherein the driving interactive operating system may be a driving interactive operating system set for a display screen or a driving interactive operating system set for a camera.
The load information indicates the task size of the second operating system, and determines the system resources required by the second operating system. The load information of the second operating system may be determined according to the code complexity and/or external device information required to run the system.
In one embodiment, a vehicle, at start-up, initiates a container manager through a first operating system, creates and initiates a plurality of containers through the container manager, and deploys a plurality of second operating systems in different containers. The number of containers created by the container manager may be determined based on the number of second operating systems. For example, the number of second operating systems is equal to the number of created containers.
The vehicle is provided with a container manager program, and the container manager is started by the container manager program. The container manager program may be located in the first operating system.
In one embodiment, the vehicle may also include a real-time operating system, which is used by the vehicle to quickly perform data calculations and processing, outputting data in a short period of time.
A virtual machine manager program is provided in the vehicle, and the virtual machine manager is started by the virtual machine manager program. The vehicle may load and run the virtual machine manager program after the hardware is powered up, thereby starting the virtual machine manager.
In use, when the vehicle is started, the virtual machine manager is started, the vehicle creates two virtual machines through the virtual machine manager, the real-time operating system and the first operating system are deployed in different virtual machines, and the vehicle deploys a plurality of second operating systems in the virtual machines where the first operating system is located through the virtual machine manager.
The real-time operating system and the first operating system may be started by the vehicle starting the real-time operating system using the virtual machine manager and starting the first operating system using the real-time operating system.
In step 102, system resources in the vehicle are allocated to the container where each second operating system is located according to the load information of each second operating system by the first operating system.
The system resources may include hardware resources, which may include a central processing unit (central processing unit, CPU for short), memory, and the like.
In one embodiment, first, for each second operating system, a relationship between load information of the second operating system and total load information of all the second operating systems is determined by the first operating system, second, system resources to be allocated to a container in which the operating system is located are determined according to system resources allocated to the first operating system by the vehicle and the determined relationship, and third, the determined system resources are allocated to the container in which the operating system is located.
The relationship between the load information of one second operating system and the total load information of all the second operating systems may be a ratio of the load amount of one second operating system to the total load amount of all the second operating systems, and the system resource allocated to the first operating system by the vehicle is multiplied by the ratio to obtain the system resource to be allocated to the container where the second operating system is located.
Based on the characteristics of the container technology, the first operating system can dynamically allocate system resources to the second operating system by adopting the container technology, so that the full utilization of the system resources is facilitated, the problems of excessive system resources caused by small operating system load, shortage of system resources caused by large operating system load and the like in the background technology are avoided, and the stable performance of the vehicle is ensured.
In one embodiment, during use of the vehicle, a vehicle control instruction is received through a first operating system, the vehicle mechanism control instruction indicates a target mechanism to be controlled, a target second operating system for controlling the target mechanism is started through the first operating system by using a container manager, and the target mechanism is controlled through the started target second operating system.
The vehicle sends an instruction to the container manager through the first operating system, the container manager is triggered to start the target second operating system, and the vehicle controls the target mechanism through the started target second operating system.
In one embodiment, during use of the vehicle, the container manager records the cause of the container operation anomaly and restarts the container in response to the container manager determining that a container is being withdrawn from the vehicle due to the operation anomaly.
There are various reasons for the container to be abnormal, for example, a critical program running in the container crashes, the remaining resources are insufficient to run the critical program, etc. The container manager can record the reasons of abnormal operation of the container, and generate a log for maintenance and debugging of management personnel.
After the container is determined to be withdrawn due to abnormal operation, the container is restarted, so that the vehicle can continue to provide corresponding functions, and the performance stability of the vehicle is ensured.
In this embodiment, the container manager has functions of detecting an abnormality in the operation of the container, determining the cause of the abnormality in the operation of the container, recording the cause of the abnormality in the operation of the container, and restarting the container.
Fig. 2 is a schematic structural view of a vehicle according to an exemplary embodiment, and referring to fig. 2, the vehicle includes a real-time operating system and a Linux operating system, and the vehicle further includes an infotainment operating system, a first driving interactive operating system provided for a dashboard and a HUD, a second driving interactive operating system provided for a camera, and a communication network operating system (hereinafter referred to as four operating systems).
The method comprises the steps of starting a virtual machine manager when a vehicle is started, creating two virtual machines through the virtual machine manager, deploying a real-time operating system and a Linux operating system in different virtual machines, deploying four operating systems in the virtual machines where the Linux operating system is located, starting the real-time operating system through the virtual machine manager, starting the Linux operating system through the real-time operating system, starting a container manager through the Linux operating system after the Linux operating system is started, creating and starting four containers through the container manager, and deploying the four operating systems in different containers.
The Linux operating system determines the load information of each operating system in the four operating systems in the using process, dynamically allocates system resources for the container where each operating system is located according to the load information of each operating system, specifically allocates more system resources for the container where the operating system with large load is located, and allocates less system resources for the container where the operating system with small load is located, so that the full utilization of the system resources is realized.
The vehicle receives a vehicle control instruction through a Linux operating system, the vehicle mechanism control instruction indicates a target mechanism to be controlled, a target second operating system for controlling the target mechanism is started through the Linux operating system by utilizing a container manager, and the target mechanism is controlled through the started target second operating system.
For example, after the in-vehicle personnel inputs an instruction for opening the camera, the Linux operating system sends a corresponding instruction to the container manager, the container manager starts a second driving interactive operating system in the container 3, and the camera is controlled to be opened through the started second driving interactive operating system.
In the embodiment of the disclosure, the vehicle comprises a first operating system and a plurality of second operating systems which are arranged for different mechanisms of the vehicle, the second operating systems are deployed in different containers when the vehicle is started, the load information of the second operating systems in each container is determined through the first operating system, and system resources in the vehicle are allocated to the container where each second operating system is located according to the load information of each second operating system. According to the embodiment of the disclosure, the container technology is adopted, so that the vehicle can dynamically allocate the system resources to the second operating system, and the full utilization of the system resources is facilitated.
The embodiment of the disclosure adopts a virtualization technology, so that hardware resources of a vehicle can be saved, and the manufacturing cost of the vehicle is reduced.
For the foregoing method embodiments, for simplicity of explanation, the methodologies are shown as a series of acts, but one of ordinary skill in the art will appreciate that the present disclosure is not limited by the order of acts described, as some steps may occur in other orders or concurrently in accordance with the disclosure.
Further, those skilled in the art will also appreciate that the embodiments described in the specification are all alternative embodiments, and that the acts and modules referred to are not necessarily required by the present disclosure.
Corresponding to the embodiment of the application function implementation method, the disclosure also provides an embodiment of the application function implementation device and a corresponding terminal.
Fig. 3 is a block diagram of a vehicle control apparatus according to an exemplary embodiment, the vehicle control apparatus being applied to a vehicle, the vehicle comprising a first operating system and a plurality of second operating systems for controlling different mechanisms of the vehicle, the plurality of second operating systems being deployed in different containers at start-up of the vehicle, the apparatus comprising a determination module 21 and a distribution module 22, wherein,
The determining module 21 is configured to determine load information of a second operating system in each container through the first operating system;
The allocation module 22 is configured to allocate, by the first operating system, system resources in the vehicle to a container in which each second operating system is located according to load information of each second operating system.
In an alternative embodiment, the distribution module 22 may comprise a first determination sub-module, a second determination sub-module and a distribution sub-module, based on the vehicle control device shown in fig. 3, wherein,
The first determining submodule is configured to determine, for each second operating system, a relation between load information of the second operating system and total load information of all the second operating systems through the first operating system;
the second determining submodule is configured to determine system resources to be allocated to a container where the second operating system is located according to the relation and the system resources allocated to the first operating system by the vehicle;
the allocation submodule is configured to allocate the determined system resources to a container where the second operating system is located.
In an alternative embodiment, the vehicle control apparatus shown in fig. 3 may further include a first starting module, a first creating module, and a first deployment module, wherein,
The first starting module is configured to start a container manager through the first operating system when the vehicle starts;
the first creation module is configured to create and start a plurality of containers through the container manager;
The first deployment module is configured to deploy the plurality of second operating systems in different containers through the container manager.
In an alternative embodiment, the apparatus may further comprise a receiving module and a second enabling module, wherein,
The receiving module is configured to receive a vehicle control instruction through the first operating system, wherein the vehicle mechanism control instruction indicates a target mechanism to be controlled;
The second starting module is configured to start a target second operating system for controlling the target mechanism by using the container manager through the first operating system, so as to control the target mechanism through the started target second operating system.
In an alternative embodiment, the apparatus may further comprise a recording module and a starting module, wherein,
The recording module is configured to respond to the container manager to determine that a container exits due to abnormal operation, and record the reason of the abnormal operation of the container through the container manager;
the launch module is configured to restart the container through the container manager.
In an alternative embodiment, the vehicle further comprises a real-time operating system based on the vehicle control device shown in fig. 3, the device may further comprise a third start-up module, a second creation module and a second deployment module, wherein,
The third starting module is configured to start a virtual machine manager when the vehicle is started;
the second creation module is configured as a module configured to create two virtual machines through the virtual machine manager;
The second deployment module is configured to deploy the real-time operating system and the first operating system in different virtual machines through the virtual machine manager, and deploy the plurality of second operating systems in the virtual machines in which the first operating system is located.
In an alternative embodiment, the apparatus may further comprise a fourth start-up module and a fifth start-up module, wherein,
The fourth starting module is configured to start the real-time operating system through the virtual machine manager;
The fifth starting module is configured to start the first operating system through the real-time operating system.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the elements described above as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the objectives of the disclosed solution. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The embodiment of the disclosure also provides a vehicle. FIG. 4 is a schematic diagram of another vehicle according to an exemplary embodiment, the vehicle shown in FIG. 4 including a first operating system, a plurality of second operating systems configured for different mechanisms of the vehicle, an internal bus 310, and a memory 320, a processor 330, and an external interface 340 connected by the internal bus 310;
Wherein, the external interface 340 is used for acquiring data;
A memory 320 for storing machine readable instructions corresponding to vehicle control;
A processor 330 for reading the machine-readable instructions on the memory 320 and executing the machine-executable instructions to perform operations comprising:
Determining load information of a second operating system in each container through the first operating system;
and distributing system resources in the vehicle to the container where each second operating system is located according to the load information of each second operating system through the first operating system.
In the disclosed embodiments, the computer-readable storage medium may take many forms, such as, in different examples, RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, a storage drive (e.g., a hard drive), a solid state disk, any type of storage disk (e.g., an optical disk, dvd, etc.), or the like, or a combination thereof. In particular, the computer readable medium may also be paper or other suitable medium capable of printing a program. Using these media, the programs may be electronically captured (e.g., optically scanned), compiled, interpreted, and otherwise processed in a suitable manner, and then stored in a computer medium.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.