Method and device for restarting Android system

By optimizing the restart process of the Android system, using the SystemServer process to determine the initialization sequence of the application and monitor the frequency of application usage, the problem of the Android system restart time is solved, and the user experience and system performance are improved.

CN120104196APending Publication Date: 2025-06-06镁佳(北京)科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510164515.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-14
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The Android system restart time is too long, which affects the user experience.

Method used

During the system restart process, the application's dependency matrix is ​​obtained through the SystemServer process, the initialization sequence is determined, the application loading and startup process is optimized, and the application usage frequency is monitored through the ActivityManagerService, and the low-frequency application is set to an idle state to remind users to uninstall.

Benefits of technology

It shortens the restart time of the Android system, improves the user experience, optimizes the storage space, and improves the smoothness of the system operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104196A_ABST
    Figure CN120104196A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of Android systems, and discloses a restarting method and device of an Android system.The method comprises the steps that in the system restarting process, a SystemServer process is derived through a Zygote process; the method comprises the following steps of: acquiring a dependency matrix of application programs in a system by adopting a SystemServer process, and determining an initialization sequence of the application programs on the basis of the dependency matrix; the method comprises the following steps: starting an Activity ManagerService by adopting a System Server process, monitoring the use frequency of application programs in a system based on the Activity ManagerService after the system is restarted, and setting the application programs of which the use frequency is smaller than a preset frequency to be in an idle state so as to remind a user to unload the application programs. According to the method provided by the embodiment of the invention, the initialization sequence of the application programs is optimized through the dependency relationship matrix, so that the key application programs are preferentially loaded, and unnecessary waiting time is reduced, thereby shortening the restarting duration of the Android system and improving the use experience of a user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of Android systems, and in particular to a restart method and device for an Android system. Background Art

[0002] Android system is an open source operating system based on the Linux platform, which is widely used in smart terminal devices such as mobile phones and tablet computers.

[0003] However, with the improvement of the performance of smart terminal devices, the relatively complex restart process of the Android system takes too long for smart terminal devices equipped with the Android system, which seriously affects the user experience. Therefore, how to reduce the restart time of the Android system and improve the user experience has become an urgent problem to be solved. Summary of the invention

[0004] In view of this, the present disclosure provides a restart method and device for an Android system to solve the problem of how to reduce the restart time of the Android system and improve the user experience.

[0005] On the one hand, the present disclosure provides a restart method for an Android system, the method comprising: during the restart process of the system, loading the Linux kernel of the system, searching for and starting the Init process, creating a Zygote process based on the Init process, and deriving a SystemServer process through the Zygote process; the SystemServer process is used to start and manage the Java framework and core system services of the system; using the SystemServer process, obtaining a dependency matrix of applications in the system, and determining an initialization order of the applications based on the dependency matrix; using the SystemServer process, starting the ActivityManagerService, and after the system completes the restart, monitoring the usage frequency of applications in the system based on the ActivityManagerService, setting applications with a usage frequency less than a preset frequency to an idle state to remind users to uninstall them.

[0006] On the other hand, the present disclosure also provides a restart device, which includes a first restart module, a second restart module and a third restart module, wherein: the first restart module is used to load the Linux kernel of the system, search and start the Init process, create a Zygote process based on the Init process, and derive the SystemServer process through the Zygote process during the restart process of the system; the SystemServer process is used to start and manage the Java framework and core system services of the system; the second restart module is used to use the SystemServer process to obtain the dependency matrix of the application programs in the system, and determine the initialization order of the application programs based on the dependency matrix; the third restart module is used to use the SystemServer process to start the ActivityManagerService, and after the system completes the restart, based on the ActivityManagerService, monitor the usage frequency of the application programs in the system, set the application programs with a usage frequency less than the preset frequency to an idle state, so as to remind the user to uninstall them.

[0007] On the other hand, the present disclosure further provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to implement the above-mentioned restart method of the Android system.

[0008] On the other hand, the present disclosure further provides a computer program product, including computer instructions, which are used to enable a computer to execute the above-mentioned restart method of the Android system.

