Start control method and device of system on chip, storage medium and electronic equipment
By dynamically managing the operating system managed by the virtual machine monitor system when the system on-chip is started, the problem of complex configuration process and poor flexibility in the existing technology is solved, and higher flexibility and simplified configuration process are achieved.
Patent Information
- Application Number
- CN202411689443.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-14
AI Technical Summary
In the prior art, the process of configuring the operating system managed by a virtual machine monitor system is complicated and has poor flexibility.
When the system on chip is started, the preliminary startup process is performed, and the system registers required by the virtual machine monitor system are configured, the virtual machine monitor system is started, and hardware resources are allocated to a set of operating systems indicated by the system registry to realize dynamic management.
Through dynamic configuration and resource allocation, the flexibility of the operating system managed by the virtual machine monitor system is improved, the configuration process is simplified, and the limitations of static configuration are avoided.
Smart Images

Figure CN119621177A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of vehicle technology, and more specifically, to a startup control method, device, storage medium, and electronic device for a system on a chip. Background Art
[0002] Hypervisor technology was initially used in server systems. In recent years, with the development of new energy vehicle technology, it has begun to be widely used in vehicle embedded systems to achieve concurrent operation of multiple operating systems and resource isolation.
[0003] In new energy vehicle systems, multiple operating systems managed by the virtual machine monitor system are pre-customized, and customized development is usually required for each operating system to ensure that they can be loaded into the hardware.
[0004] However, the multiple operating systems managed by the virtual machine monitor system in the related art are statically defined. If the operating system managed by the virtual machine monitor system needs to be adjusted, it is necessary to re-customize the operating system and re-customize the operating system managed by the virtual machine monitor system. It can be seen that the related art has the problem of complex process and poor flexibility in configuring the operating system managed by the virtual machine monitor system. Summary of the invention
[0005] The embodiments of the present application provide a system on chip startup control method, device, storage medium and electronic device to at least solve the technical problems in the related art that the process of configuring the operating system managed by the virtual machine monitor system is complex and has poor flexibility.
[0006] According to one aspect of an embodiment of the present application, a startup control method for a system on chip is provided, which is applied to a vehicle, and the method includes: when the system on chip is started, executing a preliminary startup process; when the preliminary startup process is completed, configuring system registers required by a virtual machine monitor system and starting the virtual machine monitor system; allocating hardware resources to a group of first operating systems indicated by a system registry of the virtual machine monitor system, and starting the group of first operating systems, wherein the system registry is used to configure the operating system to be started by the virtual machine monitor system, and the group of first operating systems after startup run in a virtual environment provided by the virtual machine monitor system.
[0007] According to another aspect of an embodiment of the present application, a startup control device for a system on chip is provided, which is applied to a vehicle, and the device includes: an execution module, which is used to perform a preliminary startup process when the system on chip is started; a first startup module, which is used to configure the system registers required by the virtual machine monitor system and start the virtual machine monitor system when the preliminary startup process is completed; a second startup module, which is used to allocate hardware resources to a group of first operating systems indicated by a system registry of the virtual machine monitor system and start the group of first operating systems, wherein the system registry is used to configure the operating system to be started by the virtual machine monitor system, and the group of first operating systems after startup run in a virtual environment provided by the virtual machine monitor system.
[0008] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps in any one of the above method embodiments are implemented.
[0009] According to another aspect of the embodiments of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in any one of the above method embodiments when executing the computer program.
[0010] According to another aspect of the embodiments of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the steps in any of the above method embodiments.
[0011] Through the embodiments of the present application, when the system on chip is started, a preliminary startup process is executed. When the preliminary startup process is completed, the system registers required by the virtual machine monitor system are configured, and the virtual machine monitor system is started. Hardware resources are allocated to a group of first operating systems indicated by the system registry of the virtual machine monitor system, and a group of first operating systems are started. This allows the system registry to dynamically configure a group of first operating systems to be started and resource allocation when the system on chip is started, thereby achieving dynamic management of a group of first operating systems and solving the problems of complex process and poor flexibility in configuring the operating systems managed by the virtual machine monitor system in the related art. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1It is a hardware structure block diagram of a mobile terminal according to an optional system-on-chip startup control method of an embodiment of the present application;
[0013] Figure 2 is a flow chart of an optional system-on-chip startup control method according to an embodiment of the present application;
[0014] Figure 3 is a flow chart of another optional system-on-chip startup control method according to an embodiment of the present application;
[0015] Figure 4 is a structural block diagram of an optional system-on-chip startup control device according to an embodiment of the present application;
[0016] Figure 5 It is a block diagram of a computer system structure of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0017] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0018] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0019] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal according to an optional system-on-chip startup control method of an embodiment of the present application. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0020] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the startup control method of the system on chip in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0021] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0022] According to one aspect of an embodiment of the present application, a startup control method of a system on a chip running on the above mobile terminal is provided, which is applied to a vehicle. Figure 2 is a flow chart of an optional system-on-chip startup control method according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0023] Step S202, when the system on chip is started, a preliminary startup process is performed.
[0024] It should be noted that the embodiments of the present application are mainly applied to vehicles, mainly new energy vehicles. New energy vehicles integrate multiple functions such as power systems, driving assistance, entertainment systems, and instrument panel displays. This requires a highly integrated electronic system to support its complex operating requirements. SoC (System on Chip) is a key component of the electronic system in new energy vehicles. The system on chip integrates a microprocessor, memory, input / output interface, and other multiple functional modules on a chip, achieving high integration and high performance. In new energy vehicles, the system on chip is responsible for processing and coordinating all key functions, including but not limited to controlling battery charging and discharging, monitoring vehicle status, providing entertainment and information display, etc. When the system on chip is started, that is, once the vehicle starts to power on and the power is turned on, the initial startup process of the system on chip is started immediately. Among them, the initial startup process can include multiple startup processes. Specifically, after receiving the power signal, the system on chip starts a series of operations executed by the boot code in the ROM (Read-Only Memory) preset inside it. The main purpose of this process is to initialize the hardware resources of the on-chip system, such as configuring the CPU (Central Processing Unit), memory, peripherals, etc., to create conditions for subsequent system startup and software loading.
[0025] In practice, in the system on chip, through specific hardware mechanisms and software configurations, switching and isolation between the secure world and the non-secure world can be achieved to protect the security and integrity of the system. Specifically, the secure world (SecureWorld) and the non-secure world (Non-Secure World) are important concepts used to achieve system security isolation in the ARM (Advanced RISC Machine) architecture. The secure world is mainly used to handle sensitive tasks involving security and privacy, and the non-secure world is mainly used to handle general tasks, such as operating system operation, application execution, etc.
[0026] Exemplarily, when the new energy vehicle is powered on, that is, the system on chip is started, triggering the execution of the preliminary startup process. Optionally, the preliminary startup process is executed in the secure world.
[0027] Step S204, when the initial startup process is completed, configure the system registers required by the virtual machine monitor system and start the virtual machine monitor system.
[0028] It should be noted that the hypervisor system is a software layer running on hardware that can create and run multiple virtual machines, each of which can run a different operating system or multiple instances of the same operating system, which are called GuestOS (user operating system). Optionally, the hypervisor system virtualizes the computing resources of physical hardware (such as CPU, memory, storage and network), allowing multiple operating systems to run independently while sharing these resources.
[0029] The system registers configured for the virtual machine monitor system determine how the virtual machine monitor manages and accesses hardware resources. The system registers required by the virtual machine monitor system may include but are not limited to control registers, status registers, interrupt registers, and memory management registers. Among them, the control register can be used to control the enabling of virtualization functions and the setting of performance parameters. The status register can be used to reflect the current state of the CPU, including operating mode, interrupt status, abnormal status, etc. The interrupt register can be used to manage interrupt requests to implement interrupt processing between multiple operating systems. The memory management register is used to manage the mapping of virtual memory to ensure that each operating system has an independent memory space.
[0030] Optionally, after configuring the system registers required by the hypervisor system, a jump to the entry point of the hypervisor system is performed to start the hypervisor system. The hypervisor system loads its code and data from memory and starts running. Inside the hypervisor system, it first initializes its own environment, including setting up exception handlers, creating virtual processors, and configuring memory mapping and interrupt controllers.
[0031] Step S206, allocate hardware resources to a group of first operating systems indicated by the system registry of the virtual machine monitor system, and start the group of first operating systems, wherein the system registry is used to configure the operating system to be started by the virtual machine monitor system, and the started group of first operating systems runs in the virtual environment provided by the virtual machine monitor system.
[0032] It should be noted that the virtual machine monitor system has a pre-configured boot management service (Boot Loader Manager). There is a system registry in the boot management service, which records the list of operating systems to be started for a group of first operating systems in the virtual machine monitor system and the hardware resources required for each first operating system. Optionally, hardware resources include but are not limited to the allocation of resources such as CPU cores, memory, peripheral interfaces, and interrupts. A group of first operating systems may include one or more first operating systems. The first operating system may be operating systems of different types. The types of operating systems may include Android, Linux, RTOS (Real-Time Operating System), etc. During system operation, especially when a new operating system is registered or an existing operating system is deregistered, the system registry needs to be updated to reflect the latest resource allocation status.
[0033] In specific practice, there may be systems in the vehicle that implement multiple different functions, such as an in-vehicle entertainment system, an instrument system, a braking system, etc. The virtual machine monitor system may implement running a function in the vehicle on a first operating system corresponding to the functional system. Specifically, when there are only an in-vehicle entertainment system, an instrument system, and a braking system in the vehicle, the number of first operating systems in the corresponding set of first operating systems may be 3.
[0034] Exemplarily, after starting the virtual machine monitor system, a system registry recorded by the startup management service in the virtual machine monitor system is obtained. The system registry may include a group of first operating systems, hardware resources are allocated to each first operating system existing in the system registry, and after the hardware resources are allocated, a group of first operating systems are started.
[0035] In specific practice, in the process of allocating hardware resources to the first operating system, resource identification, allocation and isolation are required to ensure that each first operating system has an independent and appropriate hardware environment to run. The startup management service will transfer the control of hardware resources from the virtual machine monitor system to the corresponding first operating system according to the type and needs of the first operating system, while retaining the ultimate control of the resources to achieve security management and dynamic adjustment of resources. After the hardware resource allocation is completed, the startup management service will start a group of first operating systems. The startup process involves loading the kernel image of the first operating system into the allocated memory area and calling the startup routine of the first operating system through the virtual environment interface provided by the virtual machine monitor system. In a multi-core system, the virtual machine monitor system can start multiple first operating systems concurrently.
[0036] Through the embodiments of the present application, when the system on chip is started, a preliminary startup process is executed. When the preliminary startup process is completed, the system registers required by the virtual machine monitor system are configured, and the virtual machine monitor system is started. Hardware resources are allocated to a group of first operating systems indicated by the system registry of the virtual machine monitor system, and a group of first operating systems are started. This allows the system registry to dynamically configure a group of first operating systems to be started and resource allocation when the system on chip is started, thereby achieving dynamic management of a group of first operating systems, avoiding the limitations of static configuration, and improving the flexibility of configuring the operating systems managed by the virtual machine monitor system.
[0037] In an exemplary embodiment, before allocating hardware resources to a group of first operating systems indicated by a system registry of the virtual machine monitor system, the method further includes:
[0038] Reading a system configuration table of the virtual machine monitor system, wherein the system configuration table is used to indicate an operating system to be started by the system on chip, and the operating system indicated by the system configuration table is a group of first operating systems;
[0039] In a case where the group of first operating systems includes a first operating system that is not recorded in the system registry, adding system information of the first operating system to the system registry to update the system registry;
[0040] In the case that the operating systems recorded in the system registry include a second operating system that does not belong to a group of first operating systems, the system information of the second operating system in the system registry is deleted to update the system registry.
[0041] It should be noted that the system configuration table can be used to indicate the operating system to be started by the system on chip. Optionally, the system configuration table can be a static configuration before the virtual machine monitor system is started, which can be used to indicate the set of operating systems to be started on the system on chip, that is, a group of first operating systems. In specific practice, the system configuration table can be set for the vehicle before the system on chip is started (that is, the vehicle is powered on this time), and is used to guide the system on chip to select which operating system image files need to be loaded into the memory when starting.
[0042] The system registry can be used to configure the operating system to be started by the virtual machine monitor system. The system registry can record the operating system that has been started before, that is, the operating system that was started when the virtual machine monitor system was started last time. Specifically, the system registry can be updated according to the system configuration table before allocating hardware resources to a group of first operating systems indicated by the system registry of the virtual machine monitor system.
[0043] Optionally, the system information may include but is not limited to the location information of the operating system's image file, basic hardware resource requirements and security level. The second operating system may be an operating system that is not included in the set of first operating systems recorded in the system configuration table.
[0044] Exemplarily, when a group of first operating systems recorded in the system configuration table includes a first operating system not recorded in the system registry, the system configuration table is updated by adding the corresponding system information of the first operating system in the system registry. When the operating system recorded in the system registry includes a second operating system, the system registry is updated by deleting the system information of the second operating system in the system registry.
[0045] Optionally, the virtual machine monitor system can be configured with a boot management service. After executing the initial boot process, the system configuration table is read and the information of the first operating system is found. Since there is no record of the first operating system in the system registry, before loading the image of the first operating system into the memory, the boot management service will add the system information of the first operating system to the system registry and update the system registry. In the system configuration table, the boot management service also finds the information of the second operating system, but in the system registry, the information of the second operating system is no longer used. The boot management service deletes the system information of the second operating system from the system registry to update the system registry to ensure that the system registry is consistent with the actual set of first operating systems to be started. In addition, after the boot management service deletes the system information of the second operating system from the system registry to update the system registry, the system files corresponding to the second operating system are deleted from the designated storage space of the system on chip.
[0046] Through this embodiment, the system configuration table allows the first operating system required for the new function to be dynamically added without redesigning the hardware or modifying the code, thereby improving the flexibility of configuring the operating system managed by the virtual machine monitor system. In addition, through the system configuration table, a group of first operating systems to be started are updated, thereby updating the system registry, simplifying the maintenance and upgrade process, and reducing costs and complexity.
[0047] In an exemplary embodiment, the system registry is further used to configure the system version of the operating system to be started by the virtual machine monitor system, and the system configuration table is used to indicate the system version of the operating system to be started by the system on chip.
[0048] After reading the system configuration table of the virtual machine monitor system, the method further includes:
[0049] When the third operating system recorded in the system registry belongs to a group of first operating systems and the system version of the third operating system recorded in the system registry is different from the system version of the third operating system indicated by the system configuration table, the system version of the third operating system recorded in the system registry is updated according to the system version of the third operating system indicated by the system configuration table to update the system registry.
[0050] It should be noted that the system registry can also be used to configure the system version of the operating system to be started by the virtual machine monitor system, and the system configuration table can be used to indicate the system version of the operating system to be started by the system on chip. The third operating system can be an operating system that belongs to a group of first operating systems, and the system version of the third operating system recorded in the system registry is different from the system version of the third operating system indicated by the system configuration table. It can also be said that the system version in the third operating system is updated.
[0051] Exemplarily, after reading the system configuration table of the virtual machine monitor system, it is determined whether a third operating system exists by comparing the system configuration table with the system registry. If a third operating system exists, the system version of the third operating system recorded in the system registry is updated with the system version of the third operating system indicated in the system configuration table, thereby updating the system registry.
[0052] Optionally, when the system on chip is started, the startup management service first reads the system configuration table to identify a set of first operating systems to be started and their version information. Check the system registry to confirm whether each first operating system to be started has been recorded, and whether the recorded version information is consistent with the version information in the system configuration table. In the case where the version of the third operating system recorded in the system registry is inconsistent with the version indicated in the system configuration table, it means that a new version of the operating system needs to be started or the currently running version needs to be updated. At this time, the startup management service will update the version record of the third operating system in the system registry according to the new version information indicated by the system configuration table to ensure the accuracy of the version information. After updating the system registry, for the old version of the operating system that is no longer needed, the startup management service will remove its information from the system registry and release the corresponding resources.
[0053] Through this embodiment, based on the system configuration table and the system registry, it is determined whether there is a first operating system to be updated. When there is a first operating system to be updated, the system registry is updated through the system configuration table to achieve dynamic management and updating of the operating system version, thereby improving the flexibility of the electronic architecture of new energy vehicles.
[0054] In an exemplary embodiment, after adding the system information of the first operating system to the system registry, the method further includes:
[0055] Searching for a group of operating system files stored in a designated storage space of the system on chip, wherein each operating system file in the group of operating system files is a system file of an operating system;
[0056] When the set of operating system files does not include the system file of the first operating system, sending a request message to the cloud server, wherein the request message is used to request to obtain the system file of the first operating system;
[0057] When a response message is received from the cloud server in response to the request message, the system files of the first operating system are extracted from the response message, and the system files of the first operating system are saved in the designated storage space.
[0058] It should be noted that the designated storage space may be a storage area in the system on chip that is specifically designated for storing operating system files and images. This designated storage space may be a flash memory, EEPROM, or other type of non-volatile memory, used to store all operating system files required for vehicle operation.
[0059] A cloud server refers to a server cluster or service located in the cloud, which is used to store, manage and distribute vehicle software update packages and resources. The cloud server communicates with the vehicle, and when the vehicle needs the system files of the first operating system, it will request information from the cloud server, and the request message is used to request to obtain the system files of the first operating system. Optionally, the request message may include the vehicle identification code of the vehicle, information about the required operating system (such as the operating system type, version, etc.), and a specific identifier of the request, which is used by the cloud server to verify the legitimacy of the request, determine the specific content of the request, and prepare response data accordingly.
[0060] After receiving the request message, the cloud server searches for and packages the system files of the first operating system according to the request information, and then sends a response message to the vehicle, which includes the requested operating system files.
[0061] Exemplarily, when a group of operating system files stored in the designated storage space of the on-chip system does not include system files of the first operating system, a request message is sent to the cloud server to obtain the system files of the first operating system based on the request message, and save the system files of the first operating system to the designated storage space.
[0062] Through this embodiment, when a set of operating system files stored in the designated storage space of the on-chip system does not include system files of the first operating system, the vehicle can flexibly obtain and deploy a new operating system through the cloud server without physical contact or redesign of the system architecture, thereby improving the flexibility of configuring the operating system managed by the virtual machine monitor system.
[0063] In an exemplary embodiment, when the system on chip is started, before executing the preliminary startup process, the method further includes:
[0064] Sending the vehicle identification code of the vehicle to the cloud server, wherein the vehicle identification code of the vehicle is used to verify the legitimacy of the vehicle;
[0065] Receiving a session key returned by the cloud server when the legitimacy verification of the vehicle is passed, wherein the session key includes a public key of the cloud server;
[0066] receiving an update message sent by a cloud server, wherein the update message is a session message sent by the cloud server to the vehicle, the update message carries an operating system update package encrypted using a private key of the cloud server, and the operating system update package includes a set of system files of a fourth operating system;
[0067] In response to the received update message, decrypt the encrypted operating system update package using the public key of the cloud server to obtain a set of system files of the fourth operating system;
[0068] A set of system files of the fourth operating system is saved, and a system registry is updated based on the set of system files of the fourth operating system.
[0069] It should be noted that the VIN (Vehicle Identification Number) code is a unique identifier for each car, similar to the vehicle's ID number. The vehicle identification code is used to verify the legality of the vehicle. Specifically, after the cloud server receives the vehicle identification code, it will perform legality verification. The verification process usually involves comparing the received vehicle identification code with the database for vehicle identification codes stored on the cloud server to confirm the identity and legal rights of the vehicle.
[0070] The session key can be a temporary key used in a specific communication session. The session key can be generated by the cloud server, mainly including the public key of the cloud server, and is used for subsequent encrypted communications.
[0071] The public and private keys of the cloud server are used to achieve secure data transmission. The cloud server has a public-private key pair, where the public key is public and can be used by any entity that needs to communicate with the cloud server, while the private key is only stored inside the cloud server and is used to decrypt received messages or encrypt sent messages.
[0072] For example, when the system on chip is in the startup state, the vehicle will send the vehicle identification code to the cloud server. The cloud server receives the vehicle identification code and performs a legitimacy verification. If the cloud server passes the legitimacy verification of the vehicle, it will return the session key to the vehicle. If the legitimacy verification fails, the cloud server will reject any update request.
[0073] The vehicle receives an update message sent by a cloud server, wherein the update message belongs to a session message sent by the cloud server to the vehicle, and the update message carries an operating system update package encrypted using a private key of the cloud server, and the operating system update package includes a set of system files of a fourth operating system. The vehicle decrypts the encrypted operating system update package using the public key of the cloud server according to the received update message, and can obtain a set of system files of the fourth operating system, and saves the set of system files of the fourth operating system to a designated storage space, thereby updating the system configuration table based on the set of system files of the fourth operating system, and updating the system registry according to the system configuration table to reflect the configuration information of the new version, and preparing to start the updated system.
[0074] Optionally, a group of fourth operating systems may include at least one fourth operating system, and the fourth operating system may be understood as an operating system instance that is newly added or updated through a remote update mechanism. In the case where the fourth operating system is an updated operating system instance, it may be understood that the fourth operating system itself belongs to a group of first operating systems, but is an operating system with a different system version.
[0075] Through this embodiment, when the legitimacy verification of the vehicle is passed, the operating system update package is decrypted by the public key of the cloud server, and a set of system files of the fourth operating system are obtained and saved from the decrypted operating system update package, so as to update the system registry according to the system files of the fourth operating system, thereby ensuring the security, legitimacy and efficiency of the operating system update, and providing the vehicle with powerful remote maintenance and upgrade capabilities.
[0076] In an exemplary embodiment, step 204 includes: executing a first boot process, wherein the first boot process includes the following operations: a hardware initialization operation, and a file loading operation of loading an image file of a second boot process in a non-volatile memory into a random access memory;
[0077] A second startup process is executed, wherein the second startup process includes a preloading operation of a system register required for startup of the virtual machine monitor system and a startup management service of the virtual machine monitor system.
[0078] It should be noted that the preliminary startup process may include a first startup process and a second startup process. When the system on chip is started, the first startup process is executed first, and after the first startup process is completed, the second startup process is executed. Specifically, there may be a built-in BL (Boot Loader) in the system on chip, and the first startup process is usually executed by the boot loader, which is mainly responsible for hardware initialization operations and file loading operations of loading the image file of the second startup process in the non-volatile memory into the random access memory. Among them, hardware initialization may include but is not limited to: initializing the CPU core and cache; setting the memory controller; configuring the clock frequency; setting the power management unit; initializing the communication interface to communicate with the startup management service or other system components in the virtual machine monitor system. After completing the hardware initialization, the image file of the second startup process in the non-volatile memory is loaded into the random access memory.
[0079] The second startup process may include preloading operations of system registers required for the startup of the virtual machine monitor system and the startup management service of the virtual machine monitor system. Optionally, the second startup process may be used to preload image files of system registers required for configuring the virtual machine monitor system, preload image files of encryption function responses required by the system, involving fingerprint, facial recognition, etc., and preload image files of the startup management service for starting the virtual machine monitor system, and maintain description information of these image files.
[0080] Through this embodiment, through the hardware initialization of the first startup process and the preloading operation of the second startup process, the time for starting the virtual machine monitor system and a group of first operating systems is reduced, and the startup speed of the system is improved.
[0081] In an exemplary embodiment, after starting a set of first operating systems, the method further includes:
[0082] monitoring actual resource usage of each first operating system of a group of first operating systems;
[0083] Determining a system weight of each first operating system according to actual resource usage of each first operating system and a task level of a task executed by each first operating system;
[0084] According to the system weight of each first operating system, the hardware resources configured for each first operating system are adjusted.
[0085] It should be noted that the virtual machine monitor system or the startup management service in the virtual machine monitor system can continuously monitor the hardware resources consumed by each first operating system, including CPU, memory usage, peripheral access frequency, etc. The monitoring data can be real-time or based on an average value within a preset time.
[0086] Task level can be used to reflect the priority and importance of tasks performed by the operating system. For example, tasks related to vehicle safety (such as brake system control) may be ranked higher than tasks in the entertainment system. System weight is calculated based on actual resource usage and task level. Operating systems with higher weights will be given priority to allocate more hardware resources. Algorithms for calculating system weights may include, but are not limited to: weighted average method, priority scheduling algorithm, dynamic resource allocation algorithm, etc.
[0087] Specifically, according to the system weight of each first operating system, the virtual machine monitor system will dynamically adjust the hardware resources allocated to each operating system. For example, if it is detected that a first operating system is executing a task with a higher task level, but its resource allocation is insufficient, the virtual machine monitor system will reallocate resources, increase the number of CPU cores, memory capacity or optimize peripheral access rights of the operating system to ensure efficient execution of key tasks. Conversely, if the resource usage of a first operating system is far lower than its allocated amount, the virtual machine monitor system may recycle excess resources for use by other first operating systems, thereby improving overall resource utilization.
[0088] Optionally, the resource usage of the first operating system at a historical moment may be taken into consideration to further adjust the system weight of the first operating system.
[0089] Through this embodiment, the first operating system after startup is dynamically monitored, and resource allocation is adjusted according to the actual monitoring results, which can ensure that hardware resources are optimally utilized, avoid resource waste, and improve the execution efficiency of key tasks. In addition, the dynamic adjustment mechanism can be adjusted according to the real-time system status and task requirements, enhancing the system's adaptability and flexibility.
[0090] In order to better understand the startup control process of the system on chip, an example is used to illustrate: Figure 3 FIG. 1 is a flow chart of another optional system-on-chip startup control method according to an embodiment of the present application, such as Figure 3 As shown, the following steps may be included:
[0091] Step S301, when the system on chip is started, a preliminary startup process is performed;
[0092] Optionally, the preliminary startup process includes a first startup process and a second startup process. When the system on chip is started, the first startup process and the second startup process are first executed.
[0093] Step S302, configuring the system registers required by the virtual machine monitor system;
[0094] Step S303, starting the virtual machine monitor system;
[0095] Step S304, reading the system configuration table and system registry of the virtual machine monitor system;
[0096] Step S305, determining whether to update the system registry according to the system configuration table;
[0097] Specifically, if the system registry needs to be updated, jump to step S306; if the system registry does not need to be updated, jump to step S307.
[0098] Step S306, updating the system registry;
[0099] It should be noted that there are mainly three situations in which the system registry needs to be updated. The first is that the system configuration table contains a first operating system that is not recorded in the system registry; the second is that the system registry contains a second operating system, and the second operating system is not included in the first operating system in the system configuration table; the third is that the system registry contains a third operating system, the third operating system belongs to a group of first operating systems, and the system version of the third operating system recorded in the system registry is different from the system version of the third operating system indicated in the system configuration table.
[0100] Step S307, allocating resources to each first operating system in the system registry;
[0101] Step S308, starting each first operating system in the system registry;
[0102] Step S309, monitoring actual resource usage of each first operating system in a group of first operating systems;
[0103] Step S310: adjusting the hardware resources configured by each first operating system.
[0104] Optionally, the hardware resources configured for each first operating system are adjusted according to the actual usage of resources of each first operating system and the task level of the task executed by each first operating system.
[0105] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0106] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.
[0107] According to another aspect of the embodiments of the present application, a startup control device for a system on chip is also provided, and the device is used to implement the startup control method for the system on chip provided in the above-mentioned embodiments, which has been described and will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0108] Figure 4 is a structural block diagram of an optional system-on-chip startup control device according to an embodiment of the present application, such as Figure 4 As shown, the device may include:
[0109] An execution module 402 is used to execute a preliminary startup process when the system on chip is started;
[0110] The first startup module 404 is used to configure the system registers required by the virtual machine monitor system and start the virtual machine monitor system when the initial startup process is completed;
[0111] The second startup module 406 is used to allocate hardware resources to a group of first operating systems indicated by the system registry of the virtual machine monitor system and start the group of first operating systems, wherein the system registry is used to configure the operating system to be started by the virtual machine monitor system, and the started group of first operating systems runs in the virtual environment provided by the virtual machine monitor system.
[0112] In an exemplary embodiment, before allocating hardware resources to a group of first operating systems indicated by a system registry of a virtual machine monitor system, the startup control device of the system on chip further includes:
[0113] A reading module, used for reading a system configuration table of a virtual machine monitor system, wherein the system configuration table is used for indicating an operating system to be started by the system on chip, and the operating system indicated by the system configuration table is a group of first operating systems;
[0114] A first updating module is used to add system information of the first operating system to the system registry to update the system registry when a group of first operating systems includes a first operating system that is not recorded in the system registry;
[0115] The second updating module is used to delete the system information of the second operating system in the system registry to update the system registry when the operating systems recorded in the system registry include a second operating system that does not belong to a group of first operating systems.
[0116] In an exemplary embodiment, the system registry is further used to configure the system version of the operating system to be started by the virtual machine monitor system, and the system configuration table is used to indicate the system version of the operating system to be started by the system on chip.
[0117] After reading the system configuration table of the virtual machine monitor system, the startup control device of the system on chip further includes:
[0118] A third update module is used to update the system version of the third operating system recorded in the system registry according to the system version of the third operating system indicated by the system configuration table, so as to update the system registry when the third operating system recorded in the system registry belongs to a group of first operating systems and the system version of the third operating system recorded in the system registry is different from the system version of the third operating system indicated by the system configuration table.
[0119] In an exemplary embodiment, after adding the system information of the first operating system to the system registry, the startup control device of the system on chip further includes:
[0120] A search module is used to search for a group of operating system files stored in a designated storage space of the system on chip, wherein each operating system file in the group of operating system files is a system file of an operating system;
[0121] A first sending module, configured to send a request message to a cloud server when a group of operating system files does not include a system file of the first operating system, wherein the request message is used to request to obtain the system file of the first operating system;
[0122] The saving module is used to extract the system files of the first operating system from the response message when receiving the response message returned by the cloud server in response to the request message, and save the system files of the first operating system into the designated storage space.
[0123] In an exemplary embodiment, when the system on chip is started, before executing the preliminary startup process, the startup control device of the system on chip further includes:
[0124] A second sending module is used to send a vehicle identification code of the vehicle to the cloud server, wherein the vehicle identification code of the vehicle is used to verify the legitimacy of the vehicle;
[0125] A first receiving module, used to receive a session key returned by the cloud server when the legitimacy verification of the vehicle is passed, wherein the session key includes a public key of the cloud server;
[0126] A second receiving module is used to receive an update message sent by the cloud server, wherein the update message is a session message sent by the cloud server to the vehicle, and the update message carries an operating system update package encrypted using a private key of the cloud server, and the operating system update package includes a set of system files of a fourth operating system;
[0127] a decryption module, configured to, in response to the received update message, decrypt the encrypted operating system update package using the public key of the cloud server to obtain a set of system files of the fourth operating system;
[0128] The fourth updating module is used to save a set of system files of a fourth operating system and update the system registry based on the set of system files of the fourth operating system.
[0129] In an exemplary embodiment, the execution module 402 is also used to: execute a first startup process, wherein the first startup process includes the following operations: a hardware initialization operation, and a file loading operation of loading an image file of a second startup process in a non-volatile memory into a random access memory; and execute a second startup process, wherein the second startup process includes a preloading operation of system registers required for starting a virtual machine monitor system and a startup management service of the virtual machine monitor system.
[0130] In an exemplary embodiment, after starting a set of first operating systems, the startup control device of the system on chip further includes:
[0131] A monitoring module, used to monitor actual resource usage of each first operating system of a group of first operating systems;
[0132] A determination module, configured to determine a system weight of each first operating system according to actual resource usage of each first operating system and a task level of a task executed by each first operating system;
[0133] The adjustment module is used to adjust the hardware resources configured for each first operating system according to the system weight of each first operating system.
[0134] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0135] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided. The computer-readable storage medium includes a stored program, wherein the program executes the steps of any of the above method embodiments when it is run.
[0136] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, a ROM, a RAM, a mobile hard disk, a magnetic disk, or an optical disk.
[0137] According to another aspect of the embodiments of the present application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to execute the steps in any of the above method embodiments through the computer program. In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0138] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.
[0139] According to another aspect of the embodiment of the present application, a computer program product is also provided, which includes a computer program / instruction, and the computer program / instruction contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit 501, various functions provided by the embodiment of the present application are executed. The above-mentioned serial numbers of the embodiments of the present application are only for description and do not represent the advantages and disadvantages of the embodiments.
[0140] Figure 5 is a block diagram of a computer system structure of an optional electronic device according to an embodiment of the present application. Figure 5 As shown, the computer system 500 includes a CPU (Central Processing Unit) 501, which can perform various appropriate actions and processes according to the program stored in the ROM 502 or the program loaded from the storage part 508 to the RAM 503. Various programs and data required for system operation are also stored in the random access memory 503. The central processing unit 501, the read-only memory 502 and the random access memory 503 are connected to each other through a bus 504. An I / O (Input / Output) interface 505 is also connected to the bus 504.
[0141] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a CRT (CathodeRay Tube), an LCD (Liquid Crystal Display), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the input / output interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed so that a computer program read therefrom is installed into the storage section 508 as needed.
[0142] In particular, according to an embodiment of the present application, the process described in each method flow chart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains a program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processor 501, various functions defined in the system of the present application are executed.
[0143] It should be noted that Figure 5 The computer system 500 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0144] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
[0145] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.
Claims
1. A startup control method for a system on chip, characterized in that: Applied to a vehicle, the method comprises: When the system on chip is started, a preliminary startup process is performed; When the preliminary startup process is completed, configuring the system registers required by the virtual machine monitor system and starting the virtual machine monitor system; Allocate hardware resources to a group of first operating systems indicated by a system registry of the virtual machine monitor system, and start the group of first operating systems, wherein the system registry is used to configure the operating system to be started by the virtual machine monitor system, and the group of first operating systems after starting run in a virtual environment provided by the virtual machine monitor system.
2. The method according to claim 1, characterized in that Before allocating hardware resources to a group of first operating systems indicated by a system registry of the virtual machine monitor system, the method further includes: Reading a system configuration table of the virtual machine monitor system, wherein the system configuration table is used to indicate an operating system to be started by the system on chip, and the operating system indicated by the system configuration table is the group of first operating systems; In a case where the group of first operating systems includes a first operating system that is not recorded in the system registry, adding system information of the first operating system to the system registry to update the system registry; In a case where the operating systems recorded in the system registry include a second operating system that does not belong to the group of first operating systems, system information of the second operating system in the system registry is deleted to update the system registry.
3. The method according to claim 2, characterized in that The system registry is further used to configure the system version of the operating system to be started by the virtual machine monitor system, and the system configuration table is used to indicate the system version of the operating system to be started by the system on chip; After reading the system configuration table of the virtual machine monitor system, the method further includes: In a case where the third operating system recorded in the system registry belongs to the group of first operating systems, and the system version of the third operating system recorded in the system registry is different from the system version of the third operating system indicated by the system configuration table, the system version of the third operating system recorded in the system registry is updated according to the system version of the third operating system indicated by the system configuration table to update the system registry.
4. The method according to claim 2, characterized in that: After adding the system information of the first operating system to the system registry, the method further includes: Searching for a group of operating system files stored in a designated storage space of the system on chip, wherein each operating system file in the group of operating system files is a system file of an operating system; In a case where the set of operating system files does not include the system file of the first operating system, sending a request message to the cloud server, wherein the request message is used to request to obtain the system file of the first operating system; When a response message is received from the cloud server in response to the request message, the system files of the first operating system are extracted from the response message, and the system files of the first operating system are saved in the designated storage space.
5. The method according to claim 1, characterized in that When the system on chip is started, before executing the preliminary startup process, the method further includes: Sending a vehicle identification code of the vehicle to a cloud server, wherein the vehicle identification code of the vehicle is used to verify the legitimacy of the vehicle; Receiving a session key returned by the cloud server when the legitimacy verification of the vehicle is passed, wherein the session key includes a public key of the cloud server; receiving an update message sent by the cloud server, wherein the update message belongs to a session message sent by the cloud server to the vehicle, the update message carries an operating system update package encrypted using a private key of the cloud server, and the operating system update package includes a set of system files of a fourth operating system; In response to the received update message, decrypt the encrypted operating system update package using the public key of the cloud server to obtain the set of system files of the fourth operating system; The set of system files of the fourth operating system is saved, and the system registry is updated based on the set of system files of the fourth operating system.
6. The method according to claim 1, characterized in that When the system on chip is started, a preliminary startup process is performed, including: Executing a first startup process, wherein the first startup process includes the following operations: a hardware initialization operation, and a file loading operation of loading an image file of a second startup process in a non-volatile memory into a random access memory; The second startup process is executed, wherein the second startup process includes a preloading operation of a system register required for startup of the virtual machine monitor system and a startup management service of the virtual machine monitor system.
7. The method according to any one of claims 1 to 6, characterized in that After starting the set of first operating systems, the method further includes: monitoring actual resource usage of each first operating system of the group of first operating systems; Determining a system weight of each first operating system according to actual resource usage of each first operating system and a task level of a task executed by each first operating system; According to the system weight of each first operating system, the hardware resources configured for each first operating system are adjusted.
8. A startup control device for a system on chip, characterized in that: Applied to a vehicle, the device comprises: An execution module, used for executing a preliminary startup process when the system on chip is started; A first startup module, configured to configure system registers required by a virtual machine monitor system and start the virtual machine monitor system when the preliminary startup process is completed; The second startup module is used to allocate hardware resources to a group of first operating systems indicated by the system registry of the virtual machine monitor system and start the group of first operating systems, wherein the system registry is used to configure the operating system to be started by the virtual machine monitor system, and the group of first operating systems after startup run in the virtual environment provided by the virtual machine monitor system.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 7 when executed by a processor.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.