Disclosure of Invention
The application provides a method, a device, equipment, a storage medium and a program product for starting an instrument, wherein a kernel is in a deep sleep state, so that the instrument can be directly awakened from the deep sleep state when a time-sharing operating system of the instrument is started, and the starting speed of the time-sharing operating system of the instrument is improved.
In a first aspect, the present application provides a method for starting an instrument, where the method is applied to a system that is simultaneously loaded with an instrument time-sharing operating system and a central control time-sharing operating system; the method comprises the following steps:
acquiring the state of a kernel when a first instruction for indicating to start an instrument is received;
when the state of the kernel is a deep sleep state, the kernel is controlled to be switched from the deep sleep state to a normal running state; the deep sleep state indicates that at least one application is in a suspended state and that no application in a foreground running state exists; the normal running state indicates that at least one application is in a foreground running state;
operating a first container corresponding to the instrument time-sharing operating system, starting the instrument time-sharing operating system through the first container, and displaying instrument information;
and running a second container corresponding to the central control time-sharing operating system, starting the central control time-sharing operating system through the second container, and displaying a central control interface.
Optionally, the method further comprises:
and when a second instruction for indicating to turn off the meter is received, controlling the kernel to enter a deep sleep state.
Optionally, controlling the kernel to enter a deep sleep state includes:
the control part is used for controlling the application in a suspended state and controlling the application which is outside the suspended state in a termination state in all the applications;
correspondingly, controlling the kernel to switch from the deep sleep state to the normal running state comprises the following steps:
controlling the kernel to wake up the part of the application in the suspended state.
Optionally, the method further comprises:
and when the kernel is in the deep sleep state, periodically running the application in the suspended state so as to enable the application to be in the background running state.
Optionally, the first container corresponding to the operating instrument time-sharing operating system starts the instrument time-sharing operating system through the first container, and displays instrument information, including:
operating a first container corresponding to the instrument time-sharing operating system, and starting the instrument time-sharing operating system by operating a file in the first container;
and after the instrument time-sharing operation system is started, controlling the back light of the instrument screen to start, and displaying instrument information through the instrument screen.
Optionally, the method further comprises:
before the kernel enters a deep sleep state, saving instrument information displayed by the instrument time-sharing operating system, wherein the instrument information comprises: mileage information and oil amount information.
Optionally, the first instruction is an instruction generated when the ACC gear of the automotive device is in an ON state; the second instruction includes an instruction generated when the ACC gear of the automotive device is in the OFF state.
In a second aspect, the present application provides an instrument start device, where the device is applied to a system that has an instrument time-sharing operating system and a central control time-sharing operating system simultaneously; the device comprises:
the acquisition module is used for acquiring the state of the kernel when a first instruction for indicating to start the instrument is received;
the control module is used for controlling the kernel to be switched from the deep sleep state to the normal running state when the state of the kernel is the deep sleep state; the deep sleep state indicates that at least one application is in a suspended state and that no application in a foreground running state exists; the normal running state indicates that at least one application is in a foreground running state;
the first processing module is used for operating a first container corresponding to the instrument time-sharing operating system, starting the instrument time-sharing operating system through the first container and displaying instrument information;
and the second processing module is used for running a second container corresponding to the central control time-sharing operating system, starting the central control time-sharing operating system through the second container and displaying a central control interface.
In a third aspect, the present application provides a meter start device comprising: a memory and at least one processor;
the memory stores computer-executable instructions;
the at least one processor executing computer-executable instructions stored in the memory causes the at least one processor to perform the method of any one of the first aspects.
In a fourth aspect, the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements a method according to any one of the first aspects.
In a fifth aspect, the present application provides a computer program product comprising a computer program/instruction which, when executed by a processor, implements a method according to any of the first aspects.
The application provides a method, a device, equipment, a storage medium and a program product for starting an instrument, wherein the method is applied to a system which is simultaneously provided with an instrument time-sharing operating system and a central control time-sharing operating system; the method comprises the following steps: acquiring the state of a kernel when a first instruction for indicating to start an instrument is received; when the state of the kernel is a deep sleep state, the kernel is controlled to be switched from the deep sleep state to a normal running state; the deep sleep state indicates that at least one application is in a suspended state and that no application in a foreground running state exists; the normal running state indicates that at least one application is in a foreground running state; operating a first container corresponding to the instrument time-sharing operating system, starting the instrument time-sharing operating system through the first container, and displaying instrument information; and the method comprises the steps of enabling the kernel to be in a deep sleep state, and waking up the kernel from the deep sleep state when the instrument is started again, so that the starting speed of the instrument can be improved.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented, for example, in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a schematic view of an application scenario provided in an embodiment of the present invention, as shown in fig. 1, a CPU11 is a central processing unit (Central Processing Unit) capable of responding to an instruction generated by an automobile device and controlling execution content of a kernel in an operating system. The central control system 12 and the instrument system 13 of the automobile equipment are positioned on an application layer facing to a user, and containers are respectively arranged in the central control system 12 and the instrument system 13 so as to realize the starting of different systems; the middle GUI is an interface layer and is used for providing rich functional controls and exquisite interface design functions; the bottom layer of the system is an operating system 15, including the construction of a file system and the running of a driver, while the kernel is the core of the operating system, and can determine when the program operates on each piece of hardware.
The central control system and the meter system are called as business function classification, the latter meter time-sharing operation system is the meter system, and the central control time-sharing operation system is the central control system.
In order to reduce the waste of hardware resources, the meter system 13 and the central control system share one chip, and the meter system 13 and the central control system 12 are simultaneously mounted on one system, such as a linux system. However, when the meter system 13 is mounted in the linux system, there is a problem in that the start speed is slow when the meter system is started.
Based on the above problems, the method and the device for controlling the internal core to be in the deep sleep state when the automobile equipment is not used, when the first instruction for starting the instrument is received, different operations are executed according to the state information of the internal core, and when the state information of the internal core is in the deep sleep state, the internal core is directly controlled to be switched from the deep sleep state to the normal running state, so that the internal core does not need to carry out a complete initialization process, and the starting speed of the instrument is accelerated.
The technical scheme of the invention is described in detail below by specific examples. The following embodiments may be combined with each other, and some embodiments may not be repeated for the same or similar concepts or processes.
Fig. 2 is a schematic flow chart of an instrument starting method according to an embodiment of the present invention, where the method provided in the embodiment may be executed by a CPU, as shown in fig. 2, and the method in the embodiment may include:
s201, acquiring the state of the kernel when a first instruction for indicating to start the instrument is received.
In this embodiment, when the first instruction for starting the meter is received, the state of the kernel in the system may be acquired first, and the states of the kernel may be two, where the kernel is not initialized when the automobile is started for the first time; the second case is when the kernel is in a deep sleep state; when the states of the cores are different, the cores can be controlled to execute different operations.
S202, when the state of the kernel is a deep sleep state, controlling the kernel to be switched from the deep sleep state to a normal running state; the deep sleep state indicates that at least one application is in a suspended state and that no application in a foreground running state exists; the normal running state indicates that at least one application is in a foreground running state.
When the kernel is in the deep sleep state, the kernel is directly controlled to wake up from the deep sleep state, namely, the kernel is controlled to be switched from the deep sleep state to the normal state.
When the kernel is in a deep sleep state, at least one application in all applications is in a suspended state, and the other applications are in a termination state, namely in a killing state, and meanwhile, no application in a foreground running state exists. When the kernel is in a deep sleep state, the instrument time-sharing operating system is also in a power-on state.
The normal running state refers to that at least one application is in a foreground running state, and can also allow part of the applications to be in a suspended state or in a background running state.
In addition, when the state of the kernel is not initialized, the kernel is controlled to perform initialization operation.
When the state of the kernel is not initialized, the kernel can be controlled to perform initialization operation. The kernel is software in the system, and can realize process management, memory management, IO management, file management, network management and the like. Specifically, the kernel of the system may be loaded into memory and the initialization of the kernel checking hardware and circuit logic controlled to facilitate the completion of subsequent meter starts.
Before the initialization operation, hardware power-up is needed, such as power-up of an embedded single board CPU chip and power-up of an instrument time-sharing operating system.
The state of the kernel is in an uninitialized state and can be determined by whether an instruction for starting the instrument is received for the first time. If an instruction for starting the instrument is received for the first time, the state of the kernel is not initialized, after the kernel is controlled to perform initializing operation, the instrument is further started, and after the automobile equipment is not used, the kernel is controlled to be in a deep sleep state; if the instruction for starting the instrument is not received for the first time, the state of the kernel is a deep sleep state, and the kernel can be directly awakened from the deep sleep state.
S203, operating a first container corresponding to the instrument time-sharing operating system, starting the instrument time-sharing operating system through the first container, and displaying instrument information.
And after the kernel wakes up from the deep sleep state, executing a flow of the first container corresponding to the time-sharing operating system of the running instrument, so that instrument information can be displayed on an instrument screen.
S204, running a second container corresponding to the central control time-sharing operating system, starting the central control time-sharing operating system through the second container, and displaying a central control interface.
The method comprises the steps of displaying instrument information, controlling the central control time-sharing operating system to start through a second container corresponding to the central control time-sharing operating system through the second container, and displaying a central control interface.
After the time-sharing operating system of the control instrument is started, the central control time-sharing operating system can be continuously started. In general, when a user is using an automobile device, it is necessary to determine the running condition of the vehicle from information displayed by an instrument. The central control time-sharing operating system is usually used for running the entertainment device, and has lower requirement on the starting speed of the central control time-sharing operating system, so that the central control time-sharing operating system can be started continuously after the instrument time-sharing operating system is started.
The instrument time-sharing operating system and the central control time-sharing operating system share a kernel, wherein the instrument time-sharing operating system can be a linux operating system; the central control time-sharing operating system can be an Android operating system. When the kernel is in a deep sleep state, the instrument time-sharing operating system and the central control time-sharing operating system are both in a sleep state, so that the instrument time-sharing operating system and the central control time-sharing operating system can be realized only by running the second container when the central control time-sharing operating system is started.
In this embodiment, when the automobile is not used, the control kernel is in a deep sleep state, and when the instrument time-sharing operating system is started, if the kernel is in the deep sleep state, the kernel is directly awakened from the deep sleep state, and the steps of powering on hardware and initializing the kernel are not required to be executed, so that the process of starting the instrument is saved, the starting speed of the instrument time-sharing operating system is improved, and when the instrument time-sharing operating system is started, the central control time-sharing operating system can be continuously started. In practice, the method can realize the starting of the instrument process within 2 seconds and display of instrument data.
In some embodiments, the method further comprises:
and when a second instruction for indicating to turn off the meter is received, controlling the kernel to enter a deep sleep state.
In this embodiment, in order to switch the control core from the deep sleep state to the normal state, the control core needs to perform the deep sleep state when the vehicle is not in use. Specifically, when the vehicle is in use, the user can send a second instruction for indicating to turn off the meter, and when the CPU receives the second instruction, the CPU can enter a deep sleep state.
In practice, when the automotive device is powered on for the first time, the state information of the kernel is not initialized. When the automobile equipment is powered on for the first time and started, the automobile equipment can enter a deep sleep state when a second instruction of powering down the automobile is received, and then the automobile equipment can be directly awakened from the deep sleep state when the automobile equipment is powered on for the second time and subsequent times.
The kernel is controlled to enter the deep sleep state, so that the user can be conveniently and directly switched from the deep sleep state to the normal state when the user starts the instrument next time.
In some embodiments, controlling the kernel to enter a deep sleep state includes:
the control part is used for controlling the application in a suspended state and controlling the application which is outside the suspended state in a termination state in all the applications;
correspondingly, controlling the kernel to switch from the deep sleep state to the normal running state comprises the following steps:
controlling the kernel to wake up the part of the application in the suspended state.
When the control kernel enters the deep sleep state, part of the applications can be set to be in a suspended state and the rest of the applications can be set to be in a termination state, namely, a killing state according to the requirements of a user. By suspending part of the applications and killing the rest of the applications, the consumption of the CPU and the network pressure of the instrument time-sharing operating system are reduced, and the consumption of electric quantity in the deep sleep process is reduced. The application in the suspended state and the application in the terminated state may be determined according to actual situations, which is not limited herein.
Accordingly, when the control kernel wakes up from the deep sleep state, the kernel is ready and only needs to be controlled to switch to the normal running state and wake up the part of the application in the suspended state.
In some embodiments, the method further comprises:
and when the kernel is in the deep sleep state, periodically running the application in the suspended state so as to enable the application to be in the background running state.
Wherein, when the kernel is in a deep sleep state, the application in a suspended state also needs to run periodically. Wherein, the operation period can be preset, such as the operation period is 6 hours. When the CPU receives an instruction that the current moment sent by the timer meets the set running period, the CPU controls the kernel to run the application in the suspended state.
The background running state refers to a state that an application is in the background of an operating system and is running, that is, application codes are executed in the background system. The application entering the background running state can enter the suspended state again after being maintained for a period of time.
In some embodiments, the running the first container corresponding to the meter time-sharing operating system, starting the meter time-sharing operating system through the first container, and displaying meter information, including:
operating a first container corresponding to the instrument time-sharing operating system, and starting the instrument time-sharing operating system by operating a file in the first container;
and after the instrument time-sharing operation system is started, controlling the back light of the instrument screen to start, and displaying instrument information through the instrument screen.
When the instrument process is started, the files in the first container need to be run, wherein the files comprise display application programs, sound application programs and other related application programs, and the process of the instrument can be started by running the files.
When the kernel is in the deep sleep state, the first container corresponding to the instrument timesharing operating system is also in a termination running state. And, the first time the meter is started, the files in the first container also need to be run.
The instrument time-sharing operating system and the central control time-sharing operating system can be mutually isolated and independently operated through a container technology.
Further, when the kernel is in a deep sleep state, the instrument screen backlight is turned off. Therefore, after the meter is started, it is also necessary to backlight the meter screen so that meter information can be displayed on the screen.
In some embodiments, the method further comprises:
before the kernel enters a deep sleep state, saving instrument information displayed by the instrument time-sharing operating system,
the meter information includes: mileage information and oil amount information.
In addition, in order to facilitate quick start of the meter, meter information of the kernel before entering the deep sleep state can be stored. Specifically, meter information may be stored in RAM (Random Access Memory ) and the RAM is placed in a powered-on state. When the instrument is started next time, after the back light of the instrument starts, the instrument information can be directly read from the RAM and displayed on an instrument screen. The meter information here may be mileage information, oil amount information, or the like.
By storing the instrument information, the instrument information can be displayed quickly when the instrument is started next time.
In some embodiments, the first instruction is an instruction generated when an ACC gear of the automotive device is in an ON state; the second instruction includes an instruction generated when the ACC gear of the automotive device is in the OFF state.
When the user turns ON the ACC gear of the automobile equipment, the automobile equipment is powered ON, and the CPU receives a first instruction.
Conversely, when the ACC gear for turning the vehicle device is in the OFF state, the vehicle device is indicated as the down point, and the CPU will receive the second instruction.
In addition, the user can control the power-on or power-off of the automobile equipment through the automobile key, and correspondingly, the CPU can receive the first instruction or the second instruction.
Fig. 3 is a flow chart of another method for starting an instrument according to an embodiment of the present invention, as shown in fig. 3, where the method includes:
s301, executing step S302 when the ACC gear is detected to be in an ON state;
s302, judging whether the first power-on starting is performed; if yes, go to step S303; if not, executing step S304;
s303, initializing a Linux kernel;
s304, exiting the deep sleep state, entering a normal running state, and waking up the suspended application by the kernel;
s305, the first container operates, the back of the instrument screen is bright, and the instrument displays normally;
s306, the second container runs, and a central control time-sharing operating system is started;
s307, detecting that the ACC gear is in an OFF state;
s308, entering a deep sleep state, suspending part of applications, turning off the instrument screen backlight, and terminating the first container;
s309, detecting that the ACC gear is in the ON state again.
In practice, the meter start may be controlled according to the above-described execution steps.
According to the method, when the automobile is not used, the inner core is controlled to be in the deep sleep state, and when the instrument is started, if the inner core is in the deep sleep state, the inner core is directly awakened from the deep sleep state, the steps of hardware power-on and inner core initialization are not required to be executed, the process of starting the instrument is saved, and therefore the starting speed of the instrument is improved. In practice, the method can realize the starting of the instrument process within 2 seconds and display of instrument data.
On the basis of the above embodiments, the time when the kernel is in the deep sleep state may be set according to the frequency of the user using the automobile in consideration of the difference in the frequency of the user using the automobile device. Specifically, when the automobile equipment is powered down, the inner core can be controlled to enter a deep sleep state, the time of the inner core in the deep sleep state is counted, and when the counted result exceeds the preset time, the inner core is controlled to be in a state of stopping operation. For example, when the core is in the deep sleep state for 10 days, the core may be controlled to be in a state of stopping operation.
Through the operation, when the user uses the automobile frequently, the automobile can enter a deep sleep state, so that the instrument can be started quickly when the automobile is used next time; when the user does not use the automobile frequently, the user can exit the deep sleep state, and power consumption is reduced.
Fig. 4 is a schematic structural diagram of an instrument starting device according to an embodiment of the present invention. As shown in fig. 4, the device 40 is applied to an operating system in which an instrument time-sharing operating system and a central control time-sharing operating system are simultaneously loaded; the apparatus 40 includes:
an obtaining module 401, configured to obtain a state of a kernel when a first instruction for instructing to start a meter is received;
the control module 402 is configured to control the kernel to switch from the deep sleep state to the normal operation state when the state of the kernel is the deep sleep state; the deep sleep state indicates that at least one application is in a suspended state and that no application in a foreground running state exists; the normal running state indicates that at least one application is in a foreground running state;
the first processing module 403 is configured to run a first container corresponding to the instrument time-sharing operating system, start the instrument time-sharing operating system through the first container, and display instrument information;
and the second processing module 404 is configured to run a second container corresponding to the central control time sharing operating system, start the central control time sharing operating system through the second container, and display a central control interface.
In some embodiments, the control module 402 is further configured to:
and when a second instruction for indicating to turn off the meter is received, controlling the kernel to enter a deep sleep state.
In some embodiments, the control module 402 is specifically configured to, when controlling the kernel to enter a deep sleep state:
the control part is used for controlling the application in a suspended state and controlling the application which is outside the suspended state in a termination state in all the applications;
accordingly, when the control module 402 controls the kernel to switch from the deep sleep state to the normal running state, the control module is specifically configured to:
controlling the kernel to wake up the part of the application in the suspended state.
In some embodiments, the control module 402 is further configured to:
and when the kernel is in the deep sleep state, periodically running the application in the suspended state so as to enable the application to be in the background running state.
In some embodiments, the first processing module 403 is specifically configured to:
operating a first container corresponding to the instrument time-sharing operating system, and starting the instrument time-sharing operating system by operating a file in the first container;
and after the instrument time-sharing operation system is started, controlling the back light of the instrument screen to start, and displaying instrument information through the instrument screen.
In some embodiments, the apparatus further comprises a save module for:
before the kernel enters a deep sleep state, saving instrument information displayed by the instrument time-sharing operating system, wherein the instrument information comprises: mileage information and oil amount information.
The instrument starting device provided by the embodiment of the invention can realize the instrument starting method of the embodiment shown in fig. 2 and 3, and the implementation principle and technical effects are similar, and are not repeated here.
Fig. 5 is a schematic hardware structure of an instrument starting device according to an embodiment of the present invention. As shown in fig. 5, the meter start device 50 provided in the present embodiment includes: at least one processor 501 and a memory 502. The processor 501 and the memory 502 are connected by a bus 503.
In a specific implementation, at least one processor 501 executes computer-executable instructions stored in the memory 502, so that at least one processor 501 performs the meter start method in the above method embodiment.
The specific implementation process of the processor 501 may refer to the above-mentioned method embodiment, and its implementation principle and technical effects are similar, and this embodiment will not be described herein again.
In the embodiment shown in fig. 5, it should be understood that the processor may be a central processing unit (english: central Processing Unit, abbreviated as CPU), or may be other general purpose processors, digital signal processors (english: digital Signal Processor, abbreviated as DSP), application specific integrated circuits (english: application Specific Integrated Circuit, abbreviated as ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in a processor for execution.
The memory may comprise high speed RAM memory or may further comprise non-volatile storage NVM, such as at least one disk memory.
The bus may be an industry standard architecture (Industry Standard Architecture, ISA) bus, an external device interconnect (Peripheral Component, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, among others. The buses may be divided into address buses, data buses, control buses, etc. For ease of illustration, the buses in the drawings of the present application are not limited to only one bus or one type of bus.
The embodiment of the invention also provides a computer readable storage medium, wherein computer execution instructions are stored in the computer readable storage medium, and when a processor executes the computer execution instructions, the instrument starting method of the method embodiment is realized.
The computer readable storage medium described above may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk. A readable storage medium can be any available medium that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. In the alternative, the readable storage medium may be integral to the processor. The processor and the readable storage medium may reside in an application specific integrated circuit (Application Specific Integrated Circuits, ASIC for short). The processor and the readable storage medium may reside as discrete components in a device.
An embodiment of the present application provides a computer program product comprising a computer program which, when executed by a processor, implements a meter start method as provided in any of the embodiments corresponding to fig. 2 to 3 of the present application.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the method embodiments described above may be performed by hardware associated with program instructions. The foregoing program may be stored in a computer readable storage medium. The program, when executed, performs steps including the method embodiments described above; and the aforementioned storage medium includes: various media that can store program code, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.