Summary of the invention
For this reason, need the method that can realize Android system quick turn-on,
Inventor provide a kind of method of Android system quick turn-on, comprise step: while startup core service, start Zygote step.
Also comprise step, parallel processing is done in start up system service and prestrain resource operation.
Also comprise step, optimization system service, by the non-core service type delay start preset.
Also comprise step, optimize logger, Dynamic Distribution is calculated, dynamic icon shows and loading icon micro-shifts out from main thread.
Also comprise step, optimize INIT booting script, delete redundant code.
Also comprise step, in the LINUX stage, peripherals driving is optimized, I2C communication, firmware downloads and rectification step are delayed process.
Also comprise step, classification is carried out to the type information during peripherals drives, the type information needing serial ports to export not reaching severity level is deleted.
Also comprise step, cutting is carried out to UBOOT file, only retain the necessary initialization operation of start.
Also comprise step, the frequency used when determining to start shooting according to the hardware configuration of machine.
Inventor additionally provides a kind of device of Android system quick turn-on, comprises pre-cooling module, and described pre-cooling module is used for starting Zygote step while startup core service.
Also comprise parallel processing module, described parallel processing module is used for start up system service and prestrain resource operation to do parallel processing.
Also comprise optimizing delay module, described optimizing delay module is used for optimization system service, and the non-core service type delay start that will preset.
Also comprise optimization login module, Dynamic Distribution for optimizing logger, and calculates by described optimization login module, dynamic icon shows and load icon micro-shifts out from main thread.
Also comprise optimization script module, described optimization script module, for optimizing INIT booting script, deletes redundant code.
Also comprise optimization driver module, described optimization driver module was optimized peripherals driving in the LINUX stage, and I2C communication, firmware downloads and rectification step are delayed process.
Described optimization driver module is also for carrying out classification to the type information in peripherals driving, and the type information needing serial ports to export not reaching severity level is deleted.
Also comprise cutting module, described cutting module is used for carrying out cutting to UBOOT file, only retains the necessary initialization operation of start.
Also comprise start frequency setting module, described start frequency setting module is used for the frequency used when determining to start shooting according to the hardware configuration of machine.
Be different from prior art, technique scheme starts by Zygote step being advanceed to start while core serves.And a series of Optimization Steps, reach the effect improving Android system starting up speed.
Embodiment
By describe in detail technical scheme technology contents, structural attitude, realized object and effect, coordinate accompanying drawing to be explained in detail below in conjunction with specific embodiment.
Refer to Fig. 1, for invention describes a kind of method of Android system quick turn-on, be applicable to mobile phone, panel computer, navigating instrument etc. arbitrarily with the electronic product of Android system, the method comprising the steps of S101: " start core service " and while start Zygote step.As shown in Figure 2, start-up phase can be roughly divided into UBOOT 201, LINUX 202, INIT 203 to the original starting procedure of Android system, and android system starts 204 four-stages.UBOOT 201, LINUX202 and INIT 203 stage are all serials, only have started for 204 stages to android system just can executed in parallel.In UBOOT 201 stage, Android system can perform chip power on after basic initialization operation, comprise initialization section internal memory and guidance system kernel start; In LINUX 202 stage, Android system can perform the operating system part of core, comprises the initialization of all resources of chip and the loading of peripherals driving; After kernel operating system is ready, Android system is by carry root file system, and the INIT 203 performed in root file system serves; INIT 203 (kernel starts voluntarily) service is responsible for resolving INIT script, carry Android file system, and starts corresponding service according to the content of booting script, comprises the Zygote process guiding android system to start 204; After Zygote process initiation, the first system resource that defines of prestrain and class, and then " start up system service (SystemServer) ", and other Booting sequence is completed by it.
If the common practices of Fig. 2 is by startup Zygote process and INIT 203 process " start main and serve " start simultaneously.And in fact, whether " start main service " to startup zygote process without any impact, therefore while the step starting Zygote process is advanceed to " starting core service " from " starting main service " by this method as shown in Figure 3, carry out startup of running simultaneously, overcome the technology prejudice of those skilled in the art, decrease the time starting the wait core startup service that Zygote needs at start process, reach the effect improving Android system starting up speed.
Shown in Fig. 1, method also comprises step S102, " start up system service " and " prestrain resource " is operated and does parallel processing.Described " prestrain resource " includes but not limited to: load preset class, load preset resource and load OPENGL step.In the Booting sequence of above-mentioned serial as in the previous paragraph, if there are some operations more consuming time, follow-up operating delay can be caused to perform, thus cause the on time to lengthen.In some embodiment such as shown in Fig. 2, started for 204 stages at Android system, " start up system service " will " prestrain resource " afterwards serial carry out.Specifically, be that serial is carried out between " prestrain resource ", comprise the step of successively carrying out " loading preset class ", " loading preset resource " and " loading OPENGL ", carry out " start up system service " step subsequently again.The present invention adopts the mode of parallel processing to above-mentioned steps, and described parallel processing is specially: startup " load preset class " while, start " loading preset resource ", start " loading OPENGL " and run " start up system service " simultaneously.As in some embodiment shown in Fig. 3, after the socket step creating Zygote client, run " start up system service " and " loading preset class ", " loading preset resource " and " loading OPENGL " step simultaneously.By carrying out parallel processing to the step of above-mentioned script serial processing, the step originally successively completed can be walked abreast simultaneously and carry out, the used time shortening to the longest time-consuming step consuming time.Therefore by starting start up system service and load resource operation simultaneously, reach and reduce the on time, improve the effect of Android system starting up speed.
In certain embodiments, shown in Fig. 1, method also comprises step S103, optimization system service, by the non-core service type delay start preset.Described " non-core service " refers to some services that can not use in system normal boot process, namely start irrelevant with system, influential system does not normally enter some services at main interface, and classification includes but not limited to: positioning service, input method service, backup services, phonetic search, multimedia service etc.By described non-core service type delay start, the normal function of neither influential system service, can decrease the consuming time of start up system service procedure again, reaches the effect improving Android system starting up speed.
In certain embodiments, shown in Fig. 1, method also comprises step S104, optimizes logger (Launcher), Dynamic Distribution is calculated, dynamic icon shows and loading icon micro-(Widget) is shifted out from main thread.Because system just can show Launcher after will waiting for Launcher main thread idle.And above-mentioned Dynamic Distribution calculates, dynamic icon shows and load the working time that icon micro-(Widget) operation will take main thread, in the present embodiment above-mentioned Dynamic Distribution is calculated, dynamic icon shows and loading icon micro-(Widget) operation is shifted out from main thread, transfer in other threads and gone, so just, the time of main thread can be saved, allow main thread be shown by logger as early as possible, also reached the effect improving Android system starting up speed by said method.
Shown in Fig. 1, method also comprises step S105, optimizes INIT booting script, deletes redundant code.Described INIT booting script is init.rc file, generally for compatible more platform and have some redundant codes, such as, operation for debugging in this script, and also having is exactly have some unwanted services, operation as gps, rild etc. for specific products.Therefore in certain embodiments, described " redundant code " code for using during booting script, or the code reserved for debugging.These redundant codes are deleted, the time of resolving script when booting script is reduced, follow-uply need the time of operation service also to obtain minimizing owing to optimizing unwanted service operations, reach and reduce the Android system on time, improve the effect of Android system starting up speed.
In certain embodiments, shown in Fig. 1, method also comprises step S106, is optimized peripherals driving in the LINUX stage, and I2C communication, firmware downloads and rectification step are delayed process.Described " peripherals " refers to the equipment of outside access for meeting information input and output demand, comprises the equipment such as touch-screen, inductor, network interface card, camera and sound-track engraving apparatus.Step is optimized to these device drives, process is delayed in above-mentioned operation comparatively consuming time, LINUX system can be made to load root file system as early as possible, reach the effect improving Android system starting up speed.
In the particular embodiment, shown in Fig. 1, method also comprises step S107, carries out classification, the type information needing serial ports to export not reaching severity level deleted the type information during peripherals drives.Reduce the printing needing serial ports to export unnecessary in Booting sequence, the time that the CPU that minimizing CPU is frequently interrupted interrupting by serial ports and causes performs kernel code increases, and shortens the time of load driver further.Reach the effect improving Android system starting up speed.
In certain embodiments, shown in Fig. 1, method also comprises step, carries out cutting to UBOOT file, only retains the necessary initialization operation of start.Concrete, in the UBOOT stage of start,. cutting is carried out to UBOOT, keep UBOOT file as far as possible little, such as only retain the initialization operation that some starts are necessary, " necessary initialization operation " refers to the systemic-function initialization that start is necessary, such as: initiating hardware equipment (internal memory, storage, serial ports, display, PMU etc.), the actions such as initialization system clock, frequency.Concrete, can some initialization operations of cutting comprise: LOGO display, the initialization of USB controller, the initialization of SD controller, the display of charging icon, some are in order to compatible and time delay etc. that is interpolations.Like this, start guides the time being loaded into UBOOT file indirectly to reduce, and can linux system be guided as soon as possible to start, also reach the effect improving Android system starting up speed.
Shown in Fig. 1, method also comprises step, the frequency used when determining to start shooting according to the hardware configuration of machine and the disturbed condition of hardware circuit.In certain embodiments, in order to compatibility in UBOOT, usually cpu, ddr etc. can be set to relatively low frequency, and the degree etc. of concurrent operations when deciding to start shooting according to the performance of machine memory.This is the running frequency in order to reasonably adjust machine, the hardware performance of Appropriate application machine, because the machine of memory read/write poor-performing, if do the wait that too many concurrent operations can cause IO when start, starting up speed can be made on the contrary to become slower.Therefore by arranging different start frequencies according to different hardware configuration, improve the starting up speed of Android system.
As shown in Figure 4, inventor additionally provides a kind of device of Android system quick turn-on, comprises pre-cooling module 101, and described pre-cooling module is used for starting Zygote step while startup core service.By arranging pre-cooling module, the step starting Zygote process is started while " starting main service " advances to " starting core service ", overcome the technology prejudice of those skilled in the art, reach the effect improving Android system quick turn-on.
In certain embodiments, the device of Android system quick turn-on also comprises parallel processing module 102, and described parallel processing module is used for start up system service and prestrain resource operation to do parallel processing.By arranging parallel processing module, starting start up system service simultaneously and loading resource operation, reaching time saving object, and reaching the effect reducing the on time.
In further embodiments, the device of Android system quick turn-on also comprises optimizing delay module 103, and described optimizing delay module is used for optimization system service, and the non-core service type delay start that will preset.The normal function of optimizing delay module neither influential system service is set, the consuming time of start up system service procedure can be decreased again, reach the effect of speed accelerating Android system start.
The device of Android system quick turn-on also comprises optimizes login module 104, and Dynamic Distribution for optimizing logger, and calculates by described optimization login module, dynamic icon shows and load icon micro-shifts out from main thread.By arranging optimization login module.The time of main thread can be saved, allow main thread be shown by logger as early as possible, decrease Android system start required time.
In certain embodiments, the device of Android system quick turn-on also comprises optimizes script module 105, and described optimization script module, for optimizing INIT booting script, deletes redundant code.The time of resolving script when can make booting script is reduced, and follow-uply needs the time of operation service also to obtain minimizing owing to optimizing unwanted service operations, reaches the effect reducing the Android system on time.
In certain embodiments, the device of Android system quick turn-on also comprises optimizes driver module 106, and described optimization driver module was optimized peripherals driving in the LINUX stage, and I2C communication, firmware downloads and rectification step are delayed process.By design optimization driver module 106, process is delayed in above-mentioned operation comparatively consuming time, LINUX system can be made to load root file system as early as possible, reach the effect improving Android system starting up speed.
Concrete, described optimization driver module 106 is also for carrying out classification to the type information in peripherals driving, and the type information needing serial ports to export not reaching severity level is deleted.CPU can be reduced so frequently to be interrupted interrupting by serial ports and time that the CPU that causes performs kernel code increases, shorten the time of load driver further.Reach the effect improving Android system starting up speed.
The device of Android system quick turn-on also comprises cutting module 107, and described cutting module 107, for carrying out cutting to UBOOT file, only retains the necessary initialization operation of start.By design cutting module, only retain necessary start file, save the time that the UBOOT stage needs, accelerate to guide linux system to start, also reach the effect of raising Android system starting up speed.
In certain embodiments, the device of Android system quick turn-on also comprises start frequency setting module, and described start frequency setting module is used for the frequency used when determining to start shooting according to the hardware configuration of machine.By start frequency setting module, reach the effect improving Android system starting up speed.
It should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or terminal device and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or terminal device.When not more restrictions, the key element limited by statement " comprising ... " or " comprising ... ", and be not precluded within process, method, article or the terminal device comprising described key element and also there is other key element.In addition, in this article, " be greater than ", " being less than ", " exceeding " etc. be interpreted as and do not comprise this number; " more than ", " below ", " within " etc. be interpreted as and comprise this number.
Those skilled in the art should understand, the various embodiments described above can be provided as method, device or computer program.These embodiments can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.The hardware that all or part of step in the method that the various embodiments described above relate to can carry out instruction relevant by program has come, described program can be stored in the storage medium that computer equipment can read, for performing all or part of step described in the various embodiments described above method.Described computer equipment, includes but not limited to: personal computer, server, multi-purpose computer, special purpose computer, the network equipment, embedded device, programmable device, intelligent mobile terminal, intelligent home device, wearable intelligent equipment, vehicle intelligent equipment etc.; Described storage medium, includes but not limited to: the storage of RAM, ROM, magnetic disc, tape, CD, flash memory, USB flash disk, portable hard drive, storage card, memory stick, the webserver, network cloud storage etc.
The various embodiments described above describe with reference to the process flow diagram of method, equipment (system) and computer program according to embodiment and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of computer equipment to produce a machine, making the instruction performed by the processor of computer equipment produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer equipment readable memory that works in a specific way of vectoring computer equipment, the instruction making to be stored in this computer equipment readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded on computer equipment, make to perform sequence of operations step on a computing device to produce computer implemented process, thus the instruction performed on a computing device is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although be described the various embodiments described above; but those skilled in the art are once obtain the basic creative concept of cicada; then can make other change and amendment to these embodiments; so the foregoing is only embodiments of the invention; not thereby scope of patent protection of the present invention is limited; every utilize instructions of the present invention and accompanying drawing content to do equivalent structure or equivalent flow process conversion; or be directly or indirectly used in other relevant technical fields, be all in like manner included within scope of patent protection of the present invention.