Application keep-alive method, electronic equipment and computer readable storage medium

By using warm or hot-start methods to keep common applications alive according to the frequency of application usage and system resources in electronic devices, the problem of long wait time for application startup is solved, and the system response efficiency and application are improved program stability.

CN119127328APending Publication Date: 2024-12-13HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310694304.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-12
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In electronic devices, the waiting time is long when the application is cleaned up and started again, which affects the system response efficiency.

Method used

By using warm or hot-start methods to keep commonly used applications inactive processing based on the frequency of application usage and system resources, including preloading processes and interfaces in the background, adjusting process parameters, and keeping locks to avoid accidental shutdowns. .

Benefits of technology

It shortens the application startup time, improves the system response efficiency and user experience, and ensures the application stability and rapid response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127328A_ABST
    Figure CN119127328A_ABST
Patent Text Reader

Abstract

The invention discloses an application keep-alive method, electronic equipment and a computer readable storage medium, and the method comprises the steps: determining N candidate application programs according to the use data of each application program and the use frequency from high to low, and N is a positive integer; under the condition that the system resources meet the application keep-alive conditions, keep-alive processing is conducted on the N candidate application programs in a warm start mode or a hot start mode; wherein the starting duration corresponding to the warm starting mode is longer than the starting duration corresponding to the hot starting mode. By the adoption of the application program keep-alive processing method and device, common application programs can be subjected to keep-alive processing, so that the keep-alive application programs are changed into warm start or hot start from cold start, then the start time of the application programs is shortened, and the system response efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an application keep-alive method, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the rapid development of Internet technology, more and more applications are being developed and run in electronic devices. Among them, different applications can provide different application services. For example, instant messaging applications can provide real-time chat services, video applications can provide video playback services, game applications can provide online game services, etc. When an electronic device opens multiple applications, the electronic device can automatically clean up some applications based on various strategies to save system resources. However, in the process of cleaning up applications, electronic devices usually close the applications directly, which makes some applications wait for a long time when they are restarted after being cleaned, thereby affecting the system response efficiency. Summary of the invention

[0003] The embodiments of the present application provide an application keeping alive method, an electronic device, and a computer-readable storage medium, which can keep commonly used applications alive so that the kept applications change from cold start to warm start or hot start, thereby shortening the startup time of the applications and helping to improve system response efficiency.

[0004] In a first aspect, the present application provides an application keeping alive method, the method comprising: determining N candidate applications in descending order of usage frequency based on usage data of each application, where N is a positive integer; when system resources meet the application keeping alive conditions, keeping the N candidate applications alive in a warm start mode or a hot start mode; wherein the startup duration corresponding to the warm start mode is greater than the startup duration corresponding to the hot start mode.

[0005] In the above embodiments, the electronic device can keep commonly used applications alive in a warm start mode or a hot start mode. Compared with a cold start mode, the warm start mode and the hot start mode have a shorter startup time, which is beneficial to improving the response efficiency of the system and thus providing the object with a smooth user experience.

[0006] In combination with the first aspect, in one possible manner, the system resources satisfying the application keep-alive condition include: the system memory margin is greater than or equal to a preset memory threshold, the system CPU load is less than or equal to a preset load threshold, and the system temperature is less than or equal to a preset temperature threshold. It can be seen that determining whether the system resources satisfy the application keep-alive condition from the three perspectives of memory, CPU load, and temperature is conducive to a more comprehensive understanding of the system resource situation.

[0007] In combination with the first aspect, in a possible manner, the above-mentioned keeping N candidate applications alive in a warm start mode or a hot start mode includes: determining whether a first candidate application satisfies a hot start condition, the first candidate application being any one of the N candidate applications; in response to the first candidate application satisfying the hot start condition, keeping the first candidate application alive in a hot start mode; in response to the first candidate application not satisfying the hot start condition, keeping the first candidate application alive in a warm start mode. It can be seen that dividing the startup modes of the candidate applications into hot start modes and warm start modes is conducive to improving the flexibility of keeping applications alive.

[0008] In conjunction with the first aspect, in a possible manner, the above-mentioned determination of whether the first candidate application meets the hot start condition includes: obtaining an application whitelist, the application whitelist records applications that are permitted to be kept alive in a hot start manner; in response to the first candidate application belonging to the application whitelist, determining that the first candidate application meets the hot start condition; in response to the first candidate application not belonging to the application whitelist, determining that the first candidate application does not meet the hot start condition. It can be seen that by setting the application whitelist, it is helpful to more conveniently determine the method of keeping the candidate application alive.

[0009] In conjunction with the first aspect, in one possible manner, the above-mentioned keeping alive the first candidate application in a warm start manner includes: preloading the process of the first candidate application in the background; the above-mentioned keeping alive the first candidate application in a hot start manner includes: preloading the process of the first candidate application and the interface of the first candidate application in the background. It can be seen that by preloading the process or interface of the candidate application in the background, the delay of starting the application can be effectively shortened and the system responsiveness can be improved.

[0010] In combination with the first aspect, in a possible manner, the method further includes: determining the process type of the first candidate application; in response to the process type of the first candidate application being the first type, performing application protection processing on the first candidate application using the first strategy; in response to the process type of the first candidate application being the second type, performing application protection processing on the first candidate application using the second strategy. It can be seen that performing application protection processing on the candidate application according to the process type of the candidate application is conducive to improving the stability of application keepalive.

[0011] In conjunction with the first aspect, in a possible manner, the above-mentioned application protection processing for the first candidate application using the first strategy includes: obtaining the initial process parameters of the first candidate application; adjusting the initial process parameters to obtain the modified process parameters; and extending the survival time of the process of the first candidate application in the background according to the modified process parameters. It can be seen that by adjusting the process parameters of the candidate application, the survival time of the process of the candidate application in the background can be flexibly extended.

[0012] In combination with the first aspect, in a possible manner, the above-mentioned application protection processing for the first candidate application using the second strategy includes: performing a keep-alive lock on the first candidate application within a preset time period; wherein the process of the first candidate application is prohibited from being closed during the keep-alive lock period. It can be seen that by performing a keep-alive lock on the candidate application, the process of the candidate application can be prevented from being accidentally closed.

[0013] In conjunction with the first aspect, in one possible manner, the method further includes: in response to the cleanup operation for the first candidate application, keeping the process of the first candidate application running in the background. It can be seen that by keeping the process of the candidate application running in the background, a quick response can be achieved when the candidate application is started.

