Method and device for releasing starting resources and terminal equipment

By detecting the startup status and resource occupation of the application in the terminal device, and detecting the application process that has not been started, the lag caused by the backend load in the fast application startup scenario is solved, and the efficient supply of system resources is achieved.

CN119512722APending Publication Date: 2025-02-25HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311071623.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-23
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

In the scenario where the application is continuously and quickly started, the application that has not been launched continues to occupy system resources when it retreats to the background, resulting in the terminal device being stuck.

Method used

By detecting that the application retreats to the background, it obtains its first frame drawing time and startup time. If the startup is not completed or the startup time is less than or equal to the threshold, the process of the application is checked to free up the resources occupied by the background.

Benefits of technology

Accurately confirm the application processes that are no longer needed in the background, and release the resources they occupy, reduce the lag of terminal devices, and ensure that system resources are supplied to the front-end applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512722A_ABST
    Figure CN119512722A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a starting resource releasing method and device and terminal equipment, in the starting resource releasing method, the terminal equipment responds to detection that an application goes back to the background to run, the drawing time of a first frame of the application and the starting duration of the application are obtained, and if the drawing time of the first frame of the application is not updated, the starting duration of the application is not updated. If the application is started, or the starting duration of the application is smaller than or equal to the duration threshold value, the terminal equipment searches and kills the process of the application so as to release the starting resources occupied by the background of the application, so that the process of the application can be searched and killed and the starting resources occupied by the background of the application can be released under the condition that the application returns to the background before being started completely; the supply of system resources to the process of the application running in the foreground is ensured, and the jamming of the terminal equipment is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of intelligent terminal technology, and in particular to a method, apparatus and terminal device for releasing startup resources. Background Art

[0002] The cold start of an Android application is usually a time-consuming process. After creating the corresponding process and activity (Activity) of the application and starting the Activity, the interface drawing and display will begin. The whole process will consume a lot of resources on the central processing unit (CPU), memory (memory) and input output (IO), which is a typical load scenario. If the application retreats to the background before it is fully started, for example, the home key is pressed before the first frame is drawn, the terminal device will continue the startup process of the above application in the background, which becomes the background load of the terminal device. In the scenario of continuous and rapid application startup, the user will click to start an application, quickly return to the desktop, and then quickly click to start the next application, and the cycle continues. At the same time point, there may be multiple applications in the background of the terminal device that are all starting up. The computing overhead and resource requirements of the terminal device are very high, which can easily cause the terminal device to freeze. Summary of the invention

[0003] The embodiments of the present application provide a method, apparatus and terminal device for releasing startup resources. The embodiments of the present application also provide a computer-readable storage medium, so as to realize, when an application exits to the background before completing startup, killing the process of the application, releasing the startup resources occupied by the background application, ensuring the supply of system resources to the process of the application running in the foreground, and reducing the lag of the terminal device.

[0004] In a first aspect, an embodiment of the present application provides a method for releasing startup resources, comprising: in response to detecting that an application has retreated to the background, obtaining the drawing time of the first frame of the application and the startup duration of the application; if the drawing time of the first frame of the application is not updated, or the startup duration of the application is less than or equal to a duration threshold, killing the process of the application to release the startup resources occupied by the background application.

[0005] In the above-mentioned method for releasing startup resources, the terminal device obtains the drawing time of the first frame of the above-mentioned application and the startup duration of the above-mentioned application in response to detecting that the application has retreated to the background. If the drawing time of the first frame of the above-mentioned application has not been updated, or the startup duration of the above-mentioned application is less than or equal to the duration threshold, the terminal device kills the process of the above-mentioned application to release the startup resources occupied by the above-mentioned application in the background. In this way, the terminal device can accurately identify the application in the background that the user is likely to not use next based on the startup duration of the application being less than or equal to the duration threshold, or the first frame of the application has not yet started to be drawn, and kill the process of the application to release the startup resources occupied by the application in the background. This will not affect the user experience, but can also save the system resources consumed by the application when it is started in the background, ensure the supply of system resources to the process of the application running in the foreground, and reduce the jamming of the terminal device 100.

[0006] In one possible implementation manner, the killing the process of the application includes: obtaining an identifier of the process of the application; and killing the process corresponding to the identifier.

[0007] In one possible implementation, the startup duration of the application includes the length of time from the moment the process of the application is created to the moment the application exits to the background.

