Optimization method and device based on Android system accelerated startup
By adjusting the Zygote loading strategy, delaying loading WIFI components and cropping system UI, the problem of prolonging the startup time of the Android system is solved, and the rapid startup is achieved and the user experience is improved.
Patent Information
- Application Number
- CN202011292913.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-18
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2040-11-18
AI Technical Summary
The Android system boot time is gradually extending, especially for car and TV box products, which affects the user experience and requires rapid startup.
Adjust Zygote's loading strategy through preload optimization steps, delay the loading of WIFI HAL, WIFI Driver, Supplicant, ConfigureChip, and clone the system UI loading of the key lock and pull-down status bar according to product business characteristics, and optimize the startup process.
Significantly reduces the startup time, starts SystemServer in advance, optimizes WIFI activation timing, delays loading of non-essential components, thereby speeding up startup.
Smart Images

Figure CN112395015B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Android system startup, and in particular to an optimization method and device based on Android system accelerated startup. Background Art
[0002] As Google's Android system continues to evolve, its functions become more and more complete, and the logic added to the startup process becomes more and more complex. When users perform a cold start, the time to complete the startup becomes longer and longer, seriously affecting the user experience. Especially for car-mounted and TV box products, the demand for fast startup is becoming stronger and stronger. Summary of the invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention proposes an optimization method based on Android system accelerated startup, which can improve the startup speed of the Android system.
[0004] The present invention also proposes an optimization device based on Android system accelerated startup having the above-mentioned optimization method based on Android system accelerated startup.
[0005] The present invention also proposes a computer-readable storage medium having the above-mentioned optimization method based on accelerated startup of the Android system.
[0006] According to the first aspect of the present invention, the optimization method based on the accelerated startup of the Android system includes: a preloading optimization step, judging whether the system is not flashed for the first time, adjusting the loading strategy process of Zygote according to the first judgment result, and starting the system service after Zygote loads the preloading resources; a WIFI enabling optimization step, turning off the WIFI function before shutting down the system, and turning on the WIFI function after the system service is started; a UI loading optimization step, judging whether there is a key lock and / or a drop-down status bar through product business characteristics, and cutting out the system UI loading of the key lock and / or the drop-down status bar according to the second judgment result.
[0007] The optimization method for accelerating startup based on the Android system according to the embodiment of the present invention has at least the following beneficial effects: starting SystemServer in advance without waiting for Zygote to be loaded, optimizing the timing of starting WiFi, delaying the process of loading WIFI HAL, WIFI Driver, Supplicant, and ConfigureChip during the startup phase, optimizing the process of loading the startup system UI, not starting or delaying the loading process of the startup key lock and the pull-down status bar during the startup phase, thereby reducing the startup time and speeding up the startup process.
[0008] According to some embodiments of the present invention, the preloading optimization step includes: if the system is flashed for the first time, the first judgment result is that preloading optimization is prohibited, and Zygote executes the system's original loading strategy process; otherwise, the first judgment result is that preloading optimization is possible, and after Zygote loads the preloading resources, it starts the system service.
[0009] According to some embodiments of the present invention, the preloading optimization step also includes: if the first judgment result is that preloading optimization is possible, then while starting the system service, preloading classes, preloading application hardware abstraction layers, preloading graphics card drivers, and preloading shader libraries are loaded through multi-threading.
[0010] According to some embodiments of the present invention, the WIFI enabling optimization step includes: the system receives a shutdown command, monitors the ACTION_SHUTDOWN broadcast, and turns off the WIFI function by setting wifiEnabled to false; after the system service is started, it monitors ACTION_LOCK, turns on the WIFI function by setting wifiEnabled to true, and loads the WIFI function related process.
[0011] According to some embodiments of the present invention, the UI loading optimization step includes: if the key lock does not exist, the second judgment result is to crop the key lock, and not load the system UI of the key lock; if the drop-down status bar does not exist, the second judgment result is to crop the drop-down status bar, and not load the system UI of the drop-down status bar.
[0012] According to some embodiments of the present invention, the UI loading optimization step also includes: if the key lock exists, the second judgment result is to delay the loading of the key lock, and load the system UI of the key lock after logging into the desktop; if the drop-down status bar does not exist, the second judgment result is to delay the loading of the drop-down status bar, and load the system UI of the drop-down status bar after logging into the desktop.
[0013] According to the second aspect of the present invention, an optimization device based on accelerated startup of the Android system includes: a preload optimization module, which is used to determine whether the system is not flashed for the first time, and adjust the loading strategy process of Zygote according to the first judgment result. After Zygote loads the preloaded resources, it starts the system service; a WIFI activation optimization module, which is used to turn off the WIFI function before the system is shut down, and turn on the WIFI function after the system service is started; a UI loading optimization module, which is used to determine whether there is a key lock and / or a drop-down status bar through product business characteristics, and according to the second judgment result, cut out the system UI loading of the key lock and / or the drop-down status bar.
[0014] According to the embodiment of the present invention, the optimization device based on the accelerated startup of the Android system has at least the following beneficial effects: starting the System Server in advance without waiting for the Zygote to be loaded, optimizing the timing of starting WiFi, delaying the loading of WIFI HAL, WIFI Driver, Supplicant, and ConfigureChip during the startup phase, optimizing the process of loading the startup system UI, not starting or delaying the loading process of the startup key lock and the pull-down status bar during the startup phase, thereby reducing the startup time and speeding up the startup process.
[0015] According to the computer-readable storage medium of the third aspect embodiment of the present invention, a computer program is stored thereon, and when the computer program is executed by a processor, the method of the first aspect embodiment of the present invention is implemented.
[0016] The computer-readable storage medium according to the embodiment of the present invention has at least the same beneficial effects as the embodiment of the first aspect of the present invention.
[0017] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0019] Figure 1 A schematic diagram of a method according to an embodiment of the present invention;
[0020] Figure 2 The original boot process of the Android system;
[0021] Figure 3 It is a schematic diagram of a preloading optimized process in the method of an embodiment of the present invention;
[0022] Figure 4 A schematic block diagram of a module of an apparatus according to an embodiment of the present invention;
[0023] Figure 5 This is the test result of optimizing the startup time of the Android system according to the embodiment of the present invention.
[0024] Reference numerals:
[0025] Preloading optimization module 100, WIFI enabling optimization module 200, UI loading optimization module 300. DETAILED DESCRIPTION
[0026] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0027] In the description of the present invention, "several" means one or more, "more" means two or more, "greater than", "less than", "exceed" etc. are understood as not including the number itself, and "above", "below", "within" etc. are understood as including the number itself. If there is a description of "first" or "second", it is only used for the purpose of distinguishing the technical features, and cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features.
[0028] Reference Figure 1 The method of the embodiment of the present invention includes: a preloading optimization step, judging whether the system is not flashed for the first time, adjusting the loading strategy process of Zygote according to the first judgment result, and starting the system service after Zygote loads the preloading resources; a WIFI enabling optimization step, turning off the WIFI function before the system is shut down, and turning on the WIFI function after the system service is started; a UI loading optimization step, judging whether there is a key lock and / or a drop-down status bar through product business characteristics, and cutting out the system UI loading of the key lock and / or the drop-down status bar according to the second judgment result.
[0029] The optimization method of the pre-loading optimization step is to adjust the loading strategy of Zygote, reduce the loading amount, and start SystemServer in advance. Figure 2 It can be seen that the system service (SystemServer) must wait for Zygote to execute all the tasks in sequence before starting. In the embodiment of the present invention, refer to Figure 3 , except for the first system startup, the system service only needs to be started after Zygote completes preloading resources, so that the system service can prepare in advance and start other services earlier. For non-essential preloaded items, including: preloading classes, preloading application hardware abstraction layer, preloading graphics card driver and preloading shader library, they are executed in parallel with system services through multithreading, thereby accelerating the startup speed. Through testing, the optimization effect is about 3s.
[0030] In an embodiment of the present invention, the WIFI activation is also optimized at startup. When the Android system running on the device receives a shutdown command, it determines whether the WIFI is turned on; if the WIFI is turned on, during the shutdown process, by monitoring the ACTION_SHUTDOWN broadcast, wifiEnabled is first set to false. The next time the machine is started, the WIFI-related hardware data extraction layer, WIFI driver, Driver, Supplicant, ConfigureChip and other processes will not be loaded. They will be loaded when the load is low, thereby speeding up the startup speed. After the system service is started, that is, after monitoring ACTION_LOCK, wifiEnabled is set to true. At this time, the loading of WIFI-related processes is delayed. When the user enters the main interface, he can immediately see that the wifi is connected. Through testing, WIFI activation optimization can increase the startup speed by about 2.5s.
[0031] Reference Figure 2 In the original boot process of the Android system, all system UIs must be fully loaded before they can be loaded into the desktop. In an embodiment of the present invention, whether the key lock and the drop-down menu bar need to be loaded is determined based on the product business characteristics. For example, if the TV box product does not require a lock screen function and a drop-down status bar, the loading of the key lock and the drop-down menu bar is skipped during the system UI loading process, thereby omitting the time-consuming key lock and drop-down menu bar loading process. If the product requires a key lock or a drop-down menu bar, but the real-time requirements are not strong, the loading of the key lock or the drop-down menu bar is delayed until the desktop startup is completed, thereby speeding up the boot speed. Through testing, the boot speed can be accelerated by about 5s.
[0032] The device of the embodiment of the present invention, referring to Figure 4 , including: a preloading optimization module 100, used to determine whether the system is not flashed for the first time, and adjust the loading strategy process of Zygote according to the first judgment result. After Zygote loads the preloading resources, it starts the system service; a WIFI activation optimization module 200, used to turn off the WIFI function before the system is shut down, and turn on the WIFI function after the system service is started; a UI loading optimization module 300, used to determine whether there is a key lock and / or a drop-down status bar through product business characteristics, and according to the second judgment result, cut off the system UI loading of the key lock and / or the drop-down status bar.
[0033] The optimization effect of the embodiments of the present invention on various Android systems can be seen in Figure 5 The optimization method of the present invention has an optimization effect of about 8 to 10.5 seconds.
[0034] Although specific embodiments are described herein, those of ordinary skill in the art will recognize that many other modifications or alternative embodiments are also within the scope of the present disclosure. For example, any of the functions and / or processing capabilities described in conjunction with a particular device or component may be performed by any other device or component. In addition, although various exemplary implementations and architectures have been described according to embodiments of the present disclosure, those of ordinary skill in the art will recognize that many other modifications to the exemplary implementations and architectures described herein are also within the scope of the present disclosure.
[0035] Some aspects of the present disclosure are described above with reference to the block diagram and flow chart of the system, method, system and / or computer program product according to the exemplary embodiments.It should be understood that the combination of one or more blocks in the block diagram and the flow chart and the blocks in the block diagram and the flow chart can be realized by executing computer executable program instructions respectively.Equally, according to some embodiments, some blocks in the block diagram and the flow chart may not need to be executed in the order shown, or may not need to be executed in full.In addition, additional components and / or operations beyond those components and / or operations shown in the blocks in the block diagram and the flow chart may be present in certain embodiments.
[0036] Therefore, the blocks in the block diagrams and flow charts support the combination of devices for performing the specified functions, the combination of elements or steps for performing the specified functions, and the program instruction devices for performing the specified functions. It should also be understood that each block in the block diagrams and flow charts and the combination of blocks in the block diagrams and flow charts can be implemented by a special-purpose hardware computer system or a combination of special-purpose hardware and computer instructions that performs a specific function, element or step.
[0037] The program modules, applications, etc. described herein may include one or more software components, including, for example, software objects, methods, data structures, etc. Each such software component may include computer-executable instructions that, in response to execution, cause at least a portion of the functionality described herein (e.g., one or more operations of the illustrative methods described herein) to be performed.
[0038] Software components can be encoded with any of various programming languages. An exemplary programming language can be a low-level programming language, such as an assembly language associated with a specific hardware architecture and / or an operating system platform. The software component comprising assembly language instructions may need to be converted to executable machine code by an assembler before being executed by hardware architecture and / or platform. Another exemplary programming language can be a higher-level programming language, which can be transplanted across multiple architectures. The software component comprising a higher-level programming language may need to be converted to an intermediate representation by an interpreter or a compiler before execution. Other examples of programming languages include but are not limited to macro languages, shells or command languages, job control languages, scripting languages, database queries or search languages or report writing languages. In one or more exemplary embodiments, the software component comprising the instruction of one of the above-mentioned programming language examples can be directly executed by an operating system or other software components, without first being converted into another form.
[0039] Software components may be stored as files or other data storage structures. Software components of similar type or related functions may be stored together, such as in a specific directory, folder, or library. Software components may be static (e.g., preset or fixed) or dynamic (e.g., created or modified at execution time).
[0040] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the relevant technical field without departing from the purpose of the present invention.
Claims
1. An optimization method for accelerating booting based on an Android system, characterized in that: include: Preloading optimization step, judging whether the system is not flashed for the first time, adjusting the loading strategy process of Zygote according to the first judgment result, and starting the system service after Zygote loads the preloading resources; Optimization steps for enabling WIFI: turn off the WIFI function before shutting down the system, and turn on the WIFI function after the system service is started; A UI loading optimization step, judging whether there is a key lock and / or a drop-down status bar according to product business characteristics, and cutting out the system UI loading of the key lock and / or the drop-down status bar according to a second judgment result; The preloading optimization step comprises: If the system is flashed for the first time, the first judgment result is that preloading optimization is prohibited, and Zygote executes the original loading strategy process of the system; otherwise, the first judgment result is that preloading optimization is possible, and Zygote starts the system service after loading the preloading resources; if the first judgment result is that preloading optimization is possible, while starting the system service, the preloading class, preloading application hardware abstraction layer, preloading graphics card driver and preloading shader library are loaded through multi-threading; The UI loading optimization step includes: if the key lock does not exist, the second judgment result is to crop the key lock, and the system UI loading of the key lock is not performed; if the drop-down status bar does not exist, the second judgment result is to crop the drop-down status bar, and the system UI loading of the drop-down status bar is not performed; if the key lock exists, the second judgment result is to delay the loading of the key lock, and load the system UI of the key lock after logging into the desktop; if the drop-down status bar exists, the second judgment result is to delay the loading of the drop-down status bar, and load the system UI of the drop-down status bar after logging into the desktop.
2. The optimization method for accelerating booting based on the Android system according to claim 1, characterized in that: The WIFI enabling optimization steps include: The system receives the shutdown command, monitors the ACTION_SHUTDOWN broadcast, and turns off the WiFi function by setting wifiEnabled to false; After the system service is started, ACTION_LOCK is monitored, the WIFI function is enabled by setting wifiEnabled to true, and the WIFI function related processes are loaded.
3. An optimization device for accelerating booting based on an Android system, using the method of any one of claims 1 to 2, characterized in that: include: The preloading optimization module is used to determine whether the system is not flashed for the first time, and adjust the loading strategy process of Zygote according to the first judgment result. After Zygote loads the preloading resources, it starts the system service; The WIFI activation optimization module is used to turn off the WIFI function before the system is shut down, and to turn on the WIFI function after the system service is started; The UI loading optimization module is used to determine whether there is a key lock and / or a drop-down status bar based on product business characteristics, and according to the second judgment result, cut off the system UI loading of the key lock and / or the drop-down status bar.
4. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 2 when executed by a processor.
Citation Information
Patent Citations
Method for accelerating startup by dynamically adjusting startup preloaded resources
CN103488495A
ARM (Advanced RISC Machine) platform based Android startup acceleration method
CN104102506A