[0009] Through the restart method and device of the Android system of the above embodiment of the present disclosure, the initialization order of the application is optimized through the dependency matrix, so that the key application is loaded first, and the unnecessary waiting time is reduced, thereby shortening the restart time of the Android system and improving the user experience. The SystemServer process is used to centrally manage the Java framework and core system services, reduce repeated resource loading, and further improve the system restart efficiency.

[0010] In addition, ActivityManagerService monitors the frequency of application usage and marks infrequently used applications, putting them into an idle state and reminding users to uninstall them, thereby optimizing storage space and improving system operation smoothness. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0012] Figure 1 is a flowchart of a restart method of an Android system provided by an embodiment of the present disclosure;

[0013] Figure 2 It is a specific flow chart of a restart method of an Android system provided by an embodiment of the present disclosure;

[0014] Figure 3 is a structural schematic diagram of a restart device provided by an embodiment of the present disclosure;

[0015] Figure 4 It is a structural schematic diagram of another restart device provided by an embodiment of the present disclosure. DETAILED DESCRIPTION

[0016] Android is an open source operating system based on the Linux kernel, which is widely used in smartphones and other portable digital devices. Its startup process is mainly divided into the boot loader stage and the kernel stage. In the boot loader stage, the system starts from hardware power-on and goes through several stages in sequence:

[0017] 1. Hardware stage: The device is powered on and the initial hardware initialization is performed.

[0018] 2. Firmware stage: The firmware (called BIOS in some architectures) starts running, detecting and initializing system hardware such as memory controllers, storage devices, bus bridges, etc.

[0019] 3. First-level boot loader: After completing hardware detection, the firmware transfers control to the Master Boot Record (MBR), which can be stored on a disk, removable media, or network.

[0020] 4. Second-level boot loader (Bootloader): Bootloader is responsible for user selection of kernel, loading kernel and related parameters into memory, performing basic initialization, and finally starting the operating system.

[0021] 5. In the kernel stage, the kernel takes over control and completes the following key operations:

[0022] Set up kernel data structures and detect system devices.

[0023] Load necessary device drivers and initialize system hardware.

[0024] Enter user-level initialization, check file system integrity, mount file systems, set up swap partitions (Swap), start system services, initialize the terminal, and complete other system configurations.

[0025] In summary, the relatively complex restart process of the Android system takes too long when facing high-performance mobile terminals. In particular, the more applications installed on the mobile terminal, the more time-consuming the restart process of the Android system is, which greatly affects the user experience of the mobile terminal.

[0026] To solve the above problems, various embodiments of the present invention provide a restart method for an Android system, the method comprising: during the system restart process, loading the system's Linux kernel, searching for and starting the Init process, creating a Zygote process based on the Init process, and deriving a SystemServer process through the Zygote process; the SystemServer process is used to start and manage the Java framework and core system services of the system; using the SystemServer process, obtaining the dependency matrix of applications in the system, and determining the initialization order of the applications based on the dependency matrix; using the SystemServer process, starting the ActivityManagerService, and after the system completes the restart, monitoring the usage frequency of applications in the system based on the ActivityManagerService, setting applications with a usage frequency less than a preset frequency to an idle state to remind users to uninstall them.

[0027] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0028] Please refer to Figure 1 , Figure 1 : is a flowchart of a restart method of an Android system provided by an embodiment of the present disclosure, and the process of the method may include the following steps:

[0029] Step S101, during the system restart process, load the system's Linux kernel, search and start the Init process, create a Zygote process based on the Init process, and derive the SystemServer process through the Zygote process.

[0030] In this embodiment, the SystemServer process is used to start and manage the Java framework and core system services of the system.

[0031] In one possible implementation, restarting the Android system may refer to the process of terminating the currently running system processes, releasing system resources, reloading the Linux kernel, initializing system services, and restoring the user environment to ensure that the device equipped with the Android system can restart from scratch.

[0032] Here, when the power management IC (PMIC) receives a preset restart signal, the Android system can supply power to the hardware devices in the system and start the system restart process.

[0033] As an example, the preset reboot signal may include, but is not limited to: a user selecting a reboot option, a terminal executing a reboot command, or hardware triggering.

[0034] Furthermore, during the restart process of the Android system, the Linux kernel of the system is loaded; wherein, the Linux kernel of the Android system may be the underlying core of the Android operating system, and its functions may include but are not limited to: managing hardware resources, process scheduling, memory management, file system, network communication, etc.