[0008] In one possible implementation, after obtaining the drawing time of the first frame of the application and the startup duration of the application, it also includes: if the drawing time of the first frame of the application has been updated, determining whether the startup duration of the application is less than or equal to a duration threshold; if the startup duration of the application is less than or equal to the duration threshold, killing the process of the application to release the startup resources occupied by the background of the application.

[0009] In one possible implementation, after determining whether the startup duration of the application is less than or equal to a duration threshold, the method further includes: if the startup duration of the application is greater than the duration threshold, returning the application to background operation.

[0010] In one possible implementation, after obtaining the drawing time of the first frame of the application and the startup duration of the application, the method further includes: if the startup duration of the application is greater than a duration threshold, determining whether the drawing time of the first frame of the application has been updated; if the drawing time of the first frame of the application has not been updated, killing the process of the application to release the startup resources occupied by the background of the application.

[0011] In one possible implementation manner, after determining whether the drawing time of the first frame of the application has been updated, the method further includes: if the drawing time of the first frame of the application has been updated, returning the application to the background for running.

[0012] In one possible implementation manner, the duration threshold is preset, or the duration threshold is adaptively adjusted according to different applications.

[0013] In a second aspect, an embodiment of the present application provides a device for releasing startup resources, which is included in a terminal device and has the function of implementing the behavior of the terminal device in the first aspect and the possible implementation of the first aspect. The function can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, an acquisition module and a killing module, etc.

[0014] In a third aspect, an embodiment of the present application provides a terminal device, comprising: one or more processors; a memory; multiple applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the terminal device, enable the terminal device to execute the method provided in the first aspect.

[0015] It should be understood that the second and third aspects of the embodiments of the present application are consistent with the technical solutions of the first aspect of the embodiments of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here.

[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method provided in the first aspect.

[0017] In a fifth aspect, an embodiment of the present application provides a computer program, which, when executed by a computer, is used to execute the method provided in the first aspect.

[0018] In one possible design, the program in the fifth aspect may be stored in whole or in part on a storage medium packaged together with the processor, or may be stored in whole or in part on a memory not packaged together with the processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 A schematic diagram of a scenario where an application is started quickly and continuously;

[0020] Figure 2 A schematic diagram of the structure of a terminal device provided in one embodiment of the present application;

[0021] Figure 3 A schematic diagram of a method for releasing startup resources provided in one embodiment of the present application;

[0022] Figure 4A flowchart of a method for releasing startup resources provided in one embodiment of the present application;

[0023] Figure 5 A flowchart of a method for releasing startup resources provided in another embodiment of the present application;

[0024] Figure 6 A flowchart of a method for releasing startup resources provided in yet another embodiment of the present application;

[0025] Figure 7 A schematic diagram of the structure of a terminal device provided in another embodiment of the present application;

[0026] Figure 8 A schematic diagram of the structure of a terminal device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0027] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.

[0028] Figure 1 This is a schematic diagram of a scenario where applications are started quickly and continuously, such as Figure 1 As shown, in the usage scenario of continuous and rapid application startup, after the user clicks to start application 1, the terminal device starts to start application 1 and displays the interface of application 1. During the startup of application 1, the user returns application 1 to the background to start by pressing the home button, and then the user quickly clicks to start application 2, the terminal device starts to start application 2 and displays the interface of application 2. During the startup of application 2, the user returns application 2 to the background to start by pressing the home button, and then the user quickly clicks to start application 3, the terminal device starts to start application 3 and displays the interface of application 3. In this way, when the terminal device starts to display the interface of application 3, both application 1 and application 2 are in the startup process in the background of the terminal device, which has a high computing overhead and resource requirements for the terminal device, and is likely to cause the terminal device to freeze.

[0029] To address this issue, the commonly used existing related technology is to freeze the process of the application running in the background. For example, 500ms, 1s or 2s after the application process returns to the background, the application process is set to a non-schedulable state, so that the application process will not be scheduled by the CPU, thereby preventing the background process from loading resources; when the above application returns to the foreground to run, the application process is set to the running state again, and the startup process of the application continues.

[0030] However, freezing the application process requires status judgment, and the process is usually frozen some time after the application process has been in the background. The freezing judgment needs to be combined with data such as the process call situation, process status, and process priority. For application processes that are in the background before the cold start is completed, they often do not meet the freezing conditions and may not be frozen. Therefore, the process freezing solution cannot effectively alleviate the high load of background application processes in the scenario of continuous and rapid application startup.

