Nothing Special   »   [go: up one dir, main page]

CN104503788A - Setting method capable of shortening starting time of Android operating system - Google Patents

Setting method capable of shortening starting time of Android operating system Download PDF

Info

Publication number
CN104503788A
CN104503788A CN201410784129.6A CN201410784129A CN104503788A CN 104503788 A CN104503788 A CN 104503788A CN 201410784129 A CN201410784129 A CN 201410784129A CN 104503788 A CN104503788 A CN 104503788A
Authority
CN
China
Prior art keywords
android
point file
virtual machine
service
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201410784129.6A
Other languages
Chinese (zh)
Inventor
杨霞
桑楠
孙海泳
石鹏
雷林
孙超群
刘志伟
武琼
刘维飞
袁艺
杨姗
沈游人
李昊星
唐伟文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN201410784129.6A priority Critical patent/CN104503788A/en
Publication of CN104503788A publication Critical patent/CN104503788A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

本发明公开了一种缩短安卓操作系统启动时间的设置方法,属于操作系统快速启动技术领域。本发明包括启动安卓设备,执行引导程序,由引导程序装载Linux内核;再执行安卓用户空间资源加载、本地服务开启和用户分区扫描后,执行Zygote进程,在加载完安卓虚拟机所需的类与资源后,中断该进程并为其设置还原点文件,以及创建还原点文件检查进程,设置该进程在引导程序装载Linux内核后启动,用于判断是否存在所述还原点文件,若存在,则根据还原点文件对初始化安卓虚拟机进程进行还原;若不存在,则执行初始化安卓虚拟机进程。本发明用于安卓设备,能在保证用户体验的前提下显著缩短系统启动时间。

The invention discloses a setting method for shortening the startup time of an Android operating system, and belongs to the technical field of quick startup of an operating system. The present invention includes starting the Android device, executing the boot program, and loading the Linux kernel by the boot program; and then executing the Android user space resource loading, local service opening and user partition scanning, executing the Zygote process, and loading the Android virtual machine. After the resource, interrupt the process and set the restore point file for it, and create a restore point file inspection process, set the process to start after the bootloader loads the Linux kernel, to judge whether there is the restore point file, if it exists, then according to The restore point file restores the process of initializing the Android virtual machine; if it does not exist, then executes the process of initializing the Android virtual machine. The invention is used for Android devices, and can significantly shorten the system startup time under the premise of ensuring user experience.

Description

一种缩短安卓操作系统启动时间的设置方法A setting method for shortening the startup time of the Android operating system

技术领域technical field

本发明涉及操作系统快速启动技术,特别是一种基于安卓操作系统的快速启动方法。The invention relates to an operating system quick-start technology, in particular to a quick-start method based on an Android operating system.

背景技术Background technique

安卓是一种基于Linux的自由及开源的操作系统,安卓操作系统已广泛应用于移动设备、智能家电等领域,如智能手机、平板电脑、机顶盒、智能电视等。随着安卓操作系统在这些领域的大量使用,系统启动速度慢成为许多用户抱怨的缺点。相比手机这类平时较少断电冷启动的设备,平板电脑、智能电视等在实际使用中断电冷启动的频率相对较高,开机速度是影响用户体验的一个重要因素。Android is a free and open-source operating system based on Linux. The Android operating system has been widely used in mobile devices, smart home appliances and other fields, such as smartphones, tablets, set-top boxes, and smart TVs. With the extensive use of the Android operating system in these fields, the slow system startup speed has become a shortcoming that many users complain about. Compared with devices such as mobile phones, which are less likely to be powered off and cold-started, tablet computers and smart TVs have a relatively high frequency of power-off cold-starts in actual use. Boot speed is an important factor affecting user experience.

安卓操作系统启动过程如图1所示,按照先后顺序分别为:引导程序、Linux内核、本地服务、安卓虚拟机、安卓服务、应用程序的启动。安卓操作系统从设备通电到进入安卓用户界面,一般需要35秒左右的时间,而用户空间启动就占用了多于28秒的时间:从Zygote进程(该进程用于设备开机过程中初始化安卓虚拟机)被创建到SystemServer进程(该进程用于管理安卓系统服务)被创建用时18秒左右;从SystemServer进程被创建到最终进入用户界面,用时10秒左右。Zygote进程通过预加载近2800多个类以及图标、图像、字符串等资源来完成安卓虚拟机的初始化,这会消耗大量时间。SystemServer进程的耗时在于启动安卓服务并扫描安装包。The start-up process of the Android operating system is shown in Figure 1, and the sequence is as follows: bootloader, Linux kernel, local service, Android virtual machine, Android service, and application startup. It generally takes about 35 seconds for the Android operating system to enter the Android user interface from when the device is powered on, and it takes more than 28 seconds to start the user space: from the Zygote process (this process is used to initialize the Android virtual machine during the device boot process) ) is created until the SystemServer process (the process is used to manage Android system services) is created, it takes about 18 seconds; from the SystemServer process is created to the final access to the user interface, it takes about 10 seconds. The Zygote process completes the initialization of the Android virtual machine by preloading nearly 2,800 classes and resources such as icons, images, and strings, which consumes a lot of time. The time-consuming of the SystemServer process is to start the Android service and scan the installation package.

