Background
The Linux operating system has the characteristics of free openness, strong kernel vehicle-mounted functions, low requirement on hardware resources, multi-platform support, more developers and the like, so that the Linux operating system is widely applied to various fields, particularly the vehicle-mounted control field.
In order to improve the operation efficiency of a vehicle-mounted system, a multi-core scheme is usually adopted, and other cores are often used for realizing auxiliary vehicle-mounted functions such as display of the vehicle-mounted system, when the vehicle-mounted system is started, a kernel (operating system kernel) is mostly guided to be started by uboot (Universal Boot Loader, an open source code item following a GPL term), and then other cores are started, however, in the process of realizing the present invention, the inventor finds that at least the following problems exist in the prior art: because other cores need to start loading and starting after the completion of the starting of the inner core, the multi-core scheme causes the starting time of the vehicle-mounted system to be longer, and the user experience is influenced.
Disclosure of Invention
In view of the above, it is necessary to provide an in-vehicle system starting method, an in-vehicle system starting device, an in-vehicle device, a vehicle and a readable storage medium to solve the above problems.
The embodiment of the application provides a linux-based vehicle-mounted system starting method, wherein the vehicle-mounted system is applied to a vehicle and comprises a main core and a plurality of auxiliary cores, and the method comprises a U-Boot stage and a kernel stage;
the U-Boot stage comprises:
determining a slave core to be started;
executing a first preprocessing flow according to the slave core to be started;
acquiring a first address of the slave core and updating the first address into a first page table;
initiating a boot to perform a boot of the master core and an early boot of at least one of the slave cores;
the kernel phase includes:
updating a first address of the slave core into a second page table;
executing a second preprocessing flow;
performing addressing based on the second page table;
establishing a communication connection;
performing a late attach of an early booted slave core to establish communication between the slave core and the master core.
Therefore, the plurality of slave cores to be started are started in the phase from U-Boot in advance, so that the corresponding vehicle-mounted functions of the plurality of slave cores take effect in advance, and the communication between the plurality of slave cores and the kernel is established after the plurality of slave cores are started. By the method, the starting time of the plurality of slave cores can be integrally advanced, and the plurality of slave cores and the kernel are synchronously started, so that the starting time is reduced, and the realization of the vehicle-mounted function preset by a user is advanced.
In some embodiments, the determining the slave core to be started specifically includes:
acquiring a control instruction input by a user;
matching the control instruction with the corresponding vehicle-mounted function to determine the vehicle-mounted function selected by the user;
and matching the vehicle-mounted function with a plurality of slave cores to determine the slave core executing the vehicle-mounted function.
In this way, the slave core to be started is determined according to the control instruction input by the user, and further, the slave core started each time the vehicle-mounted system is started can be determined according to the user requirement.
In some embodiments, executing the first preprocessing flow according to the slave core to be started specifically includes:
acquiring a second address and sending a control command to place the compressed file of the slave core to be started at the second address;
and distributing corresponding storage space according to the compressed file, wherein the storage space is used for storing the compressed file and the decompressed file.
Therefore, the compressed file of the slave core is placed in the address of the U-Boot, so that the U-Boot can be conveniently loaded, and meanwhile, a corresponding storage space needs to be allocated, so that the compressed file and the decompressed file of the compressed file can be conveniently stored.
In some embodiments, the in-vehicle system includes a remote communication module for establishing communication with the early-booted slave core, the method further comprising, prior to establishing a communication connection:
setting the telecommunications module to a built-in mode.
The mode of the remote communication module is changed, so that the kernel as a master core establishes communication with the plurality of slave cores in advance.
In some embodiments, the executing the second pre-processing flow further comprises:
determining a started slave core;
closing the initialized configuration of the started slave core;
closing the reset remote process of the started slave core;
and closing the timer vehicle-mounted function of the started slave core.
Thus, since a plurality of slave cores are started in advance, the later attachment of the slave cores is prevented from being influenced by the configuration.
In some embodiments, before initiating the boot to perform the boot of the master core and the early boot of the at least one slave core, the method further comprises:
judging whether the files of the slave core are compressed or not;
if not, decompressing the file, and loading the decompressed file into an internal memory;
and if so, loading the decompressed file into the memory.
By judging whether the files of the slave core are compressed before the initialization starting, the decompressed files are prevented from being decompressed again, and the starting time is reduced.
The embodiment of the application simultaneously provides a vehicle-mounted system starting device, which is applied to a vehicle, wherein the vehicle-mounted system comprises a main core and a plurality of slave cores, and the vehicle-mounted system starting device comprises;
the determining module is used for determining a slave core to be started;
the execution module is used for executing a first preprocessing flow according to the slave core to be started;
the updating module is used for acquiring a first address of the slave core and updating the first address into a first page table;
a boot module to initiate a boot to perform a boot of the master core and an early boot of at least one of the slave cores;
further, the update module is further configured to update the first address of the slave core into a second page table;
the execution module is also used for executing a second preprocessing flow;
an addressing module to perform addressing based on the second page table;
the communication module is used for establishing communication connection;
the execution module is further to perform a late attach of the slave core that is early booted to establish communication between the slave core and the master core.
Therefore, the plurality of slave cores to be started are started in the phase from U-Boot in advance, so that the corresponding vehicle-mounted functions of the plurality of slave cores take effect in advance, and the communication between the plurality of slave cores and the kernel is established after the plurality of slave cores are started. Through the device, the starting time of the plurality of slave cores can be integrally advanced, and the plurality of slave cores and the kernel are synchronously started, so that the starting time is reduced, and the realization of the vehicle-mounted function preset by a user is advanced.
The application also provides an on-board device, which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor executes the computer program to realize the steps of the on-board system starting method according to the embodiment.
The vehicle-mounted device starts a plurality of to-be-started slave cores to the U-Boot stage in advance, so that the vehicle-mounted functions corresponding to the slave cores take effect in advance, and the communication between the slave cores and the kernel is established after the slave cores are started in the later period of the slave cores. The starting time of the plurality of slave cores is integrally advanced, and the plurality of slave cores and the kernel are synchronously started, so that the starting time is reduced, and the realization of the vehicle-mounted function preset by a user is advanced.
The application simultaneously provides a vehicle, includes above-mentioned embodiment the car-mounted device.
The vehicle-mounted device of the vehicle starts a plurality of slave cores to be started to a U-Boot stage in advance, so that the vehicle-mounted functions corresponding to the slave cores are started in advance, and the communication between the slave cores and the kernel is established after the slave cores are started. The starting time of the plurality of slave cores is integrally advanced, and the plurality of slave cores and the kernel are synchronously started, so that the starting time is reduced, and the realization of the vehicle-mounted function preset by a user is advanced.
The present application also provides a computer-readable storage medium, which stores a computer program, and the computer program, when executed by a processor, implements the steps of the vehicle-mounted system starting method according to the above embodiment.
Therefore, the vehicle-mounted system starting method can be realized by the computer program stored in the computer readable storage medium, so that the starting time is reduced, and the vehicle-mounted functions preset by a user are realized in advance.
Detailed Description
In order that the objects, features and advantages of the present application can be more clearly understood, the present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict. In the following description, numerous specific details are set forth to provide a thorough understanding of the present application, and the described embodiments are merely a subset of the embodiments of the present application and are not intended to be a complete embodiment.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
Referring to fig. 1 and fig. 2, fig. 1 and fig. 2 are schematic flow charts of a vehicle-mounted system starting method according to an embodiment of the present application. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs. For convenience of explanation, only portions related to the embodiments of the present application are shown.
The vehicle-mounted system starting method is applied to the vehicle. The vehicle-mounted system of the vehicle is realized through multiple cores and comprises a main core and a plurality of slave cores, wherein the main core is a core for independently realizing functions, the slave cores are cores for realizing the functions based on communication connection, and the slave cores are mainly used for realizing auxiliary functions of the vehicle, such as screen display and annular display, and are used for helping a user to know vehicle conditions or vehicle surrounding side environment conditions when the vehicle is started so as to improve the experience of the user in using the vehicle. The starting method of the vehicle-mounted system comprises the following steps.
The vehicle-mounted system starting method comprises a U-Boot stage and a kernel stage, wherein the U-Boot is a Boot loader mainly used for an embedded system, and the U-Boot stage is mainly used for starting a master Boot program after the vehicle-mounted system is started. It is understood that kernel is the main core of the vehicle-mounted system.
Further, referring to fig. 1 again, the U-Boot stage mainly includes the following steps:
step S101: and determining the slave core to be started.
It can be understood that the plurality of slave cores can realize different vehicle-mounted functions according to actual requirements, such as a vehicle-mounted display function of a vehicle-mounted system and a vehicle-mounted all-around vehicle-mounted function, so that a user can acquire the starting entrance of the vehicle-mounted system and the surrounding environment condition after the vehicle is started in real time. In this way, the slave core to be started can be selected according to requirements.
In an embodiment, step S101 specifically includes:
and acquiring the vehicle-mounted functions selected by the user, wherein the vehicle-mounted functions comprise vehicle-mounted functions configured by system defaults and vehicle-mounted functions selected by the user actively, for example, the vehicle-mounted system is started to automatically check the health condition of the vehicle, and the vehicle endurance mileage and fuel consumption condition of the vehicle are displayed, or prompt music or voice is played when the vehicle-mounted system is started according to the selection of the user.
And matching the vehicle-mounted function with a plurality of slave cores to determine the slave core to be started.
And determining the corresponding slave core to be started according to the vehicle-mounted function used for pre-configuration.
Further, the vehicle-mounted function selected by the user can be determined by acquiring a control instruction input by the user through an operation control device when the vehicle-mounted system is started and matching the control instruction with the corresponding vehicle-mounted function; and matching the vehicle-mounted function with a plurality of slave cores to determine the slave core executing the vehicle-mounted function. That is, the slave core to be started can be started at the vehicle-mounted system and selected by user input.
Step S102: and executing a first preprocessing flow according to the slave core to be started.
Specifically, step S102 specifically includes:
acquiring a second address of the U-Boot and sending a control command to place a compressed file of the slave core at the second address;
and distributing corresponding storage space according to the compressed file, wherein the storage space is used for storing the compressed file and the decompressed file of the compressed file.
Specifically, the compressed file of the slave core is placed in a partition or a storage file consistent with the U-Boot, so that the U-Boot can read the file and allocate a storage space for the compressed file.
In this embodiment, the compressed file is a file in an lzop compression format.
Step S103: and acquiring a first address of the slave core and updating the first address into a first page table.
Thus, the U-Boot is convenient to load the firmware of the slave core to be started according to the address in the first page table.
Step S104: initiating a boot to perform a boot of the master core and an early boot of at least one slave core.
In this way, the early stage guide of the slave core is executed in advance in the U-Boot stage, so that the vehicle-mounted function selected by the user and corresponding to the slave core is realized in advance.
In an embodiment, step S104 further includes:
judging whether the files of the slave core are compressed or not;
if not, decompressing the file, and loading the decompressed file into an internal memory;
and if so, loading the decompressed file into the memory.
In order to reduce the occupation of the storage space, most of the Linux kernels and files are compressed, and the Linux kernels and files loaded into the internal memory cannot be compressed, so that the compressed Linux kernels and files need to be decompressed and then loaded into the internal memory.
Further, the kernel is a Linux operating system and is responsible for program scheduling and management of various hardware resources, the kernel stage is mainly used for starting the kernel and establishing communication between the kernel and the slave core, please refer to fig. 2 again, and the kernel stage mainly includes the following steps:
step S201: the EDMA vehicle-mounted function of the main core configuration is closed.
Wherein, EMMA (enhanced direct memory access) is enhanced direct memory access for fast data exchange. Because the slave core executes the EDMA vehicle-mounted function in advance in the U-Boot stage, the master core is closed to configure the EDMA vehicle-mounted function, and repeated execution is avoided.
It is understood that in another embodiment, the EDMA in-vehicle function may be adaptively turned off based on the start-up condition of the slave core, and step S201 may be omitted.
Step S202: updating the first address of the early-guided slave core into the kernel second page table.
Specifically, the address of the slave core is updated into the second page table of the kernel to facilitate addressing by the kernel.
Step S203: and executing a second preprocessing flow.
Specifically, the kernel is configured in advance so as to realize the kernel as communication between the master core and the plurality of slave cores.
In an embodiment, step S203 specifically includes:
determining a started slave core;
closing the initialized configuration of the started slave core;
closing the reset remote process of the started slave core;
and closing the timer vehicle-mounted function of the started slave core.
In particular, since multiple slave cores are already running, the above on-board function reset may result in a late attachment failure of the slave cores.
Step S204: performing addressing based on the second page table.
In particular, addressing of the slave core is performed based on the address of the slave core in the second page table.
Step S205: a communication connection is established.
Specifically, the necessary configuration of the communication connection of the master core is performed.
Further, the in-vehicle system has a remote communication module therein for establishing communication with the plurality of slave cores, and step S205 further includes:
the telecommunications module is set to a built-in mode. Therefore, remote communication is started in advance, communication is established with a plurality of slave cores earlier, and starting time is optimized.
Step S206: performing a late attach of an early booted slave core to establish communication between the slave core and the master core.
Specifically, the kernel acquires the address of the slave core through the second page table and performs addressing to establish communication between the slave core and the kernel, and the early starting of the plurality of slave cores is completed.
Therefore, the plurality of slave cores to be started are started in the phase from U-Boot in advance, so that the corresponding vehicle-mounted functions of the plurality of slave cores take effect in advance, and the communication between the plurality of slave cores and the kernel is established after the plurality of slave cores are started. By the method, the starting time of the plurality of slave cores can be integrally advanced, and the plurality of slave cores and the kernel are synchronously started, so that the starting time is reduced, and the advance realization of the vehicle-mounted function preset by a user is realized.
The sequence number of each step in the foregoing embodiments does not mean the execution sequence, and the execution sequence of each process should be determined by the vehicle-mounted function and the internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
Fig. 1 and 2 describe in detail a vehicle-mounted system starting method of the present application, by which a vehicle-mounted function preset by a user can be implemented in advance. The functional modules and the hardware device architecture for implementing the vehicle-mounted system starting device are described below with reference to fig. 3 and 4. It is to be understood that the embodiments are illustrative only and that the scope of the claims is not limited to this configuration.
Fig. 3 is a functional block diagram of an in-vehicle system starting apparatus according to an embodiment of the present application.
In some embodiments, the in-vehicle system starting apparatus 100 may include a plurality of functional modules composed of program code segments. The program codes of the respective program segments in the in-vehicle system starting apparatus 100 may be stored in the memory of the in-vehicle apparatus 10 and executed by at least one processor in the in-vehicle apparatus 10 to implement the in-vehicle system starting function.
Referring to fig. 3, in the present embodiment, the vehicle-mounted system starting apparatus 100 may be divided into a plurality of functional modules according to the functions performed by the apparatus, and the functional modules are used for executing the steps in the corresponding embodiments of fig. 1 and 2 to realize the function of starting the vehicle-mounted system. In the present embodiment, the functional blocks of the in-vehicle system starting apparatus 100 include: the system comprises a determining module 101, an executing module 102, an updating module 103, a starting module 104, a judging module 105, a compressing module 106, a loading module 107, an addressing module 108 and a communication module 109.
A determining module 101, configured to determine a slave core to be started;
an execution module 102, configured to execute a first preprocessing flow according to the slave core to be started;
an update module 103, configured to obtain a first address of an early-booted slave core and update the first address into a first page table;
a boot module 104 configured to initiate a boot to perform a boot of the master core and an early boot of at least one of the plurality of slave cores;
further, the update module 103 is further configured to update the first address of the slave core into the second page table of the kernel;
the execution module 102 is further configured to execute a second preprocessing flow.
Specifically, the second preprocessing flow is a processing measure performed before the communication is established between the master core and the slave core, so as to avoid affecting the late attachment flow of the slave core.
An addressing module 108 for performing addressing based on the second page table.
In particular, addressing of the slave core is performed based on the address of the slave core in the second page table.
And a communication module 109 for establishing a communication connection.
Specifically, the necessary configuration of the communication connection of the master core is performed.
The execution module 102 is further configured to perform a late attach of the slave core to establish communication between the slave core and the master core.
Therefore, the plurality of slave cores to be started are started in the phase from U-Boot in advance, so that the corresponding vehicle-mounted functions of the plurality of slave cores take effect in advance, and the communication between the plurality of slave cores and the kernel is established after the plurality of slave cores are started. Through the device, the starting time of the plurality of slave cores can be integrally advanced, and the plurality of slave cores and the kernel are synchronously started, so that the starting time is reduced, and the realization of the vehicle-mounted function preset by a user is advanced.
Further, the determining module 101 includes:
and the first sub-acquisition module is used for acquiring the control instruction input by the user. The control command can be command information input by a user through a key or a touch screen.
The sub-matching module is used for matching the control instruction with the corresponding vehicle-mounted function so as to determine the vehicle-mounted function selected by the user;
the sub-matching module is further used for matching the vehicle-mounted function with a plurality of slave cores so as to determine the slave core executing the vehicle-mounted function.
Further, the executing module 102 includes:
and the second sub-obtaining module is used for obtaining a second address of the U-Boot.
The sub-control module is used for sending a control command to place the compressed file of the slave core at the second address;
and the sub-distribution module is used for distributing corresponding storage space according to the compressed file, and the storage space is used for storing the compressed file and the decompressed file of the compressed file.
Further, the kernel includes a remote communication module for establishing communication with the slave core, and the execution module 102 further includes:
and the sub-setting module is used for setting the remote communication module to be in a built-in mode.
Further, the executing the second preprocessing flow further includes:
the sub-determination module is used for determining the started slave core;
the sub-closing module is used for closing the initialized configuration of the started slave core and closing the reset remote process of the started slave core; and closing the timer vehicle-mounted function of the started slave core.
The functional modules of the vehicle-mounted system starting device 100 further include:
a judging module 105, configured to judge whether a file of the slave core is compressed;
if not, the compression module 106 is configured to decompress the file, and the loading module 107 sends a loading instruction to load the decompressed file into the memory;
if yes, the loading module 107 sends a loading instruction to load the decompressed file into the memory.
Fig. 4 is a schematic structural diagram of an in-vehicle device according to an embodiment of the present application. The vehicle-mounted device 10 comprises a memory 11, a processor 12 and a communication bus 13, wherein the memory 11 is connected with the processor 12 in a communication mode through the communication bus 13.
The in-vehicle device 10 further comprises a computer program 14, such as an in-vehicle system-initiated program, stored in the memory 11 and executable on the processor 12.
The steps of the method for starting the vehicle-mounted system in the embodiment of the method are realized when the computer program 14 is executed by the processor 12. Alternatively, the processor 12 executes the computer program 14 to realize the functions of the modules/units in the system embodiment.
Illustratively, the computer program 14 may be partitioned into one or more modules/units, which are stored in the memory 11 and executed by the processor 12 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 14 in the in-vehicle apparatus 10. For example, the computer program 14 may be partitioned into modules 101 and 109 in FIG. 3.
It will be understood by those skilled in the art that the schematic diagram 4 is merely an example of the in-vehicle apparatus 10, and does not constitute a limitation to the in-vehicle apparatus 10, and the in-vehicle apparatus 10 may include more or less components than those shown, or combine some components, or different components, for example, the in-vehicle apparatus 10 may further include an input device, etc.
The Processor 12 may be a Central Processing Unit (CPU), and may include other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, and the processor 12 is a control center of the in-vehicle apparatus 10 and connects various parts of the entire in-vehicle apparatus 10 by various interfaces and lines.
The memory 11 may be used for storing the computer program 14 and/or the modules/units, and the processor 12 may implement various functions of the in-vehicle apparatus 10 by running or executing the computer program and/or the modules/units stored in the memory 11 and calling data stored in the memory 11. The storage 11 may include an external storage medium and may also include a memory. In addition, the memory 11 may include a high speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The modules/units integrated with the in-vehicle apparatus 10 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the processes in the methods of the embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium and used by a processor to implement the steps of the embodiments of the methods. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
An embodiment of the present application provides a vehicle (not shown). The vehicle includes the vehicle-mounted device 10 described in the above embodiment. The vehicle-mounted device 10 of the vehicle starts a plurality of slave cores to be started to the U-Boot stage in advance, so that the vehicle-mounted functions corresponding to the slave cores are started in advance, and the communication with the kernel is established after the slave cores are started. Through the device, the starting time of the plurality of slave cores can be integrally advanced, and the plurality of slave cores and the kernel are synchronously started, so that the starting time is reduced, and the realization of the vehicle-mounted function preset by a user is advanced.
Finally, it should be noted that the above embodiments are only used for illustrating the technical solutions of the present application and not for limiting, and although the present application is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions can be made on the technical solutions of the present application without departing from the spirit and scope of the technical solutions of the present application.