[0031] Based on the above problems, an embodiment of the present application provides a method for releasing startup resources, which checks and kills the processes of applications that retreat to the background before completing startup, and prevents the application from starting in the background, thereby ensuring the resource supply of the foreground process and avoiding terminal device freezes.

[0032] The method for releasing startup resources provided in the embodiment of the present application can be applied to terminal devices, wherein the above-mentioned terminal devices can be smart phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPC), netbooks or personal digital assistants (PDA) and other devices; the embodiment of the present application does not impose any restrictions on the specific type of terminal devices.

[0033] For example, Figure 2 A schematic diagram of the structure of a terminal device provided in one embodiment of the present application is shown in FIG. Figure 2As shown, the terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. 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.

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

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

[0036] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

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

[0038] In some embodiments, the processor 110 may include one or more interfaces. The interface 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, etc.

[0039] The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. While the charging management module 140 is charging the battery 142, it may also power the terminal device 100 through the power management module 141.

[0040] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0041] The wireless communication function of the terminal 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.

[0042] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0043] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal 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.

[0044] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent 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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a 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.

[0045] 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 terminal 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, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0046] In some embodiments, the antenna 1 of the terminal 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 terminal 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-CDMA), 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).

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

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

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

[0050] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0051] 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 optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted 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 terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

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

[0053] Video codecs are used to compress or decompress digital videos. The terminal device 100 may support one or more video codecs. Thus, the terminal device 100 may play or record videos in various coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0054] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of the terminal device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0055] 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 terminal device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0056] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may 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 may store data created during the use of the terminal 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. The processor 110 executes various functional applications and data processing of the terminal device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

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

[0058] 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 arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.

[0059] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The terminal device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0060] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal device 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the ear.

[0061] Microphone 170C, also called "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 terminal device 100 can be provided with at least one microphone 170C. In other embodiments, the terminal 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 terminal device 100 can also be provided with three, four or more microphones 170C to realize the collection of sound signals, noise reduction, identification of sound sources, realization of directional recording function, etc.

[0062] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0063] The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The terminal device 100 may receive key input and generate key signal input related to user settings and function control of the terminal device 100.

[0064] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0065] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0066] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the terminal device 100 by inserting the SIM card interface 195 or pulling it out from the SIM card interface 195. The terminal device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The terminal device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the terminal device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal device 100 and cannot be separated from the terminal device 100.

[0067] For ease of understanding, the following embodiments of the present application will be described in detail with Figure 2 Taking the terminal device of the shown structure as an example, combined with the accompanying drawings and application scenarios, the method for releasing the startup resources provided in the embodiment of the present application is specifically explained.

[0068] In scenarios related to continuous and rapid application startup, if the application retreats to the background before the cold start is completed, it will bring a high background load and easily cause the foreground application to freeze. In order to reduce the background load in this case, the embodiment of the present application kills such background load processes through killing to ensure the supply of system resources of the terminal device 100 to the foreground application process.

[0069] Figure 3 A schematic diagram of a method for releasing startup resources provided by an embodiment of the present application is shown in FIG. Figure 3As shown, when application 2 is started, application 1 returns to the background and has not yet completed the startup, so the terminal device 100 kills the process of application 1 and releases the background startup resources occupied by application 1; similarly, when application 3 is started, application 2 returns to the background and has not yet completed the startup, so the terminal device 100 kills the process of application 2 and releases the background startup resources occupied by application 2.

[0070] Figure 4 A flowchart of a method for releasing startup resources provided in one embodiment of the present application is shown in FIG. Figure 4 As shown, the above method for releasing the startup resources may include:

[0071] Step 401 , in response to detecting that an application has retreated to the background, the terminal device 100 obtains the drawing time of the first frame of the application and the startup duration of the application.

[0072] The drawing time of the first frame of the application may be the moment when the first frame of the application starts to be drawn; the startup duration of the application may be the length of time from the moment when the process of the application is created to the moment when the application exits to the background.

[0073] Step 402, if the drawing time of the first frame of the above application is not updated, or the startup duration of the above application is less than or equal to the duration threshold, the terminal device 100 kills the process of the above application to release the startup resources occupied by the background of the above application.

[0074] Among them, the above-mentioned duration threshold can be pre-set according to system performance and / or implementation requirements during specific implementation, or the above-mentioned duration threshold can also be adaptively adjusted according to different applications. This embodiment does not limit the size of the above-mentioned duration threshold.