当前缩短安卓启动时间的方案主要是基于ARM Hibernation(休眠/唤醒技术)的方法:将内存中的所有数据以及CPU、设备的运行状态的数据全部保存到该方案所申请的内存空间中,生成快速启动的内存映像并将内存映像以特定格式保存到外存(非易失的存储设备),以后设备每次启动时由引导程序从外存读取特定格式的内存映像到内存并且恢复CPU、设备的运行状态信息。该方法直接从备份的映像文件读取信息并恢复系统的运行状态,跳过了每次启动时对最新的系统分区和用户分区的扫描阶段,因此用户每次安装新应用程序后必须重新做一次系统的休眠/唤醒以生成内存映像,否则设备重启后新安装的应用程序就会消失,而这一过程需要花费较长的时间,该缺点严重影响了用户体验。The current solution to shorten Android startup time is mainly based on ARM Hibernation (sleep/wake-up technology): all the data in the memory and the data of the running state of the CPU and the device are all saved in the memory space applied for by the solution, generating fast Start the memory image and save the memory image to the external memory (non-volatile storage device) in a specific format. After each startup of the device, the boot program will read the memory image in a specific format from the external memory to the memory and restore the CPU and device. operating status information. This method directly reads information from the backup image file and restores the operating state of the system, skipping the scanning stage of the latest system partition and user partition at each startup, so the user must do it again after each installation of a new application The system sleeps/wakes up to generate a memory image, otherwise the newly installed application will disappear after the device restarts, and this process takes a long time, which seriously affects the user experience.

发明内容Contents of the invention

本发明目的是针对安卓操作系统启动较缓慢的问题以及现有相关技术方案的不足,提出了一种在用户空间缩短安卓操作系统启动时间的设置方法。The object of the present invention is to propose a setting method for shortening the startup time of the Android operating system in the user space, aiming at the problem of slow startup of the Android operating system and the shortcomings of existing related technical solutions.

为了实现上述目的,本发明的技术方案是:改进现有的初始化安卓虚拟机进程(Zygote进程)的启动过程,其具体实现包括下列步骤:In order to achieve the above object, the technical solution of the present invention is: improve the start-up process of existing initialization Android virtual machine process (Zygote process), its concrete realization comprises the following steps:

步骤1:启动安卓设备,执行引导程序,由引导程序装载Linux内核;再执行安卓用户空间资源加载、本地服务开启和用户分区扫描;Step 1: Start the Android device, execute the boot program, and load the Linux kernel by the boot program; then perform Android user space resource loading, local service opening and user partition scanning;

步骤2:执行初始化安卓虚拟机进程,在加载完安卓虚拟机所需的类与资源后,中断初始化安卓虚拟机进程;Step 2: Execute the process of initializing the Android virtual machine, and after loading the classes and resources required by the Android virtual machine, interrupt the process of initializing the Android virtual machine;

步骤3:为Zygote进程创建还原点:设置还原点文件的文件目录(可任意设置存放文件目录),并在该文件目录下创建还原点文件,所述还原点文件包括当前进程链接信息、进程ID、CPU状态信息、进程的内存执行环境信息;Step 3: Create a restore point for the Zygote process: set the file directory of the restore point file (you can arbitrarily set the storage file directory), and create a restore point file under this file directory. The restore point file includes current process link information, process ID , CPU status information, memory execution environment information of the process;

创建还原点文件检查进程,设置所述还原点文件检查进程在引导程序装载Linux内核后启动,用于判断是否存在所述还原点文件(即用户在启动安卓设备时起作用),若存在,则根据还原点文件对Zygote进程进行还原(即Zygote进程在还原点处开始运行从而跳过了类与资源的预加载阶段,完成快速启动过程);若不存在,则基于现有的方式执行Zygote进程。Create a restore point file inspection process, set the restore point file inspection process to start after the bootloader loads the Linux kernel, and be used to judge whether there is the restore point file (that is, the user plays a role when starting the Android device), if it exists, then Restore the Zygote process according to the restore point file (that is, the Zygote process starts running at the restore point to skip the preloading stage of classes and resources, and complete the fast startup process); if it does not exist, execute the Zygote process based on the existing method .