[0014] In conjunction with the first aspect, in a possible manner, the process of the first candidate application includes a main process of the first candidate application and a sub-process of the first candidate application, and the method further includes: in response to a cleanup operation for the first candidate application, keeping the main process of the first candidate application running in the background, and closing the sub-process of the first candidate application in the background. It can be seen that closing the sub-process of the candidate application is conducive to saving system resources and avoiding the candidate application from being started in a cold start mode.

[0015] In a second aspect, the present application provides another application keeping alive method, the method comprising: in response to a trigger operation for a first application, determining a target application associated with the first application based on running data of each application, the running data of each application being used to determine the association relationship between each application; preloading the process of the target application in the background, or preloading the process of the target application and the interface of the target application in the background.

[0016] In the above embodiment, when the electronic device starts the first application, it can load the target application associated with the first application in the background in advance, so that when the target application is started, the interface of the target application can be quickly displayed in the foreground, thereby improving the response efficiency of the system.

[0017] In conjunction with the second aspect, in a possible manner, the above-mentioned determining the target application associated with the first application based on the running data of each application includes: counting the number of times the first application is started and the number of times the first application is switched to the second application based on the running data of each application; determining the association between the first application and the second application based on the number of times the first application is started and the number of times the first application is switched to the second application; in response to the association between the first application and the second application being greater than or equal to the association threshold, determining the second application as the target application associated with the first application. It can be seen that by counting the number of times the first application is started and the number of times the first application is switched to the second application, it is conducive to more efficiently determining the target application associated with the first application.

[0018] In conjunction with the second aspect, in a possible manner, the above-mentioned determining the association between the first application and the second application based on the number of times the first application is started and the number of times the first application is switched to the second application includes: determining the switching mode of switching from the first application to the second application; in response to the switching mode of switching from the first application to the second application being a jump switching mode, determining the association between the first application and the second application based on the number of times the first application is started and the number of times the first application is switched to the second application; in response to the switching mode of switching from the first application to the second application being a cross-application switching mode, determining the number of times the first application is switched to the second application within a reference time interval, and determining the association between the first application and the second application based on the number of times the first application is started and the number of times the first application is switched to the second application within the reference time interval. It can be seen that according to the switching mode of switching from the first application to the second application, it is conducive to more flexibly determining the association between the first application and the second application.

[0019] In conjunction with the second aspect, in one possible manner, in response to the association between the first application and the second application being greater than or equal to an association threshold, determining the second application as a target application associated with the first application includes: in response to the switching mode from the first application to the second application being a jump switching mode, the association between the first application and the second application being greater than or equal to a first association threshold, determining the second application as a target application associated with the first application; in response to the switching mode from the first application to the second application being a cross-application switching mode, the association between the first application and the second application being greater than or equal to a second association threshold, determining the second application as a target application associated with the first application. It can be seen that different switching modes correspond to different association thresholds, which is conducive to more accurately determining the target application associated with the first application.

[0020] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors, a display screen and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute: based on the usage data of each application, N candidate applications are determined in order of usage frequency from high to low, where N is a positive integer; when system resources meet the application keep-alive conditions, the N candidate applications are kept alive in a warm start mode or a hot start mode; wherein the startup duration corresponding to the warm start mode is greater than the startup duration corresponding to the hot start mode.

[0021] In combination with the third aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: determining whether a first candidate application satisfies a hot start condition, the first candidate application being any one of N candidate applications; in response to the first candidate application satisfying the hot start condition, keeping the first candidate application alive in a hot start manner; in response to the first candidate application not satisfying the hot start condition, keeping the first candidate application alive in a warm start manner.

[0022] In combination with the third aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: obtaining an application whitelist, the application whitelist recording applications that are allowed to be kept alive in a hot start manner; in response to a first candidate application belonging to the application whitelist, determining that the first candidate application meets a hot start condition; in response to the first candidate application not belonging to the application whitelist, determining that the first candidate application does not meet the hot start condition.

[0023] In combination with the third aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: preloading the process of the first candidate application in the background; the above-mentioned keeping the first candidate application alive in a hot start manner includes: preloading the process of the first candidate application and the interface of the first candidate application in the background.

[0024] In combination with the third aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: determining the process type of a first candidate application; in response to the process type of the first candidate application being a first type, performing application protection processing on the first candidate application using a first strategy; in response to the process type of the first candidate application being a second type, performing application protection processing on the first candidate application using a second strategy.

[0025] In combination with the third aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: obtain initial process parameters of a first candidate application; adjust the initial process parameters to obtain modified process parameters; and extend the time that the process of the first candidate application survives in the background based on the modified process parameters.

[0026] In combination with the third aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: performing a keep-alive lock on the first candidate application within a preset time period; wherein the process of the first candidate application is prohibited from being closed during the keep-alive lock period.

[0027] In combination with the third aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: in response to a cleanup operation for the first candidate application, keep the process of the first candidate application running in the background.

[0028] In combination with the third aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: in response to a cleanup operation for the first candidate application, keep the main process of the first candidate application running in the background, and close the sub-process of the first candidate application in the background.

[0029] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors, a display screen and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute: in response to a trigger operation for a first application, determine a target application associated with the first application based on the running data of each application, the running data of each application is used to determine the association relationship between the applications; preload the process of the target application in the background, or preload the process of the target application and the interface of the target application in the background.

[0030] In combination with the fourth aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: based on the running data of each application, counting the number of times the first application is started and the number of times the first application is switched to the second application; based on the number of times the first application is started and the number of times the first application is switched to the second application, determining the association between the first application and the second application; in response to the association between the first application and the second application being greater than or equal to an association threshold, determining that the second application is a target application associated with the first application.

[0031] In combination with the fourth aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: determining a switching method for switching from a first application to a second application; in response to the switching method for switching from the first application to the second application being a jump switching method, determining an association between the first application and the second application based on the number of times the first application is started and the number of times the first application is switched to the second application; in response to the switching method for switching from the first application to the second application being a cross-application switching method, determining the number of times the first application is switched to the second application within a reference time interval, and determining an association between the first application and the second application based on the number of times the first application is started and the number of times the first application is switched to the second application within the reference time interval.

[0032] In combination with the fourth aspect, in one possible manner, the one or more processors call the computer instructions to cause the electronic device to execute: in response to the switching mode from the first application to the second application being a jump switching mode, the association degree between the first application and the second application is greater than or equal to a first association threshold, determining that the second application is a target application associated with the first application; in response to the switching mode from the first application to the second application being a cross-application switching mode, the association degree between the first application and the second application is greater than or equal to a second association threshold, determining that the second application is a target application associated with the first application.

