Method and device for starting application program and electronic equipment
By listening to events and judging conditions, the main process of the application is started, which solves the user experience problem caused by the killing of the application process and improves the sustainability and usability of the application.
Patent Information
- Application Number
- CN202410172000.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2025-08-05
AI Technical Summary
The process of the application being killed will cause the user to be unable to receive messages or start coldly, affecting the user experience.
By listening to the front and backend switching events and the killing of the application process, we can determine whether the electronic device meets the preset conditions. If so, start the main process of the application to improve the application's ability to keep alive.
Avoid the impact of the killing of application processes on the user experience, reduce cold start time, and improve application availability.
Smart Images

Figure CN120429029A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic devices, and in particular to a method, device, and electronic device for starting an application. Background Art
[0002] With the advancement of science and technology, electronic devices can now host applications that provide various services to users. During the use of electronic devices, application processes are often killed. This can prevent users from receiving messages from the application. Alternatively, restarting an application after killing it is considered a cold restart, which can take a long time and prevent users from using the application quickly.
[0003] Therefore, how to improve the application's ability to keep alive and avoid affecting the normal operation of the application due to the killing of the application process. Summary of the Invention
[0004] The present application provides a method, device, and electronic device for starting an application, thereby improving the ability of the application to stay alive and preventing the normal operation of the application from being affected by the killing of the application process.
[0005] In a first aspect, a method for starting an application is provided, which is applied to an electronic device, where a process of a first application of the electronic device is killed, comprising: monitoring a first event, where the first event includes one of the following: a foreground-background switching event, or an application process being killed event; in response to monitoring the first event, determining whether the electronic device meets a first preset condition, where the first preset condition corresponds to the first event; and when the electronic device meets the first preset condition, starting the main process of the first application.
[0006] For example, the electronic device can be a mobile phone terminal, tablet computer, or other device that can carry an application. For the application that causes the foreground / background switching event, it can be any application carried on the electronic device. The embodiment of the present application does not limit the specific process of the first event triggering.
[0007] It should be noted that killing an application process may also be understood as closing the application process, terminating the application process, etc.
[0008] It should be noted that the specific first event monitored by the electronic device may be different, and the first preset condition required to determine whether the electronic device meets the first preset condition may also be different. The first event can be understood as an event that triggers the electronic device to determine whether the first preset condition is met. The embodiments of the present application do not limit the events that trigger the electronic device to determine whether the first preset condition is met, including but not limited to foreground and background switching events and application process killing events.
[0009] Based on the above solution, when the electronic device detects a first event, it first determines whether the electronic device meets a first preset condition. If so, the main process of the application of the killed process can be restarted. If not, the main process of the application of the killed process will not be restarted. This allows the process of the killed application to be pre-started in the background of the electronic device, improving the application's ability to stay alive and avoiding the user experience being affected by the killing of the application process.
[0010] In combination with the first aspect, in certain implementations of the first aspect, the response to monitoring the first event, determining whether the electronic device meets the first preset condition, includes: responding to monitoring the foreground and background switching event, determining whether the electronic device meets the first preset condition; wherein, the first preset condition includes the following multiple items: the first application is an application in the configuration list, the main process of the first application is killed, and the system resources of the electronic device meet the second preset condition.
[0011] For example, after the system server detects a foreground / background switching event, it needs to further determine whether a first preset condition is met. If multiple conditions in the first preset condition are met, the main process of the first application can be started (or loaded); if any condition in the first preset condition is not met, the main process of the first application will not be started (or loaded).
[0012] It should be noted that the application that causes the foreground / background switching event may be different from the application that is launched.
[0013] It is understandable that the order of determining whether the electronic device satisfies multiple conditions in the first preset condition is not limited.
[0014] Based on the above solution, the first application launched is from the configuration list, indicating that an application of high importance or frequent user use is likely to be launched. Launching an application whose main process was killed can avoid a cold restart of the application when the user opens it again. This cold restart process consumes a certain amount of time and system resources, affecting the user experience.
[0015] In combination with the first aspect, in certain implementations of the first aspect, the response to monitoring the first event, determining whether the electronic device meets the first preset condition, includes: in response to monitoring the event that the process of the application is killed and the electronic device displays the desktop, determining whether the electronic device meets the first preset condition; wherein, the first preset condition includes the following multiple items: the first application is an application in the configuration list, the main process of the first application is killed, and the system resources of the electronic device meet the second preset condition.
[0016] For example, the electronic device is in an unlocked state. When the system server monitors the event that the application process is killed, it is necessary to further determine whether the first preset condition is met. When multiple items included in the first preset condition are met, the main process of the first application can be started (or loaded); when any item in the first preset condition is not met, the main process of the first application will not be started (or loaded).
[0017] It should be noted that an electronic device in an unlocked state can display the desktop or the interface of another application.
[0018] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: in response to monitoring an event in which the process of the application is killed and the electronic device displays the interface of the second application, the electronic device will not start the main process of the first application.
[0019] It should be noted that when the electronic device is unlocked, the foreground of the electronic device can display the desktop or the interface of an application (for example, a second application). When the foreground of the electronic device displays the desktop, it means that no other applications are currently running in the foreground of the electronic device, that is, the user is not currently using other applications. When the foreground of the electronic device displays an application interface, it means that the foreground of the electronic device is currently running the displayed application, that is, the user is currently using the application displayed in the foreground.
[0020] As can be seen, when the electronic device is unlocked and detects an application process has been killed, if the electronic device's desktop is displayed in the foreground, there is a possibility that the killed application process will be launched. This prevents the main process of the killed application from being launched while the user is using other applications, which would occupy system memory and affect the user's experience in other applications.
[0021] For example, when the system server monitors that the application process is killed and the electronic device is unlocked, it is determined that the desktop is displayed on the foreground of the electronic device, and the main process of the first application in the configuration list is killed, and the system resources of the electronic device are sufficient, the main process of the first application can be started.
[0022] In combination with the first aspect, in certain implementations of the first aspect, the response to monitoring the first event, determining whether the electronic device meets the first preset condition, includes: in response to monitoring the event that the process of the application is killed, and the electronic device is in a locked state, determining whether the electronic device meets the first preset condition; wherein, the first preset condition includes the following multiple items: the first application is an application in a configuration list, the main process of the first application is killed, and the system resources of the electronic device meet the second preset condition.
[0023] It should be noted that when the electronic device is in the locked screen state, the electronic device may be in the screen-off state or the screen-off state.
[0024] It should be noted that the electronic device is in the locked screen state. When the system server monitors the event that the application process is killed, it needs to further determine whether the first preset condition is met. When multiple items included in the first preset condition are met, the main process of the first application can be started (or loaded); when any item in the first preset condition is not met, the main process of the first application will not be started (loaded).
[0025] It should be noted that when the electronic device is in a locked screen state, it means that no application is running in the foreground of the electronic device, that is, the user is not currently using the application.
[0026] For example, when the system server monitors that the application process is killed and the electronic device is in the lock screen state, it is determined that the killed process is the main process of the first application in the configuration list, and the system resources of the electronic device are sufficient, the main process of the first application can be started.
[0027] Based on the above solution, when the electronic device is in the lock screen state, it is obvious that the user is not using the application in the foreground of the electronic device. Therefore, it is only necessary to determine that the electronic device meets the first preset condition to start the main process of the application of the killed process, and no other applications will be affected.
[0028] In combination with the first aspect, in certain implementations of the first aspect, when the first event is the foreground / background switching event, before responding to monitoring the first event, the method also includes: in response to the operation on the first interface of the electronic device, the electronic device displays a second interface; wherein, the first interface is the interface of the third application of the electronic device, and the second interface is the interface of the fourth application of the electronic device or the desktop of the electronic device.
[0029] For example, the user can operate on a certain application interface to retreat the application to the background, and the foreground of the electronic device can display the interface of other applications or the desktop of the electronic device to indicate that a foreground-background switching event has occurred.
[0030] In combination with the first aspect, in some implementations of the first aspect, the first application is the same as the third application, or the first application is different from the third application.
[0031] That is, the application that experiences the foreground / background switching event may be the same as or different from the application that subsequently meets the first preset condition and can be launched as the main process. The application that experiences the foreground / background switching event is not necessarily an application in the configuration list, but the application that is launched is an application in the configuration list.
[0032] In combination with the first aspect, in some implementations of the first aspect, the first event is an event in which the process of the application is killed; wherein, before responding to monitoring the first event, the method also includes: in response to an operation on a first interface of the electronic device, displaying a multitasking interface, the first interface being the interface of the first application of the electronic device; in response to an operation on the multitasking interface, closing the first application.
[0033] For example, the application process can be killed through the user's active operation. Of course, the process of killing the application process can also be imperceptible to the user, and this embodiment of the present application does not limit this.
[0034] In combination with the first aspect, in certain implementations of the first aspect, the system resources include at least the following items: central processing unit (CPU) resources, memory, power, and temperature.
[0035] Exemplarily, when the electronic device's CPU resources, memory, and power are sufficient and the electronic device's temperature is appropriate, it is determined that the electronic device's system resources meet the second preset condition, that is, the electronic device's system resources are sufficient and there is a possibility of starting the application's main process.
[0036] In combination with the first aspect, in some implementations of the first aspect, the lock screen state includes a screen off state and a screen off state.
[0037] In a second aspect, a device for starting an application is provided, in which a process of a first application is killed. The device includes: a processing unit for monitoring a first event, wherein the first event includes one of the following: a foreground-background switching event, an application process killing event; and is further used to determine whether the device meets a first preset condition in response to monitoring the first event, wherein the first preset condition corresponds to the first event; and is further used to start the main process of the first application when the device meets the first preset condition.
[0038] In combination with the second aspect, in certain implementations of the second aspect, the processing unit is specifically used to determine whether the device meets the first preset condition in response to monitoring the foreground and background switching event; wherein, the first preset condition includes the following items: the first application is an application in the configuration list, the main process of the first application is killed, and the system resources of the device meet the second preset condition.
[0039] In combination with the second aspect, in certain implementations of the second aspect, the processing unit is specifically used to determine whether the device meets the first preset condition in response to monitoring an event in which the process of the application is killed and the device displays the desktop; wherein the first preset condition includes the following multiple items: the first application is an application in the configuration list, the main process of the first application is killed, and the system resources of the device are sufficient to meet the second preset condition.
[0040] In combination with the second aspect, in certain implementations of the second aspect, the processing unit is specifically configured to respond to monitoring an event in which the process of the application is killed, and the device displays the interface of the second application, and will not start the main process of the first application.
[0041] In combination with the second aspect, in certain implementations of the second aspect, the processing unit, in response to monitoring an event in which the process of the application is killed and the device is in a locked state, determines whether the device meets the first preset condition; wherein the first preset condition includes the following multiple items: the first application is an application in a configuration list, the main process of the first application is killed, and the system resources of the device meet the second preset condition.
[0042] In combination with the second aspect, in certain implementations of the second aspect, the device further includes a display unit, which is used to display a second interface in response to an operation on the first interface of the device; wherein the first interface is the interface of the third application of the device, and the second interface is the interface of the fourth application of the device or the desktop of the device.
[0043] In combination with the second aspect, in some implementations of the second aspect, the first application is the same as the third application, or the first application is different from the third application.
[0044] In combination with the second aspect, in certain implementations of the second aspect, the device further includes a display unit, which is used to display a multitasking interface in response to an operation on a first interface of the device, where the first interface is the interface of a first application of the device; and is also used to close the first application in response to an operation on the multitasking interface.
[0045] In combination with the second aspect, in some implementations of the second aspect, the system resources include at least the following items: central processing unit (CPU) resources, memory, power, and temperature.
[0046] In combination with the second aspect, in some implementations of the second aspect, the lock screen state includes a screen off state and a screen off state.
[0047] In a third aspect, an electronic device is provided, comprising: one or more processors; one or more memories; the one or more memories storing one or more computer programs, the one or more computer programs comprising instructions, which, when executed by the one or more processors, enable the electronic device to perform a method as in the first aspect above and any possible implementation thereof.
[0048] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a computer, the computer implements the method as described in the first aspect and any possible implementation thereof.
[0049] In a fifth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the method as described in the first aspect and any possible implementation thereof.
[0050] In a sixth aspect, a chip is provided, which includes a processor and a data interface. The processor reads instructions stored in a memory through the data interface to execute the method in the first aspect and any possible implementation thereof.
[0051] In combination with the sixth aspect, in a possible implementation, the processor is coupled to the memory through an interface.
[0052] In combination with the sixth aspect, in a possible implementation, the chip system also includes a memory, in which a computer program or computer instructions are stored. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a structural diagram of an electronic device.
[0054] Figure 2 It is a software structure diagram of an electronic device.
[0055] Figure 3 This is a schematic flowchart of a method for starting an application provided in an embodiment of the present application.
[0056] Figure 4 It is a set of GUIs provided in the embodiments of this application.
[0057] Figure 5 This is a schematic flowchart of a method for starting an application provided in an embodiment of the present application.
[0058] Figure 6 It is a set of GUIs provided in the embodiments of this application.
[0059] Figure 7This is a schematic flowchart of a method for starting an application provided in an embodiment of the present application.
[0060] Figure 8 It is a set of GUIs provided in the embodiments of this application.
[0061] Figure 9 This is a schematic flowchart of a method for starting an application provided in an embodiment of the present application.
[0062] Figure 10 This is a schematic flowchart of a method for starting an application provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The technical solution in this application will be described below with reference to the accompanying drawings.
[0064] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of this application and the appended claims, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can 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 subsequent associated objects are in an "or" relationship.
[0065] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0066] The following describes an electronic device, a user interface for such an electronic device, and embodiments for using such an electronic device. In some embodiments, the electronic device may be a portable electronic device that also includes other functions such as a personal digital assistant and / or a music player, such as a mobile phone, a tablet computer, a wearable electronic device with wireless communication functions (such as a smart watch), etc. Exemplary embodiments of portable electronic devices include but are not limited to devices equipped with Or a portable electronic device with other operating systems. The portable electronic device may also be other portable electronic devices, such as a laptop computer. It should also be understood that in some other embodiments, the electronic device may not be a portable electronic device, but a desktop computer. In some other embodiments, the electronic device may be an instrument for measurement, such as an oscilloscope.
[0067] For example, Figure 1 : The figure shows a schematic structural diagram of an electronic device 100. 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 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0068] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0069] 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 processing unit (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). The different processing units may be independent devices or integrated into one or more processors.
[0070] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0071] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0072] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0073] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0074] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0075] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0076] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0077] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0078] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0079] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0080] Display screen 194 is used to display images, videos, and the like. 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 (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0081] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0082] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0083] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0084] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0085] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0086] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0087] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0088] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0089] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0090] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0091] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0092] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.
[0093] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.
[0094] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 180A can be set on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a device comprising at least two parallel plates with conductive materials. When a force acts on the pressure sensor 180A, the capacitance between the electrodes changes. The electronic device 100 determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation based on the pressure sensor 180A. The electronic device 100 can also calculate the position of the touch based on the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the alarm application icon, the instruction to create a new alarm is executed.
[0095] Fingerprint sensor 180H is used to collect fingerprints. Electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, accessing application locks, taking photos with fingerprints, answering calls with fingerprints, and so on. For example, when the phone detects a user's touch operation on the lock screen, the phone can collect the user's fingerprint information through fingerprint sensor 180H and match the collected fingerprint information with the fingerprint information pre-set in the phone. If the match is successful, the phone can enter the non-lock screen interface from the lock screen interface.
[0096] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.
[0097] Figure 2 This is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer may include a series of application packages.
[0098] like Figure 2 As shown, the application layer may include camera, settings, skin module, user interface (UI), third-party applications, etc. Among them, third-party applications may include gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0099] 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 may include some predefined functions.
[0100] like Figure 2 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0101] The window manager manages windowed applications. It can determine the display size, determine whether a status bar is present, lock the screen, and take screenshots. Content providers store and retrieve data and make it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and phone books.
[0102] The view system includes visual controls, such as controls for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views.
[0103] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0104] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0105] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0106] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for calling and managing the Android system.
[0107] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0108] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0109] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).
[0110] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0111] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0112] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0113] A 2D graphics engine is a drawing engine for 2D drawings.
[0114] In addition, the system library can also include status monitoring service modules, such as a physical status recognition module for analyzing and identifying user gestures; a sensor service module for monitoring sensor data uploaded by various sensors at the hardware layer to determine the physical status of the electronic device 100.
[0115] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0116] The hardware layer can include various types of sensors, such as Figure 1 Various types of sensors introduced in.
[0117] Combined with the above Figure 1 and Figure 2 The electronic device introduced in the embodiment of the present application is an electronic device such as a mobile phone terminal, a tablet computer, etc. that can run various applications. The physical devices involved in the electronic device 100 mainly include hardware components such as sensors, decision support systems (DSS) display chips, touch screens, fingerprint recognition modules, etc.; as well as kernel software layers such as screen management modules, display drivers, fingerprint drivers, and anti-mistouch; application framework layer functions such as anti-mistouch input, screen control, always on display (AOD) services, and power management; and application layer services such as special adaptation applications (camera), third-party applications, system hibernation, and AOD.
[0118] When using electronic devices such as mobile phones and tablets, users often encounter the situation where their application processes are killed. This may be caused by one or more of the following: an application exception; on native Android devices, the application running in the background for too long, resulting in excessive load; the application may be cleared by the task manager or force-stopped in settings; the application may have committed suicide, such as by hot-updating; or the entire device may be restarted. For example, if the process of a social networking application that has been retired to the background is killed, the user will not be able to receive messages from other users through the social networking application in a timely manner, affecting the user experience. Furthermore, if the application process is killed, when the user opens the application again, there is no background process for the application. The system then reassigns a new process to the application to start the application, requiring a cold start. This process typically takes a long time, and the electronic device needs to load the startup animation for a period of time, making it difficult for the user to access the application interface in a timely manner, thus affecting the user experience.
[0119] Therefore, the present application provides a method, device and electronic device for starting an application, which can pull up the application whose process was killed in advance before the user triggers the cold start of the application, thereby improving the user's ability to keep the application alive during the user's use of the electronic device and avoiding the user's experience being affected by the killing of the application process.
[0120] like Figure 3 FIG300 is a schematic flow chart of a method for starting an application program according to an embodiment of the present invention. The method 300 can be applied to electronic devices carrying application programs, such as mobile terminals and tablet computers. The method is described in detail below.
[0121] S301: A trigger event is monitored.
[0122] Specifically, the system server module of the electronic device monitors whether a trigger event occurs. When any trigger event occurs, it can decide whether to start the main process of the killed application.
[0123] In the method for starting an application provided in an embodiment of the present application, two types of monitored trigger events are exemplarily provided. First, a monitor is set for the foreground and background switching event. If the foreground and background switching of the electronic device is monitored, it means that a trigger event is monitored. In other words, the foreground and background switching event can be understood as a trigger event. Second, a monitor is set for the application. If the application process is monitored to be killed, it means that a trigger event is monitored. In other words, the killing of the application process can be understood as a trigger event. It can be understood that the above two trigger events correspond to two scenarios. Listen to the corresponding events in different scenarios, and pull up the main program of the application when the preset conditions are met.
[0124] It should be noted that after the system server monitors the trigger event, it is necessary to further determine whether the preset conditions are met, that is, to execute the following step S302.
[0125] S302: Determine whether a preset condition is met.
[0126] It should be noted that when preset conditions are met, the main process of the application of the killed process can be launched. The preset conditions can be restrictions on the electronic device. Among them, the restrictions on the electronic device can include that the killed process is the main process of an application hosted on the electronic device, the application of the killed process is included in the electronic device configuration list, the electronic device has sufficient system resources, or the electronic device displays the desktop in the foreground.
[0127] It should be understood that the specific contents of the preset conditions may vary depending on the two different triggering events or different scenarios. The preset conditions will be described in detail below.
[0128] S303: Start the main process of the application.
[0129] It should be noted that an application can have multiple processes, and the main process of an application can be understood as the process that carries the application package name. Launching the main process of an application can be understood as preloading or starting the application in the background of the electronic device. When the user opens the application again, there is no need to cold-start the application.
[0130] Generally speaking, an application's main process is created when the application starts. It is primarily responsible for launching the application's components (such as Activities, Services, and BroadcastReceivers), and it continues to run for the duration of the application. Child processes are dynamically created by the main process and are typically used to perform long-running tasks, such as network operations and database access. The creation and destruction of child processes is typically controlled by the main process, which can be done by calling the system's application programming interface (API).
[0131] For example, a social application process can include the main process of the social application and the push process of the social application. Simply put, if the main process of the social application is killed, it means that the user has exited the social application, and the interface of the social application will not be displayed in the foreground or background of the electronic device. If the push process of the social application is killed, the user will not receive push messages from the social application, such as system push messages or push messages from other users.
[0132] As can be seen from the above, the method for starting an application provided in the embodiment of the present application can be applied to a variety of scenarios. The following will be combined with the accompanying drawings to specifically introduce the method for starting an application in various scenarios.
[0133] Scenario 1: A foreground / background switching event occurs.
[0134] For ease of understanding, Figure 4 As shown in FIG, a set of graphical user interfaces (GUIs) are shown. A mobile phone terminal is used as an example to describe the scenario where a foreground-background switching event occurs.
[0135] like Figure 4 As shown in (a) of the figure, the interface of the social application (application, App) of the mobile terminal is displayed. The interface of the social application displays a chat window between the local user (i.e. the user of the mobile terminal) and user A. The interface of the social application displayed on the foreground of the mobile terminal indicates that the user is using the social application. In response to the user sliding upward from the bottom of the interface of the social application in the direction indicated by the dotted arrow, the mobile terminal can display the following: Figure 4 The GUI shown in (b) in FIG.
[0136] like Figure 4As shown in (b) in the figure, in response to the user sliding upward from the bottom of the interface of the social application in the direction indicated by the dotted arrow, the mobile phone terminal displays a multi-tasking interface. Multiple tabs are displayed on the multi-tasking interface, and the multiple tabs respectively represent the applications that have been started. Among them, the multiple tabs include tab 401, and the interface of the social application is displayed in tab 401. It can be considered that tab 401 is the interface of the social application after being reduced. In response to the user sliding to the right in the direction indicated by the dotted arrow, the mobile phone terminal can display the following interface: Figure 4 The GUI shown in (c) in FIG.
[0137] like Figure 4 As shown in (c) in the figure, in response to the user sliding to the right in the direction indicated by the dotted arrow, the mobile phone terminal displays a multi-tasking interface. Multiple tabs are displayed on the multi-tasking interface, wherein the multiple tabs include tab 402, and the interface of the video application is displayed in tab 402. Tab 402 can be considered to be the interface of the video application after reduction. When the multi-tasking interface of the mobile phone terminal displays multiple tabs, it means that the mobile phone terminal has opened multiple applications, and the foreground and background switching between multiple applications can be realized in the multi-tasking interface. In response to the user's operation on tab 402, the mobile phone terminal can display the following: Figure 4 The GUI shown in (d) in FIG.
[0138] like Figure 4 As shown in (d) in the figure, in response to the user's operation on tab 402, the mobile terminal displays the interface of the video application. This indicates that the user has switched the social application displayed in the foreground of the mobile terminal to the video application, and the social application originally displayed in the foreground of the mobile terminal has returned to the background, that is, a foreground-background switch event has occurred.
[0139] It should be noted that Figure 4 The set of GUIs shown is only an example of a triggering front-back switching event. Figure 4 By sliding to exit the interface of the social application on the mobile terminal shown in (a), the mobile terminal can display the desktop and the social application is switched to the background. This is also a way to trigger the foreground-background switching event. Alternatively, when the social application is switched to the background, the user opens another application on the desktop of the mobile terminal, which is also a way to trigger the foreground-background switching event. In the embodiments of the present application, the specific method of triggering the foreground-background switching event is not limited.
[0140] like Figure 5 As shown, a schematic flow chart of a method for starting an application provided in an embodiment of the present application is shown. This method 500 can be applied to the above-mentioned scenario 1. The method is described in detail below.
[0141] S501: Monitoring a foreground / background switching event.
[0142] For example, the front-end and back-end switching events can be as above Figure 4 The process shown is triggered.
[0143] It should be noted that the application that switches between the foreground and background can be any application hosted on the electronic device, and this embodiment of the present application does not limit this.
[0144] Specifically, after the system server detects a foreground / background switching event, it needs to further determine whether a preset condition is met. The preset condition includes one or more of the following steps S502 through S504. If met, the main process of the application is launched. This embodiment of the application does not limit the execution order of steps S502 through S504.
[0145] S502: Determine whether any process of an application in the configuration list has been killed.
[0146] It is understandable that when an application's process is killed, it is cleared from memory and is no longer running.
[0147] It should be noted that the configuration list is a system-preset configuration file that includes applications arranged in a certain order. The present embodiment of the application does not limit the order of the applications in the configuration list. Generally speaking, the applications in the configuration list can be highly important and frequently used by users. The applications in the configuration list can be different from the applications that switch between the foreground and background.
[0148] It should be noted that whether a process of an application in the configuration list is killed can be determined by traversing the configuration list.
[0149] For example, the configuration list includes application 1, application 2, and application 3 in order of arrangement. When the system server detects a foreground / background switching event, the system server sequentially traverses the applications in the configuration list in order of arrangement. When it is determined that the process of any application in the configuration list has been killed, the subsequent step S503 can be executed.
[0150] For example, when systemserver traverses the applications in the configuration list in order of arrangement, and determines that the process of application 1 in the configuration list is killed, then continue to execute subsequent step S503 to make the next judgment. If it is determined that the process of application 1 has not been killed, and when traversing to application 2, it is determined that the process of application 2 is killed, then continue to execute subsequent step S503 to make the next judgment. If it is determined that neither the process of application 1 nor the process of application 2 has been killed, and when traversing to application 3, it is determined that the process of application 3 is killed, then continue to execute subsequent step S503 to make the next judgment. If all the applications in the configuration list are traversed and no application process is found to be killed, then exit the entire process, and this foreground and background switching event will not pull up the main process of the application.
[0151] Simply put, only the applications in the configuration list can be launched, and each time a foreground-background switching event occurs, at most one application's main process is launched. There is a possibility that no application's main process is launched.
[0152] It should be noted that by determining whether there is an application whose process is killed in the configuration list, the applications that may be launched subsequently are limited to more important applications, so as to avoid the situations where the processes of applications that are not frequently used by users are launched in advance after being killed, resulting in excessive system resources being occupied and affecting the user experience.
[0153] S503: Determine whether the killed process is the main process of the application.
[0154] It's important to note that after determining that any application process has been killed by traversing the configuration list, it's necessary to further determine whether the application's main process was killed. The main process of an application can be understood as the process containing the application package name. It should be understood that if the main process of an application is killed, the application will need to be cold-started when the user reopens it.
[0155] It should be noted that if it is determined in step S502 that the process of the application in the configuration list is killed, but it is determined in step S503 that the process killed is not the main process of the application, then return to step S502 and continue to traverse whether there are other applications with killed processes in the configuration list. If so, continue to execute step S503; if not, exit the entire process, and this foreground and background switching will not pull up the main process of the application.
[0156] Simply put, the main process of an application in the configuration list can only be started when the main process is killed. Moreover, each time a foreground-background switching event occurs, at most one main process of an application can be started. It is possible that no main process of any application will be started.
[0157] It should be noted that restarting the application whose main process was killed can avoid the cold start of the application when the user opens the application again. The cold start process of the application takes a certain amount of time and system resources, affecting the user experience.
[0158] S504: Determine whether system resources are sufficient.
[0159] It should be noted that after determining that the main process of any application in the configuration list has been killed, it is also necessary to determine whether the system resources are sufficient. Exemplarily, system resources may include central processing unit (CPU) resources, memory, power, electronic device temperature, etc. For example, when the CPU resources, memory and power of the electronic device are sufficient, and the temperature of the electronic device is appropriate, it is determined that the system resources are sufficient. When any of the CPU resources, memory, power, and electronic device temperature of the electronic device does not meet the conditions, it is determined that the system resources are insufficient.
[0160] For example, after determining that the main process of application 1 in the configuration list is killed, further determine whether the system resources of the electronic device hosting application 1 are sufficient. If the system resources are sufficient, step S505 can be executed to pull up the main process of application 1; if the system resources are not sufficient, exit the entire process, and this foreground and background switching will not pull up the main process of the application.
[0161] Simply put, the main process of an application in the configuration list can only be restarted if the main process is killed and system resources are sufficient. Furthermore, each time a foreground / background switching event occurs, at most one main process of an application is restarted; there is a possibility that no main process of an application will be restarted.
[0162] It should be noted that sufficient system resources indicate that the CPU resources, power, memory, etc. of the electronic device system can meet the needs of launching the main process of the application in advance. Under this condition, there is a possibility of successfully launching the main process of the application, avoiding the failure of launching the main process of the application due to insufficient system resources, resulting in a waste of system resources.
[0163] S505: Start the main process of the application.
[0164] It should be noted that in method 500 , the application that is switched between the foreground and background may be different from the application that is launched.
[0165] For example, when application 4 switches from the foreground to the background of the electronic device, it begins traversing the configuration list and determines that the process of application 1 in the configuration list has been killed, and it is the main process of application 1 that has been killed. If the electronic device has sufficient resources, the main process of application 1 can be started. Application 4 is the application that triggered the foreground-background switch event and is not in the configuration list and has not been killed. Application 1 is the application in the configuration list whose main process was killed.
[0166] It should be noted that when the above-mentioned preset conditions (including step S502, step S503, and step S504) are all met, the main process of the application can be launched. Launching the main process of the application can be understood as preloading the application in the background of the electronic device, so that when the user opens the application again, there is no need to cold-start the application.
[0167] For example, when the system server detects a foreground-background switching event on an electronic device, it will traverse the applications in the configuration list in the order in which they are arranged, and will find application 1 in the configuration list. It will then determine that the process of application 1 has been killed, and further determine that the main process of application 1 has been killed. If the electronic device has sufficient system resources, it can start the main process of application 1, allowing the electronic device to preload application 1 in the background.
[0168] The embodiment of the present application does not limit the execution order of step S502 to step S504. In addition to the above execution order, several other execution orders of method 500 are introduced below with reference to examples.
[0169] Illustratively, the configuration list includes application 1, application 2, and application 3 in order of arrangement.
[0170] Example 1: Determine whether the main process of an application has been killed → Determine whether the application is in the configuration list → Determine whether system resources are sufficient
[0171] When the system server monitors the foreground and background switching event of the electronic device, it determines that the main process of application 1 is killed, traverses the configuration list, determines that the configuration list includes application 1, and pulls up the main process of application 1 when the system resources are sufficient. The electronic device preloads the main process of application 1 in the background.
[0172] Example 2: Determine whether the main process of an application has been killed → Determine whether system resources are sufficient → Determine whether the application is in the configuration list
[0173] When the system server monitors the foreground and background switching event of the electronic device, it determines that the main process of application 1 is killed, the system resources are sufficient, and when application 1 is included in the configuration list, the main process of application 1 is pulled up, and the electronic device preloads the main process of application 1 in the background.
[0174] Example 3: Determine whether system resources are sufficient → Determine whether any application process in the configuration list has been killed → Determine whether the killed process is the main process of the application
[0175] When the system server monitors the foreground and background switching event of the electronic device, it first determines that the system resources are sufficient, and determines that the process of application 1 is killed by traversing the configuration list. When the main process of application 1 is killed, it starts the main process of application 1, and the electronic device preloads the main process of application 1 in the background.
[0176] It should be noted that method 500 may also include other execution orders, which will not be described here to avoid redundancy.
[0177] Based on the above scheme, when a foreground-background switching event occurs, if all preset conditions are met, the electronic device can preload the main process of the application of the killed process in the background in advance, so as to avoid the user being unable to receive messages from the application due to the main process of the application being killed, or to avoid the cold start process of the application taking a certain amount of time when the user opens the application, affecting the user's experience.
[0178] Scenario 2: The application process is killed.
[0179] For ease of understanding, Figure 6 As shown, a set of GUIs are shown, taking a mobile terminal as an example to introduce a sub-scenario in which an application process is killed.
[0180] like Figure 6 As shown in (a) of FIG, the interface of the social application of the mobile terminal is displayed. The interface of the social application displays a chat window between the local user and user A. The interface of the social application displayed on the foreground of the mobile terminal indicates that the user is using the social application. In response to the user sliding upward from the bottom of the interface of the social application in the direction indicated by the dotted arrow, the mobile terminal can display the following Figure 6 The GUI shown in (b) in FIG.
[0181] like Figure 6As shown in (b) in the figure, in response to the user sliding upward from the bottom of the interface of the social application in the direction indicated by the dotted arrow, the mobile phone terminal displays a multi-tasking interface. A plurality of tabs are displayed on the multi-tasking interface, and the plurality of tabs respectively represent the applications that have been started. Among them, the plurality of tabs include tab 601, and the interface of the social application is displayed in tab 601. Tab 601 can be considered as a reduced interface of the social application. The multi-tasking interface also includes a blank area, such as area 602 surrounded by dotted lines. In response to the user sliding upward in the direction indicated by the dotted arrow and clicking on area 602, the mobile phone terminal can display an area as shown in FIG. Figure 6 The GUI shown in (c) in FIG.
[0182] like Figure 6 As shown in (c) of FIG. 1 , in response to the user swiping upward in the direction indicated by the dotted arrow and clicking on area 602, the mobile terminal displays the desktop. It should be noted that swiping upward in the direction indicated by the dotted arrow indicates that the user has closed the social application, i.e., the social application process has been killed. In response to the user clicking on area 602, the mobile terminal displays the desktop in the foreground. At this time, no other applications are running in the foreground of the mobile terminal.
[0183] Or, as Figure 6 As shown in (d) in the figure, in response to the user's social application interface on the mobile terminal (such as Figure 6 In the example shown in (a), in the example shown in FIG, a user slides upward from the bottom of the interface of the social application along the direction indicated by the dotted arrow, and the mobile terminal displays a multi-tasking interface. In response to the user first sliding upward along the direction indicated by the dotted arrow and then sliding right along the direction indicated by another dotted arrow, the mobile terminal may display the following interface: Figure 6 The GUI shown in (e) in FIG.
[0184] like Figure 6 As shown in (e) in the figure, in response to the user sliding upward along the direction indicated by the dotted line and sliding to the right along the direction indicated by another dotted arrow, the mobile phone terminal displays a multi-tasking interface. Multiple tabs are displayed on the multi-tasking interface, wherein the multiple tabs include tab 603, and the interface of the video application is displayed in tab 603. Tab 603 can be considered to be the interface of the video application after reduction. When the multi-tasking interface of the mobile phone terminal displays multiple tabs, it means that the mobile phone terminal has opened multiple applications, and can close any application in the multi-tasking interface, and display any application in the foreground. In response to the user's operation on tab 603, the mobile phone terminal can display the following: Figure 6 The GUI shown in (f) in FIG.
[0185] like Figure 6As shown in (f), in response to the user's operation on the tab 603, the mobile terminal displays the interface of the video application. This indicates that after the process of the social application is killed, the mobile terminal displays the interface of another video application in the foreground, indicating that the user is currently using the video application.
[0186] That is to say, when an application process is killed and the phone is unlocked, the foreground of the mobile terminal can display the interface of another application, or it can not display the interface of any application (for example, display the desktop of the mobile terminal). Figure 6 In the scenario where the process of an application is killed, after the process of a certain application is killed, the electronic device is unlocked.
[0187] It should be noted that Figure 6 The set of GUIs shown is only an example of an event that triggers the process of killing an application. Figure 6 The GUI shown is a process in which a user actively kills an application process. An application process may also be killed in the background due to excessive system load. In other words, the process of killing an application process may be imperceptible to the user. In the embodiments of the present application, the specific method for triggering the application process killing event is not limited.
[0188] like Figure 7 As shown, a schematic flow chart of a method for starting an application provided by the present application is shown. The method 700 can be applied to the following examples: Figure 6 The following describes the method in detail for the scenario shown in the figure.
[0189] S701: An event in which an application process is killed is monitored, and the electronic device is in unlocked state.
[0190] For example, the event that the application process is killed can be as follows: Figure 6 The process shown is triggered.
[0191] It should be noted that the application of the killed process can be any application hosted on the electronic device, and this embodiment of the application does not limit this. Since an application can include multiple processes, whenever any process of an application is killed, the event will be reported, that is, the electronic device will monitor the event that the application process has been killed.
[0192] Specifically, after the system server detects that an application process has been killed, it needs to further determine whether a preset condition is met. The preset condition includes one or more of the following steps S602 to S605. When met, the main process of the application is started. This embodiment of the application does not limit the execution order of steps S602 to S605.
[0193] It should be noted that when the electronic device is in an unlocked state, the electronic device is in a screen-on state. The foreground of the electronic device can display the desktop, or the interface of a certain application. When the foreground of the electronic device displays the desktop, it means that no other applications are running in the foreground of the current electronic device, that is, the user is not currently using other applications. When the foreground of the electronic device displays a certain application interface, it means that the foreground of the current electronic device is running the displayed application, that is, the user is currently using the application displayed in the foreground. Among them, the foreground of the electronic device displays the interface of a certain application, which can be understood as the foreground displays any interface included in the application, or displays a pop-up window of the application, or displays a minimized window of the application, or displays a split-screen display interface of multiple applications, etc. The embodiment of the present application does not limit the specific form of the display of a certain application interface in the foreground of the electronic device, and any display method that can indicate that the user is using an application on the electronic device falls within the protection scope of the embodiment of the present application.
[0194] S702: Determine whether the current foreground is the desktop of the electronic device.
[0195] It should be noted that according to the above Figure 6 When a process of an application is killed, the electronic device may display the following Figure 6 The desktop shown in (c) in FIG; or it may be displayed as shown in FIG. Figure 6 If the electronic device displays the interface of another application as shown in (e) Figure 6 The desktop shown in (c) indicates that the user is not currently using other applications; if the electronic device displays Figure 6 The desktop of another application shown in (e) indicates that the user is currently using the application displayed in the foreground.
[0196] For example, when the desktop of the electronic device is currently displayed in the foreground, the user may want to open an application. Then, when the user uses the mobile phone later, he may want to reopen the application that was just closed. Figure 6 If the desktop of another application is shown in (e), it means that the user wants to continue using the current application later. In this case, there is no need to pull up the main process of the killed application monitored in step S701.
[0197] For example, if the system server detects that the process of application 1 is killed and the electronic device is unlocked, and determines that the electronic device's desktop is displayed in the foreground, it will directly proceed to the next step S703 for the next judgment. If it determines that the electronic device's desktop is not displayed in the foreground, the entire process will be exited, and the event of the application process being killed will not start the main process of application 1.
[0198] It should be noted that by determining that the foreground display is the electronic device's desktop, that is, the user is not currently using an application, there is a possibility of launching the main process of the killed application. This avoids launching the main process of the killed application while the user is currently using other applications, which would occupy system memory and affect the user's experience of using other applications.
[0199] S703: Determine whether the killed process is the main process of the application.
[0200] It should be noted that whenever any process of an application is killed, the electronic device can monitor the application process killing event. However, if only the main process of an application is killed, the application will need to be cold restarted when the user reopens the application. Therefore, it is necessary to confirm that the killed process is the main process of the application.
[0201] For example, when the PUSH process of a social application is killed, the system server monitors the application process killing event. However, because the PUSH process is not the main process, the main process of the social application is not started.
[0202] It should be noted that the main process of the application that was killed, as detected in step S701, is determined in step S703, and the main process of the application that may be restarted in the subsequent step S706 is also the main process of the application that was killed, as detected in step S701. It should be understood that after the main process of an application is killed, the application needs to be cold-started when the user opens the application again.
[0203] For example, if the system server detects that the process of application 1 has been killed and the electronic device's desktop is displayed in the foreground, it will determine in step S703 whether the process that was killed was the main process of application 1. If it was the main process of application 1, the system server will continue to execute the subsequent step S704 for the next judgment. If it was not the main process of application 1, the system server will exit the entire process, and the killing event of the application process will not start the main process of application 1.
[0204] Simply put, each time an application process is killed, at most one application's main process is started, and there is a possibility that no application's main process is started.
[0205] It should be noted that restarting the application whose main process was killed can avoid the cold start of the application when the user opens the application again. The cold start process of the application takes a certain amount of time and system resources, affecting the user experience.
[0206] S704: Determine whether the application program of the killed process belongs to the configuration list.
[0207] It should be noted that the configuration list is a configuration file preset by the system. The applications included in the configuration list may be different in different scenarios. That is, the application in the configuration list in step S502 may be different from the application in the configuration list in step S704. The configuration list can arrange the applications in a certain order. The embodiment of the present application does not limit the arrangement order of the applications in the configuration list. Generally speaking, the applications in the configuration list can be applications with high importance and high user frequency. The application whose process is detected to be killed in step S701 does not necessarily belong to the configuration list.
[0208] In one embodiment, the configuration list exemplarily includes application 1, application 2, and application 3. The system server determines whether the application of the killed process exists according to the configuration list, and thus determines whether to restore the main process of the application of the killed process.
[0209] For example, when the system server monitors that the process of application 1 is killed and the desktop of the electronic device is displayed in the foreground, it is determined that the main process of application 1 is killed. When the system server determines that the application 1 of the killed process is an application in the configuration list, it can continue to execute subsequent steps S705, and the main process of application 1 may be pulled up.
[0210] For example, when the system server detects that the process of application 4 is killed and the desktop of the electronic device is displayed in the foreground, it is determined that the main process of application 4 is killed. When the system server determines that the application 4 whose process is killed is not an application in the configuration list, it exits the entire process. The event of killing the process of application 4 will not start the main process of application 4.
[0211] Simply put, only applications in the configuration list can be launched, and each time an application process is killed, at most one application's main process can be launched. There is a possibility that no application's main process will be launched.
[0212] It should be noted that by determining whether there is an application whose process is killed in the configuration list, the applications that may be launched subsequently are limited to more important applications, so as to avoid launching the application in advance after the process of an application that is not frequently used by the user is killed, resulting in excessive system resources being occupied and affecting the user experience.
[0213] S705: Determine whether system resources are sufficient.
[0214] It should be noted that when the main process of an application in the configuration list is killed and the desktop of an electronic device is currently displayed in the foreground, it is also necessary to determine whether the system resources are sufficient. Exemplarily, system resources may include CPU resources, memory, power, electronic device temperature, etc. For example, when the CPU resources, memory and power of the electronic device are sufficient, and the temperature of the electronic device is appropriate, the system resources are determined to be sufficient. When any of the CPU resources, memory, power, and electronic device temperature of the electronic device does not meet the conditions, the system resources are determined to be insufficient.
[0215] For example, when it is detected that the main process of application 1 in the configuration list is killed and the desktop of the electronic device is currently displayed in the foreground, it is further determined whether the system resources of the electronic device hosting application 1 are sufficient. If the system resources are sufficient, step S706 can be executed to pull up the main process of application 1; if the system resources are not sufficient, the entire process is exited, and the killing of application 1 will not pull up the main process of application 1.
[0216] Simply put, the main process of an application in the configuration list can only be restarted if the main process is killed and there are sufficient system resources. Furthermore, each time an application process is killed, at most one main process will be restarted; there is a possibility that no main process will be restarted.
[0217] It should be noted that sufficient system resources indicate that the CPU resources, power, memory, etc. of the electronic device system can meet the needs of launching the main process of the application in advance. Under this condition, there is a possibility of successfully launching the main process of the application, avoiding the failure of launching the main process of the application due to insufficient system resources, resulting in a waste of system resources.
[0218] S706: Start the main process of the application.
[0219] It should be noted that when the above-mentioned preset conditions (including step S702, step S703, step S704, and step S705) are all met, the main process of the application can be launched. Launching the main process of the application can be understood as preloading the application in the background of the electronic device, so that when the user opens the application again, there is no need to cold-start the application.
[0220] For example, when the system server detects that the process of application 1 is killed and the desktop of the electronic device is displayed in the foreground, it is determined that the main process of application 1 is killed, and application 1 belongs to the application in the configuration list. When the system resources are sufficient, the main process of application 1 can be pulled up, so that the electronic device can preload application 1 in the background.
[0221] The embodiment of the present application does not limit the execution order of step S702 to step S705. In addition to the above execution order, several other execution orders of method 700 are introduced below with reference to examples.
[0222] Illustratively, the configuration list includes application 1, application 2, and application 3 in order of arrangement.
[0223] Example 1: Determine whether the application of the killed process belongs to the configuration list → Determine whether the killed process is the main process of the application → Determine whether the current foreground is the desktop of the electronic device → Determine whether the system resources are sufficient
[0224] When the system server detects that the process of application 1 is killed and the electronic device is unlocked, it determines that the configuration list includes application 1 whose process is killed, and determines that the killed process is the main process of application 1. When the desktop of the electronic device is in the foreground and the system resources are sufficient, the main process of application 1 is pulled up, and the electronic device preloads the main process of application 1 in the background.
[0225] Example 2: Determine whether system resources are sufficient → Determine whether the application of the killed process belongs to the configuration list → Determine whether the killed process is the main process of the application → Determine whether the current foreground is the desktop of the electronic device
[0226] When the system server detects that the process of application 1 is killed and the electronic device is unlocked, it first determines that the system resources are sufficient to pull up the main process of the application, and determines that the configuration list includes application 1 whose process is killed. When the main process of application 1 is killed and the current foreground is the desktop of the electronic device, the main process of application 1 is pulled up, and the electronic device preloads the main process of application 1 in the background.
[0227] Example 3: Determine whether the current foreground is the desktop of the electronic device → determine whether the application of the killed process belongs to the configuration list → determine whether the killed process is the main process of the application → determine whether the system resources are sufficient
[0228] When the system server detects that the process of application 1 is killed and the electronic device is unlocked, it first determines that the current foreground is the desktop of the electronic device, and determines that the configuration list includes application 1 whose process is killed. When the main process of application 1 is killed and the system resources are sufficient, the main process of application 1 is pulled up, and the electronic device preloads the main process of application 1 in the background.
[0229] It should be noted that method 700 may also include other execution orders, which will not be described here to avoid redundancy.
[0230] Based on the above method, when an application process is killed and the electronic device is unlocked, if all preset conditions are met, the electronic device can preload the main process of the application of the killed process in the background in advance, so as to avoid the user being unable to receive messages from the application due to the killing of the main process of the application, or to avoid the cold start process of the application taking a certain amount of time when the user opens the application, thereby affecting the user's usage experience.
[0231] In one implementation, the system server may monitor the killing events of processes of multiple different applications, and the electronic device is in an unlocked state. If all the preset conditions in the above method 700 are met, the main process of the killed application that first meets the preset conditions can be started according to the order in which the preset conditions are determined to be met.
[0232] For example, if the system server detects that the processes of application 1 and application 2 have been killed, and the electronic device is unlocked, and if the previously determined application 1 meets the various preset conditions in steps S702 to S705, the main process of application 1 will be launched. That is, although the system server may detect that the processes of multiple applications have been killed and all meet the conditions, it will only launch the main process of one of the applications at a time.
[0233] For ease of understanding, Figure 8 As shown, a set of GUIs are shown, taking a mobile terminal as an example to introduce a sub-scenario in which another application process is killed.
[0234] like Figure 8 As shown in (a) of FIG, the interface of the social application of the mobile terminal is displayed. The interface of the social application displays a chat window between the local user and user A. The interface of the social application displayed on the foreground of the mobile terminal indicates that the user is using the social application. In response to the user sliding upward from the bottom of the interface of the social application in the direction indicated by the dotted arrow, the mobile terminal can display the following Figure 8 The GUI shown in (b) in FIG.
[0235] like Figure 8 As shown in (b) in the figure, in response to the user sliding upward from the bottom of the interface of the social application in the direction indicated by the dotted arrow, the mobile phone terminal displays a multi-tasking interface. A plurality of tabs are displayed on the multi-tasking interface, and the plurality of tabs respectively represent the applications that have been started. Among them, the plurality of tabs include tab 801, and the interface of the social application is displayed in tab 801. Tab 801 can be considered to be a reduced interface of the social application. The multi-tasking interface also includes a blank area, such as area 802 surrounded by dotted lines. In response to the user sliding upward in the direction indicated by the dotted arrow and clicking on area 802, the mobile phone terminal can display an area as shown in FIG. Figure 8 The GUI shown in (c) in FIG.
[0236] like Figure 8 As shown in (c) in the figure, in response to the user sliding upward along the direction indicated by the dotted arrow and clicking on area 802, the mobile terminal displays a desktop. It should be noted that in response to the user sliding upward along the direction indicated by the dotted arrow, it means that the user closes the social application, that is, the process of the social application is killed. In response to the user clicking on area 802, the foreground of the mobile terminal can display the desktop. At this time, no other applications are running in the foreground of the mobile terminal. A switch button 803 is provided on the mobile terminal. In response to the user's operation on the switch button 803, the mobile terminal can display the desktop as shown in the figure. Figure 8 The GUI shown in (d) in FIG.
[0237] like Figure 8 As shown in (d) in FIG, in response to the user's operation of the switch button 803, the mobile terminal is in a locked screen state. The mobile terminal in the locked screen state may be in a locked screen state. When the mobile terminal is in the locked screen state, no application is displayed in the foreground of the mobile terminal, that is, the user is currently not using any application on the mobile terminal.
[0238] Alternatively, as Figure 8 As shown in (e) in the figure, a mobile phone terminal in the locked screen state can be in the off screen state. When the mobile phone terminal is in the locked screen state and the user clicks the mobile phone screen, but the mobile phone screen is not unlocked, the mobile phone terminal is in the off screen state. The foreground of the mobile phone terminal in the off screen state does not display any application, that is, the user is currently not using any application on the mobile phone terminal.
[0239] That is to say, in Figure 8 In the scenario where the process of an application is killed, when the process of a certain application is killed, the electronic device is in a locked screen state.
[0240] It should be noted that Figure 8 The set of GUIs shown is only an example of an event that triggers the process of killing an application. Figure 8 The GUI shown is a process in which a user actively kills an application process. An application may also be killed in the background due to excessive system load. In other words, the process of killing an application process may be imperceptible to the user. In the embodiments of the present application, the specific method for triggering the application process killing event is not limited.
[0241] like Figure 9 As shown, a schematic flow chart of a method for starting an application provided by the present application is shown. The method 900 can be applied to the following examples: Figure 8 The following describes the method in detail for the scenario shown in the figure.
[0242] S901: An event that an application process is killed is monitored, and the electronic device is in a locked screen state.
[0243] It should be noted that the screen of an electronic device in the locked screen state can be in the off state, in which case no information may be displayed. It can also be in the off state, in which case the screen may display an AOD, such as time information, lock screen wallpaper, magazine lock screen, etc. Whether the electronic device is in the off state or the off state, no application interface is displayed in the foreground. In other words, when the electronic device is in the locked screen state, the user is not using any application through the electronic device.
[0244] For example, the event that the application process is killed can be as follows: Figure 8 The process shown is triggered.
[0245] It should be noted that the application of the killed process can be any application hosted on the electronic device, and this embodiment of the application does not limit this. Since an application can include multiple processes, whenever any process of an application is killed, the event will be reported, that is, the electronic device will monitor the event that the application process has been killed.
[0246] Specifically, after the system server detects that an application process has been killed, it needs to further determine whether a preset condition is met. The preset condition includes one or more of the following steps S902 to S904. When met, the main process of the application is started. This embodiment of the application does not limit the execution order of steps S902 to S904.
[0247] It should be noted that when the electronic device is in a locked screen state, the electronic device is in a screen-off state or a screen-off state, which means that no other application is running in the foreground of the electronic device, that is, the user is not currently using other applications.
[0248] S902: Determine whether the process to be killed is the main process of the application.
[0249] It should be noted that the main process of the application that was killed, as monitored in step S901, is determined in step S902, and the main process of the application that may be restarted in the subsequent step S905 is also the main process of the application that was killed, as monitored in step S901. It should be understood that after the main process of an application is killed, the application needs to be cold-started when the user opens the application again.
[0250] For example, if the system server detects that the process of application 1 has been killed and the electronic device is in the locked screen state, it will determine in step S902 whether the process that was killed was the main process of application 1. If it was the main process of application 1, the subsequent step S903 will be executed for the next judgment. If it was not the main process of application 1, the entire process will be exited, and the application process killing event will not start the main process of application 1.
[0251] Simply put, each time an application process is killed, at most one application's main process is started, and there is a possibility that no application's main process is started.
[0252] It should be noted that restarting the application whose main process was killed can avoid the cold start of the application when the user opens the application again. The cold start process of the application takes a certain amount of time and system resources, affecting the user experience.
[0253] S903: Determine whether the application program of the killed process belongs to the configuration list.
[0254] It should be noted that the configuration list is a configuration file preset by the system. The applications included in the configuration list may be different in different scenarios. That is to say, the applications in the configuration list of step S502, the applications in the configuration list of step S704, and the applications in the configuration list of step S903 may be different. The configuration list can arrange the applications in a certain order. The embodiment of the present application does not limit the arrangement order of the applications in the configuration list. Generally speaking, the applications in the configuration list can be applications that are of high importance and are used frequently by users. The application that monitors the killed process in step S901 does not necessarily belong to the configuration list.
[0255] In one embodiment, the configuration list exemplarily includes application 1, application 2, and application 3. The system server determines whether the application of the killed process exists according to the configuration list, and thus determines whether to restore the main process of the application of the killed process.
[0256] For example, when the system server monitors that the process of application 1 is killed and the electronic device is in the lock screen state, it is determined that the main process of application 1 is killed. When the system server determines that the application 1 of the killed process is an application in the configuration list, it can continue to execute the subsequent step S904, and the main process of application 1 may be pulled up.
[0257] For example, when the system server detects that the process of application 4 is killed and the electronic device is in the lock screen state, it is determined that the main process of application 4 is killed. When the system server determines that the application 4 of the killed process is not an application in the configuration list, it exits the entire process. The event of killing the process of application 4 will not start the main process of application 4.
[0258] Simply put, only applications in the configuration list can be launched, and each time an application process is killed, at most one application's main process can be launched. There is a possibility that no application's main process will be launched.
[0259] It should be noted that by determining whether there is an application whose process is killed in the configuration list, the applications that may be launched subsequently are limited to more important applications, so as to avoid the situations where the processes of applications that are not frequently used by users are launched in advance after being killed, resulting in excessive system resources being occupied and affecting the user experience.
[0260] S904: Determine whether system resources are sufficient.
[0261] It should be noted that when the main process of an application in the configuration list is killed and the screen of the electronic device is turned off, it is also necessary to determine whether the system resources are sufficient. Exemplarily, system resources may include CPU resources, memory, power, electronic device temperature, etc. For example, when the CPU resources, memory and power of the electronic device are sufficient, and the temperature of the electronic device is appropriate, the system resources are determined to be sufficient. When any of the CPU resources, memory, power, and electronic device temperature of the electronic device does not meet the conditions, the system resources are determined to be insufficient.
[0262] For example, when it is detected that the main process of application 1 in the configuration list is killed and the electronic device is in the lock screen state, it is further determined whether the system resources of the electronic device hosting application 1 are sufficient. If the system resources are sufficient, step S905 can be executed to pull up the main process of application 1; if the system resources are not sufficient, the entire process is exited, and the event of killing the process of application 1 will not pull up the main process of application 1.
[0263] Simply put, the main process of an application in the configuration list can only be restarted if the main process is killed and there are sufficient system resources. Furthermore, each time an application process is killed, at most one main process will be restarted; there is a possibility that no main process will be restarted.
[0264] It should be noted that sufficient system resources indicate that the CPU resources, power, memory, etc. of the electronic device system can meet the needs of launching the main process of the application in advance. Under this condition, there is a possibility of successfully launching the main process of the application, avoiding the failure of launching the main process of the application due to insufficient system resources, resulting in a waste of system resources.
[0265] S905: Start the main process of the application.
[0266] It should be noted that when the above-mentioned preset conditions (including step S902, step S903, and step S904) are all met, the main process of the application can be launched. Launching the main process of the application can be understood as preloading the application in the background of the electronic device, so that when the user opens the application again, there is no need to cold-start the application.
[0267] For example, when the system server detects that the process of application 1 is killed and the electronic device is in the lock screen state, it is determined that the main process of application 1 is killed, and application 1 belongs to the application in the configuration list. When the system resources are sufficient, the main process of application 1 can be pulled up, so that the electronic device can preload application 1 in the background.
[0268] The embodiment of the present application does not limit the execution order of step S902 to step S904. In addition to the above execution order, several other execution orders of method 900 are introduced below with reference to examples.
[0269] Illustratively, the configuration list includes application 1, application 2, and application 3 in order of arrangement.
[0270] Example 1: Determine whether the application of the killed process belongs to the configuration list → Determine whether the killed process is the main process of the application → Determine whether the system resources are sufficient
[0271] When the system server detects that the process of application 1 is killed and the electronic device is in the lock screen state, it determines that the configuration list includes application 1 whose process is killed. When the main process of application 1 is killed and the system resources are sufficient to pull up the main process of application 1, the electronic device preloads the main process of application 1 in the background.
[0272] Example 2: Determine whether the application's main process is killed → Determine whether system resources are sufficient → Determine whether the application of the killed process belongs to the configuration list
[0273] When the system server detects that the process of application 1 is killed and the electronic device is in the lock screen state, it first determines that the main process of application 1 is killed, then determines that the system resources are sufficient, and when it determines that the configuration list includes application 1 whose process is killed, it starts the main process of application 1, and the electronic device preloads the main process of application 1 in the background.
[0274] Example 3: Determine whether system resources are sufficient → Determine whether the application of the killed process belongs to the configuration list → Determine whether the killed process is the main process of the application
[0275] When the system server detects that the process of application 1 is killed and the electronic device is in the lock screen state, it determines that the system resources are sufficient. When it is determined that the configuration list includes application 1 whose process is killed, and the main process of application 1 is killed, the main process of application 1 is pulled up, and the electronic device preloads the main process of application 1 in the background.
[0276] It should be noted that method 900 may also include other execution orders, which will not be described here to avoid redundancy.
[0277] Based on the above solution, when an application process is killed and the electronic device is in a locked screen state, if all preset conditions are met, the electronic device can preload the main process of the application of the killed process in the background in advance, so as to avoid the user being unable to receive messages from the application due to the killing of the main process of the application, or to avoid the cold start process of the application taking a certain amount of time when the user opens the application, thereby affecting the user's experience.
[0278] In one implementation, the system server may monitor the killing events of processes of multiple different applications, and the electronic device is in the lock screen state. If all the preset conditions in the above method 900 are met, the main process of the killed application that first meets the preset conditions can be started according to the order in which the preset conditions are determined to be met.
[0279] For example, if the system server detects that the processes of application 1 and application 2 have been killed, and the electronic device is in the lock screen state, if the previously determined application 1 meets the various preset conditions in steps S902 to S904, then the main process of application 1 will be launched. In other words, although the system server may detect that the processes of multiple applications have been killed and all meet the conditions, it will only launch the main process of one of the applications at a time.
[0280] The above methods 700 and 900 respectively illustrate sub-scenarios of two application process killing events. In method 700, the electronic device is in an unlocked state. The foreground of the unlocked electronic device may display the application currently being used by the user. If the main process of the application of the killed process is pulled up when the user is using the foreground application, it will affect the operation of the application currently being used by the user. However, in method 900, the electronic device is in a locked screen state. Obviously, the foreground of the electronic device in the locked screen state does not display an application, and the user is not currently using the application of the electronic device. Therefore, in method 900, if the main process of the application of the killed process is to be pulled up, it is not necessary to determine whether the current foreground is the desktop of the electronic device.
[0281] It should be noted that, for a killed application, when the above scenario 1 (foreground / background switching event) or scenario 2 (application process being killed event) is detected, the application may be restarted.
[0282] Specifically, when a foreground / background switching event occurs, the process of background application 1 is killed. If the system first determines that the main process of application 1 can be launched through the process of method 500 in scenario 1, the system will not launch the main process of application 1 through method 700 or method 900 in scenario 2. If the system first determines that the main process of application 1 can be launched through method 700 or method 900 in scenario 2, the system will not launch the main process of application 1 through method 500 in scenario 1. In other words, for an application whose process has been killed, any of the above methods can be used to launch a certain application. Once the application is launched, the judgment process of other scenarios will not be executed.
[0283] like Figure 10 1000 is a method for starting an application program according to an embodiment of the present invention, which can be applied to electronic devices such as mobile phones, tablet computers, and personal computers.
[0284] S1001, monitoring the first event.
[0285] Exemplarily, the first event includes a foreground / background switching event and an application process being killed event. For different first events, the method for starting the application provided in the embodiment of the present application may be different, and different first events correspond to different scenarios.
[0286] It should be noted that the front-end and back-end switching events can be as above Figure 4The application program that triggers the foreground switching of the process shown can be any application program carried by the electronic device. The embodiment of the present application does not limit the specific process triggered by the first event and the specific application program that causes the foreground-background switching event.
[0287] It should be noted that the application process is killed as described above. Figure 6 or Figure 8 The process shown triggers the application whose process is killed, which can be any application hosted on the electronic device. When an application process is killed, in one case, the electronic device is in an unlocked state, at which time the user may be using other applications on the electronic device; in another case, the electronic device is in a locked state, at which time the user is not using other applications on the electronic device. It can be seen that there are two possible sub-scenarios for the application process being killed. In different sub-scenarios, the method for starting the application provided by the embodiment of the present application may be different.
[0288] S1002: In response to monitoring a first event, determine whether the electronic device meets a first preset condition.
[0289] Specifically, the system server monitors the first event. When the system server monitors the first event, it needs to determine whether the electronic device meets the first preset condition.
[0290] It should be noted that the first preset condition corresponds to the first event. That is, depending on the different first events monitored by the electronic device, the first preset condition that needs to be determined whether the electronic device satisfies may also be different.
[0291] S1003: When the electronic device meets a first preset condition, the main process of the first application is started.
[0292] It should be noted that the first application is the application whose process is killed on the electronic device. The first application and the application that switches between the foreground and background in the above steps can be the same application or different applications.
[0293] That is to say, when the electronic device monitors the first event, it first determines whether the electronic device meets the first preset condition. If so, the main process of the application of the killed process can be pulled up. If not, the main process of the application of the killed process will not be pulled up.
[0294] It should be noted that in the embodiment of the present application, the first preset condition includes multiple conditions. If multiple conditions are met, the main process of the application of the killed process will be launched; if any one of the conditions is not met, the main process of the application of the killed process will not be launched.
[0295] It should be understood that not all applications whose processes have been killed on an electronic device can be reactivated. Applications that are reactivated must be in the electronic device's configuration list. Applications in the configuration list are considered important and frequently used by users. The configuration list can be a system-preset configuration file, and the applications included in the configuration list may vary in different scenarios.
[0296] It should be understood that what is launched is the main process of the application, which can be understood as the process carrying the application name. Launching the main process of an application can be understood as preloading the application in the background of the electronic device or starting the application in the background.
[0297] It should be noted that the first preset condition may be a restriction condition on the electronic device, including: the main process of the application hosted on the electronic device is killed, the application of the killed process belongs to the application in the configuration list of the electronic device, the system resources of the electronic device meet the second preset condition (system resources are sufficient), or the electronic device displays the desktop in the foreground, etc. The following is a detailed description based on the first event:
[0298] In one case, the first event is a foreground / background switching event.
[0299] Specifically, in response to monitoring a foreground-background switching event, the electronic device determines whether the electronic device meets a first preset condition; wherein the first preset condition includes the following items: the first application is an application in a configuration list, the main process of the first application is killed, and the system resources of the electronic device are sufficient.
[0300] It should be noted that after the system server detects a foreground / background switching event, it needs to further determine whether the first preset condition is met. If multiple conditions in the first preset condition are met, the main process of the first application can be started (or loaded); if any condition in the first preset condition is not met, the main process of the first application will not be started (or loaded).
[0301] For example, when the system server monitors the foreground and background switching event, it can traverse the configuration list to determine that the process of the first application in the configuration list is killed, and the killed process is the main process of the first application, and when the system resources of the electronic device are sufficient, the main process of the first application can be started.
[0302] It should be noted that the first application launched is from a configuration list, indicating that an application of high importance or frequent user use is likely to be launched. Launching an application whose main process was killed can avoid a cold restart of the application when the user opens it again. This cold restart process consumes a certain amount of time and system resources, affecting the user experience.
[0303] Exemplarily, the system resources of the electronic device include at least the following: CPU resources, memory, power, and temperature. That is, when the CPU resources, memory, and power of the electronic device are sufficient and the temperature of the electronic device is appropriate, it is determined that the system resources of the electronic device meet the second preset condition, i.e., the system resources of the electronic device are sufficient.
[0304] It should be noted that sufficient system resources indicate that the CPU resources, power, memory, etc. of the electronic device system can meet the needs of launching the main process of the application in advance. Under this condition, there is a possibility of successfully launching the main process of the application, avoiding the failure of launching the main process of the application due to insufficient system resources, resulting in a waste of system resources.
[0305] It should be noted that the application that causes the foreground / background switching event may be different from the application that is launched.
[0306] It is understandable that the order of determining whether the electronic device satisfies multiple conditions in the first preset condition is not limited.
[0307] In another case, the first event is an event that the application process is killed.
[0308] Exemplarily, in this case, two sub-scenarios are further included, namely, the electronic device is in an unlocked state, and the electronic device is in a locked screen state.
[0309] Specifically, the electronic device is in an unlocked state. In response to monitoring an event that an application process is killed and the electronic device displays the desktop, the electronic device determines whether the electronic device meets a first preset condition; wherein the first preset condition includes the following multiple items: the first application is an application in a configuration list, the main process of the first application is killed, and the system resources of the electronic device meet a second preset condition.
[0310] It should be noted that when the electronic device is in an unlocked state, the foreground of the electronic device may display the interface of a certain application, or may not display the interface of any application (for example, displaying the desktop of a mobile phone terminal).
[0311] Specifically, the electronic device is in an unlocked state. In response to monitoring the event that the process of the application is killed, and the electronic device displays the interface of the second application, the electronic device will not start the main process of the first application.
[0312] It should be noted that the electronic device is in an unlocked state. When the system server monitors the event that the application process is killed, it needs to further determine whether the first preset condition is met. When multiple items included in the first preset condition are met, the main process of the first application can be started (or loaded); when any item in the first preset condition is not met, the main process of the first application will not be started (or loaded).
[0313] It should be noted that when the electronic device is unlocked, the foreground of the electronic device can display the desktop or the interface of an application (for example, a second application). When the foreground of the electronic device displays the desktop, it means that no other applications are currently running in the foreground of the electronic device, that is, the user is not currently using other applications. When the foreground of the electronic device displays an application interface, it means that the foreground of the electronic device is currently running the displayed application, that is, the user is currently using the application displayed in the foreground.
[0314] As can be seen, when the electronic device is unlocked and detects an application process has been killed, if the electronic device's desktop is displayed in the foreground, there is a possibility that the killed application process will be launched. This prevents the main process of the killed application from being launched while the user is using other applications, which would occupy system memory and affect the user's experience in other applications.
[0315] For example, when the system server monitors that the application process is killed and the electronic device is unlocked, it is determined that the desktop is displayed on the foreground of the electronic device, and the main process of the first application in the configuration list is killed, and the system resources of the electronic device are sufficient, the main process of the first application can be started.
[0316] Specifically, in response to monitoring an event in which an application process is killed and the electronic device is in a locked state, the electronic device determines whether the electronic device meets a first preset condition; wherein the first preset condition includes the following multiple items: the first application is an application in a configuration list, the main process of the first application is killed, and the system resources of the electronic device meet a second preset condition.
[0317] It should be noted that when the electronic device is in the locked screen state, the electronic device may be in the screen-off state or the screen-off state.
[0318] It should be noted that the electronic device is in the locked screen state. When the system server monitors the event that the application process is killed, it needs to further determine whether the first preset condition is met. When multiple items included in the first preset condition are met, the main process of the first application can be started (or loaded); when any item in the first preset condition is not met, the main process of the first application will not be started (loaded).
[0319] It should be noted that when the electronic device is in a locked screen state, it means that no application is running in the foreground of the electronic device, that is, the user is not currently using the application.
[0320] For example, when the system server monitors that the application process is killed and the electronic device is in the lock screen state, it is determined that the killed process is the main process of the first application in the configuration list, and the system resources of the electronic device are sufficient, the main process of the first application can be started.
[0321] It should be noted that the first event can be triggered by a user's operation or by the system. The following is an example of a possibility in which the first event is triggered by a user.
[0322] In one implementation, a foreground / background switching event may be triggered by a user operation.
[0323] Specifically, the electronic device displays a second interface in response to the user's operation on the first interface of the electronic device, wherein the first interface is the interface of the third application of the electronic device, and the second interface is the interface of the fourth application of the electronic device or the desktop of the electronic device.
[0324] For example, the first interface may be as follows: Figure 4 The first interface can be the interface of any application on the electronic device. The second interface can be the interface of the social application shown in (a). Figure 4 In the video application interface shown in (d) of FIG, the third application may be a social application, and the fourth application may be a video application. The user can operate on the social application interface to move the social application to the background, allowing the electronic device to display the interface of another application (the video application) or the electronic device's desktop in the foreground, thus completing the foreground-background switching event.
[0325] It should be noted that the first application is the same as the third application, or the first application is different from the third application.
[0326] That is, the application that experiences the foreground / background switching event may be the same as or different from the application that subsequently meets the first preset condition and can be launched as the main process. The application that experiences the foreground / background switching event is not necessarily an application in the configuration list, but the application that is launched is an application in the configuration list.
[0327] In one implementation, the application process killing event may be triggered by a user operation.
[0328] Specifically, the electronic device displays a multitasking interface in response to the user's operation on the first interface of the electronic device, where the first interface is the interface of the first application of the electronic device; the electronic device closes the first application in response to the user's operation on the multitasking interface.
[0329] For example, the first interface may be as follows: Figure 6 The interface of the social application shown in (a) in Figure 1. The multitasking interface is as follows: Figure 6 As shown in (b) of FIG. The user operation on the multitasking interface can be the user swiping on the multitasking interface and closing an application. Through the user operation, the application is closed, that is, the application process is killed, completing the application process killing event.
[0330] It should be noted that the above process of triggering a foreground-background switching event, or an application process being killed is only an exemplary description, and the embodiments of the present application do not limit this.
[0331] Based on the above solution, when a foreground / background switching event occurs, or an application process is killed, a determination is made as to whether preset conditions are met. If multiple of the preset conditions are met, the electronic device can preload the main process of the killed application in the background. This prevents the user from not receiving messages from the application due to the killing of the main process, or prevents the application from taking a certain amount of time to cold-start when the user opens the application, thereby affecting the user's experience.
[0332] The present application provides a computer program product that, when executed on a device, enables the device to execute the technical solution in the above embodiment. The implementation principle and technical effects are similar to those of the above method-related embodiments and will not be described in detail here.
[0333] The present embodiment provides a readable storage medium containing instructions that, when executed on a device, cause the device to execute the technical solution of the above embodiment. The implementation principles and technical effects are similar and will not be further described here.
[0334] The present application provides a chip for executing instructions. When the chip is running, the technical solution in the above embodiment is executed. The implementation principle and technical effect are similar and will not be described in detail here.
[0335] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of this application.
[0336] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units (modules) can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0337] In the several embodiments provided in this application, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the unit is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0338] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0339] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0340] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0341] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for starting an application, characterized in that: The method is applied to an electronic device, wherein a process of a first application of the electronic device is killed, and includes: Monitor a first event, where the first event includes one of the following: Foreground and background switching events, application process killing events; In response to monitoring the first event, determining whether the electronic device meets a first preset condition, where the first preset condition corresponds to the first event; When the electronic device meets the first preset condition, the main process of the first application is started.
2. The method according to claim 1, characterized in that The step of determining, in response to monitoring the first event, whether the electronic device satisfies a first preset condition includes: In response to monitoring the foreground and background switching event, determining whether the electronic device meets the first preset condition; The first preset condition includes the following: The first application is an application in a configuration list, a main process of the first application is killed, and system resources of the electronic device meet a second preset condition.
3. The method according to claim 1, characterized in that The step of determining, in response to monitoring the first event, whether the electronic device satisfies a first preset condition includes: In response to monitoring the event that the process of the application program is killed and the electronic device displays the desktop, determining whether the electronic device meets the first preset condition; The first preset condition includes the following: The first application is an application in a configuration list, a main process of the first application is killed, and system resources of the electronic device meet a second preset condition.
4. The method according to claim 1, wherein The method further comprises: In response to monitoring the event that the process of the application is killed and the electronic device displays the interface of the second application, the electronic device will not start the main process of the first application.
5. The method according to claim 1, wherein The step of determining, in response to monitoring the first event, whether the electronic device satisfies a first preset condition includes: In response to monitoring an event that the process of the application is killed and the electronic device is in a locked screen state, determining whether the electronic device meets the first preset condition; The first preset condition includes the following: The first application is an application in a configuration list, a main process of the first application is killed, and system resources of the electronic device meet a second preset condition.
6. The method according to any one of claims 1 to 5, characterized in that When the first event is the foreground / background switching event, Before responding to monitoring the first event, the method further includes: In response to an operation on the first interface of the electronic device, the electronic device displays a second interface; The first interface is an interface of a third application of the electronic device, and the second interface is an interface of a fourth application of the electronic device or a desktop of the electronic device.
7. The method according to claim 6, characterized in that The first application is the same as the third application, or the first application is different from the third application.
8. The method according to any one of claims 1 to 5, characterized in that The first event is an event in which the process of the application program is killed; Before responding to monitoring the first event, the method further includes: In response to an operation on a first interface of the electronic device, displaying a multitasking interface, where the first interface is an interface of a first application of the electronic device; In response to an operation on the multitasking interface, the first application is closed.
9. The method according to any one of claims 2 to 5, characterized in that The system resources include at least the following: Central processing unit CPU resources, memory, power, and temperature.
10. The method according to claim 5, characterized in that The lock screen state includes the screen off state and the screen off state.
11. A device for starting an application, characterized in that: A process of a first application of the device is killed, and the device includes: A processing unit is configured to monitor a first event, where the first event includes one of the following: Foreground and background switching events, application process killing events; further configured to, in response to monitoring the first event, determine whether the device satisfies a first preset condition, where the first preset condition corresponds to the first event; It is also used to start the main process of the first application when the device meets the first preset condition.
12. The device according to claim 11, characterized in that The processing unit is specifically configured to determine whether the device meets the first preset condition in response to monitoring the foreground and background switching event; The first preset condition includes the following: The first application is an application in a configuration list, a main process of the first application is killed, and system resources of the device meet a second preset condition.
13. The device according to claim 11, characterized in that The processing unit is specifically configured to, in response to monitoring an event that the application process is killed and the device displays the desktop, determine whether the device meets the first preset condition; The first preset condition includes the following: The first application is an application in the configuration list, the main process of the first application is killed, and the system resources of the device are sufficient to meet the second preset condition.
14. The device according to claim 11, characterized in that The processing unit is specifically configured to respond to monitoring an event in which the process of the application is killed, and the device displays the interface of the second application, and then not start the main process of the first application.
15. The device according to claim 11, characterized in that The processing unit, in response to monitoring the event that the process of the application is killed and the device is in a locked screen state, determines whether the device meets the first preset condition; The first preset condition includes the following: The first application is an application in a configuration list, a main process of the first application is killed, and system resources of the device meet a second preset condition.
16. The device according to any one of claims 11 to 15, characterized in that The device further comprises a display unit, The display unit is configured to display a second interface in response to an operation on the first interface of the device; The first interface is an interface of a third application of the device, and the second interface is an interface of a fourth application of the device or a desktop of the device.
17. The device according to claim 16, characterized in that The first application is the same as the third application, or the first application is different from the third application.
18. The device according to any one of claims 11 to 15, characterized in that The device further comprises a display unit, The display unit is configured to display a multitasking interface in response to an operation on a first interface of the device, where the first interface is an interface of a first application of the device; It is also used to close the first application in response to an operation on the multitasking interface.
19. The device according to any one of claims 12 to 15, characterized in that The system resources include at least the following: Central processing unit CPU resources, memory, power, and temperature.
20. The device according to claim 15, characterized in that The lock screen state includes the screen off state and the screen off state.
21. An electronic device, characterized in that: include: one or more processors; one or more memories; The one or more memories store one or more computer programs, which include instructions. When the instructions are executed by the one or more processors, the electronic device performs the method according to any one of claims 1 to 10.
22. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a computer, the computer is caused to implement the method according to any one of claims 1 to 10.
23. A computer program product comprising instructions, characterized in that When the computer program product is run on a computer, the computer is caused to perform the method according to any one of claims 1 to 10.
24. A chip, characterized in that: The chip includes a processor and a data interface, and the processor reads instructions stored in a memory through the data interface to execute the method according to any one of claims 1 to 10.