本发明对现有的Zygote进程创建了还原点,每次系统启动时只需要找到相应的还原点文件进行还原即可,避免了系统每次启动时进行重复的预加载类与资源操作,这一优化可以节约14秒左右的系统启动时间。同时,由于本发明不会跳过每次启动时对最新的系统分区和用户分区的扫描阶段,用户无需靠重新生成内存映像去保证设备重启后新安装应用的存在,弥补了现有方案的不足,提高了用户体验。The present invention creates restore points for the existing Zygote process, and only needs to find the corresponding restore point files to restore each time the system starts, avoiding repeated preloading class and resource operations when the system starts each time. Optimization can save about 14 seconds of system startup time. At the same time, since the present invention does not skip the scanning stage of the latest system partition and user partition each time it is started, the user does not need to rely on regenerating the memory image to ensure the existence of the newly installed application after the device is restarted, which makes up for the shortcomings of the existing solutions , improving the user experience.

进一步的,本发明的步骤3还包括,在创建还原点文件后,继续执行初始化安卓虚拟机进程,并判断系统是否能进行安卓用户界面,若否,则执行步骤2,该处理用于检测备份Zygote进程还原点文件成功是否备份成功。Further, step 3 of the present invention also includes, after creating the restore point file, continue to execute the process of initializing the Android virtual machine, and judge whether the system can carry out the Android user interface, if not, then perform step 2, which is used to detect the backup Whether the Zygote process restore point file is successfully backed up.

为了进一步缩短系统启动时间,本发明还包括延迟加载包、延迟启动初始服务设置:In order to further shorten the system startup time, the present invention also includes delay loading package, delay start initial service setting:

即将系统分区的安装包和服务分为延迟安装包、延迟服务和启动安装包、启动服务(具体可根据用户需求调查挑选出用户不常用或系统启动后不会被用户立即使用的安装包和服务作为延迟安装包、延迟服务),将延迟安装包和服务从系统分区移动到用户分区;在安卓操作系统启动完成后,再启动延迟安装包和服务。The installation packages and services of the system partition are divided into delayed installation packages, delayed services and start-up installation packages, and start-up services (specifically, according to user demand surveys, we can select installation packages and services that are not commonly used by users or that will not be used by users immediately after system startup. As a delayed installation package, delayed service), the delayed installation package and service are moved from the system partition to the user partition; after the Android operating system is started, the delayed installation package and service are started.

该延迟设置可以在上述步骤1、2或3任意一个步骤处理中进行或者在完成上述步骤1、2、3之后。在上述设置中,对非必要的安装包及服务进行延迟加载的操作,这一方法可以节约5秒左右的启动时间。The delay setting can be performed during any one of the above steps 1, 2 or 3 or after the above steps 1, 2 and 3 are completed. In the above settings, the non-essential installation packages and services are delayed loaded. This method can save about 5 seconds of startup time.

综上所述,由于采用了上述技术方案,本发明的有益效果是:本发明对Zygote进程创建了还原点,每次启动时只需要找到相应的还原点文件进行还原即可,避免了系统每次启动时进行重复的预加载类与资源操作,这一优化可以节约14秒左右的启动时间。其次,本发明对非必要的安装包及服务进行延迟加载的操作,这一方法可以节约5秒左右的启动时间。最后,由于本发明不会跳过每次启动时对最新的系统分区和用户分区的扫描阶段,用户无需靠重新生成内存映像去保证设备重启后新安装应用的存在,弥补了现有方案的不足,提高了用户体验。In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are: the present invention has created a restore point to the Zygote process, and only needs to find the corresponding restore point file to restore when starting each time, avoiding the system Repeated preloading class and resource operations at the first startup, this optimization can save about 14 seconds of startup time. Secondly, the present invention performs delay loading operation on non-essential installation packages and services, and this method can save about 5 seconds of startup time. Finally, since the present invention does not skip the scanning stage of the latest system partition and user partition each time it is started, the user does not need to rely on regenerating the memory image to ensure the existence of the newly installed application after the device is restarted, which makes up for the shortcomings of the existing solutions , improving the user experience.

附图说明Description of drawings

本发明将通过例子并参照附图的方式说明,其中:The invention will be illustrated by way of example with reference to the accompanying drawings, in which:

图1是安卓操作系统正常启动时的系统架构图。FIG. 1 is a system architecture diagram when the Android operating system starts normally.

图2是本发明实施例1的设置流程图。Fig. 2 is a flow chart of setting in Embodiment 1 of the present invention.

具体实施方式Detailed ways

为使本发明的目的、技术方案和优点更加清楚,下面结合实施方式,对本发明作进一步地详细描述。In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the embodiments.

实施例1Example 1

参见图2,为了实现缩短安卓操作系统启动时间,本发明包括下列设置:Referring to Fig. 2, in order to realize shortening the startup time of the Android operating system, the present invention includes the following settings:

步骤101:启动安卓设备,执行引导程序,由引导程序装载Linux内核;再执行安卓用户空间资源加载、本地服务开启和用户分区扫描,即基于现有的安卓操作系统完成系统的初始化。Step 101: Start the Android device, execute the boot program, and load the Linux kernel by the boot program; then perform Android user space resource loading, local service opening and user partition scanning, that is, complete system initialization based on the existing Android operating system.

步骤102:由Zygote进程加载完安卓虚拟机所需的类与资源后,中断Zygote进程(由系统的库libprocr.so提供的procr_freeze_process函数(该函数具有预处理检查功能)停掉中断时钟并堵塞相关信号以冻结Zygote进程)Step 102: after the Zygote process has loaded the required classes and resources of the Android virtual machine, interrupt the Zygote process (the procr_freeze_process function provided by the library libprocr.so of the system (this function has a preprocessing check function) stops the interrupt clock and blocks the relevant signal to freeze the Zygote process)

步骤103:Step 103:

(1)由库libprocr.so提供的函数完成对Zygote进程的还原点创建,即当调用库libprocr.so提供的相关函数后进程就会为Zygote进程创建还原点:(1) The function provided by the library libprocr.so completes the creation of the restore point for the Zygote process, that is, when the related functions provided by the library libprocr.so are called, the process will create a restore point for the Zygote process:

本步骤中,基于获取的当前安卓操作系统文件的文件结构,为还原点文件写入可被库libprocr.so识别的头部信息(即为还原点文件设置可被库libprocr.so识别的标示符)。In this step, based on the obtained file structure of the current Android operating system file, write header information that can be recognized by the library libprocr.so for the restore point file (that is, set an identifier that can be recognized by the library libprocr.so for the restore point file ).

在Zygote进程的preload()函数后加入procr_request_check()库函数,该函数向内核发送信号使得Zygote进程陷入内核为自己创建还原点文件(本实施例中还原点文件命名为Zygote.procr);首先指定还原点文件的文件目录,本实施例中,设置为/data/,然后将当前Zygote进程链接信息、Zygote进程ID、CPU状态信息、Zygote进程的内存执行环境信息、signal信息(表头文件,用于设置某一信号的对应动作)保存到所创建的还原点文件中;After the preload () function of Zygote process, add procr_request_check () library function, this function sends signal to kernel and makes Zygote process fall into kernel to create restore point file for oneself (restore point file is called Zygote.procr in the present embodiment); The file directory of the restore point file, in this embodiment, is set to/data/, then the current Zygote process link information, Zygote process ID, CPU state information, the memory execution environment information of the Zygote process, signal information (table header file, use To set the corresponding action of a certain signal) to the created restore point file;

(2)创建还原点文件检查进程(本实施例命名为procr进程),并设置procr进程在引导程序装载Linux内核后启动,用于判断/data/下是否存在上述设置的还原点文件,若存在,则根据还原点文件对Zygote进程进行还原;否则基于现有的方式执行Zygote进程。(2) Create a restore point file inspection process (the present embodiment is named as the procr process), and set the procr process to start after the boot program loads the Linux kernel to determine whether there is a restore point file for the above settings under /data/, if there is , the Zygote process is restored according to the restore point file; otherwise, the Zygote process is executed based on the existing method.

本实施例中,procr进程的设置具体为:In this embodiment, the setting of the procr process is specifically:

编写文件procr.sh:首先检查/data/下是否存在进程还原点文件。如果存在,还原Zygote进程;否则,创建procr进程,并由procr进程创建Zygote进程,基于现有的方式执行Zygote进程。Write the file procr.sh: first check whether there is a process restore point file under /data/. If it exists, restore the Zygote process; otherwise, create a procr process, and the Zygote process is created by the procr process, and the Zygote process is executed based on the existing method.

将procr.sh文件放到/system/bin目录下并修改其权限为可执行,修改init.rc脚本(该脚本记录着初始化进程执行的功能)使得系统在创建Zygote进程前先创建procr进程。Put the procr.sh file in the /system/bin directory and modify its permissions to be executable, and modify the init.rc script (the script records the functions executed by the initialization process) to make the system create the procr process before creating the Zygote process.