[0033] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a touch screen, a camera, one or more processors and one or more memories; the one or more processors are coupled to the touch screen, the camera, and the one or more memories, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect or any possible implementation of the first aspect, or executes the method described in the second aspect or any possible implementation of the second aspect.

[0034] In the sixth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute the method described in the first aspect or any possible implementation of the first aspect, or execute the method described in the second aspect or any possible implementation of the second aspect.

[0035] In the seventh aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect or any possible implementation of the first aspect, or to execute the method described in the second aspect or any possible implementation of the second aspect.

[0036] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, causes the electronic device to execute a method as described in the first aspect or any possible implementation of the first aspect, or to execute a method as described in the second aspect or any possible implementation of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1A is a structural diagram of an electronic device 100 provided in an embodiment of the present application;

[0038] Figure 1B is a software structure block diagram of an electronic device 100 provided in an embodiment of the present application;

[0039] Figure 2 It is a flowchart of an application keeping alive method provided in an embodiment of the present application;

[0040] Figure 2A This is a schematic diagram of a setting interface provided in an embodiment of the present application;

[0041] Figure 3 It is a flowchart of another application keeping alive method provided in an embodiment of the present application;

[0042] Figure 4A This is a schematic diagram of an application management interface provided by an embodiment of the present application;

[0043] Figure 4B This is another schematic diagram of an application management interface provided in an embodiment of the present application;

[0044] Figure 4C This is a schematic diagram of a cleaning setting interface provided in an embodiment of the present application;

[0045] Figure 5 It is a flowchart of an application keep-alive method provided in an embodiment of the present application;

[0046] Figure 6 This is a flowchart of another application keeping alive method provided in an embodiment of the present application;

[0047] Figure 7 It is a schematic diagram of switching applications provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0049] The terms "first", "second", "third", etc. in the embodiments of the present application are distinguished from different objects, rather than being used to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a series of steps or units are included, or alternatively, steps or units not listed are also included, or other steps or units inherent to these processes, methods, products or devices are also included.

[0050] In addition, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can mean: a, or b, or c, or a and b, or a and c, or b and c, or a, b and c, where a, b, c can be single or multiple.

[0051] With the rapid development of Internet technology, more and more applications are developed and run in electronic devices. At present, electronic devices can automatically kill (ie, clean up) applications running in the background based on various strategies to save system resources.

[0052] Exemplarily, the electronic device automatically kills the application running in the background in any of the following situations:

[0053] 1) Automatically kill applications running in the background at preset intervals (e.g. every 48 hours);

[0054] 2) If the application started in the foreground occupies a large amount of memory, the application running in the background will be automatically killed;

[0055] 3) When multiple applications are open (for example, an instant messaging application logged in to a work account and an instant messaging application logged in to a personal account are opened at the same time), the application running in the background is automatically killed;

[0056] 4) When the temperature of the electronic device is too high, the application running in the background will be automatically killed;

[0057] 5) If there is a memory leak in the application, the application running in the background will be automatically killed.

[0058] After the application is killed, it will be started again through a cold start. This cold start method takes a long time to start, resulting in reduced processing efficiency.

[0059] Based on this, an embodiment of the present application provides an application keeping alive method, whereby an electronic device can perform keep alive processing on an application program, implement hot start or warm start of the application program, so that the application program can respond more quickly when it starts, and the startup time is shorter than that of a cold start method, which is beneficial to improving system processing efficiency.

[0060] It should be noted that cold start, warm start, and hot start are three startup methods named according to the startup time of the application. The startup time of the cold start method is usually the time required for the application to switch from the closed state to the open state; the startup time of the warm start method is usually the time required for the application process to be loaded in the background in advance and the application interface to be loaded in the foreground; the startup time of the hot start method is usually the time required for the application process and the application interface to be loaded in the background and the application interface to be switched from the background to the foreground. Among them, the startup time of the cold start method is greater than the startup time of the warm start method, and the startup time of the warm start method is greater than the startup time of the hot start method. For example, if the startup time of the cold start method is 10 seconds, the startup time of the warm start method may be 5 seconds, and the startup time of the hot start method may be 1 second.

[0061] The electronic devices involved in the embodiments of the present application may be mobile phones, tablet computers, laptop computers, PDAs, mobile internet devices (MIDs), wearable devices, virtual reality (VR) devices, augmented reality (AR) devices, wireless terminals in industrial control, wireless terminals in self driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, personal digital assistants (PDAs), etc., but the embodiments of the present application are not limited to this.

[0062] The following introduces an exemplary electronic device provided in the embodiments of the present application.

[0063] See also Figure 1A , Figure 1A A schematic structural diagram of an electronic device 100 is shown.

[0064] like Figure 1AAs shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0065] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0066] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0067] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0068] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0069] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (AMOLED), a flexible light emitting diode (FLED), Miniled, MicroLed, MicrooLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0070] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0071] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0072] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0073] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 100.

[0074] See also Figure 1B , Figure 1B It is a software structure block diagram of the electronic device 100 provided in an embodiment of the present application.

[0075] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0076] The application layer can include a series of application packages.

[0077] like Figure 1B As shown, the application package may include applications (application, APP) such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

[0078] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0079] like Figure 1B As shown, the application framework layer may include an activity manager, a window manager service, a content provider, a view system, a resource manager, a notification manager, and a system UI, etc., and the embodiments of the present application do not impose any restrictions on this.

[0080] The activity manager is used to manage the life cycle of each application. Applications are usually run in the electronic device 100 in the form of activities. For each activity, there is a corresponding application record (Activity Record) in the activity manager, and this Activity Record records the status of the activity of the application. The activity manager can use this Activity Record as an identifier to schedule the activity process of the application.

[0081] The window manager is used to manage the graphical user interface (GUI) resources used on the screen. Specifically, it can be used to: obtain the display size, create and destroy windows, show and hide windows, layout windows, manage focus, and manage input methods and wallpapers.

[0082] Content providers are used to store and retrieve data and make it accessible to applications. The data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0083] The view system can be used to build the display interface of the application. Each display interface can be composed of one or more controls. Generally speaking, controls can include interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc.

[0084] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, it can prompt text information in the status bar, emit a prompt sound, vibrate, or flash an indicator light.

[0085] System UI is the core application of the Android system, responsible for reporting the status of the system and applications and interacting with users. System UI includes the status bar, navigation bar, notification panel, and recents interface.

[0086] The system library and kernel layer below the application framework layer can be called the underlying system. The underlying system includes an underlying display system for providing display services. For example, the underlying display system includes a display driver in the kernel layer and a surface manager in the system library.