[0035] The method of loading the Linux kernel of the system may include: after the power management chip is powered, loading the Bootloader to initialize the system hardware devices, loading the Linux kernel of the system and completing the basic settings of the system.

[0036] Specifically, loading the Bootloader may include two steps: loading the first-level Bootloader for loading the second-level Bootloader; and loading the second-level Bootloader for more comprehensive hardware initialization.

[0037] After the Bootloader is loaded, the Linux kernel is loaded and control is handed over to the Linux kernel.

[0038] In a possible implementation, searching and starting the Init process, creating a Zygote process based on the Init process, and deriving the SystemServer process through the Zygote process may include:

[0039] Find and start the Init process in the system files, create the Zygote process based on the Init process, use the Zygote process to derive the application process on demand, and load the code and resources of the corresponding application in the process.

[0040] The purpose of searching and starting the Init process may be to complete the basic initialization of the Android system, start the core services, and provide environmental support for the normal operation of the Android system. The core services may include: attribute management services, device management services, daemon processes, and Zygote processes.

[0041] Furthermore, the purpose of creating the Zygote process based on the Init process can be to provide an efficient process creation mechanism for Android system applications and be responsible for starting the SystemServer process. Among them, the Zygote process can be created by the Init process when the system starts and serve as the parent process of all Android system application processes.

[0042] Here, a new child process can be derived (forked) through the Zygote process, and the code and resources of the corresponding application can be loaded into the child process to increase the speed of system restart.

[0043] Furthermore, the Zygote process will preload a variety of Android framework classes, resources, and system libraries when it starts. Each application process will copy an initialized Java virtual machine from the Zygote process to avoid repeated loading and increase the restart speed. In addition, multiple application processes can share the memory pages preloaded by the Zygote process to reduce duplicate resource consumption.

[0044] In a possible implementation, deriving the SystemServer process through the Zygote process may include:

[0045] The SystemServer process is forked through the Zygote process, so that the SystemServer process is responsible for starting and managing the entire Java framework.

[0046] Among them, the SystemServer process can be the first child process forked by the Zygote process. The SystemServer process can include but is not limited to: activity management service (ActivityManagerService, AMS) process, window management service (WindowManagerService, WMS) process, display management service (DisplayManagerService, DMS) process, etc.

[0047] Step S102: using the SystemServer process to obtain a dependency matrix of applications in the system, and determining an initialization order of the applications based on the dependency matrix.

[0048] In this embodiment, the dependency of an application may refer to other components, system services or libraries that the application depends on when running or initializing. That is, if an application requires another application or system service to provide a function, there is a dependency relationship between the application and the other application or system service.

[0049] Furthermore, the dependency matrix may be a matrix for describing and representing dependency relationships between application programs.

[0050] As an example, suppose there are two applications in the system, A1 and A2, the dependency matrix can be as follows:

[0051] A1 A2 A1 0 5 A2 0 0

[0052] It can be seen that there is a dependency relationship between A1 and A2. The larger the value of the dependency in the dependency matrix, the higher the degree of dependency between the applications.

[0053] Furthermore, based on the dependency matrix, the dependency degree between the applications is determined, and then the initialization order of the applications is determined.

[0054] Here, the initialization order refers to the order in which applications are loaded and started based on the dependencies between them. By determining the initialization order of applications and initializing them, it is ensured that high-priority applications are loaded and started first, avoiding delays caused by confusion in the startup order of applications, thereby improving the system restart speed.

[0055] Step S103, using the SystemServer process to start the ActivityManagerService, after the system completes the restart, based on the ActivityManagerService monitoring the usage frequency of the applications in the system, the applications with a usage frequency less than the preset frequency are set to an idle state to remind the user to uninstall them.

[0056] In this embodiment, the SystemServer process is used to start the ActivityManagerService, which may include:

[0057] Use the SystemServer process to initialize the ActivityManagerService through the SystemServiceManager, register the ActivityManagerService with the SystemServiceManager to start the ActivityManagerService.

[0058] In a possible implementation, after starting the ActivityManagerService, the Launcher is started, and the Launcher is used to display shortcut icons of installed applications on the interface to complete the restart of the system.