本实施例中个,在根据还原点文件对Zygote进程进行还原处理时,由procr进程的proc_restart程序(/system/bin/proc_restart-f/data/Zygote.procr//恢复进程状态)根据还原点文件内容恢复Zygote进程ID、CPU状态信息、Zygote进程的内存执行环境信息。将proc_restart放到/system/bin目录下修改成可执行权限,并将还原文件Zygote.procr保存在/data目录下,为只读权限。Zygote进程恢复可运行状态后,在还原点处继续运行从而跳过耗时的类与资源的预加载阶段,实现了系统的快速启动。In this embodiment, when the Zygote process is restored according to the restore point file, the proc_restart program (/system/bin/proc_restart-f/data/Zygote.procr//recovery process state) of the procr process is based on the restore point file The content restores the Zygote process ID, CPU status information, and memory execution environment information of the Zygote process. Put proc_restart in the /system/bin directory and change it to executable permission, and save the restore file Zygote.procr in the /data directory with read-only permission. After the Zygote process returns to the runnable state, it continues to run at the restore point, thereby skipping the time-consuming preloading stage of classes and resources, and realizing the rapid startup of the system.

步骤104:Zygote进程完成还原点创建,如果Zygote进程继续运行最后成功进入安卓用户界面说明备份Zygote进程还原点文件成功,否则进入步骤102重新备份;Step 104: the Zygote process completes the restore point creation, if the Zygote process continues to run and successfully enters the Android user interface at last to illustrate that the backup Zygote process restore point file is successful, otherwise enter step 102 to back up again;

本步骤中,Zygote进程完成还原点创建后退回到procr进程,先把停掉的中断时钟打开再把堵塞的信号恢复过来,再继续运行后续进程(以进入安卓用户界面)以测试是否备份Zygote进程成功。In this step, the Zygote process returns to the procr process after completing the creation of the restore point, first turns on the stopped interrupt clock and then restores the blocked signal, and then continues to run the subsequent process (to enter the Android user interface) to test whether the Zygote process is backed up success.

经上述设置后的安卓设备,用户在启动安卓是设备后,首先执行引导程序,由引导程序装载Linux内核,在执行安卓用户空间资源加载、本地服务开启和用户分区扫描后,则执行procr进程;进程procr会首先检查/data/下是否存在还原点文件,若否,则由procr进程重新创建Zygote进程进入现有的启动模式;若是,则进入本发明的快速启动模式(根据还原文件将Zygote进程进行运行状态还原后执行后续进程后进入安卓用户界面),即在还原点处继续运行从而跳过耗时的类与资源的预加载阶段,实现了系统的快速启动。For the Android device after the above settings, after starting the Android device, the user first executes the boot program, and the Linux kernel is loaded by the boot program, and after performing Android user space resource loading, local service opening and user partition scanning, the procr process is executed; Process procr can at first check whether there is a restore point file under /data/, if not, then recreate Zygote process by procr process and enter existing start-up mode; After restoring the running state, execute the follow-up process and enter the Android user interface), that is, continue to run at the restore point to skip the time-consuming preloading stage of classes and resources, and realize the rapid startup of the system.

实施例2Example 2

在实施例1的设置方式上增设了关于延迟安装包、延迟服务的设置,具体为:In the setting method of embodiment 1, settings about delaying installation packages and delaying services are added, specifically:

在步骤101中,根据用户需求调查挑选出用户不常用或系统启动后不会被用户立即使用的安装包和服务,定义为延迟安装包、延迟服务,其余的定义为启动安装包、启动服务;In step 101, the installation packages and services that are not commonly used by users or that will not be used by users immediately after system startup are selected according to the user demand survey, which are defined as delayed installation packages and delayed services, and the rest are defined as startup installation packages and startup services;

然后将延迟安装包、延迟服务从系统分区移到用户分区,从而实现对非必要服务的暂时堵塞init.rc脚本(该脚本记录着初始化进程执行的功能);Then move the delayed installation package and delayed service from the system partition to the user partition, thereby temporarily blocking the init.rc script for unnecessary services (the script records the functions performed by the initialization process);

本步骤中,我们以堵塞服务A为例给出具体的实施方式。首先,在init.rc脚本中添加代码:In this step, we take the blocking service A as an example to give a specific implementation manner. First, add code to the init.rc script:

On property:ro.user.start=1On property: ro.user.start=1

Start AStart A

在init.rc脚本文件中,记录着某个属性改变后要采取的动作,动作的执行条件以“onproperty:<key>=<value>”形式给出。当某个执行条件相关的键值被设定后,与该条件相关的触发器就会被触发。如上所示,当ro.user.start属性值被设置为1时,A服务就会被启动。In the init.rc script file, the action to be taken after a property is changed is recorded, and the execution condition of the action is given in the form of "onproperty:<key>=<value>". When a key value related to an execution condition is set, the trigger related to the condition will be triggered. As shown above, when the ro.user.start attribute value is set to 1, the A service will be started.