[0075] Specifically, when the first frame of the application has not started to be drawn, the drawing time of the first frame of the application is an initial value. After the first frame of the application starts to be drawn, the drawing time of the first frame of the application is updated to the moment when the first frame of the application starts to be drawn. Therefore, in this embodiment, the fact that the drawing time of the first frame of the application has not been updated indicates that the first frame of the application has not started to be drawn.

[0076] That is to say, in this embodiment, when the first frame of the above application has not yet started to be drawn, or the startup duration of the above application is less than or equal to the duration threshold, the terminal device 100 kills the process of the above application to release the startup resources occupied by the background of the above application.

[0077] Specifically, the terminal device 100 may check and kill the process of the above application by: the terminal device 100 obtains an identifier (process identifier, PID) of the process of the above application, and checks and kills the process corresponding to the above identifier.

[0078] In this embodiment, if the application startup duration is less than or equal to the duration threshold, or the first frame of the application has not yet started to be drawn, it means that the scenario at this time is likely that the user has just clicked the icon of the application to trigger the startup of the application, but immediately retreated the application to the background, which means that the user is likely not to use the application next. In addition, if the application startup duration is less than or equal to the threshold, or the first frame of the application has not yet started to be drawn, it also means that after the terminal device 100 responds to the user's operation of clicking the application icon, too many system resources have not been used to cold-start the application. Even if the user subsequently switches the application back to the foreground, or the user clicks the application icon again, the cost of cold-starting the application from the beginning will not be too large.

[0079] Therefore, based on the fact that the startup duration of the application is less than or equal to the duration threshold, or the first frame of the application has not yet started to be drawn, the terminal device 100 can accurately identify the applications in the background that the user is likely not to use next, and kill the processes of such applications. On the one hand, it will not have a substantial impact on the user experience, and on the other hand, it can save the system resources consumed by the startup of such applications in the background and reduce terminal lag.

[0080] In the above-mentioned method for releasing startup resources, the terminal device 100 obtains the drawing time of the first frame of the above-mentioned application and the startup duration of the above-mentioned application in response to detecting that the application has retreated to the background. If the drawing time of the first frame of the above-mentioned application has not been updated, or the startup duration of the above-mentioned application is less than or equal to the duration threshold, the terminal device 100 kills the process of the above-mentioned application to release the startup resources occupied by the above-mentioned application in the background. In this way, the terminal device 100 can accurately identify the application in the background that the user is likely to not use next based on the startup duration of the application being less than or equal to the duration threshold, or the first frame of the application has not yet started to be drawn, and kill the process of the application to release the startup resources occupied by the application in the background. This will not affect the user experience, but can also save the system resources consumed by the application when it is started in the background, ensure the supply of system resources to the process of the application running in the foreground, and reduce the jamming of the terminal device 100.

[0081] Figure 5 A flowchart of a method for releasing startup resources provided in another embodiment of the present application is shown in FIG. Figure 5 As shown, this application Figure 4 In the illustrated embodiment, after step 401, the following steps may also be included:

[0082] Step 501: If the rendering time of the first frame of the application has been updated, the terminal device 100 determines whether the startup duration of the application is less than or equal to a duration threshold, and then executes step 502 or step 503.

[0083] Step 502: If the startup duration of the above application is less than or equal to the duration threshold, the terminal device 100 kills the process of the above application to release the startup resources occupied by the background of the above application.

[0084] Step 503: If the startup duration of the above application is greater than the duration threshold, the terminal device 100 returns the above application to the background.

[0085] In this embodiment, after the terminal device 100 obtains the drawing time of the first frame of the above-mentioned application and the startup duration of the above-mentioned application, if the drawing time of the first frame of the above-mentioned application has been updated, it means that the terminal device 100 has started to draw the first frame of the application. At this time, the terminal device 100 can continue to determine whether the startup duration of the application is less than or equal to the duration threshold. If so, the terminal device 100 can determine that the above-mentioned application belongs to the scenario of not being fully started and exiting the background. In this way, the terminal device 100 can check and kill the process of the above-mentioned application to release the startup resources occupied by the background application, ensure the supply of system resources of the terminal device 100 to the process of the application running in the foreground, and reduce the lag of the terminal device 100.

[0086] Figure 6 A flowchart of a method for releasing startup resources provided in another embodiment of the present application is shown in FIG. Figure 6 As shown, this application Figure 4 In the illustrated embodiment, after step 401, the following steps may also be included:

[0087] Step 601: If the startup duration of the application is greater than the duration threshold, it is determined whether the drawing time of the first frame of the application has been updated. Then, step 602 or step 603 is executed.

[0088] Step 602: If the drawing time of the first frame of the above application is not updated, the terminal device 100 kills the process of the above application to release the startup resources occupied by the background of the above application.

[0089] Step 603: If the drawing time of the first frame of the above application has been updated, the terminal device 100 returns the above application to the background.

[0090] In this embodiment, after the terminal device 100 obtains the drawing time of the first frame of the above-mentioned application and the startup duration of the above-mentioned application, if the startup duration of the above-mentioned application is greater than the duration threshold, the terminal device 100 can continue to determine whether the drawing time of the first frame of the above-mentioned application has been updated. If the drawing time of the first frame of the above-mentioned application has not been updated, it means that the terminal device 100 has not started to draw the first frame of the above-mentioned application. Then, the terminal device 100 can determine that the above-mentioned application belongs to the scenario of not being fully started and exiting the background. In this way, the terminal device 100 can check and kill the process of the above-mentioned application to release the startup resources occupied by the background application, ensure the supply of system resources of the terminal device 100 to the process of the application running in the foreground, and reduce the lag of the terminal device 100.

[0091] It is to be understood that some or all of the steps or operations in the above embodiments are merely examples, and the present application embodiments may also perform other operations or variations of various operations. In addition, the various steps may be performed in different orders presented in the above embodiments, and it is possible that not all of the operations in the above embodiments need to be performed.

[0092] It is understandable that, in order to implement the above functions, the terminal device includes hardware and / or software modules corresponding to the execution of each function. In combination with the algorithm steps of each example described in the embodiments disclosed in this application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of this application.

[0093] This embodiment can divide the terminal device into functional modules according to the above method embodiment. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one module. The above integrated module can be implemented in the form of hardware. It should be noted that the division of modules in this embodiment is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0094] Figure 7 A schematic diagram of the structure of a terminal device provided in another embodiment of the present application, in which each functional module is divided according to each function, Figure 7 A possible schematic diagram of the composition of the terminal device 700 involved in the above embodiment is shown. Figure 7 As shown, the terminal device 700 may include: an acquisition module 701 and a detection and killing module 702;

[0095] Among them, the acquisition module 701 is used to obtain the drawing time of the first frame of the above application and the startup duration of the above application in response to detecting that the application has retreated to the background; wherein the startup duration of the above application includes the length of time from the creation time of the process of the above application to the time when the above application retreats to the background.

[0096] The killing module 702 is used to kill the process of the application when the drawing time of the first frame of the application is not updated, or the startup time of the application is less than or equal to the time threshold, so as to release the startup resources occupied by the background of the application. In this embodiment, the killing module 702 is specifically used to obtain the identifier of the process of the application and kill the process corresponding to the identifier.

[0097] It should be noted that this application Figure 4 All relevant contents of each step involved in the illustrated method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0098] The terminal device 700 provided in this embodiment is used to execute the present application Figure 4 The method for releasing startup resources provided in the illustrated embodiment can therefore achieve the same effect as the above method.

[0099] Figure 8 A schematic diagram of a terminal device provided in another embodiment of the present application, Figure 7 Compared with the terminal equipment shown in the figure, the difference is that Figure 8 The terminal device 700 shown may further include: a determination module 703;

[0100] In one implementation, the judging module 703 is configured to, after the obtaining module 701 obtains the drawing time of the first frame of the application and the startup duration of the application, if the drawing time of the first frame of the application has been updated, determine whether the startup duration of the application is less than or equal to the duration threshold;

[0101] The killing module 702 is specifically used to kill the process of the above application when the startup duration of the above application is less than or equal to the duration threshold, so as to release the startup resources occupied by the above application in the background.

[0102] Furthermore, the terminal device 700 may further include: a return module 704;

[0103] The return module 704 is used to return the application to the background when the startup time of the application is greater than the time threshold.

[0104] In another implementation, the judging module 703 is configured to judge whether the drawing time of the first frame of the application has been updated if the starting time of the application is greater than the time threshold after the obtaining module 701 obtains the drawing time of the first frame of the application and the starting time of the application;

[0105] The killing module 702 is specifically used to kill the process of the above application when the drawing time of the first frame of the above application is not updated, so as to release the startup resources occupied by the background of the above application.

[0106] Furthermore, the terminal device 700 may further include: a return module 704;

[0107] The return module 704 is used to return the application to the background when the drawing time of the first frame of the application has been updated.

