Summary of the invention
For this reason, need to provide a kind of to increase and elongated problem along with installation APK for the current Android system on time, inventor puts forward a kind of method that Android system realizes quick turn-on, comprise the steps: to read and resolve the application bag configuration file preserved, obtaining the information of preloaded list and current default desktop; Class in document framework folder under scanning system file preloaded list described in prescan, notice desktop has loaded; Close boot animation, start to show desktop.
Further, also step is comprised: scanning Application Folder; While notice desktop has loaded, start to scan Application Folder, after application scan completes, notice desktop has loaded, and refreshes application icon.
Further, also comprise step, check that framework library file is the need of optimization executable file; If be judged as NO, just carry out the operation of the information obtaining preloaded list and current default desktop; If be judged as YES, then start to optimize executable file, after optimization, notify that desktop has loaded, close boot animation, start to show desktop.
Further, also step is comprised: judge whether current desktop is prefabricated desktop; If be judged as YES, under just carrying out step scanning system file/document framework folder in class and preloaded list described in prescan, otherwise start to optimize executable file, notify after optimization that desktop has loaded, closedown boot animation, starts to show desktop.
Further, described optimization executable file operation concrete steps are, document framework folder under scanning system file and Application Folder, judge to check whether reshuffle the package informatin read in file is scanned, delete the package informatin be not scanned subsequently, start the application file folder under scan data file folder, upgrade authority and configuration information.
A kind of Android system realizes the device of quick turn-on, comprise and read parsing module, preloaded components, scan module and desktop display module, described reading parsing module is for reading and resolving the application bag configuration file preserved, and preloaded components is for obtaining the information of preloaded list and current default desktop; Scan module is used for the class in the document framework folder under scanning system file and the preloaded list described in prescan, enable desktop display module; Desktop display module, for closing boot animation, starts to show desktop.
Concrete, scan module also for while enable desktop display module, starts to scan Application Folder, and desktop display module, also for after application scan completes, refreshes application icon.
Concrete, also comprise optimization judge module, for checking, described optimization judge module judges that framework library file is the need of optimization executable file; If be judged as NO, just enable preloaded components; If be judged as YES, then optimize judge module and start to optimize executable file, enable desktop display module after optimization.
Further, also comprise optimization judge module, described optimization judge module is for judging whether current desktop is prefabricated desktop; If be judged as YES, just enable scans module, otherwise optimization judge module starts to optimize executable file, enable desktop display module after optimization.
Concrete, described optimization judge module also comprises scanning and judges submodule, delete submodule and upgrade submodule, described scanning judges that submodule is for the document framework folder under scanning system file and Application Folder, and judge to check whether reshuffle the package informatin read in file is scanned, delete submodule for deleting the package informatin be not scanned, scanning judges submodule also for the application file folder under scan data file folder, upgrades submodule for upgrading authority and configuration information.
This programme is by the means of the primary start-up phase APK scan mechanism of amendment Android system, namely the application program in priority scan system folder and prefabricated desktop programs, framework storehouse, desktop can be shown in advance, carry out scanning and the optimization of other programs subsequently again, like this, what scan before start is the Application Folder of on system folder, desktop folder and desktop about about ten forever, just can realize quick turn-on.Solve the problem that under prior art, starting up speed is slack-off after APK installation is more and more cleverly, regardless of Android how many APK after user, all can not change the starting up speed of original system.
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, under prior art, scanning process shows with system desktop in whole start process is serial for the APK (Android application data bag) in Android primary system boot stage.APK scanning mainly has PMS (Package Manager Service) to perform, first it reads and resolves the APK bag configuration file being kept at system storage region, secondly it needs scanning/system/framework, / system/priv-app, / system/app, these Application Folders of/vendor/app, after having scanned these files, check whether the APK package informatin read from configuration file is scanned, some APK bag is not scanned, that needs the APK package informatin be not scanned in Reconfigurations file, scanning/data/app file is then continued after renewal completes, and upgrade authority and configuration information, finally perform the APK of desktop, and close boot animation, display desktop completes starting procedure.
As can be seen from above-mentioned flow process obviously, if the APK quantity more than one of installing, the time that the several file of interscan and inspection upgrade privileges configuration information can increase, thus causes the on time to lengthen further.
In one particular embodiment of the present invention, inventor provide a kind of method that Android system realizes quick turn-on, as shown in Figure 2, this method is applicable to the electronic equipment having installed Android system, this method can have been come by PMS (the Package Manager Service) thread under Android system, comprise the steps S1: read and resolve the application bag configuration file preserved, concrete operations are, first confirm that current system application related information reads, and resolve the application bag configuration file being kept at system storage region, described system storage area is in Android system/system file under APK file, S1 can confirm the APK relevant information such as authority, service, acceptance of application requests.Carry out the information that step S4 obtains preloaded list and current default desktop again; Described preloaded list is obtained by loading the xml file configured, APK handbag in preloaded list is containing the service used in advance during system boot and the UI that will show, such as locking screen interface, status bar etc., if the application information that the information spinner desktop of default desktop comprises, for subsequent step.Carry out the class in the document framework folder under S6 scanning system file subsequently and the preloaded list described in prescan, document framework folder under described system folder is system/framework file in Android system, the file at this file mainly java class data place, system cloud gray model needs the support of these classes.Notify that desktop has loaded subsequently, and carry out step S7 closedown boot animation, start to show desktop.So far, by resolving configuration file, obtain and load list and DESKTOP INFORMATION, scanning runs the class needed, and/system/priv-app need not be scanned, / system/app, these Application Folders of/vendor/app, simplify starting procedure to greatest extent, reach the effect reducing the on time, solve the problem of Android system quick turn-on of how allowing, now close boot animation, start to show desktop, preloaded list and DESKTOP INFORMATION is loaded with owing to having carried out step S4, application program after start on desktop also can normally be run, do not have any exception.Also owing to scanning Application Folder, the number of applications of installing in this file can not affect the scanning required time in starting procedure, reaches the on time not by the technique effect of the quantity restriction of the application program of system installation.Reach solve the above-mentioned Android system on time can along with installation APK increase and the object of elongated problem.
In some specific embodiment, also comprise step S14: scanning Application Folder; This step embody rule mode can realize as follows, carries out S2 create a by-pass journey when PMS works, and wait for the notice that the desktop that PMS thread transmits has loaded, after having notice, S14 scans Application Folder in steps; While notice desktop has loaded, start to scan Application Folder, carried out step S15 after application scan completes and refresh application icon.Described Application Folder comprises system/priv-app, system/app, vendor/app, data/app file etc., comprise not in the application program of desktop display in these files, also mostly be user from the program of installing simultaneously, these application programs of scanning are placed on closedown boot animation, carry out while display desktop, make how many APK are installed and also do not affect the display of having started shooting with desktop, above-mentioned application program is not the application program on prefabricated desktop simultaneously, user can not use in the very first time of start, also the experience of user can not be affected.
As a specific embodiment, also comprise step S3, check that framework library file is the need of optimization executable file; Described executable file is the file of the DEX form in Android system, can analogize to the file of the EXE form under the Windows operating system that most people know.The effect carrying out this determining step is, if system first time opens, whether (as the first time after device systems new clothes starts shooting or first time start after factory reset) can go to detect to have to generate and apply corresponding DEX file, if then will not generate and optimize, efficiency when application runs after improving like this.Therefore, if be judged as NO, just carry out the operation of the information obtaining preloaded list and current default desktop; If be judged as YES, namely S8 is judged to need to optimize DEX executable file, then start to optimize executable file, notify that desktop has loaded after optimization, close boot animation, start to show desktop.By setting steps S3, avoid first time start time not yet optimization system file just carry out the operations such as the reading of preloaded list, namely avoid possible run-time error, the equipment of first time start is optimized simultaneously, later device power-up speed can be made to accelerate.
In other specific embodiments, also comprise step S5: judge whether current desktop is prefabricated desktop; If be judged as YES, under just carrying out step scanning system file/document framework folder in class and preloaded list described in prescan, otherwise start to optimize executable file, notify after optimization that desktop has loaded, closedown boot animation, starts to show desktop.Described prefabricated desktop is interpreted as the desktop that Optimum Operation is crossed, refer to the desktop of desktop UI and all optimised mistake of homepage application program in the present embodiment, concrete which application program current that can read from system configuration log file is homepage application, and can do further confirmation by bag name.If not described prefabricated desktop, then enter step S8 and be judged to need to optimize DEX executable file, be optimized executable file operation.The meaning of design procedure S5 is, avoid change homepage application after not yet optimization system file just carry out the operations such as class loading, namely avoid possible run-time error, the homepage application program of desktop UI and desktop is optimized simultaneously, also can improve later device power-up speed.
In some specific embodiment, the concrete steps S9 of described optimization executable file operation is: the document framework folder under scanning system file and Application Folder, i.e. system/framework document framework folder and system/priv-app, system/app, these Application Folders of vendor/app, carry out S10 again and judge whether reshuffle the package informatin read in file is scanned, S13 is carried out for the file do not scanned and deletes the package informatin be not scanned, and carry out the application file that step S11 starts scan data file folder lower and press from both sides, namely/data/app file, and carry out S12 renewal authority and configuration information.Carry out above-mentioned optimization executable file step, delete not by file, package informatin etc. that scanning optimization is crossed, allow system in starting procedure, no longer scan these files, save the time of scanning document, the starting up speed of system in the operation after raising.
Inventor additionally provides the device that a kind of Android system realizes quick turn-on, comprise and read parsing module 31, preloaded components 32, scan module 33 and desktop display module 34, described reading parsing module 31 is for reading and resolving the application bag configuration file preserved, and preloaded components 32 is for obtaining the information of preloaded list and current default desktop; Scan module is used for the class in the document framework folder under scanning system file and the preloaded list described in prescan, enable desktop display module; Desktop display module 34, for closing boot animation, starts to show desktop.By above-mentioned module, make Android system in the class of just having carried out resolving configuration file, acquisition loads list and DESKTOP INFORMATION, scanning operation need, etc. all preliminary work, now close boot animation, start to show desktop, the application program on desktop also can normally be run, and does not have any exception, and owing to eliminating the step of scanning Application Folder, reach the on time not by the technique effect of the quantity restriction of the application program of system installation.Also reach solve the above-mentioned Android system on time can along with installation APK increase and the object of elongated problem.
Concrete, scan module 33 also for while enable desktop display module, starts to scan Application Folder, and desktop display module 35, also for after application scan completes, refreshes application icon.The benefit of design scan module is carried out while being these application programs of scanning to be placed on and closing boot animation, display desktop, make how many APK are installed and also do not affect the display of having started shooting with desktop, above-mentioned application program is not the application program on prefabricated desktop simultaneously, user can not use in the very first time of start, also can not affect the experience of user.
In further embodiments, also comprise and optimize judge module 35, for checking, described optimization judge module 35 judges that framework library file is the need of optimization executable file; If be judged as NO, just enable preloaded components; If be judged as YES, then optimize judge module and start to optimize executable file, enable desktop display module after optimization.The benefit of design optimization judge module in avoiding just carries out quick turn-on operation when first time start, avoids possible run-time error, also improves the operational efficiency of system.
In other specific embodiments, described optimization judge module 35 is for judging whether current desktop is prefabricated desktop; If be judged as YES, just enable scans module 33, otherwise optimization judge module starts to optimize executable file, enable desktop display module after optimization.Another benefit of design optimization judge module in avoiding carries out quick turn-on operation after have changed homepage application or prefabricated desktop, avoids possible run-time error, also improves the operational efficiency of system.
Concrete described optimization judge module 35 also comprises scanning and judges submodule 351, deletes submodule 352, upgrades submodule 353, described scanning judges that submodule is for the document framework folder under scanning system file and Application Folder, and judge to check whether reshuffle the package informatin read in file is scanned, delete submodule for deleting the package informatin be not scanned, scanning judges submodule also for the application file folder under scan data file folder, upgrades submodule for upgrading authority and configuration information.Design getting well of these submodules be in updating file and distribute information rationally, delete the file package informatin do not scanned, make system need not lose time when quick turn-on to scan these files, also system of being convenient to calls executable file in quick turn-on operation afterwards, improves the travelling speed of application program and system.
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.