最后,在安卓操作系统启动完成后启动延迟安装包和服务,本实施例中,采用由定制的安卓应用(本实施例中命名为Delayinit.apk),选择用户inactivity状态启动被堵塞的服务并且安装用户分区的包。本步骤中,将定制的安卓应用——Delayinit.apk加入系统。系统启动完成后,安卓Application Framework会向Delayinit.apk发送一个Intent消息,命名为BOOTCOMPLETED Intent。以上述服务A为例,Delayinit.apk收到关于服务A的intent消息后会选择用户inactivity状态设置ro.user.start属性为1并唤醒init进程开启服务A。当用户处于inactivity状态时,Delayinit.apk也会调用“PM”工具去扫描安装用户分区的安装包。所述“PM”工具由安卓操作系统提供,它会隐式的调用Package Manager系统服务完成特定分区(本实施例为用户分区)中安装包和服务的扫描和安装工作。Finally, start the delayed installation package and service after the start of the Android operating system is complete. In this embodiment, use a customized Android application (named Delayinit.apk in this embodiment), select the user inactivity state to start the blocked service and install Packages for user partitions. In this step, add the customized Android application - Delayinit.apk to the system. After the system startup is complete, the Android Application Framework will send an Intent message to Delayinit.apk, named BOOTCOMPLETED Intent. Taking the above service A as an example, after receiving the intent message about service A, Delayinit.apk will select the user inactivity state, set the ro.user.start attribute to 1 and wake up the init process to start service A. When the user is in the inactivity state, Delayinit.apk will also call the "PM" tool to scan the installation package for installing the user partition. Described " PM " tool is provided by Android operating system, and it can call Package Manager system service implicitly to complete the scanning and installation work of installation package and service in specific partition (this embodiment is user partition).

本发明的恢复Zygote进程到特定的执行状态与现有的基于ARM Hibernation的休眠/唤醒技术的不同之处在于:Zygote进程恢复到还原点处开始运行仅仅跳过了类与资源的预加载阶段并不影响系统应用的更新,因此需要恢复的信息量少,恢复迅速。而现有的基于ARMHibernation的休眠/唤醒技术会跳过安卓用户空间启动甚至Linux内核启动,虽然节约了被跳过部分的启动时间,但是需要恢复的信息量大,恢复耗时,并且每次从备份的映像文件恢复导致不能更新系统应用。The difference between the recovery Zygote process of the present invention and the existing dormancy/wake-up technology based on ARM Hibernation to a specific execution state is: the Zygote process returns to the restore point and starts running, only skipping the preloading stage of classes and resources and Updates that do not affect system applications, so the amount of information that needs to be restored is small and the restoration is rapid. However, the existing sleep/wake-up technology based on ARMHibernation will skip Android user space startup or even Linux kernel startup. Although the startup time of the skipped part is saved, the amount of information to be restored is large, and recovery is time-consuming. Restoring the backed-up image file results in failure to update system applications.

采用实施例1所述的方法,通过BootChart工具采集正常启动和快速启动的进程启动时间信息。正常启动时,从Zygote进程创建到加载完类与资源用时18秒左右;快速启动时,完成这一过程仅用时4秒左右。Using the method described in Embodiment 1, the process startup time information of normal startup and fast startup is collected through the BootChart tool. When starting normally, it takes about 18 seconds from the creation of the Zygote process to the loading of classes and resources; when starting quickly, it only takes about 4 seconds to complete this process.

采用实施例2所述的方法,通过BootChart工具采集正常启动和快速启动的进程启动时间信息。未采用延迟技术时,从SystemServer进程被创建到最终进入用户界面,用时10秒左右;采用延迟技术后,完成这一过程仅用时5秒左右。Using the method described in Embodiment 2, the process startup time information of normal startup and fast startup is collected through the BootChart tool. When the delay technology is not used, it takes about 10 seconds from the creation of the SystemServer process to the final access to the user interface; after the delay technology is used, it only takes about 5 seconds to complete this process.

本发明并不局限于前述的具体实施方式。本发明扩展到任何在本说明书中披露的新特征或任何新的组合,以及披露的任一新的方法或过程的步骤或任何新的组合。The present invention is not limited to the foregoing specific embodiments. The present invention extends to any new feature or any new combination disclosed in this specification, and any new method or process step or any new combination disclosed.

Claims (3)