[0059] Here, the launcher may be a desktop application of the Android system, which may be used to launch and manage installed applications.

[0060] In a possible implementation, monitoring the usage frequency of applications in the system based on ActivityManagerService may include at least one of the following:

[0061] Based on ActivityManagerService monitoring at least one life cycle callback of the application, determine the active status of the application;

[0062] Based on ActivityManagerService, the usage of the application is recorded through UsageStatsManager; the usage may include but is not limited to: the number of launches, the foreground running time, and the most recent usage time.

[0063] Furthermore, the preset frequency can be set according to the needs of the user, which is not limited here. For example, when the preset frequency is once a week, when the application is used less than once a week, the application is set to an idle state.

[0064] Furthermore, the method of reminding the user to uninstall can be ActivityManagerService, which sends a notification through NotificationManager to remind the user to clean up the low-frequency applications. For example, the notification can be in the form of: "You have 5 applications that have not been used for a long time, do you want to clean them up?"

[0065] In the restart method and device of the Android system of the above-mentioned embodiment of the present disclosure, the initialization order of the application is optimized through the dependency matrix, so that the key application is loaded first, and the unnecessary waiting time is reduced, thereby shortening the restart time of the Android system and improving the user experience. The SystemServer process is used to centrally manage the Java framework and core system services, reduce the repeated loading of resources, and further improve the efficiency of system restart. The frequency of application usage is monitored through ActivityManagerService, and low-frequency applications are marked to enter the idle state, reminding users to uninstall them, optimizing storage space, and improving the smoothness of system operation.

[0066] In a possible implementation of the above embodiment, a SystemServer process is used to obtain a dependency matrix of applications in the system, and based on the dependency matrix, an initialization order of the applications is determined, including:

[0067] The SystemServer process is used to start the Binder thread pool and the system server manager in the system; wherein the Binder thread pool is used for inter-process communication, and the system server manager is used for managing at least one system service;

[0068] Based on the system server manager, at least one system service is started, a preset asynchronous task execution mechanism is adopted in the system service, and a preset time-consuming operation is executed in the system background;

[0069] Based on at least one system service, a dependency matrix of at least one application is obtained to determine an initialization order of the at least one application.

[0070] In this embodiment, Binder is the core mechanism of inter-process communication in the Android system, and can be used for data interaction between different application processes or systems. The system server manager is the above-mentioned SystemServiceManager, which is started by the SystemServer process to manage at least one system service in the Android system and maintain the life cycle of the system service.

[0071] In a possible implementation, based on the system server manager, at least one system service is started, a preset asynchronous task execution mechanism is adopted in the system service, and a preset time-consuming operation is executed in the system background, which may include:

[0072] Based on SystemServiceManager, start at least one of ActivityManagerService, WindowManagerService, and DisplayManagerService;

[0073] A preset asynchronous task execution mechanism is used in at least one service to execute preset time-consuming operations.

[0074] Here, the asynchronous task execution mechanism may refer to placing preset time-consuming operations into a background thread or task queue for execution during program execution to avoid blocking the main thread and improve the system's response speed and concurrency capabilities.

[0075] As an example, the preset asynchronous task execution mechanism can use AsyncTask before Android 11, and can use HandlerThread after Android 11. There is no specific limitation here, and it can be set according to actual needs.

[0076] In a possible implementation, obtaining a dependency matrix of at least one application based on at least one system service to determine an initialization order of at least one application includes:

[0077] Based on at least one system service, parsing the dependency relationship of at least one application, and building a dependency relationship matrix of the application according to the dependency relationship;

[0078] According to the dependency matrix, the dependency strength of the application is determined, and the application with dependency strength greater than a preset threshold is imported into the main thread of the Handler program for execution, and the application with dependency strength less than the preset threshold is imported into the child thread of the Handler program for execution, so as to determine the initialization order of at least one application.

[0079] In this embodiment, applications whose dependency strength is greater than a preset threshold are regarded as high-dependency programs, and the high-dependency programs are imported into the main thread of the Handler program for execution; applications whose dependency strength is less than the preset threshold are regarded as low-dependency programs, and the low-dependency programs are imported into the child thread of the Handler program for execution.