[0087] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0088] The system library can include multiple functional modules. For example: surface manager, media library, OpenGL ES, SGL, etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of multiple commonly used audio and video formats, as well as static image files, etc. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. SGL is a drawing engine for 2D drawing.

[0089] The kernel layer is a layer between hardware and software. The kernel layer at least includes display driver, camera driver, audio driver, sensor driver, etc., and the present application embodiment does not impose any restrictions on this.

[0090] Electronic devices can be installed with a variety of applications, and different applications can provide different application services. For example, an instant messaging application can provide real-time chat services, a video application can provide video playback services, and a game application can provide online game services. The application preservation method provided in the embodiment of the present application can preserve commonly used applications according to the application usage habits of an object (such as a user). When the object needs to use these applications, it can quickly respond and display the interface, thereby improving the object's usage experience.

[0091] The following is a description of the method for keeping an application alive provided in an embodiment of the present application.

[0092] See also Figure 2 , Figure 2 A flowchart of an application keep-alive method provided in an embodiment of the present application may include but is not limited to the following steps:

[0093] S201, obtaining usage data of each application in the electronic device.

[0094] The application usage data may be used to reflect at least one of the application usage time, usage duration, usage frequency, usage status, etc. Optionally, the electronic device may obtain the usage data of each application from the log.

[0095] S202: Determine N candidate applications in descending order of usage frequency based on usage data of each application.

[0096] After the electronic device obtains the usage data of each application, it can determine N candidate applications in descending order of usage frequency, where N is an integer greater than or equal to 1. The specific value of N can be the default configuration of the system resources of the electronic device, or it can be set by the object according to actual needs.

[0097] For example, see Figure 2A , Figure 2A A setting interface provided in the embodiment of the present application. Figure 2A As shown, the electronic device can output a setting interface 41, which may include multiple setting options, such as WLAN, Bluetooth, mobile network, more connections, application keep alive, etc. The object triggers the application keep alive option 411, and the parameters related to the application keep alive can be set in detail. In response to the selection operation for the application keep alive option 411, the electronic device can output the application keep alive setting interface 42. The application keep alive setting interface 42 may include setting options related to the number of keep alive applications, for example, it may include a common application keep alive number setting option 421 and a category keep alive setting option. Among them, the common application keep alive number setting option 421 is used to set the number of common applications that need to be kept alive; the common video application keep alive number setting option 422 is used to set the number of common video applications that need to be kept alive; the common shopping application keep alive number setting option 423 is used to set the number of common shopping applications that need to be kept alive; the common social application number setting option 424 is used to set the number of common social applications that need to be kept alive. For example, assuming that the electronic device detects that the subject inputs an operation for the keep-alive number setting option 421 for common applications, and the input number is 3, then the electronic device can determine 3 candidate applications with a high to low frequency of use in a comprehensive ranking of keep-alive, for example, the 3 candidate applications can be instant messaging application A, shopping application B, and short video application C. For another example, assuming that the electronic device detects that the subject inputs an operation for the keep-alive number setting option 422 for common video applications, and the input number is 2, then the electronic device can determine 2 video-type candidate applications with a high to low frequency of use in a keep-alive, for example, the 2 video-type candidate applications can be video application D and video application E.

[0098] S203: When the system resources meet the application keep-alive condition, the N candidate application programs are kept alive by warm start or hot start.

[0099] After the electronic device determines N candidate applications according to the frequency of use from high to low, it can detect the system resources to determine whether the system resources meet the application keep-alive conditions. Determining whether the system resources meet the application keep-alive conditions can be understood as determining whether the system resources have sufficient margin to load the processes of N candidate applications. Among them, the application keep-alive conditions may include system memory, system central processing unit (CPU) load and system temperature. The system memory can be used to indicate the size of the system memory margin, the system CPU can be used to indicate the size of the system CPU margin, and the system temperature can be used to indicate the current temperature of the system. For example, the system resources satisfying the application keep-alive conditions means that the system memory margin is sufficient, the system CPU margin is sufficient, and the system temperature does not exceed the temperature threshold. The system resources satisfying the application keep-alive conditions means that the system resources have sufficient margin to load the processes of N applications.

[0100] When the system resources meet the application keep-alive conditions, the electronic device can keep N candidate applications alive. When the system resources do not meet the application keep-alive conditions, the electronic device can output a prompt message to prompt that the system resource margin is insufficient. The prompt message may include the reason why the system resources do not meet the application keep-alive conditions, such as insufficient system memory margin, insufficient system CPU margin, or too high system temperature, etc. Optionally, when the system resources do not meet the application keep-alive conditions, the electronic device can also automatically clean up the applications running in the background to free up system memory and CPU and reduce system temperature.

[0101] In some embodiments, when system resources meet the application keep-alive condition, the electronic device may perform keep-alive processing on the application in two ways:

[0102] Method 1: Load the application process in the background

[0103] Among them, the process of an application can be understood as an active application, that is, the code of the application has been placed in the corresponding storage space, and it is an application that occupies system resources. An application can be called a program before it is called into the memory space, and it can be called a process after it is called and occupies resources. Electronic devices can shorten the delay of starting the application and improve system responsiveness by loading the process of the application in the background.

[0104] Method 2: Load the application process and application interface in the background

[0105] In addition to pre-loading the process of an application in the background, the electronic device can also load the interface of the application in the background. In a specific implementation, the electronic device can obtain an application whitelist, which can record applications that can load interfaces in the background; if the application belongs to the application whitelist, the electronic device can not only load the process of the application in the background, but also load the interface of the application in the background. This is because the interface of the application is usually loaded in the foreground, and the interface of the application loaded in the background needs to be adapted and debugged in advance. By setting up an application whitelist, the application that can load the interface in the background can be recorded to ensure the feasibility of loading the application interface in the background. In this way, pre-loading the process and interface of the application in the background can further shorten the delay in starting the application and improve the efficiency of application startup.

[0106] In some embodiments, the electronic device can automatically trigger the keep-alive processing of N candidate applications when it is turned on, that is, the processes of the N candidate applications are loaded in the background in advance, so that when the N candidate applications are started in the foreground, the interface of the application can be quickly output. Optionally, the electronic device can also monitor the N candidate applications after it is turned on to determine whether the N candidate applications are cleaned up, that is, determine whether the processes of the N candidate applications are closed in the background. If it is detected that there are cleaned applications among the N candidate applications, then the cleaned applications in the N candidate applications can be pulled up if the system resources meet the keep-alive conditions, that is, the processes of the cleaned applications are reloaded in the background. Among them, the way in which the electronic device monitors the N candidate applications after it is turned on can be periodic monitoring, and the specific value of the period can be set according to demand; it can also be monitoring when a monitoring instruction is detected, and this application does not limit this.