1. shorten the method to set up of Android operation system start-up time, it is characterized in that, comprise the following steps:
Step 1: start Android device, performs boot, loads linux kernel by boot; Perform the loading of Android user's space resource again, local service is opened and user partition is scanned;
Step 2: perform initialization Android virtual machine process, after the class loaded needed for Android virtual machine and resource, interrupts initialization Android virtual machine process;
Step 3: the file directory that restoration point file is set, and restoration point file is created under described file directory, described restoration point file comprises the internal memory execution environment information of current process link information, process ID, CPU status information, process;
Create restoration point file checking process, arrange described restoration point file checking process to start after boot loads linux kernel, there is described restoration point file for judging whether, if exist, then according to restoration point file, initialization Android virtual machine process being reduced; If do not exist, then perform initialization Android virtual machine process.
2. the method for claim 1, is characterized in that, described step 3 also comprises, and after establishment restoration point file, continues to perform initialization Android virtual machine process, and judges whether system can carry out Android user interface, if not, then perform step 2.
3. method as claimed in claim 1 or 2, is characterized in that, also comprises and the installation kit of system partitioning and service are divided into delay installation kit, Delay Service and startup installation kit, startup service, delay installation kit and service are moved to user partition from system partitioning; After Android operation system has started, restart and postponed installation kit and service.
CN201410784129.6A 2014-12-16 2014-12-16 Setting method capable of shortening starting time of Android operating system Pending CN104503788A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410784129.6A CN104503788A (en) 2014-12-16 2014-12-16 Setting method capable of shortening starting time of Android operating system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410784129.6A CN104503788A (en) 2014-12-16 2014-12-16 Setting method capable of shortening starting time of Android operating system

Publications (1)

Publication Number Publication Date
CN104503788A true CN104503788A (en) 2015-04-08

Family

ID=52945189

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410784129.6A Pending CN104503788A (en) 2014-12-16 2014-12-16 Setting method capable of shortening starting time of Android operating system

Country Status (1)

Country Link
CN (1) CN104503788A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105808253A (en) * 2016-03-04 2016-07-27 北京奇虎科技有限公司 Android system startup method and apparatus
CN106126295A (en) * 2016-06-29 2016-11-16 宇龙计算机通信科技(深圳)有限公司 The control method of application program and control device, terminal
CN106162279A (en) * 2016-07-01 2016-11-23 青岛海信电器股份有限公司 TV remote key response method based on Android operation system and TV
CN106406919A (en) * 2015-07-27 2017-02-15 青岛海信移动通信技术股份有限公司 Terminal device pre-loaded application management method and terminal device
CN107391181A (en) * 2017-06-29 2017-11-24 上海与德科技有限公司 A kind of method and device of system partitioning
CN108196892A (en) * 2017-12-29 2018-06-22 北京安云世纪科技有限公司 For the method, apparatus and mobile terminal being customized to system starting process
CN109683983A (en) * 2018-12-11 2019-04-26 青岛海信电器股份有限公司 A kind of generation of image file and loading method, equipment
CN110287012A (en) * 2019-06-21 2019-09-27 努比亚技术有限公司 Multiprocessing method, wearable device and the medium of intelligent wearable device
CN111258669A (en) * 2020-03-25 2020-06-09 上海商汤临港智能科技有限公司 Face recognition method and device and storage medium
CN111782342A (en) * 2020-06-30 2020-10-16 联想(北京)有限公司 Virtual machine starting method and device
CN112181534A (en) * 2020-10-21 2021-01-05 上海商米科技集团股份有限公司 Method and equipment for dynamically managing display interface of electronic equipment
CN112395015A (en) * 2020-11-18 2021-02-23 珠海全志科技股份有限公司 Optimization method and device for accelerating startup based on Android system
CN113672339A (en) * 2021-07-28 2021-11-19 歌尔光学科技有限公司 Method for improving Android startup efficiency
CN114218563A (en) * 2021-12-02 2022-03-22 北京江民新科技术有限公司 Method and system for trapping Lesovirus
CN115292721A (en) * 2022-10-09 2022-11-04 北京麟卓信息科技有限公司 Starting method for adapting to multiple Linux kernels in android compatible environment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102012832A (en) * 2010-12-14 2011-04-13 Tcl集团股份有限公司 Method and device for accelerating starting Android system
CN102207881A (en) * 2011-07-07 2011-10-05 电子科技大学 Quick operation system start-up method based on Android
CN104102506A (en) * 2014-04-25 2014-10-15 华南理工大学 ARM (Advanced RISC Machine) platform based Android startup acceleration method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102012832A (en) * 2010-12-14 2011-04-13 Tcl集团股份有限公司 Method and device for accelerating starting Android system
CN102207881A (en) * 2011-07-07 2011-10-05 电子科技大学 Quick operation system start-up method based on Android
CN104102506A (en) * 2014-04-25 2014-10-15 华南理工大学 ARM (Advanced RISC Machine) platform based Android startup acceleration method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
XIA YANG: "Shortening the Boot Time of Android OS", 《IEEE COMPUTER SOCIETY》 *
缪汉威: "Android启动优化研究及应用", 《中国优秀硕士学位论文全文数据库信息科技辑》 *
郑文选: "基于Android快速启动技术的系统一致性的研究与实现", 郑文选", 《万方学术》 *

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106406919A (en) * 2015-07-27 2017-02-15 青岛海信移动通信技术股份有限公司 Terminal device pre-loaded application management method and terminal device
CN105808253A (en) * 2016-03-04 2016-07-27 北京奇虎科技有限公司 Android system startup method and apparatus
CN105808253B (en) * 2016-03-04 2019-05-21 北京奇虎科技有限公司 The method and device of Android system starting up
CN106126295A (en) * 2016-06-29 2016-11-16 宇龙计算机通信科技(深圳)有限公司 The control method of application program and control device, terminal
CN106162279B (en) * 2016-07-01 2020-11-17 海信视像科技股份有限公司 Television remote control key response method based on android operating system and television
CN106162279A (en) * 2016-07-01 2016-11-23 青岛海信电器股份有限公司 TV remote key response method based on Android operation system and TV
US10397511B2 (en) 2016-07-01 2019-08-27 Hisense Electric Co., Ltd. Method for television remote keypress response based on android operating system and television thereof
US11006166B2 (en) 2016-07-01 2021-05-11 Hisense Visual Technology Co., Ltd. Method for television remote keypress response based on android operating system and television thereof
CN107391181A (en) * 2017-06-29 2017-11-24 上海与德科技有限公司 A kind of method and device of system partitioning
CN108196892A (en) * 2017-12-29 2018-06-22 北京安云世纪科技有限公司 For the method, apparatus and mobile terminal being customized to system starting process
CN108196892B (en) * 2017-12-29 2021-02-23 北京安云世纪科技有限公司 Method, device and mobile terminal for customizing system startup process
CN109683983A (en) * 2018-12-11 2019-04-26 青岛海信电器股份有限公司 A kind of generation of image file and loading method, equipment
CN110287012A (en) * 2019-06-21 2019-09-27 努比亚技术有限公司 Multiprocessing method, wearable device and the medium of intelligent wearable device
CN111258669A (en) * 2020-03-25 2020-06-09 上海商汤临港智能科技有限公司 Face recognition method and device and storage medium
CN111258669B (en) * 2020-03-25 2024-04-16 上海商汤临港智能科技有限公司 Face recognition method and device and storage medium
CN111782342A (en) * 2020-06-30 2020-10-16 联想(北京)有限公司 Virtual machine starting method and device
CN111782342B (en) * 2020-06-30 2024-08-23 联想(北京)有限公司 Virtual machine starting method and device
CN112181534A (en) * 2020-10-21 2021-01-05 上海商米科技集团股份有限公司 Method and equipment for dynamically managing display interface of electronic equipment
CN112395015A (en) * 2020-11-18 2021-02-23 珠海全志科技股份有限公司 Optimization method and device for accelerating startup based on Android system
CN113672339A (en) * 2021-07-28 2021-11-19 歌尔光学科技有限公司 Method for improving Android startup efficiency
CN113672339B (en) * 2021-07-28 2024-04-16 歌尔科技有限公司 Method for improving Android starting efficiency
CN114218563A (en) * 2021-12-02 2022-03-22 北京江民新科技术有限公司 Method and system for trapping Lesovirus
CN115292721A (en) * 2022-10-09 2022-11-04 北京麟卓信息科技有限公司 Starting method for adapting to multiple Linux kernels in android compatible environment
CN115292721B (en) * 2022-10-09 2023-01-24 北京麟卓信息科技有限公司 Starting method for adapting to multiple Linux kernels in android compatible environment