[0080] Here, Handler is a mechanism used for inter-thread communication in the Android system. After the background thread executes the task, it passes the result to the main thread.

[0081] In the restart method and device of the Android system of the above-mentioned embodiment of the present disclosure, the dependency matrix of the application is obtained through the SystemServer process, and the initialization order is determined according to the degree of dependency, thereby reducing unnecessary waiting time and speeding up the system startup speed. The Binder thread pool is used for inter-process communication so that different services can be started in parallel, improving resource utilization and task execution efficiency. Asynchronous task scheduling is performed through HandlerThread or AsyncTask to ensure that time-consuming operations are executed in the background, avoid blocking the main thread, and improve the system response speed. In addition, based on the strength of the dependency, high-dependency applications are assigned to the Handler main thread for execution to ensure that key applications are initialized first. Low-dependency applications are assigned to the Handler child thread for execution to avoid overloading the main thread and improve the overall execution efficiency of the system.

[0082] In a possible implementation of the above embodiment, after the system is restarted, based on ActivityManagerService monitoring the usage frequency of applications in the system, applications with a usage frequency less than a preset frequency are set to an idle state to remind the user to uninstall them, which is implemented based on the following steps:

[0083] Based on ActivityManagerService monitoring the usage frequency of applications in the system, when the usage frequency of applications is less than the preset frequency, the applications are transferred to the idle state area and set to the idle state;

[0084] Get the application in the idle area to remind the user to uninstall the application.

[0085] In this embodiment, the idle state area may refer to a logical area division, and the area includes a list of applications with low usage frequency for system marking and management.

[0086] In a possible implementation, the usage frequency of applications in the system based on ActivityManagerService monitoring may include:

[0087] Detect the usage of applications within the Android system through the ACTION USAGE ACCESS SETTINGS permission;

[0088] When the application is frequently used, the ACTION USAGE ACCESS SETTINGS permission is used to detect that the application is normally started;

[0089] Use the ACTION USAGE ACCESS SETTINGS permission to detect when an app has not been used for a long time, move the app to the idle state area, and set the app to the idle state.

[0090] In the restart method and device of the Android system of the above embodiment of the present disclosure, by monitoring the usage frequency of applications and setting applications that have not been used for a long time to an idle state, background processes can be reduced, and memory and CPU usage can be reduced, thereby improving the overall performance of the system. By reminding users to uninstall applications that have not been used for a long time, the storage space usage can be effectively reduced, allowing users to better manage applications in the device and improve the storage utilization of the device.

[0091] In one embodiment, Figure 2 : is a specific flow chart of a restart method of an Android system provided by an embodiment of the present disclosure, and the flow may include the following steps:

[0092] Step S201, triggering restart and starting PMIC power supply;

[0093] Here, when the PMIC receives the preset restart signal, the Android system supplies power to the hardware devices in the system and starts the system restart process;

[0094] Step S202, loading the Bootloader program;

[0095] Here, the first-level Bootloader is loaded to load the second-level Bootloader; the second-level Bootloader is loaded to perform more comprehensive hardware initialization;

[0096] Step S203, loading the Linux kernel;

[0097] Here, after the Bootloader is loaded, the Linux kernel is loaded and the control is handed over to the Linux kernel;

[0098] Step S204, start the Init process;

[0099] Here, search and start the Init process in the system files;

[0100] Step S205, creating a Zygote process;

[0101] Here, a Zygote process is created based on the Init process, and the Zygote process is used to derive the application process on demand, and the code and resources of the corresponding application are loaded in the process;

[0102] Step S206, deriving a SystemServer process;

[0103] Here, the SystemServer process is forked through the Zygote process, so that the SystemServer process is responsible for starting and managing the entire Java framework;

[0104] Further, step S206 includes the following sub-steps:

[0105] Step S2061, using a preset asynchronous task execution mechanism;

[0106] Here, based on SystemServiceManager, at least one system service is started, a preset asynchronous task execution mechanism is adopted in the system service, and a preset time-consuming operation is executed in the system background;

[0107] Step S2062: Is the dependency strength greater than a preset threshold? If yes, proceed to step S2063; if no, proceed to step S2064;

[0108] Here, the dependency strength of the application is determined according to the dependency matrix of the application. When the dependency strength is greater than a preset threshold, the process proceeds to step S2063; otherwise, the process proceeds to step S2064;