[0108] It should be noted that this application Figures 4 to 6 All relevant contents of each step involved in the illustrated method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.

[0109] The terminal device 700 provided in this embodiment is used to execute the present application Figures 4 to 6 The method for releasing startup resources provided in the illustrated embodiment can therefore achieve the same effect as the above method.

[0110] It should be understood that the terminal device 700 may correspond to Figure 2 The terminal device 100 shown in FIG. Among them, the functions of the acquisition module 701, the killing module 702, the judgment module 703 and the return module 704 can be Figure 2 The processor 110 in the terminal device 100 is implemented.

[0111] In the case of adopting an integrated unit, the terminal device 700 may include a processing module, a storage module and a communication module.

[0112] The processing module can be used to control and manage the actions of the terminal device 700, for example, it can be used to support the terminal device 700 to execute the steps executed by the acquisition module 701, the killing module 702, the judgment module 703 and the return module 704. The storage module can be used to support the terminal device 700 to store program codes and data, etc. The communication module can be used to support the communication between the terminal device 700 and other devices.

[0113] Among them, the processing module can be a processor or a controller, which can implement or execute various exemplary logic boxes, modules and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module can be a memory. The communication module can specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip and / or a Wi-Fi chip.

[0114] In one embodiment, when the processing module is a processor and the storage module is a memory, the terminal device 700 involved in this embodiment can be a Figure 2 Device of the structure shown.

[0115] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the present application. Figures 4 to 6 The method provided by the illustrated embodiment.

[0116] The present application also provides a computer program product, which includes a computer program, which, when executed on a computer, enables the computer to execute the present application. Figures 4 to 6 The method provided by the illustrated embodiment.

[0117] In the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.

[0118] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, 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 this application.

[0119] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0120] In several embodiments provided in the present application, any function can be stored in a computer-readable storage medium if it is implemented in the form of a software functional unit and sold or used as an independent product. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform 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.

[0121] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for releasing startup resources, characterized in that: include: In response to detecting that the application retreats to the background, obtaining the drawing time of the first frame of the application and the startup duration of the application; If the drawing time of the first frame of the application is not updated, or the startup duration of the application is less than or equal to the duration threshold, the process of the application is killed to release the startup resources occupied by the background of the application.

2. The method according to claim 1, characterized in that The process of checking and killing the application includes: Obtaining an identifier of the process of the application; Check and kill the process corresponding to the identifier.

3. The method according to claim 1, characterized in that The startup duration of the application includes the length of time from the moment the process of the application is created to the moment the application exits to the background.

4. The method according to any one of claims 1 to 3, characterized in that: After obtaining the drawing time of the first frame of the application and the startup duration of the application, the method further includes: If the drawing time of the first frame of the application has been updated, determining whether the startup duration of the application is less than or equal to a duration threshold; If the startup duration of the application is less than or equal to the duration threshold, the process of the application is checked and killed to release the startup resources occupied by the background of the application.

5. The method according to claim 4, characterized in that After determining whether the startup duration of the application is less than or equal to the duration threshold, the method further includes: If the startup duration of the application is greater than the duration threshold, the application is retreated to the background for running.

6. The method according to any one of claims 1 to 3, characterized in that: After obtaining the drawing time of the first frame of the application and the startup duration of the application, the method further includes: If the startup duration of the application is greater than the duration threshold, determining whether the drawing time of the first frame of the application has been updated; If the drawing time of the first frame of the application is not updated, the process of the application is killed to release the startup resources occupied by the background of the application.

7. The method according to claim 6, characterized in that After determining whether the drawing time of the first frame of the application has been updated, the method further includes: If the drawing time of the first frame of the application has been updated, the application is returned to the background for running.

8. The method according to claim 1, characterized in that The duration threshold is preset, or the duration threshold is adaptively adjusted according to different applications.

9. A device for releasing startup resources, characterized in that: include: An acquisition module, configured to acquire, in response to detecting that the application has retreated to the background, a drawing time of the first frame of the application and a startup duration of the application; The killing module is used to kill the process of the application when the drawing time of the first frame of the application is not updated, or the startup duration of the application is less than or equal to the duration threshold, so as to release the startup resources occupied by the background of the application.

10. A terminal device, characterized in that: include: one or more processors; Memory; Multiple applications; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the terminal device, enable the terminal device to perform the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed on a computer, enables the computer to execute the method according to any one of claims 1 to 8.