[0107] In some embodiments, after the electronic device loads the process of the application in the background, it can determine the process type of the application, and then determine the application protection policy corresponding to the process type of the application, and use the application protection policy corresponding to the process type of the application to perform application protection processing on the application. Optionally, the process type of the application may include a cache process type. If the process type of the application is a cache process type, then the application protection policy corresponding to the cache process type can be determined to be the first policy. The process type of the application may also include a high-power consumption process type. If the process type of the application is a high-power consumption process type, then the application protection policy corresponding to the high-power consumption process type can be determined to be the second policy. According to different process types, different application protection policies are adopted to perform application protection processing on the application in a targeted manner, which can avoid the application from being accidentally cleaned up during the keep-alive process, which is conducive to improving the stability of application keep-alive.

[0108] Among them, performing application protection processing on the application can be understood as extending the survival time of the application process in the background. Specifically, the first strategy for the application of the cache process type may include: adjusting the process parameters of the application, and determining the survival time of the application process in the background according to the adjusted process parameters of the application. When the electronic device manages the application running in the background, the process parameters can be set for each application process, and the process parameters can be used to indicate the importance of the application. For example, the higher the importance of the application, the smaller the process parameter of the application can be; correspondingly, the lower the importance of the application, the larger the process parameter of the application can be. In this way, the application with lower importance can be cleared first when the electronic device system resources are insufficient. Applications with the process type of cache process are usually applications that occupy more system resources and consume more power. Such applications may be determined as applications with lower importance. Therefore, for applications with the process type of cache process, the purpose of extending the survival time of applications with the process type of cache process in the background can be achieved by adjusting their process parameters. Taking the background management mechanism of the Android system as an example, the process parameter can be an ADJ value. The larger the ADJ value of the application, the lower its importance can be determined. By reducing the ADJ value of the cache process, the survival time of the cache process in the background can be extended. For example, the ADJ value of the cache process can be 900. Adjusting the ADJ value to a value smaller than 900, such as 800 or 600, can protect the cache process.

[0109] The second strategy for the application of the high power consumption process type may include: keeping the application alive and locking it within a preset time period; if no trigger operation for the application is detected within the preset time period, then releasing the keep alive lock on the application at the end of the preset time period. Among them, keeping the application alive and locking it can be understood as the electronic device will not clean up the application. Since the application of the high power consumption process type has high power consumption, it is likely to be cleaned up when the electronic device system resources are insufficient. Keeping the application of the high power consumption process type alive and locking it within the preset time period can prevent the application of the high power consumption process type from being cleaned up by the electronic device during the keep alive process. If no trigger operation for the application of the high power consumption process type is detected within the preset time period, it means that the object has not used the application of the high power consumption process type within the preset time period, then the lock of the application of the high power consumption process type can be released at the end of the preset time period, that is, the electronic device is allowed to clean up the application of the high power consumption process type. For example, assuming that the preset time period is 1 hour, if the application A of the high power consumption process type is kept alive and locked at 10:00 in the morning, and no trigger operation for the application A is detected within 1 hour, then the keep alive lock of the application A can be released at 11:00 in the morning to save system resources.

[0110] In this way, the electronic device can keep commonly used applications running in the background. When these commonly used applications need to be started in the foreground, the electronic device can quickly display the application interface in the foreground, improve the system's response efficiency, and thus provide the object with a smooth user experience.

[0111] See also Figure 3 , Figure 3 A flowchart of another application keep-alive method provided in an embodiment of the present application may include but is not limited to the following steps:

[0112] S301, outputting an application management interface.

[0113] The electronic device may provide an application management interface, and the application management interface may display the running applications, and the running applications include the applications running in the foreground and the applications running in the background. Figure 4A , Figure 4A An application management interface is provided in the embodiment of the present application. Figure 4AAs shown, the electronic device can output an application management interface 43, and the application management interface 43 displays a music application 431, a short video application 432, and a chat application 433. The application management interface 43 also displays a cleanup option 434, and the electronic device can detect a cleanup operation on the application, such as an operation in which an object slides to select the application to be cleaned and then single-clicks or double-clicks the cleanup option 434, or an operation in which an object drags the selected application to be cleaned into the cleanup option 434. It is understandable that in actual applications, the cleanup option 434 may not be displayed in the application management interface 43, and the cleanup operation on the application may also be an operation in which an object selects the application to be cleaned and then slides (up or down) to clean it, which is not limited to this embodiment of the present application. For another example, see Figure 4B , Figure 4B Another application management interface provided in the embodiment of the present application. Figure 4B As shown, the electronic device may also output an application management interface 44, which displays icons for a game application, an icon for a food delivery application, an icon for a map application, and an icon for a mailbox application. A cleanup option is configured for the game application, and the game application may be cleaned up by triggering a cleanup option 441 configured for the game application. Similarly, a cleanup option 442 is configured for the food delivery application, a cleanup option 443 is configured for the map application, and a cleanup option 444 is configured for the mailbox application. In addition, the application management interface 44 also displays a one-click cleanup option 445. By triggering the one-click cleanup option 445, all running applications may be cleaned up.

[0114] S302: In response to a cleanup operation on a target application in the application management interface, determining whether the target application is a candidate application.

[0115] When the electronic device detects a cleaning operation for an application in the application management interface, it can determine whether the cleaned application is a candidate application, that is, determine whether the N candidate applications include the target application for cleaning. The N candidate applications can be determined according to the usage data of each application, in order of usage frequency from high to low. For details, see Figure 2 The relevant description of step S202 is not repeated here.

[0116] S303: In response to the target application being a candidate application, performing a keep-alive process on the target application.

[0117] If the target application for cleaning is a candidate application, the electronic device can keep the target application alive. Optionally, when the electronic device detects a cleaning operation for multiple applications in the application management interface, it can determine whether there are candidate applications in the multiple applications. If there are candidate applications in multiple applications, the candidate applications in the multiple applications can be kept alive, and the other applications in the multiple applications except the candidate applications can be cleaned up. Here, cleaning up the application can be understood as closing the interface displayed by the application in the foreground and the process loaded in the background of the application.