[0109] Step S2063, importing the main thread of the Handler program;

[0110] Here, the application is imported into the main thread of the Handler program;

[0111] Step S2064, importing the child thread of the Handler program;

[0112] Here, the application is imported into the child thread of the Handler program;

[0113] Step S2065, Looper program;

[0114] Here, the Looper program is used to process the application in the main thread of the Handler program first, and then process the application in the child thread of the Handler program;

[0115] Step S207, start Launcher;

[0116] Here, start the Launcher, and after the Launcher is started, display the shortcut icons of the installed applications on the interface to complete the Android system restart;

[0117] Step S208, determine whether the application is idle; if so, proceed to step S209, if not, proceed to step S211;

[0118] Step S209, transferring the application to the idle state area;

[0119] Step S210, prompting the user whether to uninstall the application;

[0120] Step S211, running the application program normally.

[0121] In one embodiment, a restarting device 300 is provided, and the restarting device 300 corresponds to the restarting method of the Android system in the above embodiment. Figure 3 As shown, the restart device 300 includes a first restart module 301, a second restart module 302 and a third restart module 303, wherein each functional module is described in detail as follows:

[0122] The first restart module 301 is used to load the Linux kernel of the system, search and start the Init process, create a Zygote process based on the Init process, and derive a SystemServer process through the Zygote process during the restart of the system; the SystemServer process is used to start and manage the Java framework and core system services of the system;

[0123] The second restart module 302 is used to use the SystemServer process to obtain the dependency matrix of the applications in the system, and determine the initialization order of the applications based on the dependency matrix;

[0124] The third restart module 303 is used to use the SystemServer process to start the Activity ManagerService. After the system completes the restart, based on the ActivityManagerService monitoring the usage frequency of the applications in the system, the applications with a usage frequency less than the preset frequency are set to an idle state to remind the user to uninstall them.

[0125] In one embodiment, the first restart module 301 is used to supply power to the hardware devices in the system and start the restart process of the system when the power management chip receives a preset restart signal;

[0126] After the power management chip is powered, the Bootloader is loaded to initialize the system hardware devices, load the system's Linux kernel and complete the basic system settings;

[0127] Find and start the Init process in the system files, create the Zygote process based on the Init process, use the Zygote process to derive the application process on demand, and load the code and resources of the corresponding application in the process.

[0128] In one embodiment, the second restart module 302 is used to use the SystemServer process to start the Binder thread pool and the system server manager in the system; wherein the Binder thread pool is used for inter-process communication, and the system server manager is used for managing at least one system service;

[0129] Based on the system server manager, at least one system service is started, a preset asynchronous task execution mechanism is adopted in the system service, and a preset time-consuming operation is executed in the system background;

[0130] Based on at least one system service, a dependency matrix of at least one application is obtained to determine an initialization order of the at least one application.

[0131] In one embodiment, the second restart module 302 is used to parse the dependency of at least one application based on at least one system service, and construct a dependency matrix of the application according to the dependency;

[0132] According to the dependency matrix, the dependency strength of the application is determined, and the application with dependency strength greater than a preset threshold is imported into the main thread of the Handler program for execution, and the application with dependency strength less than the preset threshold is imported into the child thread of the Handler program for execution, so as to determine the initialization order of at least one application.

[0133] In one embodiment, the third restart module 303 is used to monitor the usage frequency of the application in the system based on the ActivityManagerService, and when the usage frequency of the application is less than the preset frequency, transfer the application to the idle state area and set the application to the idle state;

[0134] Get the application in the idle area to remind the user to uninstall the application.

[0135] It should be noted that: when the restart device provided in the above embodiment implements the restart method of the corresponding Android system, only the division of the above program modules is used as an example. In actual application, the above processing can be assigned to different program modules as needed, that is, the internal structure of the above system can be divided into different program modules to complete all or part of the above-described processing. Figure 1 The embodiments of the method shown belong to the same concept, and the specific implementation process is detailed in the method embodiments, which will not be repeated here.

[0136] The present disclosure also provides a computer device having the above Figure 3 Restart the device as shown.