Similar Documents

Publication Publication Date Title
CN104503788A (en) Setting method capable of shortening starting time of Android operating system
CN102207881B (en) Quick operation system start-up method based on Android
RU2568280C2 (en) Fast computer start-up
US10417009B2 (en) Fast computer startup
US8875160B2 (en) Dynamic application migration
US9411608B2 (en) Method and apparatus for enhancing a hibernate and resume process for a computing device having an external mechanical input component
US8607040B2 (en) Method of provisioning firmware in an operating system (OS) absent services environment
US7409537B2 (en) Fast booting an operating system from an off state
CN104102506B (en) A kind of Android Acceleration of starting methods based on ARM platforms
US8543849B2 (en) Fast computer startup
US11126454B2 (en) Enforcing retention policies with respect to virtual machine snapshots
CN104424047A (en) NVRAM data recovery method and NVRAM data recovery device
US8468388B2 (en) Restoring programs after operating system failure
KR100994723B1 (en) Optional Suspension Reset Method and Recording Media for Shortening Initial Run Time in System
CN102789397B (en) Multi-operating system switching method in computer system
US20150149752A1 (en) Server and control method thereof
US20240111543A1 (en) Concurrent execution and copy of updated basic input/output system instructions
RU2023103995A (en) OPERATING SYSTEM UPGRADE METHOD, DEVICE, INFORMATION MEDIA AND COMPUTER SOFTWARE PRODUCT
TW201322129A (en) Electronic device and method for switching operating systems thereof

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150408

WD01 Invention patent application deemed withdrawn after publication