[0118] In some embodiments, the electronic device may also automatically trigger a cleanup operation on the application. Figure 4C , Figure 4C A cleaning setting interface is provided in the embodiment of the present application. Figure 4C As shown, the electronic device can output a cleaning setting interface 45, which includes multiple cleaning setting options, such as an automatic cleaning option 451, an infrequently used application cleaning option 452, and a cleaning reminder option 453. The object triggers the automatic cleaning option 451, and the electronic device can automatically trigger the cleaning operation of the application when the system resources are insufficient or the system resources are occupied. By triggering the infrequently used application cleaning option 452, the electronic device can automatically clean up applications that have not been used for a long time. By triggering the cleaning reminder option 453, the electronic device can output a reminder message before cleaning the application to inform that the application is about to be cleaned.

[0119] In some embodiments, if the electronic device determines that the target application to be cleaned is a candidate application, the target application to be cleaned may be kept alive in the following ways:

[0120] (1) For the target application to be cleaned, the process of the target application may not be cleaned, and the home page interface of the target application may be loaded, so that the subject can quickly enter the home page of the application when the target application is started next time. For example, assuming that the electronic device detects a cleanup operation for an instant messaging application, the instant messaging application is an application that the subject frequently uses (i.e., a candidate application), and the current interface of the instant messaging application is a friend circle browsing interface, then the electronic device may not clean up the process of the instant messaging application, and load the home page interface of the instant messaging application (such as a message viewing interface), so that the subject can quickly enter the home page interface of the instant messaging application when the instant messaging application is started next time.

[0121] (2) If the target application to be cleaned has multiple mini-program interfaces, then the interfaces of the multiple mini-programs can be cleaned and the homepage interface of the target application can be loaded, which is beneficial to saving memory space and allows the object to quickly enter the homepage of the target application the next time the target application is started. For example, assuming that the electronic device detects a cleanup operation for a payment application, the payment application is an application commonly used by the object (i.e., a candidate application), and the payment application currently has the interface of a mobile phone recharge mini-program, an interface of a red envelope mini-program, and an interface of a life payment mini-program, then the electronic device can clean the interface of the mobile phone recharge mini-program, the interface of the red envelope mini-program, and the interface of the life payment mini-program, and load the homepage interface of the payment application (i.e., the function display interface), so that the object can quickly enter the homepage interface of the payment application the next time the payment application is started.

[0122] (3) If the target application to be cleaned has multiple sub-processes, then multiple sub-processes can be cleaned to retain the main process, and the home page interface of the target application can be loaded, so that the object can quickly enter the home page of the target application when the target application is started next time. Among them, the main process of an application may have multiple sub-processes under it, and the sub-processes can inherit most of the properties of the main process. By cleaning up multiple sub-processes of an application and retaining the main process of the application, system resources can be saved.

[0123] In this way, when an electronic device detects a cleanup operation on a target application, if it is determined that the target application to be cleaned is a candidate application, the target application to be cleaned can be flexibly kept alive to avoid the cleaning of commonly used applications by the object, which is conducive to improving the stability and reliability of application preservation.

[0124] In some embodiments, the above application keep alive method can be summarized into three parts, including: determining the timing of application keep alive, performing keep alive processing on the candidate application, and performing application protection processing on the candidate application by adopting the protection policy corresponding to the process type of the candidate application. Figure 5 , Figure 5 This is a flowchart of an application keep-alive method provided in an embodiment of the present application, which may include but is not limited to the following steps:

[0125] S51, the electronic device triggers an application keep-alive operation when it is turned on.

[0126] Among them, the electronic device can automatically trigger the application keep-alive operation for N candidate applications at the time of power-on. In other words, the electronic device can load the processes of N candidate applications in advance in the background, and then when the candidate applications are opened in the foreground, the interfaces of the candidate applications can be quickly displayed, so that the object has a hot start experience.

[0127] S52, the electronic device detects whether the system resources meet the application keep-alive condition in response to the cleanup operation on the candidate application, and performs a keep-alive process on the candidate application in response to the system resources meeting the application keep-alive condition.

[0128] It should be noted that the electronic device may execute both step S51 and step S52, or may execute one of them, which is not limited in the embodiment of the present application.

[0129] In some embodiments, the cleanup operation for candidate applications may be automatically triggered by the electronic device. For example, the electronic device may automatically clean up a portion of unused applications periodically. If there are candidate applications among the automatically cleaned applications, the candidate applications may be kept alive if the system resources meet the application keep-alive conditions. Optionally, the cleanup operation for candidate applications may also be manually triggered by the object. The object may manually clean up applications as needed. If there are candidate applications among the applications manually cleaned up by the object, the candidate applications may be kept alive if the system resources meet the application keep-alive conditions.

[0130] Among them, the electronic device's system resources satisfying the application keep-alive condition may include sufficient system memory margin, sufficient system CPU margin, and the system temperature not exceeding the temperature threshold. If the electronic device determines that the system resources currently satisfy the application keep-alive condition, then the candidate application may be kept alive; if the electronic device determines that the system resources currently do not satisfy the application keep-alive condition, then the system resources may be monitored, and when it is monitored that the system resources satisfy the application keep-alive condition, the candidate application may be kept alive.

[0131] In some embodiments, the electronic device may perform keep-alive processing on the candidate application program by any one of the following steps:

[0132] S501, loading a process of a candidate application in the background.

[0133] S502, loading the process of the candidate application and the interface of the candidate application in the background.

[0134] In the above steps, two methods of keeping the candidate application alive are listed, and one of them can be selected in the specific implementation. For example, the electronic device can obtain an application whitelist, which can record applications that can load interfaces in the background; if the candidate application belongs to the application whitelist, then step S52 can be executed to load the process of the candidate application and the interface of the candidate application in the background, thereby improving the startup efficiency of the candidate application.

[0135] In some embodiments, after the electronic device loads the process of the candidate application in the background, it can also determine the process type of the candidate application, and perform application protection processing on the candidate application according to the process type of the candidate application, which can specifically include:

[0136] S5001: If the process type of the candidate application is a cache process type, a first strategy is used to perform application protection processing on the candidate application.

[0137] For candidate applications whose process type is a cache process type, the electronic device can adjust the process parameters of the candidate applications, and then determine the survival time of the candidate applications in the background based on the adjusted process parameters. By adjusting the process parameters of the candidate applications, the importance of the candidate applications can be adjusted. Since applications with lower importance are more likely to be cleared first when the electronic device system resources are insufficient, the electronic device can adjust the process parameters of the candidate applications whose process type is a cache process type to process parameters with higher importance, thereby extending the survival time of the candidate applications in the background.