[0137] See also Figure 4 , Figure 4 is a schematic diagram of the structure of another restart device provided by an embodiment of the present disclosure, such as Figure 4 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 4 A processor 10 is taken as an example.

[0138] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0139] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.

[0140] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0141] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0142] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0143] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.

[0144] The computer device also includes a communication interface, which is used for the computer device to communicate with other devices or a communication network.

[0145] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0146] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0147] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A restart method for an Android system, characterized in that: The method comprises: During the system restart process, the Linux kernel of the system is loaded, the Init process is searched and started, a Zygote process is created based on the Init process, and a SystemServer process is derived through the Zygote process; the SystemServer process is used to start and manage the Java framework and core system services of the system; Using the SystemServer process, obtaining a dependency matrix of applications in the system, and determining an initialization order of the applications based on the dependency matrix; The SystemServer process is used to start the ActivityManagerService. After the system is restarted, based on the ActivityManagerService monitoring the usage frequency of applications in the system, applications with a usage frequency less than a preset frequency are set to an idle state to remind the user to uninstall them.

2. The method according to claim 1, characterized in that During the restart process of the system, the Linux kernel of the system is loaded, the Init process is searched and started, and the Zygote process is created based on the Init process, including: When the power management chip receives the preset restart signal, it supplies power to the hardware devices in the system and starts the system restart process; After the power management chip is powered, the Bootloader is loaded to initialize the system hardware devices, load the Linux kernel of the system and complete the basic settings of the system; The Init process is searched and started in the system file, a Zygote process is created based on the Init process, the Zygote process is used to derive the process of the application program as needed, and the code and resources corresponding to the application program are loaded into the process.

3. The method according to claim 1, characterized in that The method of using the SystemServer process to obtain a dependency matrix of applications in the system and determining an initialization order of the applications based on the dependency matrix includes: Using the SystemServer process, starting the Binder thread pool and the system server manager in the system; wherein the Binder thread pool is used for inter-process communication, and the system server manager is used for managing at least one system service; Based on the system server manager, starting the at least one system service, using a preset asynchronous task execution mechanism in the system service, and executing a preset time-consuming operation in the system background; Based on the at least one system service, a dependency matrix of at least one application is obtained to determine an initialization order of the at least one application.

4. The method according to claim 3, characterized in that The obtaining, based on the at least one system service, a dependency matrix of at least one application program to determine an initialization order of the at least one application program comprises: Based on at least one system service, analyzing the dependency relationship of at least one application program, and constructing a dependency relationship matrix of the application program according to the dependency relationship; According to the dependency matrix, the dependency strength of the application is determined, and the application with dependency strength greater than a preset threshold is imported into the main thread of the Handler program for execution, and the application with dependency strength less than the preset threshold is imported into the child thread of the Handler program for execution, so as to determine the initialization order of at least one application.

5. The method according to claim 3, characterized in that: After the system is restarted, based on the ActivityManagerService monitoring the usage frequency of applications in the system, applications with a usage frequency less than a preset frequency are set to an idle state to remind the user to uninstall them, which is achieved based on the following steps: Based on the ActivityManagerService monitoring the usage frequency of the application in the system, when the usage frequency of the application is less than a preset frequency, the application is transferred to the idle state area and the application is set to the idle state; The application program in the idle state area is obtained to remind the user to uninstall the application program.

6. A restart device, characterized in that: The restart device includes a first restart module, a second restart module and a third restart module, wherein: The first restart module is used to load the Linux kernel of the system, search and start the Init process, create a Zygote process based on the Init process, and derive a SystemServer process through the Zygote process during the restart of the system; the SystemServer process is used to start and manage the Java framework and core system services of the system; A second restart module is used to use the SystemServer process to obtain a dependency matrix of applications in the system, and determine an initialization order of the applications based on the dependency matrix; The third restart module is used to use the SystemServer process to start ActivityManagerService. After the system completes the restart, based on the ActivityManagerService monitoring the usage frequency of applications in the system, applications with a usage frequency less than a preset frequency are set to an idle state to remind the user to uninstall them.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the restart method of the Android system according to any one of claims 1 to 5.

8. A computer program product, characterized in that It includes computer instructions, and the computer instructions are used to enable a computer to execute the restart method of the Android system according to any one of claims 1 to 5.