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 when a time-sharing operating system of the instrument is started, the kernel can be directly awakened from the deep sleep state, 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 simultaneously carrying 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 the instrument is received;
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 operation state; the deep sleep state represents that at least one application is in a suspended state and no application in a foreground running state exists; the normal running state represents 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 operating 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 includes:
and controlling the kernel to enter a deep sleep state when a second instruction for indicating to close the meter is received.
Optionally, controlling the kernel to enter a deep sleep state includes:
controlling part of the applications to be in a suspended state, and controlling the applications out of the suspended state in all the applications to be in a terminated state;
correspondingly, controlling the kernel to switch from the deep sleep state to the normal operation state includes:
controlling the kernel to wake up the part of the application in the suspended state.
Optionally, the method further includes:
and when the kernel is in a deep sleep state, periodically running the application in a suspended state so as to enable the application to be in a background running state.
Optionally, the 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 includes:
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 operating system is started, controlling the instrument screen to light up in a backlight mode, and displaying instrument information through the instrument screen.
Optionally, the method further includes:
before the kernel enters a deep sleep state, saving meter information displayed by the meter time-sharing operating system, wherein the meter information comprises: mileage information and oil quantity information.
Optionally, the first instruction is an instruction generated when an ACC gear of the automobile device is in an ON state; the second instruction includes an instruction generated when the ACC gear of the automobile apparatus is in the OFF state.
In a second aspect, the present application provides a meter starting apparatus applied to a system having both a meter time-sharing operating system and a central control time-sharing operating system; the device comprises:
the acquisition module is used for acquiring the state of the kernel when receiving a first instruction for indicating to start the instrument;
the control module is used for controlling the kernel to be switched 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 represents that at least one application is in a suspended state and no application in a foreground running state exists; the normal running state represents 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 operating 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 starting apparatus comprising: a memory and at least one processor;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by 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 the method according to any one of the first aspect.
In a fifth aspect, the present application provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the method according to any one of the first aspect.
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 simultaneously carrying 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 the instrument is received; 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 operation state; the deep sleep state represents that at least one application is in a suspended state and no application in a foreground running state exists; the normal running state represents 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; the method comprises the steps that a second container corresponding to the central control time-sharing operating system is operated, the central control time-sharing operating system is started through the second container, and a central control interface is displayed.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation 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 by an embodiment of the present invention, and as shown in fig. 1, a CPU11 is a Central Processing Unit (Central Processing Unit) and is capable of responding to an instruction generated by an automobile device and controlling execution content of a kernel in an operating system. A central control system 12 and an instrument system 13 of the automobile equipment are positioned on an application layer facing 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, which includes the construction of a file system and the running of a driver, and the kernel is the core of the operating system and can determine when a program operates on each hardware.
The former central control system and the instrument system are called according to the classification of service functions, and the latter instrument time-sharing operating system is the instrument system, and the middle control time-sharing operating system is the central control system.
In order to reduce the waste of hardware resources, the instrumentation system 13 and the central control system share one chip, and the instrumentation system 13 and the central control system 12 are mounted on one system, such as a linux system. However, when the instrumentation system 13 is mounted on the linux system, there is a problem that the start-up speed is slow when the instrumentation system is started up.
Based on the above problems, according to the method and the device, when the automobile equipment is not used, the kernel is in the deep sleep state, when a first instruction for starting the instrument is received, different operations are executed according to the state information of the kernel, and when the state information of the kernel is in the deep sleep state, the kernel is directly controlled to be switched from the deep sleep state to the normal operation state, so that the kernel does not need to perform a complete initialization process, and the starting speed of the instrument is increased.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a schematic flowchart of a method for starting a meter according to an embodiment of the present invention, where the method provided in this embodiment may be executed by a CPU, and as shown in fig. 2, the method of this embodiment may include:
s201, when a first instruction for indicating to start the instrument is received, acquiring the state of a kernel.
In this embodiment, when a first instruction for starting the instrument is received, the state of the kernel in the system may be obtained first, where the state of the kernel may be two, and in one case, when the automobile is started for the first time, the kernel is not initialized; the second case is that 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 operation state; the deep sleep state represents that at least one application is in a suspended state and 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 be awakened from the deep sleep state, namely the kernel is controlled to be switched to the normal state from the deep sleep state.
When the kernel is in the deep sleep state, at least one application in all the applications is in the suspended state, the other part of the applications is in the termination state, namely in the killing state, and meanwhile, the applications in the foreground running state do not exist. When the kernel is in the deep sleep state, the instrument time-sharing operating system is also in the power-on state.
The normal running state means that at least one application is in a foreground running state, and part of the applications can be allowed to be in a suspended state or run in a background.
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 the memory, and the kernel may be controlled to initialize hardware and circuit logic, so as to complete subsequent instrument startup.
Before initialization operation, hardware power-on is required, such as power-on of an embedded single-board CPU chip and power-on of an instrument time-sharing operating system.
Whether the state of the kernel is in the uninitialized state or not 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, when the kernel is controlled to perform initialization 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 is awakened from the deep sleep state, executing a flow of operating a first container corresponding to the instrument time-sharing operating system, so that the instrument information can be displayed on an instrument screen.
And S204, operating 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.
Similar to the process of displaying the instrument information, the central control time-sharing operating system can be controlled to be started by operating the second container corresponding to the central control time-sharing operating system through the second container, and a central control interface is displayed.
After the time-sharing operating system of the control instrument is started, the time-sharing operating system of the central control can be continuously started. In general, when a user is using an automobile device, it is necessary to determine a running condition of a vehicle from information displayed by a meter. The central control time-sharing operating system is generally used for running the entertainment device, and the requirement on the starting speed of the central control time-sharing operating system is low, so that the starting of the central control time-sharing operating system can be continued after the starting of the instrument time-sharing operating system is completed.
The instrument time-sharing operating system and the central control time-sharing operating system share one 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 the sleep state, so that the instrument time-sharing operating system and the central control time-sharing operating system can be started only by operating the second container.
In the embodiment, when the automobile is not used, the control kernel is in the 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 wakened from the deep sleep state, the steps of hardware power-on and kernel initialization are not required to be executed, the instrument starting process is saved, the starting speed of the instrument time-sharing operating system is increased, and the instrument time-sharing operating system can be continuously started after the instrument time-sharing operating system is started. In practice, the method can realize that the meter process is started within 2 seconds and the meter data is displayed.
In some embodiments, the method further comprises:
and controlling the kernel to enter a deep sleep state when a second instruction for indicating to close the meter is received.
In this embodiment, in order to switch the control kernel from the deep sleep state to the normal state, the control kernel needs to perform the deep sleep state when the vehicle is not used. Specifically, when the vehicle is finished, the user may send a second instruction indicating to turn off the meter, and when the CPU receives the second instruction, the CPU may enter the deep sleep state.
In practice, when the automobile device is started for the first power-on, the state information of the kernel is not initialized. After the automobile equipment is powered on and started for the first time, the automobile equipment can enter a deep sleep state when a second instruction of powering off 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 and started for the second time and subsequently.
The deep sleep state is conveniently switched to the normal state from the deep sleep state when the user starts the instrument next time by controlling the kernel to enter the deep sleep state.
In some embodiments, controlling the kernel to enter a deep sleep state includes:
controlling part of the applications to be in a suspended state, and controlling the applications out of the suspended state in all the applications to be in a terminated state;
correspondingly, controlling the kernel to switch from the deep sleep state to the normal operation state includes:
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 the suspended state according to the requirements of a user, and the rest of the applications can be set to be in the termination state, namely the killing state. By suspending part of applications and killing the rest of applications, the CPU loss and the network pressure of the instrument time-sharing operating system are reduced, and the electric quantity loss in the deep sleep process is reduced. The determination of the application in the suspended state and the application in the terminated state may be performed according to actual situations, and is not limited herein.
Accordingly, when the control kernel wakes up from the deep sleep state, the kernel is ready, and only the control kernel needs to switch to the normal operation 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 a deep sleep state, periodically running the application in a suspended state so as to enable the application to be in a background running state.
When the kernel is in a deep sleep state, the application in the suspended state needs to run periodically. Wherein, the operation period can be preset, for example, the operation period is 6 hours. And when the CPU receives an instruction which is sent by the timer and meets the set running period at the current moment, the CPU controls the kernel to run the application in the suspended state.
The background running state refers to a state that the application is in the background of the operating system and is running, namely, the application code is executed in the background system. After the application entering the background running state is maintained for a period of time, the application enters the suspended state again.
In some embodiments, the running a 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 includes:
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 operating system is started, controlling the instrument screen to light up in a backlight mode, and displaying instrument information through the instrument screen.
When the instrument process is started, files in the first container need to be operated, the files comprise a display application program, a sound application program and other related application programs, and the starting of the instrument process can be realized by operating the files.
When the kernel is in the deep sleep state, the first container corresponding to the instrument time-sharing operating system is also in the operation termination state. And, the file in the first container also needs to be run when the meter is first started.
The instrument time-sharing operating system and the central control time-sharing operating system can be isolated from each other and run independently through the container technology.
Further, when the inner core is in the deep sleep state, the instrument screen backlight is in the off state. Therefore, after the meter is started, the meter screen needs to be lit back so that the meter information can be displayed on the screen.
In some embodiments, the method further comprises:
before the kernel enters a deep sleep state, the meter information displayed by the meter time-sharing operating system is stored,
the meter information includes: mileage information and oil quantity information.
In addition, in order to conveniently and quickly start the meter, the meter information of the kernel before entering the deep sleep state can be stored. Specifically, the meter information may be stored in a RAM (Random Access Memory), and the RAM may be in a power-on state. When the instrument is started next time, the instrument backlight is lightened, the instrument information can be directly read from the RAM and displayed on the instrument screen. The meter information here may be mileage information, oil amount information, and the like.
By storing the meter information, the meter information can be rapidly displayed when the meter is started next time.
In some embodiments, the first instruction is an instruction generated when an ACC range of the automobile apparatus is in an ON state; the second instruction includes an instruction generated when the ACC gear of the automobile apparatus is in the OFF state.
When the user puts the ACC gear of the automobile equipment in the ON state, the automobile equipment is powered ON, and the CPU receives a first instruction.
Conversely, when the ACC range for the vehicle device is OFF, indicating that the vehicle device is at a low point, the CPU receives the second instruction.
In addition, the user can control the car equipment to be powered on or powered off through the car key, and correspondingly, the CPU can receive the first instruction or the second instruction.
Fig. 3 is a schematic flow chart of another meter starting method according to an embodiment of the present invention, and as shown in fig. 3, the method includes:
s301, when the ACC gear is detected to be in the ON state, executing the step S302;
s302, judging whether the power-on starting is the first power-on starting; if yes, go to step S303; if not, go to step S304;
s303, initializing the Linux kernel;
s304, exiting the deep sleep state, entering a normal operation state, and awakening the suspended application by the kernel;
s305, operating the first container, lighting the backlight of the instrument screen, and displaying the instrument normally;
s306, the second container runs, and the 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, closing the backlight of the instrument screen, and terminating the first container;
s309, detecting that the ACC gear is in the ON state again.
In practice, the meter start-up may be controlled according to the above-described execution steps.
By the method, when the automobile is not used, the kernel is controlled to be in the deep sleep state, and when the instrument is started, if the kernel is in the deep sleep state, the kernel is directly awakened from the deep sleep state, steps of hardware power-on and kernel initialization are not required to be executed, the instrument starting process is saved, and accordingly the starting speed of the instrument is improved. In practice, the method can realize that the meter process is started within 2 seconds and the meter data is displayed.
On the basis of the above embodiments, in consideration of the difference in frequency of using the car device by the user, the time during which the kernel is in the deep sleep state may be set according to the frequency of using the car by the user. Specifically, after the automobile equipment is powered off, the kernel can be controlled to enter the deep sleep state, the time of the kernel in the deep sleep state is timed, and when the timing result exceeds the preset time, the kernel is controlled to be in the state of stopping running. For example, when the time when the kernel is in the deep sleep state reaches 10 days, the kernel may be controlled to be in a state of being stopped.
Through the operation, when a user frequently uses the automobile, the automobile can enter a deep sleep state, so that the instrument can be quickly started when the automobile is used next time; when the user is not frequently using the automobile, the deep sleep state can be quitted, and the power consumption is reduced.
Fig. 4 is a schematic structural diagram of a meter 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 installed; the device 40 comprises:
the obtaining module 401 is configured to obtain a state of a kernel when a first instruction for instructing to start a meter is received;
a control module 402, configured to control the kernel to switch from a deep sleep state to a normal operation state when the state of the kernel is the deep sleep state; the deep sleep state represents that at least one application is in a suspended state and no application in a foreground running state exists; the normal running state represents 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 an instrument time-sharing operating system, start the instrument time-sharing operating system through the first container, and display instrument information;
and a second processing module 404, 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 controlling the kernel to enter a deep sleep state when a second instruction for indicating to close the meter is received.
In some embodiments, when the control module 402 controls the kernel to enter the deep sleep state, it is specifically configured to:
controlling part of the applications to be in a suspended state, and controlling the applications out of the suspended state in all the applications to be in a terminated state;
correspondingly, when the control module 402 controls the kernel to switch from the deep sleep state to the normal operation 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 a deep sleep state, periodically running the application in a suspended state so as to enable the application to be in a 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 operating system is started, controlling the instrument screen to light up in a backlight mode, and displaying instrument information through the instrument screen.
In some embodiments, the apparatus further comprises a saving module to:
before the kernel enters a deep sleep state, saving meter information displayed by the meter time-sharing operating system, wherein the meter information comprises: mileage information and oil quantity 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 fig. 3, and the realization principle and the technical effect are similar, and are not described again here.
Fig. 5 is a schematic diagram of a hardware structure of a meter starting device according to an embodiment of the present invention. As shown in fig. 5, the present embodiment provides a meter startup device 50 including: at least one processor 501 and memory 502. The processor 501 and the memory 502 are connected by a bus 503.
In a specific implementation, the at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that the at least one processor 501 executes the meter starting method in the above method embodiments.
For a specific implementation process of the processor 501, reference may be made to the above method embodiments, which implement the similar principle and technical effect, and this embodiment is not described herein again.
In the embodiment shown in fig. 5, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. 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, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures 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 a computer executing instruction is stored in the computer-readable storage medium, and when a processor executes the computer executing instruction, the meter starting method of the embodiment of the method is realized.
The computer-readable storage medium 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 or optical disk. Readable storage media can be any available media 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. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
An embodiment of the present application provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the meter starting method provided in any embodiment of the embodiments corresponding to fig. 2 to fig. 3 of the present application.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
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 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 solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.