[0138] S5002: If the process type of the candidate application is a high power consumption process type, use a second strategy to perform application protection processing on the candidate application.

[0139] For candidate applications whose process type is a high-power consumption process type, the candidate applications can be kept alive and locked within a preset time period; if no trigger operation is detected for the candidate applications within the preset time period, the keep alive lock for the candidate applications is released at the end of the preset time period. During the period when the candidate applications are kept alive and locked, the electronic device will not clean up the candidate applications, thereby achieving the purpose of extending the survival time of the candidate applications in the background.

[0140] By implementing the embodiments of the present application, on the one hand, the electronic device can keep commonly used applications running in the background. When these commonly used applications need to be started in the foreground, the electronic device can quickly display the application interface in the foreground, thereby improving the response efficiency of the system and providing the object with a smooth user experience; on the other hand, when a cleanup operation for commonly used applications is detected, the cleaned applications can be flexibly kept alive, thereby improving the stability and reliability of application keeping alive.

[0141] In some embodiments, various applications in the electronic device can be used in conjunction with each other. For example, when application A is started, it is possible to jump from application A to application B. Based on this, the embodiment of the present application provides another application keeping alive method, which can keep applications alive according to the association relationship between various applications. Figure 6 , Figure 6This is a flowchart of another application keep-alive method provided in an embodiment of the present application, which may include but is not limited to the following steps:

[0142] S601, obtaining the operation data of each application program.

[0143] The running data of each application may include the time when each application starts running, the time when the running ends, the running duration, etc. For example, the running data of each application may include: the electronic device starts application A at 11:00:00 and starts application B at 11:00:30. In this way, according to the time when application A starts running and the time when application B starts running, it can be known that the time interval between the start of application A and application B is 30 seconds, and then the association relationship between application A and application B can be determined according to the time interval between the start of application A and application B.

[0144] S602: In response to a trigger operation on a first application, determine a second application associated with the first application according to running data of each application.

[0145] Among them, the first application can be any application installed in the electronic device. The association of the first application with the second application means that the electronic device is very likely to start the second application after starting the first application. It is understandable that the order in which the electronic device starts the applications is usually determined by the object according to actual needs, and the object is very likely to use one application in conjunction with another application. For example, when the object is using a banking application, the object can receive verification information through the SMS application, when the object is using a shopping application, the object can make payments through the payment application, when the object is using the camera application, the object can view the taken photos through the gallery application, and so on.

[0146] In some embodiments, each application running data may also include the number of times the electronic device switches from the first application to the second application. The electronic device switching from the first application to the second application can be understood as the electronic device foreground switching from the interface displaying the first application to the interface displaying the second application. Here, the electronic device switching from the first application to the second application can be any of the following two switching methods:

[0147] 1) Jump switch

[0148] Jump switching means: the first application provides an application jump link, which is used to jump from the interface of the first application to the interface of the second application; when a trigger operation for the application jump link is detected, the electronic device switches from the first application to the second application. For example, see Figure 7 , Figure 7 A schematic diagram of switching applications provided in an embodiment of the present application. Figure 7 As shown, the electronic device can output a product purchase interface 46 of a shopping application (i.e., a first application), and the product purchase interface 46 provides an application jump link 461, and the application jump link 461 includes the text "Go to pay". When a trigger operation for the application jump link 461 is detected, the electronic device can switch from the shopping application to the payment application (i.e., the second application) and output a payment interface 47 of the payment application.

[0149] For the jump switching mode, the electronic device can count the number of times the first application is started in the foreground and the number of times the first application is jumped and switched to the second application according to the application running data; then, according to the number of times the first application is started in the foreground and the number of times the first application is jumped and switched to the second application, the first correlation between the first application and the second application is calculated; if the first correlation between the first application and the second application is greater than or equal to the first correlation threshold, then it can be determined that the first application is associated with the second application. Among them, the first correlation between the first application and the second application can be, for example, the ratio of the number of times the first application is jumped and switched to the second application to the number of times the first application is started in the foreground. The greater the first correlation between the first application and the second application, the greater the possibility that the electronic device jumps and switches from the first application to the second application after starting the first application. Optionally, the application running data can be the application running data within a preset time period, and the specific duration of the preset time period can be configured based on actual needs, for example, it can be the application running data within 15 days, and this application does not limit this. For example, assuming that the preset time period is 15 days, the first association threshold is 0.5, and according to the application running data statistics within 15 days, the number of times the first application is started in the foreground is 100 times, and the number of times the first application jumps to the second application is 70 times, then the first association degree between the first application and the second application can be 0.7 (that is, 70 / 100=0.7), and the association degree between the first application and the second application (0.7) is greater than the first association threshold (0.5), which means that the first application is associated with the second application.

[0150] 2) Cross-application switching

[0151] Cross-application switching means that the electronic device first switches the first application from the foreground to the background, and then starts the second application in the foreground. It is understandable that this cross-application switching method may be related to the object's usage habits. For example, if the object is accustomed to using the chat application first and then the camera application, then when a switching operation for the chat application is detected, the chat application (first application) may be switched from the foreground to the background, and when a start operation for the camera application is detected, the camera application may be started in the foreground. In other words, the process of switching from the first application to the second application during cross-application switching may be to first switch from the first application to the desktop display interface, and then switch from the desktop display interface to the second application.

[0152] For the cross-application switching mode, the electronic device can count the number of times the first application is started in the foreground and the number of times the first application is switched from the first application to the second application within the reference time interval according to the application running data; then calculate the second correlation between the first application and the second application according to the statistical number of times the first application is started in the foreground and the number of times the first application is switched from the first application to the second application within the reference time interval; if the second correlation between the first application and the second application is greater than or equal to the second correlation threshold, then it can be determined that the first application is associated with the second application. Among them, the reference time interval can be a pre-configured value, for example, it can be 60s. Counting the number of times the first application is switched from the first application to the second application within the reference time interval can reflect the object's habit of using applications. Among them, the second correlation between the first application and the second application can be, for example, the ratio of the number of times the first application is switched from the first application to the second application to the number of times the first application is started in the foreground. The greater the second correlation between the first application and the second application, the greater the possibility that the electronic device switches from the first application to the second application after starting the first application. Optionally, the application running data can be the application running data within a preset time period, and the specific duration of the preset time period can be configured based on actual needs. For example, assuming that the reference time interval is 60s, the preset time period is 7 days, and the second association threshold is 0.6, according to the application operation data statistics within 7 days, the number of times the first application is started in the foreground is 10 times, and the number of times the first application is switched to the second application across applications within 60s is 8 times, then the second association degree between the first application and the second application can be 0.8 (that is, 8 / 10=0.8), and the second association degree between the first application and the second application (0.8) is greater than the second association threshold (0.5), which means that the first application is associated with the second application.

[0153] S603: Perform keep-alive processing on the second application program.

[0154] When it is determined that the first application is associated with the second application, the electronic device may keep the second application alive when the first application is started in the foreground. The second application may be kept alive by loading the process of the second application in the background, or by loading the process of the second application and the interface of the second application in the background. The two methods of keeping the second application alive can refer to the relevant description in the above step S203, which will not be repeated here.

[0155] In this way, when the electronic device starts the first application, it can load in advance another application that may be started next, that is, a second application associated with the first application, so that when the second application is started, the electronic device can quickly display the interface of the second application in the foreground, thereby improving the response efficiency of the system.

[0156] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in this application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive solid statedisk), etc.

[0157] In short, the above description is only an embodiment of the technical solution of the present invention, and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present invention shall be included in the protection scope of the present invention.

Claims

1. An application keeping alive method, characterized in that: The method comprises: According to the usage data of each application, determine N candidate applications in descending order of usage frequency, where N is a positive integer; When the system resources meet the application keep-alive condition, the N candidate applications are kept alive in a warm start mode or a hot start mode; The startup time length corresponding to the warm startup mode is greater than the startup time length corresponding to the hot startup mode.

2. The method according to claim 1, characterized in that The system resources satisfying the application keep-alive condition include: the system memory margin is greater than or equal to a preset memory threshold, the system central processing unit load is less than or equal to a preset load threshold, and the system temperature is less than or equal to a preset temperature threshold.

3. The method according to claim 1 or 2, characterized in that The keeping alive processing of the N candidate applications in a warm start mode or a hot start mode includes: Determining whether a first candidate application satisfies a hot start condition, the first candidate application being any one of the N candidate applications; In response to the first candidate application satisfying the hot start condition, performing a keep-alive process on the first candidate application in a hot start manner; In response to the first candidate application not satisfying the hot start condition, the first candidate application is kept alive in a warm start manner.

4. The method according to claim 3, characterized in that The determining whether the first candidate application meets the hot start condition includes: Obtaining an application whitelist, wherein the application whitelist records application programs that are permitted to be kept alive in a hot start manner; In response to the first candidate application belonging to the application whitelist, determining that the first candidate application satisfies the hot start condition; In response to the first candidate application not belonging to the application whitelist, it is determined that the first candidate application does not satisfy the hot start condition.

5. The method according to claim 3, characterized in that The keeping alive processing of the first candidate application in a warm start manner includes: preloading a process of the first candidate application in the background; The keeping alive processing of the first candidate application in a hot start manner includes: The process of the first candidate application and the interface of the first candidate application are preloaded in the background.

6. The method according to claim 5, characterized in that The method further comprises: Determining a process type of the first candidate application; In response to the process type of the first candidate application being a first type, performing application protection processing on the first candidate application using a first policy; In response to the process type of the first candidate application being the second type, a second policy is adopted to perform application protection processing on the first candidate application.

7. The method according to claim 6, characterized in that The adopting the first strategy to perform application protection processing on the first candidate application includes: Obtaining initial process parameters of the first candidate application; adjusting the initial process parameters to obtain modified process parameters; The survival time of the process of the first candidate application in the background is extended according to the modified process parameter.

8. The method according to claim 6, characterized in that The adopting the second strategy to perform application protection processing on the first candidate application includes: The first candidate application is locked to be kept alive within a preset time period; wherein the process of the first candidate application is prohibited from being closed during the lock to be kept alive period.

9. The method according to claim 5, characterized in that The method further comprises: In response to the cleanup operation for the first candidate application, the process of the first candidate application is kept running in the background.

10. The method according to claim 5, characterized in that The process of the first candidate application includes a main process of the first candidate application and a sub-process of the first candidate application, and the method further includes: In response to the cleanup operation for the first candidate application, the main process of the first candidate application is kept running in the background, and the sub-process of the first candidate application is closed in the background.

11. An application keeping alive method, characterized in that: The method comprises: In response to a trigger operation on a first application, determining a target application associated with the first application according to operation data of each application, wherein the operation data of each application is used to determine an association relationship between the respective applications; The process of the target application is preloaded in the background, or the process of the target application and the interface of the target application are preloaded in the background.

12. The method according to claim 11, characterized in that The step of determining a target application associated with the first application according to the operation data of each application includes: According to the running data of each application, counting the number of times the first application is started and the number of times the first application is switched to the second application; Determining the association between the first application and the second application according to the number of times the first application is started and the number of times the first application is switched to the second application; In response to the degree of association between the first application and the second application being greater than or equal to an association threshold, determining the second application as a target application associated with the first application.

13. The method according to claim 12, characterized in that The determining the association between the first application and the second application according to the number of times the first application is started and the number of times the first application is switched to the second application includes: Determining a switching method for switching from the first application to the second application; In response to the switching mode of switching from the first application to the second application being a jump switching mode, determining the association between the first application and the second application according to the number of times the first application is started and the number of times the first application is switched to the second application; In response to the switching method from the first application to the second application being a cross-application switching method, the number of switches from the first application to the second application within a reference time interval is determined, and the association between the first application and the second application is determined based on the number of startups of the first application and the number of switches from the first application to the second application within the reference time interval.

14. The method according to claim 13, characterized in that In response to the association degree between the first application and the second application being greater than or equal to an association threshold, determining the second application as a target application associated with the first application includes: In response to the switching mode of switching from the first application to the second application being a jump switching mode, and the association degree between the first application and the second application being greater than or equal to a first association threshold, determining that the second application is a target application associated with the first application; In response to the switching mode from the first application to the second application being a cross-application switching mode, the association degree between the first application and the second application is greater than or equal to a second association threshold, and the second application is determined to be a target application associated with the first application.

15. An electronic device, characterized in that: It comprises a memory and one or more processors; the memory is coupled to the one or more processors and is used to store a computer program, and the computer program includes program instructions; the one or more processors call the program instructions so that the electronic device executes the method as described in any one of claims 1-10, or executes the method as described in any one of claims 11-14.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements the method according to any one of claims 1 to 10, or implements the method according to any one of claims 11 to 14.

17. A computer program product comprising instructions, characterized in that When the computer program product runs on an electronic device, the electronic device executes the method according to any one of claims 1 to 10, or executes the method according to any one of claims 11 to 14.